Use the GET: Child Resources link to retrieve a list of the child nodes of a deployment, including virtual machines, networks, and other objects you may have configured on the design canvas.

Using the REST API to Get Additional Deployment Information

In addition to general information about the provisioned resource, the response contains additional HATEOAS links that enable you to obtain additional details and information about each returned child resource.

表 1. HATEOAS Link Functions as Defined by rel Field

Link

Description

GET: Parent Resource

URI to get the resourceView for the parent item. See Syntax for Getting Deployment Details.

GET:Template

{com.vmware.csp.component.cafe.composition@resource.action.deployment.$actionName

URI to get a template request for a specific action that you can perform on this resource.

POST:

{com.vmware.csp.component.cafe.composition@resource.action.deployment.$actionName

URI to which to post the request to perform an action, based on the corresponding template.

Input

Use the supported input parameters to control the command output.

Parameter

Description

URL

https://$host/catalog-service/api/consumer/resources/$resourceId

$host

Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server.

$token

Specifies a valid HTTP bearer token with necessary credentials.

$resourceID

Specifies a resource ID. See Syntax for Getting Deployment Details to view all of your requests and search for a request ID.

managedOnly

If true, the returned requests are from the user's managed subtenants.

page

Specifies a page number.

limit

Specifies the number of entries to display on a page.

$orderby

Specifies how to order multiple comma-separated properties sorted in ascending or descending order.

$top

Specifies the number of returned entries from the top of the response (total number per page in relation to skip).

$skip

Specifies the number of entries to skip.

filter

Contains a Boolean expression to determine if a particular entry is included in the response.

Output

The command output contains property names and values based on the command input parameters.

表 2. Output Parameters

Property

Description

resourceId

The unique identifier of the resource.

iconId

Specifies an icon for this request based on the requested object type.

name

The user friendly name of the resource.

description

An extended user friendly description of the resource.

status

The status of the resource. For example, On, Off, etc.

catalogItemId

The identifier of the catalog item associated with this provisioned resource.

catalogItemLabel

The label of the catalog item associated with this provisioned resource.

requestId

The unique identifier of the request that created this provisioned resource.

businessGroupId

The unique identifier of the business group that owns this resource.

tenantId

The unique identifier of the tenant that owns this resource.

owners

The owner of this resource.

resourceType

The type identifier of this resource. For example, Virtual Machine.

parentResourceId

The unique identifier of the parent resource. Used for child resources of a multi-machine resource.

hasChildren

Returns trun if this resource has child resources. Used if this is a multi-machine resource.

dateCreated

The date and time at which the resource was created.

lastUpdated

The date and time at which the resource was most recently modified.

lease

The current lease of the resource.

costs

An optional rate card of the costs and charges levied against the resource.

costToDate

An optional rate card of the existing costs and charges levied against the resource.

totalCost

An optional rate card of the costs and charges levied for the entire lease period.

data

The extended, provider defined properties of the resource.

Example Curl Command

This example retrieves all children of the resource with an ID of c4d3db3e-e397-44ff-a1c9-0ecebdba12f4%27.

$curl --insecure -s -H" Content-Type: multipart/form-data" -H "Authorization: Bearer $token" https:// $host /catalog-service/api/consumer/resourceViews?managedOnly=false&withExtendedData=true&withOperations=true&%24filter=parentResource%20eq%20%27c4d3db3e-e397-44ff-a1c9-0ecebdba12f4%27

JSON Output

The validation output displays the validation status of each content item within the package.

{
    "links": [],
    "content": [
        {
            "@type": "CatalogResourceView",
            "links": [
                {
                    "@type": "link",
                    "rel": "GET: Parent Resource",
                    "href": "https://$host/catalog-service/api/consumer/resourceViews/c4d3db3e-e397-44ff-a1c9-0ecebdba12f4"
                },
                {
                    "@type": "link",
                    "rel": "GET Template: {com.vmware.csp.component.iaas.proxy.provider@resource.action.name.machine.ChangeLease}",
                    "href": "https://$host/catalog-service/api/consumer/resources/dd37b7a1-829c-4773-b5be-b229453eca4a/actions/b5739e30-871d-48c7-9012-f2a7cf431dc1/requests/template"
                },
                {
                    "@type": "link",
                    "rel": "POST: {com.vmware.csp.component.iaas.proxy.provider@resource.action.name.machine.ChangeLease}",
                    "href": "https://$host/catalog-service/api/consumer/resources/dd37b7a1-829c-4773-b5be-b229453eca4a/actions/b5739e30-871d-48c7-9012-f2a7cf431dc1/requests"
                },
                {
                    "@type": "link",
                    "rel": "GET Template: {com.vmware.csp.component.iaas.proxy.provider@resource.action.name.machine.PowerOff}",
                    "href": "https://$host/catalog-service/api/consumer/resources/dd37b7a1-829c-4773-b5be-b229453eca4a/actions/02bad06d-f92b-4cf8-b964-37bb5d57be38/requests/template"
                },
                {
                    "@type": "link",
                    "rel": "POST: {com.vmware.csp.component.iaas.proxy.provider@resource.action.name.machine.PowerOff}",
                    "href": "https://$host/catalog-service/api/consumer/resources/dd37b7a1-829c-4773-b5be-b229453eca4a/actions/02bad06d-f92b-4cf8-b964-37bb5d57be38/requests"
                }
            ],
            "resourceId": "dd37b7a1-829c-4773-b5be-b229453eca4a",
            "iconId": "cafe_default_icon_genericCatalogItem",
            "name": "DEMO-002",
            "description": null,
            "status": "On",
            "catalogItemId": null,
            "catalogItemLabel": null,
            "requestId": null,
            "resourceType": "{com.vmware.csp.component.iaas.proxy.provider@resource.type.registration.name.Infrastructure.Virtual}",
            "owners": [
                "Connie Summers"
            ],
            "businessGroupId": "c0683388-6db2-4cb5-9033-b24d15ad3766",
            "tenantId": "mycompany",
            "dateCreated": "2015-07-29T13:54:58.804Z",
            "lastUpdated": "2015-07-29T13:55:01.371Z",
            "lease": {
                "start": "2015-07-29T13:51:33.000Z"
            },
            "costs": {
                "leaseRate": {
                    "type": "moneyTimeRate",
                    "cost": {
                        "type": "money",
                        "currencyCode": "USD",
                        "amount": 0
                    },
                    "basis": {
                        "type": "timeSpan",
                        "unit": "DAYS",
                        "amount": 1
                    }
                }
            },
            "costToDate": {
                "type": "money",
                "currencyCode": "USD",
                "amount": 0
            },
            "totalCost": null,
            "parentResourceId": "c4d3db3e-e397-44ff-a1c9-0ecebdba12f4",
            "hasChildren": false,
            "data": {
                "ChangeLease": true,
                "ConnectViaRdp": true,
                "ConnectViaVmrc": true,
                "DISK_VOLUMES": [
                    {
                        "componentTypeId": "com.vmware.csp.component.iaas.proxy.provider",
                        "componentId": null,
                        "classId": "dynamicops.api.model.DiskInputModel",
                        "typeFilter": null,
                        "data": {
                            "DISK_CAPACITY": 6,
                            "DISK_INPUT_ID": "DISK_INPUT_ID1"
                        }
                    },
                    {
                        "componentTypeId": "com.vmware.csp.component.iaas.proxy.provider",
                        "componentId": null,
                        "classId": "dynamicops.api.model.DiskInputModel",
                        "typeFilter": null,
                        "data": {
                            "DISK_CAPACITY": 6,
                            "DISK_INPUT_ID": "DISK_INPUT_ID2"
                        }
                    }
                ],
                "Destroy": true,
                "EXTERNAL_REFERENCE_ID": "vm-38153",
                "Expire": true,
                "IS_COMPONENT_MACHINE": false,
                "MachineBlueprintName": "system_blueprint_vsphere",
                "MachineCPU": 1,
                "MachineDailyCost": 0,
                "MachineDestructionDate": null,
                "MachineExpirationDate": null,
                "MachineGroupName": "Demo Group",
                "MachineGuestOperatingSystem": null,
                "MachineInterfaceDisplayName": "vSphere (vCenter)",
                "MachineInterfaceType": "vSphere",
                "MachineMemory": 4096,
                "MachineName": "DEMO-002",
                "MachineReservationName": "vCenter55",
                "MachineStorage": 12,
                "MachineType": "Virtual",
                "NETWORK_LIST": [
                    {
                        "componentTypeId": "com.vmware.csp.component.iaas.proxy.provider",
                        "componentId": null,
                        "classId": "dynamicops.api.model.NetworkViewModel",
                        "typeFilter": null,
                        "data": {
                            "NETWORK_MAC_ADDRESS": "00:50:56:ba:6b:85",
                            "NETWORK_NAME": "VM Network SQA"
                        }
                    }
                ],
                "PowerOff": true,
                "Reboot": true,
                "Reconfigure": true,
                "Reprovision": true,
                "Reset": true,
                "SNAPSHOT_LIST": [],
                "Shutdown": true,
                "Suspend": true,
                "ip_address": "10.118.194.213",
                "machineId": "f3579990-a3c4-4e17-9593-1f8893636876"
            }
        },
        {
            "@type": "CatalogResourceView",
            "links": [
                {
                    "@type": "link",
                    "rel": "GET: Parent Resource",
                    "href": "https://$host/catalog-service/api/consumer/resourceViews/c4d3db3e-e397-44ff-a1c9-0ecebdba12f4"
                },
                {
                    "@type": "link",
                    "rel": "GET Template: {com.vmware.csp.component.network.service@resource.action.destroy.name,[{{com.vmware.csp.component.iaas.proxy.provider@network.network.type.registration.name.Infrastructure.Network.Network.Existing}}]}",
                    "href": "https://$host/catalog-service/api/consumer/resources/f735b57a-fe6f-4108-876f-1c1055ca2cec/actions/ec5c522d-7b5b-4d0b-b9f2-1aedf01a2f0c/requests/template"
                },
                {
                    "@type": "link",
                    "rel": "POST: {com.vmware.csp.component.network.service@resource.action.destroy.name,[{{com.vmware.csp.component.iaas.proxy.provider@network.network.type.registration.name.Infrastructure.Network.Network.Existing}}]}",
                    "href": "https://$host/catalog-service/api/consumer/resources/f735b57a-fe6f-4108-876f-1c1055ca2cec/actions/ec5c522d-7b5b-4d0b-b9f2-1aedf01a2f0c/requests"
                }
            ],
            "resourceId": "f735b57a-fe6f-4108-876f-1c1055ca2cec",
            "iconId": "cafe_default_icon_genericCatalogItem",
            "name": "Existing Network",
            "description": null,
            "status": null,
            "catalogItemId": null,
            "catalogItemLabel": null,
            "requestId": null,
            "resourceType": "{com.vmware.csp.component.iaas.proxy.provider@network.network.type.registration.name.Infrastructure.Network.Network.Existing}",
            "owners": [
                "Connie Summers"
            ],
            "businessGroupId": "c0683388-6db2-4cb5-9033-b24d15ad3766",
            "tenantId": "mycompany",
            "dateCreated": "2015-07-29T13:55:14.095Z",
            "lastUpdated": "2015-07-29T13:55:17.315Z",
            "lease": null,
            "costs": null,
            "costToDate": null,
            "totalCost": null,
            "parentResourceId": "c4d3db3e-e397-44ff-a1c9-0ecebdba12f4",
            "hasChildren": false,
            "data": {
                "Description": " ",
                "Name": "Existing Network"
            }
        }
    ],
    "metadata": {
        "size": 20,
        "totalElements": 2,
        "totalPages": 1,
        "number": 1,
        "offset": 0
    }
}