To look up deployment details such as the resources provisioned for each deployment, you use the Deployment APIs to make a GET request that displays all available resources. Then you use the resource ID in the output to make a GET request that returns the details of a particular resource.
Prerequisites
- Verify that all general prerequisites and prerequisites for the Service BrokerDeployment service have been satisfied. See Prerequisites for API Use Case Examples.
- Verify that you have a deployment ID for the deployment that you requested. See Deploy Your Cloud Template.
- Assign an API version variable for the Deployment API.
api_version_deployment='2020-08-25'
Procedure
Results
Example: Look up the details of a provisioned resource in your deployment
Display the resources provisioned in your deployment.
Assign variables.
$ url='https://appliance.domain.com'
$ api_version_deployment='2020-08-25'
$ deployment_id='15454178-63fc-42ea-b4ad-7ed8a5cdb128'
Look up deployment details.
$ curl -X GET \ $url/deployment/api/deployments/$deployment_id?expandResources=true&apiVersion=$api_version_deployment \ -H "Authorization: Bearer $access_token" | jq "."
A snippet of the response shows the details for each resource details including a deployment resource ID.
... "resources": [ { "id": "3994a33e-bd93-4eea-87f1-f99ff17717ce", "name": "BasicCloudMachine[0]", ...
Assign the deployment resource ID variable for the BasicCloudMachine resource.
$ deployment_resource_id='3994a33e-bd93-4eea-87f1-f99ff17717ce'
Display the details of that resource.
$ curl -X GET \ $url/deployment/api/deployments/$deployment_id/resources/$deployment_resource_id?apiVersion=$api_version_deployment \ -H "Authorization: Bearer $access_token" | jq "."
A snippet of the response shows the details of the single resource.
{
"id": "3994a33e-bd93-4eea-87f1-f99ff17717ce",
"name": "BasicCloudMachine[0]",
"type": "Cloud.Machine",
"dependsOn": [],
"createdAt": "2021-11-08T17:56:09.463Z",
"properties": {
"id": "/resources/compute/3114189206b1763d",
"name": "BasicCloudMachine",
...
"service": "EC2",
"storage": {
"disks": [
{
"name": "boot-disk",
"type": "HDD",
...
"networks": [
{
"name": "BasicCloudMachine_nic",
"address": "172.16.1.98",
"assignment": "dynamic"
}
],
...
"__ext:ComputeReservationTaskState:STARTED:SELECTED": "true",
"__ext:ComputeAllocationTaskState:STARTED:START_COMPUTE_ALLOCATION": "true"
},
"state": "OK"
}
List events from the deployment.
$ curl -X GET \ $url/deployment/api/deployments/$deployment_id/events?apiVersion=$api_version_deployment \ -H "Authorization: Bearer $access_token" | jq "."
A snippet of the response shows successful events.
... "totalTasks": 3, "status": "SUCCESSFUL", "inputs": { "count": 2, "image": "ubuntu", "flavor": "small" } ...