How Do I Retrieve the List of Environments in My Organization

After you retrieve the ID (URN) of your organization, you can retrieve a list of the existing environments in your VMware Cloud services platform organization by using the VMware Cloud Director service API.

Prerequisites

  • Verify that you are assigned the Provider Administrator or the Provider Support role.
  • Obtain an API token from the organization you want to manage and exchange it for an access bearer token. Use the bearer token in the Authorization header when you run API calls. See How Do I Generate an API Token.
  • Obtain the organization ID (URN). See How Do I Retrieve the ID of My Organization.

Procedure

  • Run a GET request.
    GET https://operatorUrl/organizations/organization-Urn/environments

    Here operatorUrl is the operator URL, for example vcdc-operator-prod-us-west-2.vdp.vmware.com.

Results

The response returns a list of the environments that are associated with your organization.

Example: Retrieve the List of Environments in My Organization

This example retrieves the list of environments in your organization. Run a GET request with the bearer token that you generated in the Authorization header of the request.

GET https://vcdc-operator-prod-us-west-2.vdp.vmware.com/organization/urn:vcdc:organization:12345678-1234-1234-1234-123456789abc/environments
Use the bearer token in the Authorization header of the request.
Authorization: 
Bearer eyJh…I1NiIs

The response returns the list of the environments associated with your organization.

{
  "resultTotal": 1,
  "pageCount": 1,
  "page": 1,
  "pageSize": 20,
  "valueType": "Environments",
  "values": [
    {
      "id": "urn:vcdc:environment:00000000-0000-0000-0000-000000000000",
      "name": "California",
      "location": "us-west-2",
      "url": "https://vcdc-coordinator-prod-us-west-2.vdp.vmware.com",
      "service": "http://vcdc-coordinator-prod-us-west-2-rest-frontend.vcdc-prod-us-west-2",
      "enabled": true,
      "initial": true
    }
  ]
}