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

  1. Run the query:

    curl https://vcd.selectel.ru/api/versions
    

    For current versions of the API, the deprecated attribute takes the false value, for outdated versions — true.

  2. Select any current API version from the list. The example queries use version 36.3.

Obtain the token

  1. 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..
  2. 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.
  3. 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 the urn:vcloud:org:<org_id> format, where <org_id> is the organization ID.