To get IDs of the resources in your deployment, you use the Deployment APIs to make a GET request.
Prerequisites
- Verify that all general prerequisites and prerequisites for the Automation Service Broker Deployment service have been satisfied. See Prerequisites for API Use Case Examples.
- Verify that you have the ID of the deployment you want to reconfigure. See Deploy a Cloud Template with Contents Inline.
Procedure
Example: Get Deployment Resource IDs
Get the resource IDs for your deployment with ID 5551a299-8b67-45e3-909e-a638d11b0d9f.
Assign variables.
$ url='https://appliance.domain.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'