CROC Cloud API Client#

Important

To work with CROC Cloud API Client you need Python 3 ≥ 3.4

To work with various NGN Cloud API, you can use the utilities from the c2-client package:

The package includes the following utilities:

  • c2-as — a client for Auto Scaling API;

  • c2-bs — client to Backup API;

  • c2-ct — command-line client for CloudTrail API;

  • c2-cw — command-line client for CloudWatch API;

  • c2-ec2 — command-line client for EC2 API;

  • c2-eks — command-line client for the EKS API;

  • c2-paas — command-line client for PaaS API;

  • c2-elb — command-line client for the Elastic Load Balancing API;

  • c2-route53 — command-line client for Route53 API;

  • c2rc-convert — utility for converting settings to be used in Windows.

To manage resources in NGN Cloud via API, you should use the customized version of the python-boto and python-boto3 libraries.

Installation#

All operation systems#

bjecpip install git+https://github.com/C2Devel/boto.git@2.46.1-CROC47
pip install git+https://github.com/C2Devel/boto3.git
pip install git+https://github.com/C2Devel/botocore.git
pip install c2client

Use#

Get API access settings in the NGN Cloud management console. Click the user login in the top right corner, select Profile Get API access settings.

In the C2_PROJECT variable, specify your project ID.

Add the settings you have got to environment variables:

  • For Windows, convert the settings file and export environment variables:

    C:\> c2rc-convert path\to\c2rc.sh path\to\c2rc.bat
    C:\> call path\to\c2rc.bat
    
  • For Linux, export environment variables:

    source path/to/c2rc.sh
    

Now you can use the utilities according to documentation. For example:

c2-ec2 DescribeAvailabilityZones
c2-eks DescribeCluster name backend_production