Syntax for Linking an Identity Store to the Tenant 26
Syntax for Searching LDAP or Active Directory for a User 30
Syntax for Assigning a User to a Role 32
Syntax for Displaying all Roles Assigned to a User 32
Requesting a Machine By Type 35
Request a Machine 35
Request a vCloud Air Machine 59
Request an Amazon Machine 75
Approve a Machine Request 91
Syntax for Listing Work Items 92
Syntax for Getting Work Item Details 98
Syntax for Constructing a JSON File to Approve a Machine Request 103
Syntax for Approving a Submitted Machine Request 106
List Provisioned Resources 108
Syntax for Displaying Your Provisioned Resources 109
Syntax for Displaying Provisioned Resources by Resource Type 111
Syntax for Displaying All Available Resource Types 114
Syntax for Displaying Provisioned Resources by Business Groups You Manage 116
Syntax for Viewing Machine Details 123
VMware, Inc.
3
Programming Guide
Reprovision a Machine Resource 127
Working with Reservations 130
Working with Reservation Policies 303
Working with Key Pairs 314
Working with Network Profiles 328
Syntax for Viewing Available Actions for a Provisioned Machine 127
Syntax for Reprovisioning a Provisioned Machine 129
Create a Reservation 131
Display a List of Reservations 281
Update a Reservation 292
Delete a Reservation 302
List Reservation Policies 303
Create a Reservation Policy 306
Display a Reservation Policy by ID 308
Update a Reservation Policy 310
Delete a Reservation Policy 312
Get a Key Pair List 314
Create a Key Pair 319
Query a Key Pair 322
Update a Key Pair 323
Delete a Key Pair 326
Get a Network Profile List 328
Create a Network Profile 367
Query a Network Profile 370
Update a Network Profile 392
Delete a Network Profile 395
Filtering and Formatting REST API Information397
4
Related Tools and Documentation398
5
Using the vRealize Automation REST API Reference 398
Using vRealize CloudClient 399
Using the API Explorer 399
Install the API Explorer 399
Choosing Your Mode of Operation 400
Log in with the API Explorer 403
Suppress Log Files 405
Creating an API Explorer Command Using Supplied curl Examples 405
Using Third Party Tools 406
VMware, Inc. 4
vRealize Automation Programming Guide
The Programming Guide provides information about the vRealize Automation REST APIs, including how
to use the REST API services and resources, create HTTP bearer tokens for authentication and
authorization, and construct REST API service calls.
Intended Audience
This information is intended for administrators and programmers who want to configure and manage
vRealize Automation programmatically using the vRealize Automation REST API. The guide focuses on
common use cases. For related information about all available REST API services, see in REST APIReference at https://www.vmware.com/support/pubs/vcac-pubs.html.
VMware Technical Publications Glossary
VMware Technical Publications provides a glossary of terms that might be unfamiliar to you. For
definitions of terms as they are used in VMware technical documentation, go to
This Programming Guide is updated with each release of the product or when necessary.
This table provides the update history of the Programming Guide.
RevisionDescription
EN-001636-04 Updated the input URL in Syntax for Displaying All Available Resource Types.
EN-001636-03
EN-001636-02
n
Removed the section titled Logging in Programmatically.
n
Minor reorganization of Using the API Explorer.
n
Updated the format of the Use Cases section topics.
n
Updated the order of topics in the Authentication, Filtering, and Related Tools sections.
EN-001636-01 Updated the documentation to include the following changes:
n
Added new topic section Working with Key Pairs.
n
Added new topic section Working with Network Profiles.
n
Added new topic Syntax for Creating a vCloud Reservation.
n
Added new topic Syntax for Creating an Amazon Reservation.
n
Added new topic Get Resources Schema for an Amazon EC2 Reservation Syntax.
n
Added new topic Get Resources Schema for a vCloud Reservation Syntax.
n
Added new topic Syntax for Displaying a Schema Definition for an Amazon Reservation.
n
Added new topic Syntax for Displaying a Schema Definition for a vCloud Reservation.
n
Added new topic Creating an API Explorer Command Using Supplied curl Examples.
n
Added Amazon EC2 and vCloud information to Syntax for Getting a Compute Resource for a Reservation.
n
Updated Syntax for Constructing a JSON File For a Machine Request and Syntax for Requesting a Machine.
n
Updated Syntax for Constructing a JSON File for a vCloud Air Machine Request and Syntax for Requesting a
vCloud Air Machine.
n
Updated Syntax for Constructing a JSON File for an Amazon Machine Request and Syntax for Requesting an
Amazon Machine.
n
Revised topic flow and content formatting throughout the guide.
EN-001636-00 Initial 6.2 release.
VMware, Inc. 6
Overview of the
vRealize Automation REST API1
The vRealize Automation REST API provides consumer, administrator, and provider-level access to the
service catalog with the same services that support the vRealize Automation console user interface. You
can perform vRealize Automation functions programmatically by using REST API service calls.
The vRealize Automation REST API offers the following services and functions.
Table 1‑1. vRealize Automation REST API Services
ServiceDescription
Advanced Designer ServiceManage Advanced Service Designer elements such as forms, endpoints
vRealize Orchestrator workflows, and work items through the Advanced
Designer Service.
Branding ServiceChange the background and text colors, company logo, company name,
product name, tenant name, and other resources in the console.
Catalog ServiceRetrieve global and entitled catalog items, and entitlements for a catalog
item and its service that the current user can review. A consumer can
retrieve, edit, and submit a request form for a catalog item. A provider
can retrieve, register, update, and delete catalog items. Provision and
manage systems.
Component RegistryAccess and manage all services and serves as the central view for all
service lookups.
Event Log ServiceProvide a central location and a consistent way of recording events and
querying for events.
File ServiceUnused.
Identity ServiceManage tenants, business groups, SSO and custom groups, users, and
identity stores.
Licensing ServiceRetrieve permissions and post serial keys.
Management ServiceRetrieve work item forms, callbacks, and tasks. Manage endpoint details
including tenant, password, user name, and endpoint URL. Retrieve
performance metrics. Retrieve and cancel reclamation requests.
Notification ServiceConfigure and send notifications for several types of events such as the
successful completion of a catalog request or a required approval.
Plug-in ServiceRetrieve, create, update, and delete a resource. Retrieve an extension.
Retrieve license notifications.
VMware, Inc. 7
Programming Guide
Table 1‑1. vRealize Automation REST API Services (Continued)
ServiceDescription
Portal ServiceRetrieve, create, update, and delete a portal resource.
Reservation ServiceRetrieve, create, update, and delete a reservation or reservation policy.
vCO ServiceManage vRealize Orchestrator actions, tasks, packages, and workflows.
Browse system and plug-in inventories.
WorkItem ServiceRetrieve, create, update, complete, cancel, and delete a work item. Also
retrieve form data, metadata, detail forms, and submission forms from
service providers.
When a service request contains a resource URL, the first part of the URL identifies the service and the
last part identifies the resource. For example, the following resource URL identifies the catalog service
and the providers resource:
https://$host/component-registry/api/services
For more information about all the vRealize Automation REST API service calls, see Using the vRealize
Automation REST API Reference and the REST API Reference in the vRealize Automation
Documentation Center at https://www.vmware.com/support/pubs/vcac-pubs.html.
VMware, Inc. 8
REST API Authentication2
In the REST API, vRealize Automation requires HTTP bearer tokens in request headers for authentication
of consumer requests. A consumer request applies to tasks that you can perform in the
vRealize Automation console, such as requesting a machine.
To acquire an HTTP bearer token, you authenticate with an identity service that manages the
communication with the SSO server. The identity service returns an HTTP bearer token that you include
in all request headers until the token expires, or you delete it. An HTTP bearer token expires in 24 hours
by default, but you can configure the token with a different duration.
Using HTTP Bearer Tokens
You use HTTP bearer tokens for tasks that you can also perform in the vRealize Automation console. You
create a request header with the curl command or with some other utility.
For information about requesting a bearer token, see the Identity option on the REST API Reference
landing page.
You use POST, HEAD, and DELETE methods to manage HTTP bearer tokens.
MethodURLDescription
POST/tokensAuthenticate the user with the identity service /tokens and
generate a new token.
HEAD/tokens/tokenIDValidate the token tokenID.
DELETE/tokens/tokenIDDelete the token tokenID.
The root URL for HTTP bearer calls is https://$vra_server/identity/api/tokens.
Configure the Duration of an HTTP Bearer Token
You set the duration of HTTP bearer tokens in the /etc/vcac/security.properties file on the
vRealize Automation appliance.
VMware, Inc.
9
Programming Guide
The effective duration or lifetime of an HTTP bearer token depends on the duration of its corresponding
SAML token, which the SSO server creates at request time. An HTTP bearer token expires when it
reaches the end of its configured duration, or at the end of the configured duration of the SAML token,
whichever comes first. For example, if the configured duration is three days for the HTTP bearer token
and two days for the SAML token, the HTTP bearer token expires in two days. A configuration setting on
the SSO server determines the duration of SAML tokens.
Prerequisites
n
Log in to the vRealize Automation appliance with SSH as root. The password is the one you specified
when you deployed the appliance.
n
The /etc/vcac/security.properties file on the appliance must be editable.
Procedure
1Open the /etc/vcac/security.properties file for editing.
2Add the following lines to the file, where N is an integer specifying the duration of the token in hours.
identity.basic.token.lifetime.hours=N
#The number is in hours.
3Save and close the file.
4Log out of the vRealize Automation appliance.
The new value applies the next time someone requests an HTTP bearer token.
Request an HTTP Bearer Token
You use an HTTP bearer token to authenticate a vRealize Automation REST API consumer request .
A consumer request must specify the correct component registry service and resource. For example, the
URL to obtain an HTTP bearer token must specify the identity service and token resource.
The HTTP bearer token expires in 24 hours by default. See Configure the Duration of an HTTP Bearer
Token for information on how to set the duration.
For related information, see Syntax for Requesting an HTTP Bearer Token.
Prerequisites
n
Log in to vRealize Automation using the applicable credentials. For example, to assign a user to a
role, log in as a tenant administrator.
n
Verify that the host name and fully qualified domain name of the vRealize Automation instance are
available.
VMware, Inc. 10
Programming Guide
Procedure
u
Enter a curl command in the following format, replacing the variables with the correct values.
The variable $vRA used in this example represents the host name.domain name of the
vRealize Automation server, for example, mycompany.mktg.mydomain.com.
Include the HTTP bearer token in your REST API service calls. You can store the token in a variable such
as $AUTH and then use the variable in your requests.
Syntax for Requesting an HTTP Bearer Token
An HTTP bearer token is required by the REST client to use the vRealize Automation REST API. You can
obtain a bearer token by authenticating to the identity service.
Input
Use the supported input parameters to control the command output.
VMware, Inc. 11
Programming Guide
A consumer request must specify the correct component registry service and resource. For example, the
URL to obtain an HTTP bearer token must contain the identity service and token resource values.
InputDescription
hosthost name.domain name of the vRealize Automation server, for example,
mycompany.mktg.mydomain.com.
usrnameSpecifies the tenant administrator user name.
passwdSpecifies the tenant administrator password.
tenantURLtokenSpecifies the tenant URL token determined by the system administrator when creating the
tenant, for example, support.
Output
The following information is displayed as a result of your HTTP bearer token request.
OutputDescription
expiresContains the ISO 8601 timestamp indicating when the token expires.
idContains the HTTP bearer token to use in Authorization header in subsequent requests.
tenantDisplays the tenant ID associated with the token.
Response Status Codes
One of the following codes are displayed as a result of your HTTP bearer token request.
Status CodeDescription
200 OKYour request succeeded and the resource was updated. The
response body contains the full representation of the resource.
400 BAD REQUESTThe data you provided in the POST failed validation. Inspect the
response body for details.
401 UNAUTHORIZEDThe request could not authenticate the user or authentication
credentials required.
Example: curl Command
You can enter the following command line format to request an HTTP bearer token.
When your request succeeds, the system returns the 200 OK status code, the expiration date and time of
the token, and the HTTP bearer token. After receiving the bearer token, you can include it in your request
headers.
VMware, Inc. 12
Programming Guide
Validate an HTTP Bearer Token
You can validate an existing HTTP bearer token.
Prerequisites
n
Request an HTTP Bearer Token.
Procedure
u
Create the request to validate the HTTP bearer token, as in the following example.
The system returns one of the following status codes.
VMware, Inc. 13
Programming Guide
Status CodeDescription
204 NO CONTENTThe request succeeded. The resource has been deleted.
401 UNAUTHORIZEDYou must have authentication credentials to access the resource. All requests must be
authenticated.
403 FORBIDDENYour authentication credentials do not provide sufficient access to the resource.
404 NOT FOUNDCould not locate the resource based on the specified URI.
405 METHOD NOT ALLOWEDThe DELETE method is not supported for the resource.
500 SERVER ERRORCould not create or update the resource because of an internal server error.
VMware, Inc. 14
REST API Use Cases3
Available use cases provide the prerequisite, command line options and format, and sample results to
help you perform a variety of vRealize Automation functions, such as requesting a machine or creating a
reservation.
You can find information about all of the available vRealize Automation REST API calls in the REST APIReference zip file located in the vRealize Automation Documentation Center. The use cases provide
samples of calls that you might commonly use and descriptions of example inputs and outputs relative to
those calls.
This chapter includes the following topics:
n
Create a Tenant
n
Requesting a Machine By Type
n
Approve a Machine Request
n
List Provisioned Resources
n
Reprovision a Machine Resource
n
Working with Reservations
n
Working with Reservation Policies
n
Working with Key Pairs
n
Working with Network Profiles
Create a Tenant
You can use the REST API identity service to create a vRealize Automation tenant and perform related
functions. Perform the tasks required to create a tenant with the REST API in sequence. For information
about creating and working with tenants and roles by using thevRealize Automation application user
interface, see the Tenant Administration and IaaS Configuration documentation.
Prerequisites
n
Log in to vRealize Automation as a system administrator and a tenant administrator.
n
Verify that there is access to a functional LDAP, Active Directory, or Native Active Directory identity
server.
VMware, Inc.
15
Programming Guide
n
Verify that the identity server details required for the JSON template are available.
n
Verify that the host name and fully qualified domain name of the vRealize Automation instance are
available.
n
If you are not using the API Explorer, verify that you have a valid HTTP bearer token that matches
your login credentials. See Chapter 2 REST API Authentication.
Procedure
1Use the identity service to display all the available tenants.
curl --insecure -H "Accept:text/xml"
-H "Authorization: Bearer $token"
https://$host/identity/api/tenants
2Submit a request for a new tenant and either call a JSON file that contains tenant request parameters
or specify those parameters using inline text. The first example uses a JSON file as input. The
second example uses inline text as input.
The first example calls the following sample newTenant.json file.
--data
'{"@type":"Tenant","id":"development","urlName":"development","
name":
"DevelopmentTenant","description":"Tenant for all
developers","contactEmail":
"admin@mycompany.com","defaultTenant":false}'
VMware, Inc. 16
Programming Guide
3List all available identity stores for a named tenant, such as the default tenant vsphere.local by using
variables, instead of the full token and host name.domain name.
Use the following command to call the example JSON text file and link an identity store to a tenant.
The command also tests that vRealize Automation can connect to the identity store successfully. If
the command finishes successfully, vRealize Automation succeeded in connecting to the identity
store.
6Assign a user to a role with the REST API identity service.
Use the following command string to submit a request to assign the user tony in the domain
example.mycompany.com to the tenant administrator role. It provides empty braces for the required
You can use the REST API identity service to list of all the vRealize Automation tenants in your system.
Input
Use the supported input parameters to control the command output.
ParameterDescription
URLhttps://$host/identity/api/tenants
$hostSpecifies the host name and fully qualified domain name or IP address of the
vRealize Automation identity server.
$tokenSpecifies a valid HTTP bearer token with necessary credentials.
Output
The command output contains property names and values based on the command input parameters.
VMware, Inc. 18
Programming Guide
ParameterDescription
LinksSpecifies an array of link objects, each of which contains the
following parts:
n
rel
Specifies the name of the link.
n
Self refers to the object that was returned or requested.
n
First, Previous, Next, and Last refer to
corresponding pages of pageable lists.
n
Specifies the application or service that determines the
other names.
n
href
Specifies the URL that produces the result.
ContentSpecifies an array of data rows, each of which represents one of
the tenant objects returned in a pageable list. Each tenant object
can contain the following information:
n
Id:
Specifies the unique tenant identifier.
n
urlName:
Specifies the name of the tenant as it appears in URLs.
n
Name:
Specifies the name of the tenant for display purposes.
n
description:
Specifies the long description of the tenant.
n
contactEmail:
Specifies the primary contact email address.
n
Password:
Unused
n
defaultTenant:
Is set to True if the corresponding tenant is the default
tenant (vsphere.local).
MetadataSpecifies the following paging-related data:
n
Size: Specifies the maximum number of rows per page.
n
totalElement: Specifies the number of rows returned.
n
totalPages: Specifies the total number of pages of data
available.
n
Number: Specifies the current page number.
n
Offset: Specifies the number of rows skipped.
VMware, Inc. 19
Programming Guide
Example: curl Command
The following example command displays all available tenants.
curl --insecure -H "Accept:text/xml"
-H "Authorization: Bearer $token"
https://$host/identity/api/tenants
Format the XML output to improve its readability. For information about formatting output, see Chapter 4
Filtering and Formatting REST API Information.
Example: JSON Output
The following JSON output is returned based on the command input.
{
"links" : [ ],
"content" : [ {
"@type" : "Tenant",
"id" : "vsphere.local",
"urlName" : "vsphere.local",
"name" : "vsphere.local",
"description" : null,
"contactEmail" : null,
"password" : null,
"defaultTenant" : true
}, {
"@type" : "Tenant",
"id" : "MYCOMPANY",
"urlName" : "MYCOMPANY",
"name" : "QETenant",
"description" : "Test tenant",
"contactEmail" : null,
"password" : "defaultPwd#1",
"defaultTenant" : false
} ],
"metadata" : {
"size" : 19,
"totalElements" : 2,
"totalPages" : 1,
"number" : 1,
"offset" : 0
}
}
Syntax for Requesting a New Tenant
You can use the REST API identity service to submit a request for a tenant. You can specify request
parameters using JSON command line input or by calling an existing JSON file from the command line.
VMware, Inc. 20
Programming Guide
Input
Use the supported input parameters to control the command output.
$tokenSpecifies a valid HTTP bearer token with necessary credentials.
$hostSpecifies the host name and fully qualified domain name or IP address
of the vRealize Automation identity server.
$tenantIdSpecifies the ID of the tenant.
$tenantURLSpecifies the URL of the tenant.
$enantNameSpecifies the name of the tenant.
$descriptionSpecifies a description of the tenant.
$emailAddressSpecifies the contact email address for the tenant.
JSON Input File Template
To simplify command line input, create a JSON file and call that file from the command line. To create a
JSON file, copy the following template to a new text file. To maintain formatting, use an XML editor.
Replace the italicized variables in the template with your specific values.
{
"@type" : "Tenant",
"id" : "$tenantId",
"urlName" : "$tenantURL",
"name" : "$tenantName",
"description" : "$description",
"contactEmail" : "$emailAddress",
"defaultTenant" : false
}
Output
The command output contains property names and values based on the command input parameters.
VMware, Inc. 21
Programming Guide
ParameterDescription
LinksSpecifies an array of link objects, each of which contains the
following parts:
n
rel
Specifies the name of the link.
n
Self refers to the object that was returned or requested.
n
First, Previous, Next, and Last refer to
corresponding pages of pageable lists.
n
Specifies the application or service that determines the
other names.
n
href
Specifies the URL that produces the result.
ContentSpecifies an array of data rows, each of which represents one of
the tenant objects returned in a pageable list. Each tenant object
can contain the following information:
n
Id:
Specifies the unique tenant identifier.
n
urlName:
Specifies the name of the tenant as it appears in URLs.
n
Name:
Specifies the name of the tenant for display purposes.
n
description:
Specifies the long description of the tenant.
n
contactEmail:
Specifies the primary contact email address.
n
Password:
Unused
n
defaultTenant:
Is set to True if the corresponding tenant is the default
tenant (vsphere.local).
MetadataSpecifies the following paging-related data:
n
Size: Specifies the maximum number of rows per page.
n
totalElement: Specifies the number of rows returned.
n
totalPages: Specifies the total number of pages of data
available.
n
Number: Specifies the current page number.
n
Offset: Specifies the number of rows skipped.
Example: curl Command
Submit a request for a new tenant and either call a JSON file that contains tenant request parameters or
specify those parameters using inline text. The first example uses a JSON file as input. The second
example uses inline text as input.
VMware, Inc. 22
Programming Guide
The first example calls the following sample newTenant.json file.
{
"@type" : "Tenant",
"id" : "development",
"urlName" : "development",
"name" : "DevelopmentTenant",
"description" : "Tenant for all developers",
"contactEmail" : "admin@mycompany.com",
"defaultTenant" : false
}
Example 1: Use the following example to call the above newTenant.json file, which contains parameters
for the tenant request.
"DevelopmentTenant","description":"Tenant for all developers","contactEmail":
"admin@mycompany.com","defaultTenant":false}'
Syntax for Listing All Tenant Identity Stores
You can use the REST API identity service to list all available identity stores for a named
vRealize Automation tenant, such as the default tenant vsphere.local.
Input
Use the supported input parameters to control the command output.
Syntax for Linking an Identity Store to the Tenant
You can use the REST API identity service to link an LDAP, Active Directory, or Native Active Directory
identity store to the vRealize Automation tenant.
Input
Use the supported input parameters to control the command output.
The following example command calls the example JSON text file and links an identity store to a tenant.
The command also tests that vRealize Automation can connect to the identity store successfully. If the
command finishes successfully,vRealize Automation succeeded in connecting to the identity store.
The following output indicates that an identity store is not linked to the specified tenant. To resolve the
problem, correct the identity store and connection details in the JSON input file and rerun the command.
Source: null}, {Error Msg: Cannot connect to the directory service.}, {System
Msg: 90027-Connection to directory service can’t be established}
Syntax for Searching LDAP or Active Directory for a User
You can use the vRealize Automation REST API identity service to search the configured LDAP directory,
Active Directory, or Native Active Directory for a user.
Input
Use the supported input parameters to control the command output.
$hostSpecifies the host name and fully qualified domain name or IP address of the
vRealize Automation identity server.
$tokenSpecifies a valid HTTP bearer token with necessary credentials.
$tenantIdSpecifies the ID of the tenant.
$principalIdSpecifies the ID of the user in name@domain format.
$roleIdSpecifies the ID of the user role.
Example: curl Command
The following example command string submits a request to assign the user tony in the domain
example.mycompany.com to the tenant administrator role. It provides empty braces for the required
JSON payload. See Syntax for Searching LDAP or Active Directory for a User for more information about
getting the user name and domain values.
"description" : "Entitle services, catalog items and actions to all users within a tenant.",
"prereqAdminPermissions" : null
}, {
"id" : "FILE_EDIT_TENANT",
"name" : "Manage Tenant Files",
"description" : "Upload and delete files belonging to this tenant.",
"prereqAdminPermissions" : null
}, {
"id" : "TENANT_USER_DATA_MANAGEMENT",
"name" : "Manage user data (requests, items, tasks etc) within a tenant.",
"description" : "Manage user created objects belonging to the tenant.",
"prereqAdminPermissions" : null
}, {
"id" : "TENANT_ADMIN_ROLE_ASSIGNMENT",
"name" : "Tenant Administrator Role Assignment",
"description" : "Assign the tenant administrator role to other users.",
"prereqAdminPermissions" : null
}, {
"id" : "GUI_MY_TENANT_TUG_MANAGEMENT",
"name" : "My Tenant Identity Stores, Groups and Users Administration User Interfaces",
"description" : "Access my tenant identity stores, groups and users administration GUIs.",
"prereqAdminPermissions" : null
} ]
} ],
"metadata" : {
"size" : 20,
"totalElements" : 1,
"totalPages" : 1,
"number" : 1,
"offset" : 0
VMware, Inc. 34
Programming Guide
Requesting a Machine By Type
You can use the REST API catalog service to request a machine by type.
Your vRealize Automation API calls vary slightly based on your intended machine type.
For information about requesting a machine by using the vRealize Automation application user interface,
see the IaaS Configuration documentation.
Request a Machine
You can use a sequence of Rest API catalog service commands to request a machine. This procedure
provides sample command line syntax to request a machine. Supporting information regarding available
input and output parameters, command-line entry samples, and sample JSON output samples is
available in the following reference topics.
This procedure provides sample command line syntax for approving a machine request. Supporting
information regarding available input and output parameters, command-line entry samples, and sample
JSON output samples is available.
Prerequisites
n
Log in to vRealize Automation as a consumer and current business group user.
n
Verify that the host name and fully qualified domain name of the vRealize Automation instance are
available.
n
If you are not using the API Explorer, verify that you have a valid HTTP bearer token that matches
your login credentials. See Chapter 2 REST API Authentication.
Syntax for Listing Shared and Private Catalog Items
You can use the REST API catalog service to retrieve a list of all shared viewable catalog items. Shared
catalog items do not belong to a specific business group. Also, this service retrieves a list of all shared
and private catalog items that can be viewed, including their business groups.
Input
Use the supported input parameters to control the command output.
Syntax for Locating the Blueprint Values Required to Construct a Machine
Request
You can find the blueprint values you need to complete a machine request by listing your entitled catalog
items, and then locating the catalog item that corresponds to the machine blueprint.
Shared and Private Catalog Items
n
In the list of catalog items requested, locate the catalog item that corresponds to the machine
blueprint. Refer the sample catalog item output in the example.
n
The following attributes and their values are available in the catalog item output. The actual values
are required for the machine request.
requestDataContains a map of the provider-specific field-value pairs collected for this request.
retriesRemaningSpecifies the number of attempts remaining to move this request from its current state to the
next state in the request workflow.
Some state transitions require calls to external services. These calls may fail due to transient
errors such as momentary network errors. In these cases, the catalog will retry the call a
number of times before failing.
This property defines the number of retries remaining for the current state transition. When it
reaches 0, the catalog will stop retrying and mark the request as failed. This property is reset to
the default number of retries for every new operation that is triggered.
requestedItemNameSpecifies the item name.
requestedItemDescriptionSpecifies the item description.
Example: curl Command
The following example command submits a machine request.
$hostSpecifies the host name and fully qualified domain name or IP address of the
vRealize Automation identity server.
$tokenSpecifies a valid HTTP bearer token with necessary credentials.
Output
The command output contains property names and values based on the command input parameters.
VMware, Inc. 48
Programming Guide
PropertyDescription
LinksSpecifies an array of link objects, each of which contains the following parts:
n
rel
Specifies the name of the link.
n
Self refers to the object that was returned or requested.
n
First, Previous, Next, and Last refer to corresponding pages of pageable lists.
n
Specifies the application or service that determines the other names.
n
href
Specifies the URL that produces the result.
ContentSpecifies an array of data rows, each of which represents one of the tenant objects returned in a
pageable list. Each tenant object can contain the following information:
n
version:
Displays the object version number.
n
state:
Specifies the transaction state.
n
approvalStatus:
Indicates whether this request has been approved, rejected, or is still pending some form of
approval.
n
waitingStatus:
Indicates whether this request is waiting on any external users or services before it is able to
progress.
n
requestNumber:
Specifies the number for this request.
n
executionStatus:
Indicates the current execution status of the request.
n
stateName:
Specifies the localized state name.
n
phase:
Indicates current phase of the request, which is more coarse grained and easier for users to
understand.
n
id:
Specifies the UUID Identifier of this object.
n
iconId:
Specifies the associated icon representing this item.
n
description:
Contains a brief description of the tenant.
n
reasons:
Contains the business reasons entered by the requestor or owner of this request.
n
requestedFor:
Specifies the ID of the user for whom this request is logged.
n
requestedBy:
ID of the user who actually submitted the request.
VMware, Inc. 49
Programming Guide
PropertyDescription
n
organization:
Specifies the business group or tenant to which this item belongs.
n
tenantRef:
ID of the tenant.
n
tenantLabel:
Name of the tenant.
n
subtenantRef:
ID of the business group.
n
subtenantLabel:
Name of the business group.
n
requestorEntitlementId:
Contains the requestorEntitlement value.
n
preApprovalId:
Specifies the ID of the preApproval entity.
n
postApprovalId:
Specifies the ID of the approval generated for the post-provisioning workflow step.
n
dateCreated:
Specifies the date this item was created in catalog.
n
lastUpdatedDate:
Specifies the date this item was last updated in catalog.
n
dateSubmitted:
Specifies the date this request was first submitted.
n
dateApproved:
Specifies the date this request was approved.
n
dateCompleted:
Specifies the date this request was completed.
n
quote:
Contains a quote made by the provider defining the estimated cost(s) associated with the request
and/or any resources provisioned as a result.
n
requestCompletion:
Requests completion information.
n
requestData:
Requests a map of the provider-specific field-value pairs collected for this request.
n
retriesRemaning:
Specifies the number of attempts remaining to move this request from its current state to the next
state in the request workflow.
Some state transitions require calls to external services. These calls may fail due to transient errors
such as momentary network errors. In these cases, the catalog will retry the call a number of times
before failing.
VMware, Inc. 50
Programming Guide
PropertyDescription
This property defines the number of retries remaining for the current state transition. When it
reaches 0, the catalog will stop retrying and mark the request as failed. This property is reset to the
default number of retries for every new operation that is triggered.
n
requestedItemName
n
requestedItemDescription
MetadataSpecifies the paging-related data:
n
Size:
Specifies the maximum number of rows per page.
n
totalElements:
Specifies the number of rows returned.
n
totalPages:
Specifies the total number of pages of data available.
n
Number:
Specifies the current page number.
n
Offset:
Specifies the number of rows skipped.
Example: curl Command
The following example command displays all requests.
requestDataContains a map of the provider-specific field-value pairs collected for this request.
retriesRemaningSpecifies the number of attempts remaining to move this request from its current state to the
next state in the request workflow.
Some state transitions require calls to external services. These calls may fail due to transient
errors such as momentary network errors. In these cases, the catalog will retry the call a
number of times before failing.
This property defines the number of retries remaining for the current state transition. When it
reaches 0, the catalog will stop retrying and mark the request as failed. This property is reset to
the default number of retries for every new operation that is triggered.
requestedItemNameSpecifies the item name.
requestedItemDescriptionSpecifies the item description.
VMware, Inc. 56
Programming Guide
Example: curl Command
The following example command displays details of a request.
You can use the vRealize Automation REST API catalog service to request a vCloud Air machine.
Prerequisites
n
Log in to vRealize Automation as a consumer and current business group user.
n
Verify that the host name and fully qualified domain name of the vRealize Automation instance are
available.
VMware, Inc. 59
Programming Guide
n
If you are not using the API Explorer, verify that you have a valid HTTP bearer token that matches
your login credentials. See Chapter 2 REST API Authentication.
n
View a list of catalog items. See Syntax for Listing Shared and Private Catalog Items.
n
Construct a JSON File for a vCloud Air machine request. See Syntax for Constructing a JSON File for
a vCloud Air Machine Request.
n
Obtain the request ID ($requestId) of the request for which to view status. See Syntax for Viewing All
of Your Requests.
Procedure
1Find the catalog item that corresponds to the vCloud Air blueprint to use for the machine request by
retrieving a page of published blueprint catalog items.
Syntax for Finding the Published Blueprint for a vCloud Air Machine Request
You can use the vRealize Automation REST API catalog service to retrieve a page of published blueprint
catalog items that you can use to find the catalog item that corresponds to the vCloud Air blueprint for a
vCloud Air machine request.
VMware, Inc. 60
Programming Guide
Process Overview
Use the following sequence to find a vCloud Air blueprint for use in creating a vCloud Air machine
request.
1From the list of your entitled catalog items, find the catalog item that corresponds to the vCloud Air
blueprint to use for the request. You can search on the catalog item ID Infrastructure.vCloudAir
to locate a published vCloud Air blueprint.
2In the catalog item output that contains a catalog item ID Infrastructure.vACloudAir entry, locate
the following entries that are required by the vCloud Air machine request:
n
Catalog item ID, for example c2cacf7c-b3c8-47fb-a938-2c09910b6713
n
Tenant reference, for example sqa.
n
Blueprint identifier (binding ID), for example 46548940-eb20-4368-9e73-c1685cda8c64.
n
Business group (subtenant ID), for example name1.
If the business group value is null, you do need to enter a business group value in the vCloud Air
machine request.
If the request information about a catalog item for which one is not entitled, or the blueprint catalog item is
not published, then the request is rejected.
Input
Use the supported input parameters to control the command output.
PropertyDescription
&pageSpecifies a page number. Specifies the default value is 1.
?limitSpecifies the number of entries displayed on a page. Specifies the default value is 10.
$orderbySpecifies how the results are sorted and paginated.
$skipSpecifies how many results to skip before computing pagination.
$filterSpecifies a Boolean expression to define whether a particular entry be included in the
response. Each API supports a different set of filterable fields.
Output
The command output contains property names and values based on the command input parameters.
PropertyDescription
versionDisplays the object version number.
idSpecifies the unique identifier of this resource.
outputResourceTypeRefSpecifies the type of the resource that results from requesting the catalog item.
nameSpecifies the user friendly name of the catalog item. Specifies the property type is string.
descriptionSpecifies a short description of the catalog item. Specifies the property type is string.
statusSpecifies the life cycle stage of the catalog item.
VMware, Inc. 61
Programming Guide
PropertyDescription
statusNameSpecifies the life cycle status name, such as Active.
catalogItemTypeRefSpecifies the type of the catalog item.
serviceRefSpecifies the catalog service that contains the catalog item.
iconIdSpecifies the associated icon representing this item.
organizationSpecifies the subtenant and/or tenant to which this item belongs
providerBindingSpecifies the provider side identifier of this item.
formsSpecifies the forms that are associated with catalog items of this type.
callbacksSpecifies the callbacks to the provider that are supported by this catalog item.
isNoteworthySpecifies if the catalog item should be highlighted to users for a period of time.
dateCreatedSpecifies the date that this item was created in the catalog.
lastUpdatedDateSpecifies the date that this item was last updated in the catalog.
For sample curl and REST API calls, sample output is provided.
Example: curl Command
The following example command displays the catalog items that you are entitled to view, including
published vCloud Air blueprints, one page at a time with a maximum of 10 items on each page.
You can use the vRealize Automation REST API catalog service to request a vCloud Air machine as
defined in a blueprint or you can override the default values of the blueprint by adding properties to your
JSON input file to override default values.
Input
Use the supported input parameters to control the command output.
requestDataContains a map of the provider-specific field-value pairs collected for this request.
retriesRemaningSpecifies the number of attempts remaining to move this request from its current state to the
next state in the request workflow.
Some state transitions require calls to external services. These calls may fail due to transient
errors such as momentary network errors. In these cases, the catalog will retry the call a
number of times before failing.
This property defines the number of retries remaining for the current state transition. When it
reaches 0, the catalog will stop retrying and mark the request as failed. This property is reset to
the default number of retries for every new operation that is triggered.
requestedItemNameSpecifies the item name.
requestedItemDescriptionSpecifies the item description.
Example: curl Command
The following example command submits a vCloud Air machine request, where
C:/Temp/requestMachine.json is the file name and location of the JSON file that contains the
necessary information for processing the request.
Example: JSON Output with Request and Response Headers
Display the request and response headers with the output. Reference the following example to submit a
vCloud Air machine request by using JSON inline text that contains the necessary information, rather
than by using a JSON file that contains the necessary information.
VMware, Inc. 68
Programming Guide
In this example, the @C:\vca.txt entry calls a vca.txt file that contains the request payload.
rest post --headers --service catalog-service --u consumer/requests --d @C:\vca.txt
requestDataContains a map of the provider-specific field-value pairs collected for this request.
retriesRemaningSpecifies the number of attempts remaining to move this request from its current state to the
next state in the request workflow.
Some state transitions require calls to external services. These calls may fail due to transient
errors such as momentary network errors. In these cases, the catalog will retry the call a
number of times before failing.
This property defines the number of retries remaining for the current state transition. When it
reaches 0, the catalog will stop retrying and mark the request as failed. This property is reset to
the default number of retries for every new operation that is triggered.
requestedItemNameSpecifies the item name.
requestedItemDescriptionSpecifies the item description.
Example: curl Command
The following example command displays the status of a vCloud Air machine request, where
510051b5-52ce-45db-8889-d4eeabf68da1 is the value of the request ID.
The following JSON output is returned based on the command input.
The following sample illustrates example output for a request to query the status of a vCloud Air machine,
where 510051b5-52ce-45db-8889-d4eeabf68da1 is the value of the request ID.
You can use the vRealize Automation REST API catalog service to request an Amazon machine.
Prerequisites
n
Log in to vRealize Automation as a consumer and current business group user.
n
Verify that the host name and fully qualified domain name of the vRealize Automation instance are
available.
n
If you are not using the API Explorer, verify that you have a valid HTTP bearer token that matches
your login credentials. See Chapter 2 REST API Authentication.
n
Generate a list of catalog items from which to obtain the Amazon blueprint ID. See Syntax for Listing
Shared and Private Catalog Items.
n
Construct a JSON file for an Amazon machine request. See Syntax for Constructing a JSON File for
an Amazon Machine Request.
Procedure
1Find the published Amazon blueprint to use for the machine request by displaying the entitled catalog
Syntax for Finding the Published Amazon Blueprint for a Machine Request
You can use the vRealize Automation REST API catalog service to display your entitled service catalog
items and locate a published Amazon blueprint to use for your machine request.
Input
Use the supported input parameters to control the command output.
Syntax for Constructing a JSON File for an Amazon Machine Request
You can use the vRealize Automation REST API catalog service to request a machine by using a
published Amazon blueprint, the resource values specified in the blueprint, and a JSON input file
containing request data such as your user name and business group ID.
Prerequisites
n
Obtain the information that you need to add to your JSON file. See Syntax for Finding the Published
Amazon Blueprint for a Machine Request.
n
Use an XML editor to create your JSON file.
Example: JSON Input File
Use the following JSON input file sample when constructing a file.
Populate all the highlighted value equivalents from the following example JSON file when you create a
JSON input file.
You can use the vRealize Automation REST API catalog service to request an Amazon machine as
defined in your chosen blueprint, or you can override the default values of the blueprint by adding
properties to your JSON input file to override default values. For example, you can choose a specific
location.
Input
Use the supported input parameters to control the command output.
The following table describes the IDs, machine resources, and other information to add to the JSON file
to create the JSON input parameters to submit the machine request.
Populate all the highlighted value equivalents from the following example JSON file when you create a
JSON input file.
VMware, Inc. 83
Programming Guide
ValueDescription
catalog_item_IDSpecifies the value of CatalogItem ID in the machine blueprint
catalog item.
tenant_nameSpecifies the value of tenantRef in the machine blueprint catalog
item.
business_group_IDSpecifies the value of subtenantRef in the machine blueprint
catalog item.
username@fqdnSpecifies the user name of the consumer and business group
manager account and fully qualified domain name.
blueprint_IDSpecifies the value of bindingId in the machine blueprint catalog
item.
notesSpecifies notes that help to describe the request.
descriptionContains a description of the request.
reasonsContains a general reason for the request.
provider_reasonContains a general provider reason for the request.
Amazon_ins_typeSpecifies an Amazon instance type.
Request only Amazon instance types that are supported by the
blueprint. If necessary, consult the fabric administrator for details
on what blueprint supports. For information about Amazon
instance types, see Amazon product documentation.
Example: JSON Input File
The following example requests a small Amazon instance type, which overrides the default location to uswest-1a. It also creates an EBS storage volume named Backup and mounts it to /dev/sdf.
requestDataContains a map of the provider-specific field-value pairs collected for this request.
retriesRemaningSpecifies the number of attempts remaining to move this request from its current state to the
next state in the request workflow.
Some state transitions require calls to external services. These calls may fail due to transient
errors such as momentary network errors. In these cases, the catalog will retry the call a
number of times before failing.
This property defines the number of retries remaining for the current state transition. When it
reaches 0, the catalog will stop retrying and mark the request as failed. This property is reset to
the default number of retries for every new operation that is triggered.
VMware, Inc. 86
Programming Guide
PropertyDescription
requestedItemNameSpecifies the item name.
requestedItemDescriptionSpecifies the item description.
Example: curl Command
The following example command submits a request that includes the specifications in an
requestDataContains a map of the provider-specific field-value pairs collected for this request.
retriesRemaningSpecifies the number of attempts remaining to move this request from its current state to the
next state in the request workflow.
Some state transitions require calls to external services. These calls may fail due to transient
errors such as momentary network errors. In these cases, the catalog will retry the call a
number of times before failing.
This property defines the number of retries remaining for the current state transition. When it
reaches 0, the catalog will stop retrying and mark the request as failed. This property is reset to
the default number of retries for every new operation that is triggered.
requestedItemNameSpecifies the item name.
requestedItemDescriptionSpecifies the item description.
Example: curl Command
The following example command checks the status of an Amazon machine request where 25211c6cf09d-4e2b-9be4-7b09c47c9f6c is the value of the request ID.
You can use a sequence of REST API workitem service commands to approve a machine request.
Prerequisites
n
Log in to vRealize Automation as an approver with at least one of the following qualifications:
n
You are designated as an approver in an approval policy.
n
You belong to a group which has been designated as an approval group in an approval policy.
n
You are designated as a delegate for someone who is an approver.
n
Verify that the host name and fully qualified domain name of the vRealize Automation instance are
available.
n
If you are not using the API Explorer, verify that you have a valid HTTP bearer token that matches
your login credentials. See Chapter 2 REST API Authentication.
You can use the vRealize Automation REST API workitem service to display the details of a pending work
item. You need these details to submit a completion request.
Input
Use the supported input parameters to control the command output.