To get IDs of the resources in your deployment, you use the Deployment APIs to make a GET request.

To perform operations on the load balancer or virtual machine in your deployment, you need the IDs of those resources.

Prerequisites

Procedure

  1. Assign your deployment ID variable.
    deployment_id='<your_deployment_id>'
  2. List the resources in your deployment.
    curl -X GET \
      $url/deployment/api/deployments/$deployment_id/resources?apiVersion=$api_version \
      -H "Authorization: Bearer $access_token" | jq "."
  3. Examine the response.
    • Find the resource named Provider_LoadBalancer_1 and copy the value to assign to the load balancer ID.
    • Find the resource named cloud-vm and copy the value to assign to the virtual machine ID.
  4. Assign variables for the resources.
    load_balancer_id='<your_load_balancer_id>'
    virtual_machine_id='<your_virtual_machine_id>'
    

Example: Get Deployment Resource IDs

Get the resource IDs for your deployment with ID 5551a299-8b67-45e3-909e-a638d11b0d9f.

Assign variables.

Note: If your organization uses an API service that is hosted outside of the United States, your URL variable must include a country abbreviation. See Regional Endpoints for VMware Aria Automation APIs.
$ url='https://api.mgmt.cloud.vmware.com'
$ api_version='2020-08-25'
$ deployment_id='5551a299-8b67-45e3-909e-a638d11b0d9f'

List the resources in your deployment.

$ curl -X GET \
  $url/deployment/api/deployments/$deployment_id/resources?apiVersion=$api_version \
  -H "Authorization: Bearer $access_token" | jq "."

A snippet of the response shows the ID for the resource Provider_LoadBalancer_1 and the ID for the resource cloud-vm.

...
{
      "id": "d5b4569d-2234-4fc4-a594-45e6b0251588",
      "name": "Provider_LoadBalancer_1",
      "type": "Cloud.LoadBalancer",
...
{
      "id": "42f49781-1490-4a08-ae21-8baf383a72ac",
      "name": "cloud-vm",
      "type": "Cloud.AWS.EC2.Instance",
...

Assign the load balancer ID and virtual machine ID variables.

$ load_balancer_id='d5b4569d-2234-4fc4-a594-45e6b0251588'
$ virtual_machine_id='42f49781-1490-4a08-ae21-8baf383a72ac'

What to do next

Use the load balancer ID to reconfigure your load balancer. Use the virtual machine ID to add a disk to the VM and power off the VM.