16. Managing Virtuozzo Hybrid Cloud Using API

16.1. Access to Virtuozzo Hybrid Cloud API

Virtuozzo Hybrid Cloud uses OpenStack-based API with password credentials.

Note

For more information about OpenStack API, please refer to OpenStack Authentication and API Request Workflow.

Here is a list of access parameters:

Name

Python CLI Variable

Value

User Domain

OS_USER_DOMAIN_NAME

Your domain name.

Project Domain

OS_PROJECT_DOMAIN_NAME

Your project domain name.

Project Name

OS_PROJECT_NAME

Your project name. You can view it in the upper-right corner of the self-service panel.

Username

OS_USERNAME

Your user name.

Password

OS_PASSWORD

Your password.

URL

OS_AUTH_URL

Your cloud URL should be one of the following:

16.2. Access Example with Python CLI

The example below is for the Ubuntu system you can use to connect to Virtuozzo Hybrid Cloud API. It can be a virtual machine on the Virtuozzo Hybrid Cloud or your laptop with a similar system:

  1. Install the Python 3 OpenStack client:

    # apt install python3-openstackclient python3-heatclient python3-magnumclient python3-octaviaclient
    
  2. Prepare a credentials file:

    Note

    In the request below, replace the values with your ones.

    echo -e "export OS_PROJECT_DOMAIN_NAME=vhc-pc \nexport OS_USER_DOMAIN_NAME=vhc-pc \nexport OS_PROJECT_NAME=pc-345 \nexport OS_USERNAME=alice@example.com \nexport OS_PASSWORD="strongpassword" \nexport OS_AUTH_URL=https://eu1-cloud.virtuozzo.com:5000/v3" > cloud-cred.rc
    
  3. Load the credentials into an Env Var:

    . /cloud-cred.rc
    

Now, you can use the OpenStack CLI to manage your cloud objects. For more details, go to OpenStack CLI Reference. For example:

# openstack server list

The abovementioned command will output a list of virtual machines.

16.3. API Automation Solutions

You can use the same credential information set for Heat Orchestration and Terraform on Heat.