Coder Social home page Coder Social logo

c2-api-client's Introduction

C2 EC2 API Client

Simple command-line utility for sending custom requests to CROC Cloud platform. You may send requests in parallel and specify Availability Zones.

Warning: this utility is not intended for automation cases. Use https://github.com/C2Devel/boto.git and python scripts instead.

Installation

  • Using pip:
pip install https://github.com/C2Devel/c2-api-client.git

Usage

$ c2-ec2 --help
usage: c2-ec2 [-h] [-t threads] [--azs AZ,[AZ,[...]]] [--az-field AZ_FIELD]
              action [parameters [parameters ...]]

positional arguments:
  action                The action that you want to perform.
  parameters            Any parameters for the action. Parameters specified by
                        parameter key and parameter value separated by space.

optional arguments:
  -h, --help            show this help message and exit
  -t threads, --threads threads
                        Number of threads to perform request.
  --azs AZ,[AZ,[...]]   Comma-separated list of AZs.
  --az-field AZ_FIELD   EC2 AZ request field. Default: 'AvailabilityZone'

Examples

  1. Common syntax:

    c2-ec2 <action> <arg1> <value1> <arg2> <value2>
    
  2. Send simple request

    c2-ec2 RunInstances ImageId cmi-078880A0 Description "Test instance" \
    InstanceType m1.small MaxCount 1 MinCount 1 SecurityGroup.1 test
    
  3. To send requests to specified AZ add options --azs and --az-field.

  4. Run one request to create instance in specified AZ:

```
c2-ec2 --azs ru-msk-comp1 --az-field Placement.AvailabilityZone \
RunInstances ImageId cmi-078880A0 Description "Test instance" \
InstanceType m1.small MaxCount 1 MinCount 1 SecurityGroup.1 test
```
  1. Specifing several AZs in CLI will cause parallel requests to these AZs (running instances in different AZs):
```
c2-ec2 --azs ru-msk-comp1,ru-msk-vol51 --az-field Placement.AvailabilityZone \
RunInstances ImageId cmi-078880A0 Description "Test instance" \
InstanceType m1.small MaxCount 1 MinCount 1 SecurityGroup.1 test
```

c2-api-client's People

Contributors

gmmephisto avatar nightblues avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.