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 |
|
Your domain name. |
Project Domain |
|
Your project domain name. |
Project Name |
|
Your project name. You can view it in the upper-right corner of the self-service panel. |
Username |
|
Your user name. |
Password |
|
Your password. |
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:
Install the Python 3 OpenStack client:
# apt install python3-openstackclient python3-heatclient python3-magnumclient python3-octaviaclient
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
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.