Syntax for Getting the Business Group ID for a Reservation

GET /api/tenants/{tenantId}/subtenants of the identity service API, lists all business groups. The business group is also referred to as the subtenant in the API. When you create a reservation, you must provide the business group ID, also referred to as the subtenant ID, in the REST command line. Use this procedure to obtain the subTenantId value.

Input

Use the supported input parameters to control the command output.

Parameter Description
URL https://$vRA/identity/api/tenants/$tenantId/subtenants
Method Get
$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.

$tenantId

Specifies the ID of the tenant.

Use to indicate the tenant ID to be queried. Each subtenant, or business group, must belong to a tenant.

Output

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

Property Description
Links Species an array of link objects, each of which contains the following parts:
rel Specifies the name of the link.
  • Self refers to the object that was returned or requested.
  • First, Previous, Next, and Last refer to corresponding pages of pageable lists.
  • Specifies the application or service determines the other names.
href Specifies the URL which produces the result.
Content Specifies an array of data rows, each of which represents one of the tenant objects returned in a pageable list. Each tenant object contains the following information:
@type Constants the ReservationType string.
Id Specifies the unique reservation type identifier.
name Specifies the reservation type name.
description Specifies the reservation type description.
subtenantRoles Specifies the business group roles.
extensionData Specifies the extension data of the business group.

For example, the email address of the vRealize Automation business group manager is [email protected].

Metadata Specifies the paging-related data.
Size Specifies the maximum number of rows per page.
totalElements Specifies the number of rows returned.
totalPages Specifies the total number of pages of data available.
Number Specifies the current page number.
Offset Specifies the number of rows skipped.

curl Command

The following example command retrieves all available business group, or subtenant, IDs.

insecure -H "Accept:application/json" 
-H "Authorization: Bearer $token" 
https://$vRA/identity/api/tenants/qe/subtenants

JSON Output

In this example, all available business group, or subtenant, IDs are displayed. For related information about the subtenant ID ef58f604-528d-4441-a219-4725bead629b, see Create a Reservation.

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

{
	"links": [],
	"content": [{
		"@type": "Subtenant",
		"id": "7d7dbb19-d2dc-44a3-9fc2-7435552c8a05",
		"name": "Development",
		"description": " Development ",
		"subtenantRoles": null,
		"extensionData": {
			"entries": [{
				"key": "iaas-manager-emails",
				"value": {
					"type": "string",
					"value": "[email protected]"
				}
			}]
		},
		"tenant": "qe"
	},
	{
		"@type": "Subtenant",
		"id": "ade5b8d3-decf-405e-bd0b-297f976ef721",
		"name": "Finance",
		"description": "Finance",
		"subtenantRoles": null,
		"extensionData": {
			"entries": [{
				"key": "iaas-manager-emails",
				"value": {
					"type": "string",
					"value": " [email protected] "
				}
			}]
		},
		"tenant": "qe"
	},
	{
		"@type": "Subtenant",
		"id": "ef58f604-528d-4441-a219-4725bead629b",
		"name": "Test Sub Tenant",
		"description": "VMPS",
		"subtenantRoles": null,
		"extensionData": {
			"entries": []
		},
		"tenant": "qe"
	},
	{
		"@type": "Subtenant",
		"id": "92926c91-37de-4647-9aee-70b8d557ce8d",
		"name": "Quality Engineering",
		"description": "created by demo content",
		"subtenantRoles": null,
		"extensionData": {
			"entries": [{
				"key": "iaas-manager-emails",
				"value": {
					"type": "string",
					"value": " [email protected] "
				}
			}]
		},
		"tenant": "qe"
	}],
	"metadata": {
		"size": 20,
		"totalElements": 4,
		"totalPages": 1,
		"number": 1,
		"offset": 0
	}
}