Display Your Provisioned Resources Example

GET /api/consumer/resources/{id} displays a list of all the provisioned resources that you own.

curl Command

The following example displays all applicable provisioned resources.

curl --insecure -H "Content-Type: application/json" 
-H "Authorization: Bearer $token" 
https://$vRA/catalog-service/api/consumer/resources/?page=1&limit=n&$orderby=name

JSON Output

The following JSON output is returned based on the command input.

{
  "links" : [ {
    "@type" : "link",
    "rel" : "next",
    "href" : "https://vra152-009-067.mycompany.com/catalog-service/api/consumer/resources/?page=2&limit=1"
  } ],
  "content" : [ {
    "@type" : "ConsumerResource",
    "id" : "c24e8c75-c201-489c-b51c-8d7009c23563",
    "iconId" : "Travel_100.png",
    "resourceTypeRef" : {
      "id" : "com.mycompany.mystuff.samples.travel.packageType",
      "label" : "Reservation"
    },
    "name" : "example",
    "description" : "asd",
    "status" : "ACTIVE",
    "catalogResource" : {
      "id" : "6fddafcd-bc3d-4753-8a2a-5fa3f78a5a90",
      "label" : "example"
    },
    "requestId" : "55e7fcf3-4c77-4b11-a442-1f282333ac91",
    "providerBinding" : {
      "bindingId" : "1",
      "providerRef" : {
        "id" : "f60f5d1e-d6e9-4d98-9c48-f70a3e405346",
        "label" : "travel-service"
      }
    },
…
}

Input

Use the supported input parameters to control the command output.

Parameter Description
URL https://$vRA/catalog-service/api/consumer/resources/
$vRA

Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server.

$token

Specifies a valid HTTP bearer token with necessary credentials.

$page Specifies a page number.
$limit Specifies the number of entries to display on a page. Maximum value is 5000. If not specified, defaults to 20.

For information regarding limits to the number of elements displayed, see Retrieve 10,000 Resources Ordered By Name.

$orderby Specifies how to order multiple comma-separated properties sorted in ascending or descending order. Values include:
  • $orderby=id
  • $orderby=name
  • $orderby=dateCreated
  • $orderby=lastUpdated
  • $orderby=status
  • $orderby=description
$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.

Output

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

Property Description
id Specifies the unique identifier of this resource.
iconId Specifies an icon for this request based on the requested object type.
resourceTypeRef Specifies the resource type.
name Specifies the resource name.
description Specifies the resource description.
status Specifies the resource status.
catalogItem Specifies the catalog item that defines the service this resource is based on.
requestId Specifies the request ID that provisioned this resource.
providerBinding Specifies the provider binding.
owners Species the owners of this resource.
organization Specifies the subtenant or tenant that owns this resource.
dateCreated Specifies the data and time at which the resource was created.
lastUpdated Specifies the date and time at which the resource was most recently modified.
hasLease Returns true if the resource is subject to a lease.
lease Displays the resource's current lease as start and end time stamps.
leaseForDisplay Specifies the resource's current lease, #getLease, with time units synchronized with #getCosts.
hasCosts Returns true if the resource is subject to per-time price.
costs Displays an optional rate of the price charges for the resource. This parameter is deprecated.
costToDate Displays an optional rate of the current price charges for the resource. This parameter is deprecated.
totalCost Displays an optional rate of the price charges for the entire lease period. This parameter is deprecated.
expenseMonthToDate The expense of the resource from the beginning of the month to the current date. This value is updated daily by vRealize Business for Cloud.
parentResourceRef Displays the parent of this resource.
childResources Displays the children of this resource.
operations Specifies the sequence of available operations that can be performed on this resource.
forms Specifies the forms used to render this resource.
resourceData Displays the extended provider-defined properties of the resource.

Retrieve 10,000 Resources Ordered By Name

Since the catalog service limits the number of elements that can be retrieved with a single API call to 5000, retrieving 10,000 resources requires two calls. The first call displays the first 5000 elements and the second call displays the second 5000 elements. You can make the two calls by specifying either the page and limit values or the skip and top values.

Specifying page and limit values, you make the following two calls.
curl --insecure -H "Content-Type: application/json" -H "Accept: application/json" 
   -H "Authorization: $AUTH" "https://$vRA/catalog-service/api/consumer/resources/?page=1&limit=5000&$orderby=name"
curl --insecure -H "Content-Type: application/json" -H "Accept: application/json" 
   -H "Authorization: $AUTH" "https://$vRA/catalog-service/api/consumer/resources/?page=2&limit=5000&$orderby=name"
Specifying skip and top values, you make the following two calls.
curl --insecure -H "Content-Type: application/json" -H "Accept: application/json" 
   -H "Authorization: $AUTH"  "https://$vRA/catalog-service/api/consumer/resources/?$skip=0&$top=5000&$orderby=name"
curl --insecure -H "Content-Type: application/json" -H "Accept: application/json" 
   -H "Authorization: $AUTH"  "https://$vRA/catalog-service/api/consumer/resources/?$skip=5000&$top=5000&$orderby=name"

If both page and limit values and skip and top values are specified, the skip and top values take priority.