VMware Cloud Director API
The VMware Cloud Director API allows you to interact with VMware Cloud Director using the REST client.
For a description of VMware Cloud Director API methods, see the VMware documentation.
Authorization
To authorize and start using the API, learn the API version and obtain the token.
Request the API version
-
Run the query:
curl https://vcd.selectel.ru/api/versions
For current versions of the API, the
deprecated
attribute takes thefalse
value, for outdated versions —true
. -
Select any current API version from the list. The example queries use version 36.3.
Obtain the token
-
Use any string encode tool to convert the string from text format to MIME Base64 format:
<username>@<tenant>:<password>
Specify:
<username>
— username to access Cloud Director;<tenant>
— tenant, can be viewed in the URL for Cloud Director loginт:https://vcd.selectel.ru/tenant/<tenant>
<password>
— user password to access Cloud Director..
-
Request the token:
curl -i -XPOST \ -H 'Accept: application/*;version=<version>' \ -H 'Authorization: Basic <encoded_string>' \ 'https://vcd.selectel.ru/cloudapi/1.0.0/sessions/'
Specify:
<version>
— API version;<encoded_string>
— the string received at step 1.
-
See:
- token in the
X-VMWARE-VCLOUD-ACCESS-TOKEN
field. When the key session expires, the token must be retrieved again; - organization ID in the
org:id
field in theurn:vcloud:org:<org_id>
format, where<org_id>
is the organization ID.
- token in the