Programming Guide vRealize Automation 6.
Programming Guide You can find the most up-to-date technical documentation on the VMware website at: https://docs.vmware.com/ If you have comments about this documentation, submit your feedback to docfeedback@vmware.com VMware, Inc. 3401 Hillview Ave. Palo Alto, CA 94304 www.vmware.com Copyright © 2008–2016 VMware, Inc. All rights reserved. Copyright and trademark information. VMware, Inc.
Contents vRealize Automation Programming Guide Updated Information 5 6 1 Overview of the vRealize Automation REST API 7 2 REST API Authentication 9 Using HTTP Bearer Tokens 9 Configure the Duration of an HTTP Bearer Token Request an HTTP Bearer Token 10 Validate an HTTP Bearer Token 13 Delete an HTTP Bearer Token 9 13 3 REST API Use Cases 15 Create a Tenant 15 Syntax for Displaying Your Current Tenants Syntax for Requesting a New Tenant 18 20 Syntax for Listing All Tenant Identity Stores 2
Programming Guide Reprovision a Machine Resource 127 Syntax for Viewing Available Actions for a Provisioned Machine Syntax for Reprovisioning a Provisioned Machine Working with Reservations Create a Reservation 131 Update a Reservation 281 292 Delete a Reservation 302 Working with Reservation Policies List Reservation Policies 303 303 Create a Reservation Policy 306 Display a Reservation Policy by ID Update a Reservation Policy 308 310 Delete a Reservation Policy Get a Key Pair List 129
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.
Updated Information This Programming Guide is updated with each release of the product or when necessary. This table provides the update history of the Programming Guide. Revision Description EN-001636-04 Updated the input URL in Syntax for Displaying All Available Resource Types. EN-001636-03 EN-001636-02 EN-001636-01 EN-001636-00 VMware, Inc. n Removed the section titled Logging in Programmatically. n Minor reorganization of Using the API Explorer.
Overview of the vRealize Automation REST API 1 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.
Programming Guide Table 1‑1. vRealize Automation REST API Services (Continued) Service Description Portal Service Retrieve, create, update, and delete a portal resource. Reservation Service Retrieve, create, update, and delete a reservation or reservation policy. vCO Service Manage vRealize Orchestrator actions, tasks, packages, and workflows. Browse system and plug-in inventories. WorkItem Service Retrieve, create, update, complete, cancel, and delete a work item.
REST API Authentication 2 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.
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.
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.
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. Input Description host host name.domain name of the vRealize Automation server, for example, mycompany.mktg.mydomain.com. usrname Specifies the tenant administrator user name. passwd Specifies the tenant administrator password.
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.
Programming Guide Status Code Description 204 NO CONTENT The request succeeded. The resource has been deleted. 401 UNAUTHORIZED You must have authentication credentials to access the resource. All requests must be authenticated. 403 FORBIDDEN Your authentication credentials do not provide sufficient access to the resource. 404 NOT FOUND Could not locate the resource based on the specified URI. 405 METHOD NOT ALLOWED The DELETE method is not supported for the resource.
REST API Use Cases 3 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 API Reference zip file located in the vRealize Automation Documentation Center.
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 1 Use the identity service to display all the available tenants.
Programming Guide 3 List 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. curl --insecure -H "Accept: application/json" -H 'Content-Type: application/json' -H "Authorization: Bearer $token” https://$host/identity/api/tenants/MYCOMPANY/directories 4 Link an LDAP, Active Directory, or Native Active Directory identity store to the tenant by using the identity service.
Programming Guide 7 Display all of the roles assigned to a user with the identity service. Use the following command to list all the roles that are assigned to tony@example.mycompany.com. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$host/identity/api/authorization/tenants/development/principals/ tony@example.mycompany.
Programming Guide Parameter Description Links Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link. n n Self refers to the object that was returned or requested. First, Previous, Next, and Last refer to corresponding pages of pageable lists. n n Specifies the application or service that determines the other names. href Specifies the URL that produces the result.
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.
Programming Guide Input Use the supported input parameters to control the command output. Parameter Description URL https://$host/identity/api/tenants/$tenantId --data @ $inputFileName.json $token Specifies a valid HTTP bearer token with necessary credentials. $host Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server. $tenantId Specifies the ID of the tenant. $tenantURL Specifies the URL of the tenant.
Programming Guide Parameter Description Links Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link. n n Self refers to the object that was returned or requested. First, Previous, Next, and Last refer to corresponding pages of pageable lists. n n Specifies the application or service that determines the other names. href Specifies the URL that produces the result.
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.
Programming Guide Parameter Description Links Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link. n n Self refers to the object that was returned or requested. First, Previous, Next, and Last refer to corresponding pages of pageable lists. n n Specifies the application or service that determines the other names. href Specifies the URL that produces the result.
Programming Guide Example: curl Command The following example command lists the identity stores by using variables, instead of the full token and host name.domain name. curl --insecure -H "Accept: application/json" -H 'Content-Type: application/json' -H "Authorization: Bearer $token” https://$host/identity/api/tenants/MYCOMPANY/directories Example: JSON Output The following JSON output is returned based on the command input. HTTP/1.1 200 OK Server: Apache-Beach/1.
Programming Guide "number":1, "offset":0 } } 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. Parameter Description URL https://$host/identity/api/tenants/$tenantId/directories/$domainName --data @ $inputFileName.
Programming Guide "name": "$identityStoreName", "password": "$password", "type": "$identityStoreType", "url": "$identityServerUrl", "userBaseSearchDn": "$usrBaseSearchDn", "userNameDn": "$usrNameDn" } Output The command output contains property names and values based on the command input parameters. VMware, Inc.
Programming Guide Parameter Description Links Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link. n n Self refers to the object that was returned or requested. First, Previous, Next, and Last refer to corresponding pages of pageable lists. n n Specifies the application or service that determines the other names. href Specifies the URL that produces the result.
Programming Guide Example JSON Input File Call the following sample ldap.json.txt input file from the command line to specify necessary parameters. { "alias": "example.com", "domain": "example.mycompany.com", "groupBaseSearchDn": "ou=demo,dc=example,dc=mycompany,dc=com", "name": "openLDAPDemo", "password": "password", "type": "LDAP", "url": "ldap://10.000.00.
Programming Guide x-ibm1383, x-ibm300, x-ibm33722, x-ibm737, x-ibm833, x-ibm834, x-ibm856, x-ibm874, x-ibm875, x-ibm921, x-ibm922, x-ibm930, x-ibm933, x-ibm935, x-ibm937, x-ibm939, x-ibm942, x-ibm942c, x-ibm943, x-ibm943c, x-ibm948, x-ibm949, x-ibm949c, x-ibm950, x-ibm964, x-ibm970, x-iscii91, x-iso-2022-cn-cns, x-iso-2022-cn-gb, x-iso-8859-11, x-jis0208, x-jisautodetect, x-johab, x-macarabic, x-maccentraleurope, x-maccroatian, x-maccyrillic, x-macdingbat, x-macgreek, x-machebrew, x-maciceland, x-macroman,
Programming Guide Output The command output contains property names and values based on the command input parameters. Property Links Description Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link. n 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.
Programming Guide "disabled" : false, "principalId" : { "domain" : "example.mycompany.com", "name" : "susan" }, "tenantName" : "MYCOMPANY1", "name" : "Tony Anteater" } ] } Syntax for Assigning a User to a Role You can use the REST API identity service to assign a user to a role. Input Use the supported input parameters to control the command output.
Programming Guide Input Use the supported input parameters to control the command output. Parameter Description URL https://$host/identity/api/authorization/tenants/$tenantId/principals/$principalId/ro les $token Specifies a valid HTTP bearer token with necessary credentials. $host Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server. $tenantId Specifies the ID of the tenant.
Programming Guide "name" : "Catalog Consume Tenant Management", "description" : "Consume services, resources and manage requests on behalf of any user within a Tenant", "prereqAdminPermissions" : null }, { "id" : "MY_TENANT_MANAGEMENT", "name" : "My Tenant Management", "description" : "Manage my tenant.
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.
Programming Guide c 5 Include the file in the command line when you submit the work item approval. Submit the machine request with the catalog service. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token” https://$host/catalog-service/api/consumer/requests --verbose --data @C:/Temp/requestMachine.json 6 View the requests with the catalog service.
Programming Guide Property Description outputResourceTypeRef Specifies the type of the resource that results from requesting the catalog item. name Specifies the user friendly name of the catalog item. Specifies the property type is string. description Specifies a short description of the catalog item. Specifies the property type is string. status Specifies the life cycle stage of the catalog item. statusName Specifies the life cycle status name, such as Active.
Programming Guide "subtenantLabel" : "MyTestAgentBusinessGroup" }, "providerBinding" : { "bindingId" : "e16edcf9-6a10-4bc7-98e2-a33361aeb857", "providerRef" : { "id" : "c6fb1980-75b4-4adc-ac71-020d75f61978", "label" : "iaas-service" } }, "forms" : null, "callbacks" : null, "isNoteworthy" : true, "dateCreated" : "2014-02-14T21:53:39.072Z", "lastUpdatedDate" : "2014-02-14T21:54:07.756Z", "iconId" : "cafe_default_icon_genericCatalogItem", "catalogItemTypeRef" : { "id" : "Infrastructure.
Programming Guide Output The command output contains property names and values based on the command input parameters. VMware, Inc.
Programming Guide Property Links Description Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link. n 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. href Specifies the URL that produces the result.
Programming Guide Property Description n providerRef: Provider. n forms: A specification for the various forms associated with catalog items of this type. n callbacks: A specification for the various call-backs to the provider supported by this catalog item. n isNoteworthy: Flag indicating that this catalog item should be highlighted to users for a period of time. n dateCreated: Date this item was created in catalog. n lastUpdatedDate: Date this item was last updated in catalog.
Programming Guide Example: JSON Output The following JSON output is returned based on the command input.
Programming Guide 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.
Programming Guide Syntax for Constructing a JSON File For a Machine Request You can use the REST API catalog service to construct a JSON file for use in a command line machine request. Prerequisites n Obtain the information that you need to add to your JSON file. See Syntax for Locating the Blueprint Values Required to Construct 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.
Programming Guide "value": 1 } }, { "key": "provider-VirtualMachine.Memory.Size", "value": { "type": "integer", "value": 1024 } }, { "key": "provider-VirtualMachine.LeaseDays", "value": { "type": "integer", "value": 30 } }, { "key": "provider-__Notes", "value": { "type": "string", "value": "MYCOMPANY machine" } }, { "key": "provider-VirtualMachine.Disk0.Size", "value": { "type": "string", "value": "1" } }, { "key": "provider-VirtualMachine.Disk0.
Programming Guide Input Use the supported input parameters to control the command output. Parameter Description URL https://$host/catalog-service/api/consumer/requests/requestId $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. JSON file or string input Add required JSON input to the command line. See Syntax for Constructing a JSON File For a Machine Request.
Programming Guide Property Description dateApproved Specifies the date when this request was approved. dateCompleted Specifies the date when this request was completed. 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 of the request. requestCompletion Contains additional request completion information. requestData Contains a map of the provider-specific field-value pairs collected for this request.
Programming Guide Keep-Alive = timeout=15, max=100 Connection = Keep-Alive } null Syntax for Viewing All of Your Requests You can use the vRealize Automation REST API catalog service to view all of your requests. Input Use the supported input parameters to control the command output. Parameter Description URL https://$host/catalog-service/api/consumer/requests $host Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server.
Programming Guide Property Links Description Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link. n 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. href Specifies the URL that produces the result.
Programming Guide Property Description 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.
Programming Guide Property Description 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. Metadata n requestedItemName n requestedItemDescription Specifies the paging-related data: n Size: Specifies the maximum number of rows per page.
Programming Guide "preApprovalId" : null, "postApprovalId" : null, "dateCreated" : "2014-02-14T19:45:28.361Z", "lastUpdated" : "2014-02-14T19:48:27.690Z", "dateSubmitted" : "2014-02-14T19:45:28.361Z", "dateApproved" : null, "dateCompleted" : "2014-02-14T19:48:27.683Z", "quote" : { "leasePeriod" : { "type" : "timeSpan", "unit" : "DAYS", "amount" : 5 }, "leaseRate" : { "type" : "moneyTimeRate", "cost" : { "type" : "money", "currencyCode" : null, "amount" : 213.
Programming Guide }, { "key" : "provider-arrivalDate", "value" : { "type" : "dateTime", "value" : "2014-02-21T19:44:00.000Z" } }, { "key" : "provider-address", "value" : { "type" : "string", "value" : "25 McLaren Street\nNorth Sydney, NSW 2060\nAUS" } }, { "key" : "provider-hotel", "value" : { "type" : "entityRef", "componentId" : null, "classId" : "hotel", "id" : "8", "label" : "Racecar Hotel" } }, { "key" : "provider-location", "value" : { "type" : "entityRef", "componentId" : null, "classId" : "location
Programming Guide Parameter Description $token Specifies a valid HTTP bearer token with necessary credentials. requestId Specifies the ID of the request used for the resource, for example, 9e3e2e33-2361-4c0a-8dcf-ff0a347bb08e. Add one of the following strings to the URL in the command line. Replace requestId with the actual request ID.
Programming Guide Property Description status Specifies the status of the work item. completedBy Specifies the principal ID of user who completed the work item. availableActions Contains a list of relevant work item actions. Metadata Specifies the 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.
Programming Guide Property Description approvalStatus Specifies a status indicating whether this request has been approved, rejected, or is still pending some form of approval. waitingStatus Specifies a status indicating whether this request is waiting on any external users or services before it is able to progress. requestNumber Specifies a more user-friendly identifier for this request. executionStatus Specifies the current execution status of the request.
Programming Guide Example: curl Command The following example command displays details of a request. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token” https://$host/catalog-service/api/consumer/requests/3a5d9697-e3c8-476f-9754-29e773af Example: JSON Output The following sample output contains information about the catalog item request 3a5d9697e3c8-476f-9754-29e773af4aa8.
Programming Guide } }, { "key" : "provider-Cafe.Shim.VirtualMachine.TotalStorageSize", "value" : { "type" : "decimal", "value" : 1.0 } }, { "key" : "provider-provisioningGroupId", "value" : { "type" : "string", "value" : "cccd7a7e-5283-416b-beb0-45eb4e924dcb" } }, { "key" : "provider-Cafe.Shim.VirtualMachine.AssignToUser", "value" : { "type" : "string", "value" : "fritz@example.mycompany.com" } }, { "key" : "provider-VirtualMachine.
Programming Guide }, { "key" : "provider-__Notes", "value" : { "type" : "string", "value" : "MYCOMPANY machine" } }, { "key" : "provider-Cafe.Shim.VirtualMachine.MinCost", "value" : { "type" : "string", "value" : "0.0000000000" } }, { "key" : "provider-VirtualMachine.Disk0.Label", "value" : { "type" : "string", "value" : "main" } }, { "key" : "provider-VirtualMachine.Disk0.Size", "value" : { "type" : "string", "value" : "1" } }, { "key" : "provider-VirtualMachine.Memory.
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.
Programming Guide Process Overview Use the following sequence to find a vCloud Air blueprint for use in creating a vCloud Air machine request. 1 From 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. 2 In the catalog item output that contains a catalog item ID Infrastructure.
Programming Guide Property Description statusName Specifies the life cycle status name, such as Active. catalogItemTypeRef Specifies the type of the catalog item. serviceRef Specifies the catalog service that contains the catalog item. iconId Specifies the associated icon representing this item. organization Specifies the subtenant and/or tenant to which this item belongs providerBinding Specifies the provider side identifier of this item.
Programming Guide "label" : "iaas-service" } }, "forms" : null, "callbacks" : null, "isNoteworthy" : false, "dateCreated" : "2014-09-18T23:50:52.858Z", "lastUpdatedDate" : "2014-11-11T23:52:14.407Z", "iconId" : "cafe_default_icon_genericCatalogItem", "catalogItemTypeRef" : { "id" : "Infrastructure.vCloudAir", "label" : "vCD vApp" }, "serviceRef" : { "id" : "ca6b9988-fe07-4b25-b465-3e0c905b7aad", "label" : "vCloud Air machine" }, "outputResourceTypeRef" : { "id" : "Infrastructure.
Programming Guide "requestedFor": "Auto.admin@abx.local", "state": "SUBMITTED", "requestNumber": 0, "requestData": { "entries": [ { "key": "provider-blueprintId", "value": { "type": "string", "value": "46548940-eb20-4368-9e73-c1685cda8c64" } }, { "key": "provider-provisioningGroupId", "value": { "type": "string", "value": "43a2f89a-c04e-4941-abc5-b4dc68a2810d" } }, { "key": "requestedFor", "value": { "type": "string", "value": "Auto.admin@abx.local" } }, { "key": "provider-VirtualMachine.
Programming Guide "key": "provider-ASCT-1.__Notes", "value": { "type": "string", "value": "" } }, { "key": "provider-ASCT-1.VirtualMachine.Disk0.Size", "value": { "type": "string", "value": "1" } }, { "key": "provider-ASCT-1.VirtualMachine.Disk0.Letter", "value": { "type": "string", "value": "c" } }, { "key": "provider-__MultiMachine.Provision.NumberOfInstances", "value": { "type": "string", "value": "
Programming Guide "value": 1 } }, { "key": "provider-Cafe.Shim.VirtualMachine.Reason", "value": { "type": "string", "value": "Requesting a vApp." } }, { "key": "provider-Cafe.Shim.VirtualMachine.AssignToUser", "value": { "type": "string", "value": "Auto.admin@abx.local" } }, { "key": "provider-Cafe.Shim.VirtualMachine.MinCost", "value": { "type": "string", "value": "4.0000000000" } }, { "key": "provider-Cafe.Shim.VirtualMachine.MaxCost", "value": { "type": "string", "value": "4.
Programming Guide } ] } } Syntax for Requesting a vCloud Air Machine 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.
Programming Guide Property Description requestedBy Specifies the ID of the user who actually submitted the request organization Subtenant and/or tenant owner of this request. requestorEntitlementId Specified the value of the requestorEntitlement setting. preApprovalId Specifies the ID of the preApproval setting. postApprovalId Specifies the ID of the approval generated for the post-provisioning workflow step. dateCreated Specifies the date when this request was sent to the catalog.
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.
Programming Guide Input Description $token Specifies a valid HTTP bearer token with necessary credentials. $requestId Specifies a request ID. Specifies the UUID of the request. See Syntax for Viewing All of Your Requests to view all of your requests and search for the request ID. The required request ID is located at the end of the Location URL in the response header. The request ID is located in the Location field of the response header if you submitted the request with the –headers flag.
Programming Guide Property Description 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 of the request. requestCompletion Contains additional request completion information. requestData Contains a map of the provider-specific field-value pairs collected for this request.
Programming Guide "preApprovalId" : null, "postApprovalId" : null, "dateCreated" : "2015-08-11T23:58:06.445Z", "lastUpdated" : "2015-08-11T23:59:30.151Z", "dateSubmitted" : "2015-08-11T23:58:06.445Z", "dateApproved" : null, "dateCompleted" : null, "quote" : { "leasePeriod" : { "type" : "timeSpan", "unit" : "DAYS", "amount" : 2 }, "leaseRate" : { "type" : "moneyTimeRate", "cost" : { "type" : "money", "currencyCode" : null, "amount" : 4.
Programming Guide } }, { "key" : "provider-__requested_allocation_type", "value" : { "type" : "string", "value" : "2" } }, { "key" : "provider-ASCT-1.__Notes", "value" : { "type" : "string", "value" : "" } }, { "key" : "provider-Cafe.Shim.VirtualMachine.MaxCost", "value" : { "type" : "string", "value" : "4.0000000000" } }, { "key" : "provider-Cafe.Shim.VirtualMachine.TotalStorageSize", "value" : { "type" : "decimal", "value" : 0.
Programming Guide "value" : { "type" : "string", "value" : "1" } }, { "key" : "provider-Cafe.Shim.VirtualMachine.ProvisionInto", "value" : { "type" : "string", "value" : "2" } }, { "key" : "provider-Cafe.Shim.VirtualMachine.Description", "value" : { "type" : "string", "value" : "A simple vCloud Air provisioning scenario." } }, { "key" : "provider-ASCT-1.VirtualMachine.CPU.Count", "value" : { "type" : "string", "value" : "1" } }, { "key" : "provider-Cafe.Shim.VirtualMachine.
Programming Guide "label" : "vCloud Air machine" } } Request an Amazon Machine 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.
Programming Guide 3 Request an Amazon machine as defined in the chosen blueprint or override the default values of the blueprint by adding properties to the JSON input file to override default values. For example, add ESB storage or choose a specific location. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$host/catalog-service/api/consumer/requests --data @ec2machine_specific.
Programming Guide Property Links Description Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link. n 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. href Specifies the URL that produces the result.
Programming Guide Property Description n tenantLabel: Name of the tenant. n subtenantRef: ID of the business group. n subtenantLabel: Name of the business group. n providerBinding: Contains the provider-side identifier of this item. n bindingId: binding ID. n providerRef: Provider. n forms: Specifies the form associated with catalog items of this type. n callbacks: Specifies the call-backs to the provider supported by this catalog item.
Programming Guide Property Description n Offset: Specifies the number of rows skipped. Example: curl Command The following example command displays all the catalog items that you have permission to view. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token” https://$host/catalog-service/api/consumer/catalogItems?limit=10&page Example: JSON Output The following JSON output is returned based on the command input.
Programming Guide "outputResourceTypeRef" : { "id" : "Infrastructure.
Programming Guide "key": "provider-provisioningGroupId", "value": { "type": "string", "value": " b475039a-94dd-4bf3-97f6-8596f8cf8818" } }, { "key": "requestedFor", "value": { "type": "string", "value": "Auto.admin@abx.
Programming Guide Syntax for Requesting an Amazon Machine 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.
Programming Guide { "key": "requestedFor", "value": { "type": "string", "value": "username@fqdn" } }, { "key": "provider-__Notes", "value": { "type": "string", "value": "notes" } }, { "key": "description", "value": { "type": "string", "value": "description" } }, { "key": "reasons", "value": { "type": "string", "value": "reasons" } }, { "key": "provider-Cafe.Shim.VirtualMachine.Reason", "value": { "type": "string", "value": "provider_reason" } }, { "key": "provider-__amazon.
Programming Guide Value Description catalog_item_ID Specifies the value of CatalogItem ID in the machine blueprint catalog item. tenant_name Specifies the value of tenantRef in the machine blueprint catalog item. business_group_ID Specifies the value of subtenantRef in the machine blueprint catalog item. username@fqdn Specifies the user name of the consumer and business group manager account and fully qualified domain name.
Programming Guide "type": "string", "value": "business_group_ID" } }, { "key": "requestedFor", "value": { "type": "string", "value": "username@fqdn" } }, { "key": "provider-__Notes", "value": { "type": "string", "value": "notes" } }, { "key": "description", "value": { "type": "string", "value": "description" } }, { "key": "reasons", "value": { "type": "string", "value": "reasons" } }, { "key": "provider-Cafe.Shim.VirtualMachine.
Programming Guide Property Description version Displays the object version number. state Specifies the item state, such as submitted. approvalStatus Specifies a status indicating whether this request has been approved, rejected, or is still pending some form of approval. waitingStatus Specifies a status indicating whether this request is waiting on any external users or services before it is able to progress. requestNumber Specifies a more user-friendly identifier for this request.
Programming Guide Property Description requestedItemName Specifies the item name. requestedItemDescription Specifies the item description. Example: curl Command The following example command submits a request that includes the specifications in an ec2machine_specific.json input file. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$host/catalog-service/api/consumer/requests --data @ec2machine_specific.
Programming Guide Parameter Description URL https://$host/catalog-service/api/consumer/requests/requestId $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. requestId Specifies the ID of the request to check. Output The command output contains property names and values based on the command input parameters.
Programming Guide Property Description 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 of the request. requestCompletion Contains additional request completion information. requestData Contains a map of the provider-specific field-value pairs collected for this request.
Programming Guide "lastUpdated" : "2014-09-11T22:31:05.780Z", "dateSubmitted" : "2014-09-11T22:29:02.190Z", "dateApproved" : null, "dateCompleted" : "2014-09-11T22:31:05.779Z", "quote" : { "leaseRate" : { "type" : "moneyTimeRate", "cost" : { "type" : "money", "currencyCode" : null, "amount" : 3.0 }, "basis" : { "type" : "timeSpan", "unit" : "DAYS", "amount" : 1 } } }, "requestCompletion" : { "requestCompletionState" : "SUCCESSFUL", "completionDetails" : "Request succeeded. Created mp108.
Programming Guide }, "retriesRemaining" : 3, "phase" : "SUCCESSFUL", "executionStatus" : "STOPPED", "waitingStatus" : "NOT_WAITING", "approvalStatus" : "POST_APPROVED", "catalogItemRef" : { "id" : "6cca9fd9-83b7-4f5d-8884-fb8a005fc656", "label" : "EC2 Blueprint" } } Approve a Machine Request You can use a sequence of REST API workitem service commands to approve a machine request.
Programming Guide 4 b Substitute the input variables in the template with the values you obtained for your specific work item ID, for example 5e3e9519-78ea-4409-a52c-e4aa3bc56511. c Save the file with a new name, for example, approve.json. Approve the submitted machine request by specifying the work item ID and including the JSON file as part of the command line.
Programming Guide Property Description version Displays the object version number. assignees Displays the list of work item assignees. subTenantId Optionally associates the work item with a specific business group granting users with management responsibilities over that business group permission to see the approval. tenantId Specifies the tenant ID for the work item. callbackEntityId Specifies the callback entity ID for the work item.
Programming Guide "workItemNumber" : 1, "assignees" : [ { "principalId" : "tony@example.mycompany.com", "principalType" : "USER" } ], "tenantId" : "MYCOMPANY", "callbackEntityId" : "1", "workItemType" : { "id" : "com.mycompany.cafe.samples.travel.workItem", "name" : "Workspace Assignment", "pluralizedName" : "Workspace Assignments", "description" : "Location Specific Workspace Assignment", "serviceTypeId" : "com.mycompany.cafe.samples.travel.api", "actions" : [ { "id" : "com.mycompany.cafe.samples.travel.
Programming Guide "label" : "Destination", "description" : "The destination to which travel is being requested.
Programming Guide . . "completedDate" : null, "assignedDate" : "2014-02-20T23:55:31.600Z", "createdDate" : "2014-02-20T23:55:31.600Z", "assignedOrCompletedDate" : "2014-02-20T23:55:31.600Z", "serviceId" : "2af18227-6a00-49e9-a76b-96de3ee767d2", "workItemRequest" : { "itemId" : "531660fd-b540-4946-9917-38c023b61c02", "itemName" : "test travel 1", "itemDescription" : "test travel 1", "itemRequestor" : "tony@example.mycompany.com", "itemCost" : 0.
Programming Guide }, { "key" : "requestRef", "value" : { "type" : "string", "value" : "15" } }, { "key" : "requestedItemDescription", "value" : { "type" : "string", "value" : "test travel 1" } }, { "key" : "requestLeaseRate", "value" : { "type" : "moneyTimeRate", "cost" : { "type" : "money", "currencyCode" : null, "amount" : 213.
Programming Guide "unit" : "DAYS", "amount" : 5 } }, { "key" : "requestedBy", "value" : { "type" : "string", "value" : "tony@example.mycompany.com" } } ] } }, "status" : "Active", "availableActions" : [ ] } ], "metadata" : { "size" : 20, "totalElements" : 7, "totalPages" : 1, "number" : 1, "offset" : 0 } } Syntax for Getting Work Item Details 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.
Programming Guide Property Links Description Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link. n 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. href Specifies the URL that produces the result. work itemNumber Displays a reference number for the work item.
Programming Guide Example: curl Command The following example command retrieves the necessary details for the specified work item. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token” https://$host/workitem-service/api/workitems/5e3e9519-78ea-4409-a52c-e4aa3bc56511 Example: JSON Output The following JSON output is returned based on the command input. To view the contents of a JSON output file, for example workItemDetails.
Programming Guide "name" : "rejected.png", "contentType" : "image/png", "image" : null } } ], "completeByEmail" : true, "commentsField" : "businessJustification", "listView" : { "columns" : [ { "id" : "requestedItemName", "label" : "Requested Item", "description" : "", "dataType" : { "type" : "primitive", "typeId" : "STRING" }, "displayAdvice" : null, "state" : { "dependencies" : [ ], "facets" : [ ] }, "filterable" : false, "sortable" : false, "isMultiValued" : false }, . . .
Programming Guide }, "workItemSubmission" : { "type" : "external", "formId" : "approval.submission" }, "workItemNotification" : { "type" : "external", "formId" : "approval.notification" } } }, "completedDate" : null, "assignedDate" : "2014-02-25T01:26:07.153Z", "createdDate" : "2014-02-25T01:26:07.153Z", "assignedOrCompletedDate" : "2014-02-25T01:26:07.
Programming Guide . . . }, { "key" : "requestLease" }, { "key" : "requestedBy", "value" : { "type" : "string", "value" : "fritz@example.mycompany.com" } } ] } }, "status" : "Active", "availableActions" : [ ] } Syntax for Constructing a JSON File to Approve a Machine Request You can specify a JSON file in your vRealize Automation REST API command line input.
Programming Guide "key": "source-source-provider-VirtualMachine.CPU.Count", "value": { "type": "integer", "value": 1 } }, { "key": "source-businessJustification", "value": { "type": "string", "value": "solves abx request" } }, { "key": "source-source-provider-VirtualMachine.LeaseDays", "value": { "type": "integer", "value": 0 } } ] }, "workItemId": "5e3e9519-78ea-4409-a52c-e4aa3bc56511", "workItemActionId": "com.mycompany.csp.core.approval.action.
Programming Guide Example: JSON Input File Use the following JSON input file sample when constructing a file. { "@type": "CatalogItemRequest", "catalogItemRef": { "id": "65fbca06-a28e-46f3-bced-c6e5fb3a66f9" }, "organization": { "tenantRef": "MYCOMPANY", "subtenantRef": "cccd7a7e-5283-416b-beb0-45eb4e924dcb" }, "requestedFor": "fritz@example.mycompany.
Programming Guide "value": { "type": "integer", "value": 30 } }, { "key": "provider-__Notes", "value": { "type": "string", "value": "MYCOMPANY machine" } }, { "key": "provider-VirtualMachine.Disk0.Size", "value": { "type": "string", "value": "1" } }, { "key": "provider-VirtualMachine.Disk0.Letter", "value": { "type": "string", "value": "C" } }, { "key": "provider-VirtualMachine.Disk0.
Programming Guide Parameter Description $token Specifies a valid HTTP bearer token with necessary credentials. workitem_ID Specifies the unique identifier of a work item. See Syntax for Listing Work Items. Output The command output contains property names and values based on the command input parameters. Property Links Description Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link.
Programming Guide Property Description availableActions Contains a list of relevant work item actions. Metadata Specifies the 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.
Programming Guide 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 Obtain the business group subtenant ID values to specify on the command line. See Syntax for Displaying Your Provisioned Resources. Procedure 1 Display a list of all the provisioned resources.
Programming Guide Parameter Description URL https://$host/catalog-service/api/consumer/resources $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. 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.
Programming Guide Example: curl Command The following example command displays all applicable provisioned resources. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$host/catalog-service/api/consumer/resources/?page=n&limit=n Example: JSON Output The following JSON output is returned based on the command input. { "links" : [ { "@type" : "link", "rel" : "next", "href" : "https://vra152-009-067.mycompany.
Programming Guide Input Use the supported input parameters to control the command output. Parameter Description URL https://$host/catalog-service/api/consumer/resourceType $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. Filter by the following resource types: n Infrastructure.Machine n Infrastructure.AppServic n Infrastructure.Cloud n Infrastructure.
Programming Guide Property Description hasCosts Returns true if the resource is subject to per-time costs. costs Displays an optional rate of the cost charges for the resource. costToDate Displays an optional rate of the current cost charges for the resource. totalCost Displays an optional rate of the cost charges for the entire lease period. parentResourceRef Displays the parent of this resource. childResources Displays the children of this resource.
Programming Guide "requestId" : "b013d2fa-4ba4-416c-b46b-98bb8cc7b076", "providerBinding" : { "bindingId" : "8a4581a0-84f9-4e80-9af6-75d79633e382", "providerRef" : { "id" : "6918cd49-b737-467f-94bf-d14d52c78fba", "label" : "iaas-service" } }, "owners" : [ { "tenantName" : "MYCOMPANY", "ref" : "fritz@example.mycompany.
Programming Guide Property 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.
Programming Guide "primary" : true, "schema" : { "classId" : "Infrastructure.Machine.Schema", "typeFilter" : null }, "forms" : { "catalogResourceInfoHidden" : true, "details" : { "type" : "extension", "extensionId" : "csp.places.iaas.resource.details", "extensionPointId" : null } Syntax for Displaying Provisioned Resources by Business Groups You Manage You can use the REST API catalog service to display all of the provisioned resources that are owned by the business groups that you manage.
Programming Guide Property Description 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.
Programming Guide "id" : "3bfde906-81b9-44c3-8c2d-07d2c9768168", "iconId" : "cafe_default_icon_genericCatalogResource", "resourceTypeRef" : { "id" : "Infrastructure.
Programming Guide }, "costToDate" : { "type" : "money", "currencyCode" : "USD", "amount" : 0.0 }, "totalCost" : null, "childResources" : [ ], "operations" : [ { "name" : "Reprovision", "description" : "Reprovision a machine.", "iconId" : "machineReprovision.png", "type" : "ACTION", "id" : "a1caee9b-d67f-41e8-a7b3-131616a0f6ac", "extensionId" : null, "providerTypeId" : "com.mycompany.csp.iaas.blueprint.service", "bindingId" : "Infrastructure.Machine.Action.
Programming Guide "value" : { "type" : "string", "value" : "56:52:4d:e7:46:d4" } }, { "key" : "NETWORK_NAME", "value" : { "type" : "string", "value" : "Test Agent-network-1" } } ] } } ] } }, { "key" : "SNAPSHOT_LIST", "value" : { "type" : "multiple", "elementTypeId" : "COMPLEX", "resources" : [ ] } }, { "key" : "ConnectViaRdp", "value" : { "type" : "boolean", "value" : true } }, { "key" : "MachineStatus", "value" : { "type" : "string", "value" : "On" } }, { "key" : "PowerOff", "value" : { "type" : "boolean
Programming Guide "value" : 1 } }, { "key" : "DISK_DRIVE", "value" : { "type" : "string", "value" : "c" } }, { "key" : "DISK_INPUT_ID", "value" : { "type" : "string", "value" : "DISK_INPUT_ID1" } } ] } } ] } }, { "key" : "MachineBlueprintName", "value" : { "type" : "string", "value" : "test-blueprint" } }, { "key" : "Suspend", "value" : { "type" : "boolean", "value" : true } }, { "key" : "Reboot", "value" : { "type" : "boolean", "value" : true } }, { "key" : "Reprovision", "value" : { "type" : "boolean", "
Programming Guide "key" : "Destroy", "value" : { "type" : "boolean", "value" : true } }, { "key" : "MachineType", "value" : { "type" : "string", "value" : "Virtual" } }, { "key" : "InstallTools", "value" : { "type" : "boolean", "value" : true } }, { "key" : "Shutdown", "value" : { "type" : "boolean", "value" : true } }, { "key" : "ChangeLease", "value" : { "type" : "boolean", "value" : true } }, { "key" : "machineId", "value" : { "type" : "string", "value" : "8a4581a0-84f9-4e80-9af6-75d79633e382" } }, { "k
Programming Guide "value" : 1 } }, { "key" : "MachineInterfaceType", "value" : { "type" : "string", "value" : "Test" } }, { "key" : "MachineReservationName", "value" : { "type" : "string", "value" : "Test Agent-Res-1" } }, { "key" : "Reconfigure", "value" : { "type" : "boolean", "value" : true } }, { "key" : "EXTERNAL_REFERENCE_ID" }, { "key" : "MachineExpirationDate" }, { "key" : "Reset", "value" : { "type" : "boolean", "value" : true } } ] } } ], "metadata" : { "size" : 2, "totalElements" : 1, "totalPage
Programming Guide 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 Displaying Your Provisioned Resources to view all of your requests and search for a request ID.
Programming Guide Property Description costs Displays an optional rate of the cost charges for the resource. costToDate Displays an optional rate of the current cost charges for the resource. totalCost Displays an optional rate of the cost charges for the entire lease period. 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.
Programming Guide "ref" : "fritz@example.mycompany.com", "type" : "USER", "value" : "Fritz Arbeiter" } ], "organization" : { "tenantRef" : "MYCOMPANY", "tenantLabel" : "QETenant", "subtenantRef" : "eab762cb-6e75-4379-83ef-171a71c9f00e", "subtenantLabel" : "MyTestAgentBusinessGroup" }, "dateCreated" : "2014-02-19T21:19:37.541Z", "lastUpdated" : "2014-02-20T21:41:08.478Z", "hasLease" : true, "lease" : { "start" : "2014-02-19T21:18:57.
Programming Guide Reprovision a Machine Resource You can use the vRealize Automation REST API catalog service to list the available actions for a provisioned machine and then reprovision the 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.
Programming Guide Table 3‑3. Inputs for Viewing the Available Actions for a Provisioned Machine Parameter Description URL https://$host/catalog-service/api/consumer/requests/$requestId $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 the resource ID for the request.
Programming Guide Example: JSON Output The highlighted resource action ID corresponds to the reprovisioning actions that are available for the specified machine. { "links" : [ ], "content" : [ { "@type" : "ConsumerResourceOperation", "name" : "Reprovision", "description" : "Reprovision a machine.", "iconId" : "machineReprovision.png", "type" : "ACTION", "id" : "a1caee9b-d67f-41e8-a7b3-131616a0f6ac", "extensionId" : null, "providerTypeId" : "com.mycompany.csp.iaas.blueprint.
Programming Guide Table 3‑5. JSON Template Values (Continued) Property Description requestNumber Contains Get information that is generated by the system. requestData Specifies other custom request data. JSON Input File Template Use the following JSON template to create a JSON text file that contains the information required to reprovision a machine. This example reprov_action.
Programming Guide The vRealize Automation REST API reservation service supports the following reservation types: n vSphere (except for FlexClone in vSphere) n vCloud n Amazon n Hyper-V n KVM n Xen The reservation service is extensible, which allows you to add new reservation types. A reservation must belong to a business group, also referred to as a subtenant. A business group can have multiple reservations on the same resources or on different resources.
Programming Guide Procedure 1 Display a list of supported vRealize Automation reservation types by using the reservation service. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/reservations/types 2 Display a schema definition for a reservation. a Display a schema definition for a vSphere reservation.
Programming Guide 4 Obtain a compute resource for the vRealize Automation reservation by using the reservation service. Use the following command to get a compute resource for a vSphere reservation. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/dataservice/schema/Infrastructure.Reservation.Virtual.
Programming Guide 5 Use the vRealize Automation REST API reservation service to get a resources schema for any supported reservation type, including a vSphere, Amazon, or vCloud Air reservation. a Display information about available resources, such as storage and network information, for a vSphere reservation by using the reservation service. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/data-service/schema/ Infrastructure.
Programming Guide }] } } ” c Display information about available resources, such as storage and network information, for a vCloud Air reservation by using the reservation service. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/dataservice/schema/Infrastructure.Reservation.Cloud.vCloudAir/default/reservationStorages/values d “ VMware, Inc.
Programming Guide 6 Use the vRealize Automation REST API to create any supported reservation type, including a vSphere, Amazon, or vCloud Air reservation. a Create a vSphere reservation by using the vRealize Automation reservation service. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/reservations -d “ { "name": "TestCreateReservation", "reservationTypeId": "Infrastructure.Reservation.Virtual.
Programming Guide "typeFilter": null, "values": { "entries": [{ "key": "reservationNetworkPath", "value": { "type": "entityRef", "componentId": null, "classId": "Network", "id": "44cb65d5-b321-43dd-a2ab-8ecf387bff8f", "label": "VM Network SQA" } }] } }] } }, { "key": "custom-Properties-key0", "value": { "type": "string", "value": "custom-property-value0" } }, { "key": "custom-Properties-key2", "value": { "type": "string", "value": "custom-property-value2" } }, { "key": "reservationMemory", "value": { "type
Programming Guide }, { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "cc254a84-95b8-434a-874d-bdfef8e8ad2c", "label": "NSX61-RC-ComputeClusterA" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 2 } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "componentId": null, "classId": "StoragePath", "id": "f48a527b-30a6-4d54-8829-f549bc195b69", "label": "VNXe:qe-vnxe-nfs-1" } }, { "key": "storageFreeSizeGB", "value": { "type": "integer", "value": 120 } }, { "key": "reservationStorageReservationPriority", "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "value": { "type": "entityRef", "componentId": null, "classId": "ResourcePools", "id": "4e51fabc-19e8-4e79-b413-d52309b3bb62", "label": "CoreDev" } }] } } ”
Programming Guide "frequencyReminder": 0, "emailBgMgr": true, "recipients": [ ], "alerts": [ { "alertPercentLevel": 80, "referenceResourceId": "storage", "id": "storage" }, { "alertPercentLevel": 80, "referenceResourceId": "memory", "id": "memory" }, { "alertPercentLevel": 80, "referenceResourceId": "cpu", "id": "cpu" }, { "alertPercentLevel": 80, "referenceResourceId": "machine", "id": "machine" } ] }, "extensionData": { "entries": [ { "key": "computeResource", "value": { "type": "entityRef", "componentId
Programming Guide "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [ { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide "classId": "Storage", "id": "e655aa78-e5fb-4722-9e8a-0cd4139248cf", "label": "High Performance Storage" } }, { "key": "storageReservationPriority", "value": { "type": "integer", "value": 1 } }, { "key": "storageReservedSizeGB", "value": { "type": "integer", "value": 100 } }, { "key": "storageEnabled", "value": { "type": "boolean", "value": true } }, { "key": "computeResourceStorageFreeSizeGB", "value": { "type": "integer", "value": 691 } } ] } } ] } }, { "key": "reservationMemory", "value
Programming Guide }, { "key": "memoryReservedSizeMb", "value": { "type": "integer", "value": 4096 } } ] } } } ] } } “ c Create an Amazon reservation by using the vRealize Automation reservation service. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/reservations -d “ { "name": "TestEC2Reservation", "reservationTypeId": "Infrastructure.Reservation.Cloud.
Programming Guide "label": "EC2 841 Endpoint-us-east-1" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 0 } }, { "key": "securityGroups", "value": { "type": "multiple", "elementTypeId": "ENTITY_REFERENCE", "items": [ { "type": "entityRef", "componentId": null, "classId": "AmazonSecurityGroup", "id": "10", "label": "default" } ] } }, { "key": "loadBalancers", "value": { "type": "multiple", "elementTypeId": "ENTITY_REFERENCE", "items": [ { "type": "entityRef", "componentId": null, "class
Programming Guide ] } }, { "key": "keyPairs", "value": { "type": "string", "value": "Per Provisioning Group" } } ] } }” 7 Use the reservation ID to verify that the reservation exists. Also use the ID to get information about the reservation in preparation for updating or deleting it.
Programming Guide "id": "Infrastructure.Reservation.Virtual.vSphere", "name": "vSphere", "description": "vSphere Reservation", "category": "Virtual", "serviceTypeId": "com.mycompany.csp.iaas.blueprint.service", "tenantId": null, "formReference": { "type": "external", "formId": "Infrastructure.Reservation.Virtual.vSphere.form.new" }, "schemaClassId": "Infrastructure.Reservation.Virtual.vSphere", "alertTypes": [{ "createdDate": "2015-10-13T04:44:32.008Z", "lastUpdated": "2015-10-13T04:44:32.
Programming Guide "lastUpdated": "2015-11-06T10:21:06.010Z", "version": 0, "id": "cd707ad2-d504-43e2-8002-11ee670dcf41", "name": "storage", "description": null, "referenceResourceId": "storage" }, { "createdDate": "2015-11-06T10:21:06.010Z", "lastUpdated": "2015-11-06T10:21:06.010Z", "version": 0, "id": "ef96fec4-a607-4944-a0af-fbe7df862ee2", "name": "memory", "description": null, "referenceResourceId": "memory" }, { "createdDate": "2015-11-06T10:21:06.011Z", "lastUpdated": "2015-11-06T10:21:06.
Programming Guide "lastUpdated": "2015-10-13T04:44:32.075Z", "version": 1, "id": "Infrastructure.Cloud.Amazon", "name": "Amazon", "description": "Amazon Reservation", "category": "Cloud", "serviceTypeId": "com.mycompany.csp.iaas.blueprint.service", "tenantId": null, "formReference": { "type": "external", "formId": "Infrastructure.Cloud.Amazon.form.new" }, "schemaClassId": "Infrastructure.Cloud.Amazon", "alertTypes": [{ "createdDate": "2015-10-13T04:44:32.075Z", "lastUpdated": "2015-10-13T04:44:32.
Programming Guide Property Description Links Species an array of link objects, each of which contains the following parts: rel href Content 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. Specifies the URL that produces the result.
Programming Guide Property alertTypes Metadata Description Contains the alert type list defined in the reservation type: n createdDate -- Alert type created date n lastUpdated -- Alert type last updated date n version -- Alert type version n id -- Unique identifier of alert type n name -- Name of alert type n description -- Long description of alert type n referenceResourceId -- Unique identifier of reference resource Specifies the paging-related data: n Size: n totalElements: Specifies
Programming Guide Example: JSON Output for a vSphere Reservation In the following response, there are 8 reservation types. For the vSphere reservation, the reservation type ID is Infrastructure.Reservation.Virtual.vSphere, and its schema class ID is Infrastructure.Reservation.Virtual.vSphere. { "links": [], "content": [{ "@type": "ReservationType", "createdDate": "2015-10-13T04:44:32.008Z", "lastUpdated": "2015-10-13T04:44:32.009Z", "version": 1, "id": "Infrastructure.Reservation.Virtual.
Programming Guide "@type": "ReservationType", "createdDate": "2015-11-06T10:21:06.010Z", "lastUpdated": "2015-11-06T10:21:06.011Z", "version": 1, "id": "Infrastructure.Reservation.Cloud.vCloudAir", "name": "vCloud", "description": "vCloud Reservation", "category": "Cloud", "serviceTypeId": "com.mycompany.csp.iaas.blueprint.service", "tenantId": null, "formReference": { "type": "external", "formId": "Infrastructure.Reservation.Cloud.vCloudAir.form.new" }, "schemaClassId": "Infrastructure.Reservation.Cloud.
Programming Guide "metadata": { "size": 20, "totalElements": 8, "totalPages": 1, "number": 1, "offset": 0 } } Example: JSON Output for an Amazon Reservation In the following response, there are 8 reservation types. For the Amazon reservation, the reservation type ID is Infrastructure.Reservation.Cloud.Amazon and its schema class ID is Infrastructure.Reservation.Cloud.Amazon. { "links": [], "content": [{ { "@type": "ReservationType", "createdDate": "2015-10-13T04:44:32.
Programming Guide Displaying a Schema Definition for a Reservation You can use the vRealize Automation REST API to display a schema definition for any supported reservation type, including a vSphere, Amazon EC2, or vCloud reservation. Display a Schema Definition for a vSphere Reservation You can use the REST API reservation service to display a schema definition for a specific vRealize Automation reservation type, for example a vSphere reservation.
Programming Guide "dependencies": [], "facets": [{ "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } }] }, "isMultiValued": true }, { "id": "reservationVCNSTransportZone", "label": "Transport Zone", "description": "Transport zone of the vCNS settings", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide }, "state": { "dependencies": [], "facets": [] }, "isMultiValued": true }, { "id": "reservationMemory", "label": "Memory", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "dependencies": [] }, "state": { "dependencies": [], "facets": [{ "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } }] }, "isMultiValued": false }, { "id": "machineQuota", "label": "Machine Quota", "description": "The machine quota for the reservation", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [], "facets": [] }, "isMultiValued": false }, { "id": "reservationStorages"
Programming Guide "value": { "type": "boolean", "value": true } } }] }, "isMultiValued": true }, { "id": "resourcePool", "label": "Resource Pool", "description": "The resource pool for the reservation", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide }, "isMultiValued": true }] } Syntax for Displaying a Schema Definition for a vSphere Reservation You can use the REST API reservation service to display a schema definition for a specific vRealize Automation reservation type, for example a vSphere reservation. Overview Each reservation contains several fields. Some fields are common to all reservation types and some are type-specific. The list of type-specific fields is defined in a schema.
Programming Guide Table 3‑7.
Programming Guide Property Description Id Specifies the unique identifier of this resource. label Specifies the field label. dataType Specifies the dataType field value: n type: Specifies the field value type: n Self refers to the object that was returned or requested. n First, Previous, Next, and Last refer to corresponding pages of a pageable list. n Specifies the application or service that determines the other names.
Programming Guide Property Description state Provides a structure for defining the state of a content construct, for example {@link LayoutSection}. The element state identifies the field paths in the client data context upon which that element state depends. For example, the callback facet result indicates that facet evaluation must be delegated to the server of the object. This evaluation may be dependent on data collected in the client data context.
Programming Guide "state": { "dependencies": [], "facets": [{ "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } }] }, "isMultiValued": true }, { "id": "reservationVCNSTransportZone", "label": "Transport Zone", "description": "Transport zone of the vCNS settings", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "dependencies": ["computeResource"] }, "state": { "dependencies": [], "facets": [] }, "isMultiValued": true }, { "id": "reservationMemory", "label": "Memory", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "customAllowed": false, "dependencies": [] }, "state": { "dependencies": [], "facets": [{ "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } }] }, "isMultiValued": false }, { "id": "machineQuota", "label": "Machine Quota", "description": "The machine quota for the reservation", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [], "facets": [] }, "isMultiValued": false }, { "id
Programming Guide "type": "constantClause", "value": { "type": "boolean", "value": true } } }] }, "isMultiValued": true }, { "id": "resourcePool", "label": "Resource Pool", "description": "The resource pool for the reservation", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide }, "isMultiValued": true }] } Display a Schema Definition for an Amazon Reservation You can use the REST API reservation service to display a schema definition for a specific vRealize Automation reservation type, for example an Amazon reservation. Prerequisites n Log in to vRealize Automation as a fabric group administrator. n Verify that the host name and fully qualified domain name of the vRealize Automation instance are available.
Programming Guide }, "state": { "dependencies": [ ], "facets": [ { "type": "visible", "value": { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "VPC" } } } }, { "type": "mandatory", "value": { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "VPC" } } } } ] }, "isMultiValued": true }, { "id": "locations", "label": "Locations", "description": "Th
Programming Guide "permissibleValues": { "type": "dynamic", "customAllowed": false, "dependencies": [ "computeResource" ] }, "state": { "dependencies": [ ], "facets": [ { "type": "visible", "value": { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "VPC" } } } }, { "type": "mandatory", "value": { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "
Programming Guide "componentId": null, "classId": "ElasticLoadBalancer", "typeFilter": null, "label": "Elastic Load Balancer" }, "displayAdvice": null, "permissibleValues": { "type": "dynamic", "customAllowed": false, "dependencies": [ "locations", "computeResource" ] }, "state": { "dependencies": [ ], "facets": [ { "type": "visible", "value": { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "VPC" } } } } ] }, "isMultiValued
Programming Guide "dependencies": [ "computeResource", "keyPairs" ] }, "state": { "dependencies": [ ], "facets": [ { "type": "visible", "value": { "type": "and", "subClauses": [ { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "keyPairs" } }, { "type": "expression", "operator": { "type": "equals" }, "leftOperand": { "type": "constant", "value": { "type": "string", "value": "Specific Key Pair" } }, "rightOperand": { "type": "path", "path": "keyPairs" } }
Programming Guide "leftOperand": { "type": "path", "path": "keyPairs" } }, { "type": "expression", "operator": { "type": "equals" }, "leftOperand": { "type": "constant", "value": { "type": "string", "value": "Specific Key Pair" } }, "rightOperand": { "type": "path", "path": "keyPairs" } } ] } } ] }, "isMultiValued": false }, { "id": "computeResource", "label": "Compute Resource", "description": "The compute resource for the reservation", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.
Programming Guide "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "VPC", "label": "VPC", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.Cloud.Amazon.VPC", "typeFilter": null, "label": "VPC", "schema": { "fields": [ { "id": "VPCSubnets", "label": "Subnets", "description": "The subnets.
Programming Guide "type": "integer", "value": 1 } } }, { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": true }, { "id": "VPCSecurityGroups", "label": "Security groups", "description": "The security groups", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": true }, { "id": "VPCName", "label": "VPC Name", "description": "The virtual private cloud.", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "label": "Elastic Load Balancer" }, "displayAdvice": null, "permissibleValues": { "type": "dynamic", "customAllowed": false, "dependencies": [ "VPCSubnets" ] }, "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": true } ] } }, "displayAdvice": "DATA_TABLE", "permissibleValues": { "type": "dynamic", "customAllowed": false, "dependencies": [ "computeResource" ] }, "state": { "dependencies": [ ], "facets": [ { "type": "visible", "value": { "type": "or", "subClauses": [ { "type"
Programming Guide "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "securityGroups" } } } ] } }, { "type": "mandatory", "value": { "type": "or", "subClauses": [ { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "locations" } } }, { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "p
Programming Guide "label": "Machine Quota", "description": "The machine quota for the reservation", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false }, { "id": "keyPairs", "label": "Key pair", "description": "The key pair", "dataType": { "type": "primitive", "typeId": "STRING" }, "displayAdvice": null, "permissibleValues": { "type": "static", "customAllowed": false, "values": [ { "underlyingValue": { "ty
Programming Guide }, "label": null } ] }, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false } ] Syntax for Displaying a Schema Definition for an Amazon Reservation You can use the REST API reservation service to display a schema definition for a specific vRealize Automation reservation type, for example an Amazon reservation. Overview Each reservation contains several fields.
Programming Guide Table 3‑8. Fields Common To All Reservation Types (Continued) Parameter Description Parameter Type subTenantId Specifies the subtenant ID that contains the reservation. GUID enabled Specifies whether the reservation is enabled. Boolean priority Specifies the priority of the reservation during VM provisioning. Integer reservationPolicyId Specifies the reservation policy ID to bind to this reservation. GUID alertPolicy Specifies the alert policy of the reservation.
Programming Guide Parameter Description URL https://$host/reservation-service/api/data-service/schema/$schemaclassid/default Method Get $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. $schemaclassid Specifies the schema class of the reservation type. The schema class ID for an Amazon reservation is Infrastructure.Reservation.Cloud.Amazon.
Programming Guide Property Description permissibleValues Optional field. If this field is a permissible value list field, define the meta info for the permissible value by using the following options: n type: n customAllowed: n dependencies: Specifies if the permissible value list is dynamic or static. Specifies if a custom value is allowed during user input in this field. Specifies the list of fields that the current field depends on.
Programming Guide The schema definition in this example includes 8 extension fields that are supported for the Amazon EC2 type reservation. { "fields": [ { "id": "securityGroups", "label": "Security groups", "description": "The security groups", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide }, "leftOperand": { "type": "path", "path": "VPC" } } } } ] }, "isMultiValued": true }, { "id": "locations", "label": "Locations", "description": "The locations", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "value": { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "VPC" } } } } ] }, "isMultiValued": true }, { "id": "loadBalancers", "label": "Load balancers", "description": "The load balancers", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "path": "VPC" } } } } ] }, "isMultiValued": true }, { "id": "specificKeyPairs", "label": "Specific key pair", "description": "The specific key pair", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "leftOperand": { "type": "constant", "value": { "type": "string", "value": "Specific Key Pair" } }, "rightOperand": { "type": "path", "path": "keyPairs" } } ] } }, { "type": "mandatory", "value": { "type": "and", "subClauses": [ { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "keyPairs" } }, { "type": "expression", "operator": { "type": "equals" }, "leftOperand": { "type": "constant", "value": { "type": "string", "value": "Specific Key
Programming Guide "id": "computeResource", "label": "Compute Resource", "description": "The compute resource for the reservation", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide }, "displayAdvice": null, "permissibleValues": { "type": "dynamic", "customAllowed": false, "dependencies": [ ] }, "state": { "dependencies": [ ], "facets": [ { "type": "minCardinality", "value": { "type": "constant", "value": { "type": "integer", "value": 1 } } }, { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": true }, { "id": "VPCName", "label": "VPC Name", "description": "The virtual private cloud.
Programming Guide "facets": [ { "type": "readOnly", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "VPCLoadBalancers", "label": "Load balancers", "description": "The load balancers.", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide }, "state": { "dependencies": [ ], "facets": [ { "type": "visible", "value": { "type": "or", "subClauses": [ { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "locations" } } }, { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "securityGroups" } } } ] } }, { "type": "mandatory", "value": { "type": "or", "subClauses": [ { "type
Programming Guide } } }, { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "securityGroups" } } } ] } } ] }, "isMultiValued": true }, { "id": "machineQuota", "label": "Machine Quota", "description": "The machine quota for the reservation", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false }, { "id": "keyPairs", "label": "Key
Programming Guide { "underlyingValue": { "type": "string", "value": "Not Specified" }, "label": null }, { "underlyingValue": { "type": "string", "value": "Per Provisioning Group" }, "label": null }, { "underlyingValue": { "type": "string", "value": "Per Machine" }, "label": null }, { "underlyingValue": { "type": "string", "value": "Specific Key Pair" }, "label": null } ] }, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean",
Programming Guide Prerequisites n Log in to vRealize Automation as a fabric group administrator. 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 Obtain the schema class ID of the reservation type to create. See Display a List of Supported Reservation Types.
Programming Guide ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "networkProfile", "label": "Network Profile", "description": "The Network Profile", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "computeResource" ] }, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": true }, { "id": "allocationModel", "label": "Allocation Model", "description": "The allocation model for the reservation", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "readOnly", "value": { "type": "cons
Programming Guide "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide } }, "displayAdvice": "DATA_TABLE", "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false }, { "id": "computeResource", "label": "Compute Resource", "description": "The compute resource for the reservation", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "description": "The machine quota for the reservation", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false }, { "id": "reservationStorages", "label": "Storage", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide } ] }, "isMultiValued": false }, { "id": "storageReservationPriority", "label": "Priority", "description": "The reservation priority for the storage", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "computeResourceStorageTotalSizeGB", "label": "Total (GB)", "descrip
Programming Guide } } ] }, "isMultiValued": false }, { "id": "storageReservedSizeGB", "label": "This reservation reserved (GB)", "description": "The reserved capacity size (GB) for the storage", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false }, { "id": "storageEnabled", "label": "Enabled", "description": "Whether the storage is enabled to reserve", "dataType": { "type": "primitive", "typeId": "BOOLEAN"
Programming Guide "label": "Free (GB)", "description": "The free capacity (GB) for the storage", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "readOnly", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false } ] } }, "displayAdvice": "DATA_TABLE", "permissibleValues": { "type": "dynamic", "customAllowed": false, "dependencies": [ "computeResource" ] }, "stat
Programming Guide "isMultiValued": true } ] } Syntax for Displaying a Schema Definition for a vCloud Reservation You can use the REST API reservation service to display a schema definition for a specific vRealize Automation reservation type, for example a vCloud reservation. Overview Some vRealize Automation reservation fields are common to all reservation types and some are typespecific. The list of type-specific fields is defined in a schema.
Programming Guide Table 3‑11. Extension Fields Supported in vCloud Reservations Permissible Value Depends on Field Infrastructure.Reservation.N etwork Yes computeResource Integer NA No NA reservationMemory Complex Type Infrastructure.Reservation.M emory No NA computeResource Entity Reference ComputeResource Yes NA machineQuota Integer NA No NA reservationStorages Complex Type Infrastructure.Reservation.
Programming Guide Property Description dataType Specifies the dataType field value: n type: Specifies the field value type: n Self refers to the object that was returned or requested. n First, Previous, Next, and Last refer to corresponding pages of a pageable list. n Specifies the application or service that determines the other names. n componentTypeid: n component: Specifies the type ID of the component. Specifies the unique identifier of the component.
Programming Guide Example: curl Command curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/dataservice/schema/Infrastructure.Reservation.Cloud.vCloud/default Example: JSON Output The schema definition in this example includes 6 extension fields that are supported for the vCloud type reservation. { "fields": [ { "id": "reservationNetworks", "label": "Network", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.
Programming Guide ] }, "isMultiValued": false }, { "id": "networkProfile", "label": "Network Profile", "description": "The Network Profile", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "type": "boolean", "value": true } } } ] }, "isMultiValued": true }, { "id": "allocationModel", "label": "Allocation Model", "description": "The allocation model for the reservation", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "readOnly", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "reservationMemory", "label": "Memor
Programming Guide "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "readOnly", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "memoryReservedSizeMb", "label": "Memory Reservation (MB)", "description": "The reserved capacity (MB) for the memory", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ ] }, "isMu
Programming Guide { "id": "computeResource", "label": "Compute Resource", "description": "The compute resource for the reservation", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide }, "isMultiValued": false }, { "id": "reservationStorages", "label": "Storage", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.Storage", "typeFilter": null, "label": "Storage", "schema": { "fields": [ { "id": "storagePath", "label": "Storage Path", "description": "The storage path of the storage", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "computeResourceStorageTotalSizeGB", "label": "Total (GB)", "description": "The total physical capacity (GB) for the storage", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "readOnly", "va
Programming Guide }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false }, { "id": "storageEnabled", "label": "Enabled", "description": "Whether the storage is enabled to reserve", "dataType": { "type": "primitive", "typeId": "BOOLEAN" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "computeReso
Programming Guide "type": "readOnly", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false } ] } }, "displayAdvice": "DATA_TABLE", "permissibleValues": { "type": "dynamic", "customAllowed": false, "dependencies": [ "computeResource" ] }, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": true } ] } Get the Business Group
Programming Guide Prerequisites n Log in to vRealize Automation as a fabric group administrator. 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 u Get business group ID for a vRealize Automation reservation with the reservation service.
Programming Guide }, { "@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": " user1@mycompany.
Programming Guide Parameter Description $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. $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.
Programming Guide Example: curl Command The following example command retrieves all available business group, or subtenant, IDs. insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/identity/api/tenants/qe/subtenants Example: 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.
Programming Guide "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": " user1@mycompany.
Programming Guide For example, for a vSphere, Amazon EC2, or vCloud reservation type schema definition, the following permissibleValues field in the compute resource output indicates if the compute resource is available and if it has any dependencies. “permissibleValues": {"type": "dynamic","customAllowed": false, "dependencies": []} Procedure u Use the following command to get a compute resource. Command to get a compute resource for vSphere reservation.
Programming Guide "id": "a4349488-9a56-4906-83a5-7d8b33c9d435", "label": "NSX61-RC-ManagementCluster" }, "label": "NSX61-RC-ManagementCluster" }, { "underlyingValue": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "40b151ce-e409-4d2a-8dae-bb456139a660", "label": "NSX61-RC-ComputeClusterB" }, "label": "NSX61-RC-ComputeClusterB" }, { "underlyingValue": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "cc254a84-95b8-434a-874d-bdfef8e8ad2c", "labe
Programming Guide "componentId": null, "classId": "ComputeResource", "id": "9d1a3b5a-7162-4a5a-85b7-ec1b2824f554", "label": "EC2 841 Endpoint-us-east-1" }, "label": "EC2 841 Endpoint-us-east-1" } ] } JSON output for a vCloud Reservation { "values": [ { "underlyingValue": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "c527a0f5-b1ae-4b61-8145-ad9d5c434dc7", "label": "Engineering Allocation VDC" }, "label": "Engineering Allocation VDC" } ] } Syntax for Getting a Compute Res
Programming Guide Parameter Description $schemaclassid Specifies the schema class ID. For a vSphere reservation, specify Infrastructure.Reservation.Virtual.vSphere as the $schemaclassid value. For an Amazon EC2 reservation, specify Infrastructure.Reservation.Cloud.Amazon as the the $schemaclassid value. For a vCloud reservation, specify Infrastructure.Reservation.Cloud.vCloud as the the $schemaclassid value.
Programming Guide Example: curl Command for a vSphere reservation The following command retrieves a compute resource for a vSphere reservation. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/dataservice/schema/Infrastructure.Reservation.Virtual.vSphere/default/computeResource/values -d “{}” Example: curl Command for an Amazon EC2 reservation The following command retrieves a compute resource for an Amazon EC2 reservation.
Programming Guide "id": "a4349488-9a56-4906-83a5-7d8b33c9d435", "label": "NSX61-RC-ManagementCluster" }, "label": "NSX61-RC-ManagementCluster" }, { "underlyingValue": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "40b151ce-e409-4d2a-8dae-bb456139a660", "label": "NSX61-RC-ComputeClusterB" }, "label": "NSX61-RC-ComputeClusterB" }, { "underlyingValue": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "cc254a84-95b8-434a-874d-bdfef8e8ad2c", "labe
Programming Guide }, { "underlyingValue": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "9d1a3b5a-7162-4a5a-85b7-ec1b2824f554", "label": "EC2 841 Endpoint-us-east-1" }, "label": "EC2 841 Endpoint-us-east-1" } ] } Example: Output for a vCloud Reservation In this example, there is 1 available compute resource that you can use to create a vCloud reservation.
Programming Guide Procedure u Display information about available resources. The following example command queries resource pool information for the compute resource cc254a84-95b8-434a-874d-bdfef8e8ad2c. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/data-service/schema/ Infrastructure.Reservation.Virtual.
Programming Guide Syntax for Getting Resources Schema for a vSphere Reservation You can use the REST API reservation service to display information about available resources for a vSphere reservation, such as storage and network information. Overview This example illustrates how to get a permissible value list for the resourcePool field. You can use the generated output as input for creating or updating a vSphere reservation. Table 3‑12.
Programming Guide Input Description $schemaclassid Specifies the schema class ID. This example illustrates how to use the resourcePool field of a vSphere reservation type as an example. The schema class ID of a vSphere reservation is Infrastructure.Reservation.Virtual.vSphere. For this example, the input value for $schemaclassid is Infrastructure.Reservation.Virtual.vSphere. $fieldId Specifies the field ID of the resource. For example, the field ID for the resource pool is resourcePool.
Programming Guide } }] } }” Example: JSON Output The following JSON output is returned based on the command input. In the following example output, the CoreDev resource pool is shown. Copy the output underlyingValue section into an XML editor and use it as input to create or update a reservation. Note that other REST calls can be used such as reservationNetworks and reservationStorages to get other resources for the reservation.
Programming Guide Procedure u Display resource schema, such as storage and network information. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/dataservice/schema/Infrastructure.Reservation.Cloud.
Programming Guide Get Resources Schema for an Amazon EC2 Reservation Syntax You can display resource schema, such as storage and network information, for an Amazon EC2 reservation by using the data and schema service. Overview This example illustrates how to get a permissible value list for the securityGroups field. You can use the generated output as input for creating or updating an Amazon EC2 reservation. Table 3‑13.
Programming Guide Parameter Description $schemaclassid Specifies the schema class ID. This example illustrates how to use the securityGroups field of an Amazon EC2 reservation type as an example. The schema class ID of a Amazon EC2 reservation is Infrastructure.Reservation.Cloud.Amazon. For this example, the input value for $schemaclassid is Infrastructure.Reservation.Cloud.Amazon. $fieldId Specifies the field ID of the resource. For example, the field ID for the resource pool is securityGroups.
Programming Guide }] } } ” Example: JSON Output The following JSON output is returned based on the command input. Copy the output from an underlyingValue section into an XML editor and use it as input to create or update a reservation.
Programming Guide Procedure u Display information about available resources, such as storage and network information. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/dataservice/schema/Infrastructure.Reservation.Cloud.vCloud/default/reservationStorages/values -d “ The following JSON output is returned based on the command input. { "values": [ { "underlyingValue": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.
Programming Guide "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide Table 3‑14. Extension Fields Supported in vCloud Reservations Permissible Value Depends on Field Infrastructure.Reservation.N etwork Yes computeResource Integer NA No NA reservationMemory Complex Type Infrastructure.Reservation.M emory No NA computeResource Entity Reference ComputeResource Yes NA machineQuota Integer NA No NA reservationStorages Complex Type Infrastructure.Reservation.
Programming Guide Parameter Description dependencyValues JSON string that defines the dependency values entries key -- Specifies the field ID of dependent field. For this example, enter computeResource. value -- Specifies the value of the dependent field. For this example, copy and paste the vCloud HTTP response obtained by using the Get Compute Resource task. See Get Resources Schema for a vCloud Reservation Syntax.
Programming Guide { "key": "computeResourceStorageTotalSizeGB", "value": { "type": "integer", "value": 1000 } }, { "key": "storagePath", "value": { "type": "entityRef", "componentId": null, "classId": "Storage", "id": "f4df029b-d475-4f85-ab42-05bddde3f667", "label": "Low Performance Storage" } }, { "key": "computeResourceStorageFreeSizeGB", "value": { "type": "integer", "value": 954 } } ] } }, "label": "Low Performance Storage" }, { "underlyingValue": { "type": "complex", "componentTypeId": "com.mycompany.
Programming Guide { "key": "computeResourceStorageFreeSizeGB", "value": { "type": "integer", "value": 691 } } ] } }, "label": "High Performance Storage" } ] } Creating a Reservation By Type You can use the vRealize Automation REST API to create any supported reservation type, including a vSphere, Amazon EC2, or vCloud reservation. Create a vSphere Reservation You can use the vRealize Automation REST API reservation service to create a vSphere reservation.
Programming Guide "tenantId": "qe", "subTenantId": "ef58f604-528d-4441-a219-4725bead629b", "enabled": true, "priority": 3, "reservationPolicyId": "b71c3a5f-087a-4d9e-9a56-fab785a3d128", "alertPolicy": { "enabled": true, "frequencyReminder": 20, "emailBgMgr": false, "recipients": ["test1@mycompany.com", "test2@mycompany.
Programming Guide } }] } }, { "key": "custom-Properties-key0", "value": { "type": "string", "value": "custom-property-value0" } }, { "key": "custom-Properties-key2", "value": { "type": "string", "value": "custom-property-value2" } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "key": "machineQuota", "value": { "type": "integer", "value": 2 } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide }, { "key": "reservationStorageReservationPriority", "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "value": { "type": "entityRef", "componentId": null, "classId": "ResourcePools", "id": "4e51fabc-19e8-4e79-b413-d52309b3bb62", "label": "CoreDev" } }] } } ” The command output is a URL that includes the new reservation ID, for example https://$host/reservation-service/api/reservations/94d74105-831a-4598-8f42efd590fea15c.
Programming Guide Input Description $token Specifies a valid HTTP bearer token with necessary credentials. HTTP body The HTTP body describes the reservation to create and calls the REST API used to create the reservation. Compose the HTTP body using one of the following methods: n Copy the HTTP body from the JSON output from this example and edit the applicable field values to compose the HTTP body input for the command line.
Programming Guide "id": "storage" }, { "alertPercentLevel": 20, "referenceResourceId": "memory", "id": "memory" }, { "alertPercentLevel": 30, "referenceResourceId": "cpu", "id": "cpu" }, { "alertPercentLevel": 40, "referenceResourceId": "machine", "id": "machine" }] }, "extensionData": { "entries": [{ "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "type": "string", "value": "custom-property-value2" } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "componentId": null, "classId": "reservationStorage", "typeFilter": null, "values": { "entries": [{ "key": "storageTotalSizeGB", "value": { "type": "integer", "value": 394 } }, { "key": "reservationStorageReservedSizeGB", "value": { "type": "integer", "value": 32 } }, { "key": "reservationStorageEnabled", "value": { "type": "boolean", "value": true } }, { "key": "reservationStoragePath", "value": { "type": "entityRef", "componentId": null, "classId": "StoragePath", "id": "f48a527b-30a6-4d
Programming Guide "value": { "type": "entityRef", "componentId": null, "classId": "ResourcePools", "id": "4e51fabc-19e8-4e79-b413-d52309b3bb62", "label": "CoreDev" } }] } } ” Example: JSON Output The following sample location URL is displayed, including the new vSphere reservation ID. Location: https://$host/reservation-service/api/reservations/94d74105-831a-4598-8f42-efd590fea15c Copy the output response into an XML editor for use in a future procedure, such as updating or deleting the reservation.
Programming Guide "name": "TestvAppReservation", "reservationTypeId": "Infrastructure.Reservation.Cloud.
Programming Guide }, { "key": "allocationModel", "value": { "type": "integer", "value": 0 } }, { "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [ { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide "type": "integer", "value": 1000 } }, { "key": "storagePath", "value": { "type": "entityRef", "componentId": null, "classId": "Storage", "id": "e655aa78-e5fb-4722-9e8a-0cd4139248cf", "label": "High Performance Storage" } }, { "key": "storageReservationPriority", "value": { "type": "integer", "value": 1 } }, { "key": "storageReservedSizeGB", "value": { "type": "integer", "value": 100 } }, { "key": "storageEnabled", "value": { "type": "boolean", "value": true } }, { "key": "computeResourceS
Programming Guide "typeFilter": null, "values": { "entries": [ { "key": "computeResourceMemoryTotalSizeMB", "value": { "type": "integer", "value": 13312 } }, { "key": "memoryReservedSizeMb", "value": { "type": "integer", "value": 4096 } } ] } } } ] } } “ The output is a location URL, including the new vCloud reservation ID.
Programming Guide Parameter Description $token Specifies a valid HTTP bearer token with necessary credentials. HTTP body The HTTP body describes the reservation to create and calls the REST API used to create the reservation. Compose the HTTP body using one of the following methods: n Copy the HTTP body from the JSON output from this example and edit the applicable field values to compose the HTTP body input for the command line.
Programming Guide ], "alerts": [ { "alertPercentLevel": 80, "referenceResourceId": "storage", "id": "storage" }, { "alertPercentLevel": 80, "referenceResourceId": "memory", "id": "memory" }, { "alertPercentLevel": 80, "referenceResourceId": "cpu", "id": "cpu" }, { "alertPercentLevel": 80, "referenceResourceId": "machine", "id": "machine" } ] }, "extensionData": { "entries": [ { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "c527a0f5-b1ae-
Programming Guide "elementTypeId": "COMPLEX", "items": [ { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide } }, { "key": "storageReservationPriority", "value": { "type": "integer", "value": 1 } }, { "key": "storageReservedSizeGB", "value": { "type": "integer", "value": 100 } }, { "key": "storageEnabled", "value": { "type": "boolean", "value": true } }, { "key": "computeResourceStorageFreeSizeGB", "value": { "type": "integer", "value": 691 } } ] } } ] } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "value": { "type": "integer", "value": 4096 } } ] } } } ] } } “ Example: JSON Output The output response displays the location URL, including the new vCloud reservation ID. Location: https://$host/reservation-service/api/reservations/3289b039-2a11-4ab4-a0bc-b583e4c6d085 Copy the output response into an XML editor for use in a future procedure, such as updating or deleting the reservation.
Programming Guide "name": "TestEC2Reservation", "reservationTypeId": "Infrastructure.Reservation.Cloud.
Programming Guide } }, { "key": "loadBalancers", "value": { "type": "multiple", "elementTypeId": "ENTITY_REFERENCE", "items": [ { "type": "entityRef", "componentId": null, "classId": "ElasticLoadBalancer", "id": "3", "label": "test1" } ] } }, { "key": "locations", "value": { "type": "multiple", "elementTypeId": "ENTITY_REFERENCE", "items": [ { "type": "entityRef", "componentId": null, "classId": "AvailabilityZone", "id": "10", "label": "us-east-1a" } ] } }, { "key": "keyPairs", "value": { "type": "string",
Programming Guide Input Use the supported input parameters to control the command output. Parameter Description URL https://$host/reservation-service/api/reservations Method Post $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. HTTP body The HTTP body describes the reservation to create and calls the REST API used to create the reservation.
Programming Guide "enabled": false, "frequencyReminder": 0, "emailBgMgr": true, "recipients": [ ], "alerts": [ { "alertPercentLevel": 80, "referenceResourceId": "machine", "id": "machine" } ] }, "extensionData": { "entries": [ { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "9d1a3b5a-7162-4a5a-85b7-ec1b2824f554", "label": "EC2 841 Endpoint-us-east-1" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 0 } }, { "key": "sec
Programming Guide { "type": "entityRef", "componentId": null, "classId": "ElasticLoadBalancer", "id": "3", "label": "test1" } ] } }, { "key": "locations", "value": { "type": "multiple", "elementTypeId": "ENTITY_REFERENCE", "items": [ { "type": "entityRef", "componentId": null, "classId": "AvailabilityZone", "id": "10", "label": "us-east-1a" } ] } }, { "key": "keyPairs", "value": { "type": "string", "value": "Per Provisioning Group" } } ] } }” Example: JSON Output The following sample location URL is displ
Programming Guide Prerequisites n Log in to vRealize Automation as a fabric group administrator. 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 Finish creating a new reservation. Obtain the reservation ID from the output URL. See Syntax for Creating a vSphere Reservation.
Programming Guide "referenceResourceId": "cpu", "id": "cpu" }, { "alertPercentLevel": 40, "referenceResourceId": "machine", "id": "machine" }] }, "extensionData": { "entries": [{ "key": "key4", "value": { "type": "string", "value": "custom-property-value4" } }, { "key": "key3", "value": { "type": "string", "value": "custom-property-value3" } }, { "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.
Programming Guide }] } }] } }, { "key": "key0", "value": { "type": "string", "value": "custom-property-value0" } }, { "key": "key2", "value": { "type": "string", "value": "custom-property-value2" } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "047e00f5-5424-4ed2-a751-4a334aeaff54", "label": "VC51-Cluster" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 2 } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide } }, { "key": "storageFreeSizeGB", "value": { "type": "integer", "value": 120 } }, { "key": "reservationStorageReservationPriority", "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "value": { "type": "entityRef", "componentId": null, "classId": "ResourcePools", "id": "4e51fabc-19e8-4e79-b413-d52309b3bb62", "label": "CoreDev" } }] } } Example Output for a vCloud Reservation { "id": "bf922450-d495-460d-9dbf-1c09b0692db2", "name": "TestvAppReservation", "rese
Programming Guide { "alertPercentLevel": 80, "referenceResourceId": "memory", "id": "memory" }, { "alertPercentLevel": 80, "referenceResourceId": "cpu", "id": "cpu" }, { "alertPercentLevel": 80, "referenceResourceId": "machine", "id": "machine" } ] }, "extensionData": { "entries": [ { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "c527a0f5-b1ae-4b61-8145-ad9d5c434dc7", "label": "Engineering Allocation VDC" } }, { "key": "machineQuota", "v
Programming Guide "values": { "entries": [ { "key": "networkPath", "value": { "type": "entityRef", "componentId": null, "classId": "Network", "id": "42c5063c-5422-448f-aac7-22ebe941ac8e", "label": "VM Network SQA" } } ] } } ] } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [ { "type": "complex", "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide }, { "key": "storageReservedSizeGB", "value": { "type": "integer", "value": 100 } }, { "key": "storageEnabled", "value": { "type": "boolean", "value": true } }, { "key": "computeResourceStorageFreeSizeGB", "value": { "type": "integer", "value": 691 } } ] } } ] } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide } ] } } Syntax for Verifying a Reservation and Getting Reservation Details After you create a vRealize Automation reservation, you can use the REST API reservation service and the reservation ID to verify that the reservation exists. You can also use the ID to get information about the reservation in preparation for updating or deleting it. Input Use the supported input parameters to control the command output.
Programming Guide Example: JSON Output for a vSphere Reservation The following JSON output is returned based on the command input. Copy the output response into an XML editor for future step usage. { "id": "94d74105-831a-4598-8f42-efd590fea15c ", "name": "TestReservation", "reservationTypeId": "Infrastructure.Reservation.Virtual.
Programming Guide } }, { "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "componentId": null, "classId": "reservationStorage", "typeFilter": null, "values": { "entries": [{ "key": "storageTotalSizeGB", "value": { "type": "integer", "value": 394 } }, { "key": "reservationStorageReservedSizeGB", "value": { "type": "integer", "value": 31 } }, { "key": "reservationStorageEnabled", "value": { "type": "boolean", "value": true } }, { "key": "reservationStoragePath", "value": { "type": "entityRef", "componentId": null, "classId": "StoragePath", "id": "f48a527b-30a6-4d
Programming Guide "value": { "type": "entityRef", "componentId": null, "classId": "ResourcePools", "id": "4e51fabc-19e8-4e79-b413-d52309b3bb62", "label": "CoreDev" } }] } } Example: Example Output for a vCloud Reservation { "id": "bf922450-d495-460d-9dbf-1c09b0692db2", "name": "TestvAppReservation", "reservationTypeId": "Infrastructure.Reservation.Cloud.
Programming Guide { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "c527a0f5-b1ae-4b61-8145-ad9d5c434dc7", "label": "Engineering Allocation VDC" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 0 } }, { "key": "allocationModel", "value": { "type": "integer", "value": 0 } }, { "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [ { "type": "complex", "componentTypeId": "com.
Programming Guide "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [ { "type": "complex", "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide "value": 691 } } ] } } ] } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
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. Procedure u Display a list of existing vRealize Automation reservations. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/reservations The following sample output lists two vSphere reservations, named MyTestReservation1 and MyTestReservation2 .
Programming Guide "key": "key4", "value": { "type": "string", "value": "custom-property-value4" } }, { "key": "key3", "value": { "type": "string", "value": "custom-property-value3" } }, { "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide }, { "key": "key2", "value": { "type": "string", "value": "custom-property-value2" } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "value": 2 } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "value": { "type": "entityRef", "componentId": null, "classId": "ResourcePools", "id": "4e51fabc-19e8-4e79-b413-d52309b3bb62", "label": "CoreDev" } }], "metadata": { "size": 0, "totalElements": 1, "totalPages": 1, "number": 1, "offset": 0 } } Syntax for Displaying a List of Reservations You can use the REST API reservation service to display a list of existing vRealize Automation reservations.
Programming Guide Property Description Links Species an array of link objects, each of which contains the following parts: rel href Specifies the name of the link. n Self refers to the object which 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. Specifies the URL that produces the result.
Programming Guide "emailBgMgr": false, "recipients": ["user1@mycompany.com", "user2@mycompany.
Programming Guide "componentId": null, "classId": "NetworkProfile", "id": "ed5d1503-08ac-42ca-804d-9167834a63a5", "label": "ETEDoNotDelete2014-10-13 13:10:56" } }, { "key": "reservationNetworkPath", "value": { "type": "entityRef", "componentId": null, "classId": "Network", "id": "44cb65d5-b321-43dd-a2ab-8ecf387bff8f", "label": "VM Network SQA" } }] } }] } }, { "key": "key0", "value": { "type": "string", "value": "custom-property-value0" } }, { "key": "key2", "value": { "type": "string", "value": "custom-pr
Programming Guide } }] } } }, { "key": "key1", "value": { "type": "string", "value": "custom-property-value-Updated" } }, { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "047e00f5-5424-4ed2-a751-4a334aeaff54", "label": "VC51-Cluster" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 2 } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "component
Programming Guide { "key": "reservationStorageEnabled", "value": { "type": "boolean", "value": true } }, { "key": "reservationStoragePath", "value": { "type": "entityRef", "componentId": null, "classId": "StoragePath", "id": "f48a527b-30a6-4d54-8829-f549bc195b69", "label": "VNXe:qe-vnxe-nfs-1" } }, { "key": "storageFreeSizeGB", "value": { "type": "integer", "value": 120 } }, { "key": "reservationStorageReservationPriority", "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "v
Programming Guide Update a Reservation You can use the REST API reservation service to update an existing vRealize Automation reservation. Prerequisites n Log in to vRealize Automation as a fabric group administrator. 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.
Programming Guide { "alertPercentLevel": 20, "referenceResourceId": "memory", "id": "memory" }, { "alertPercentLevel": 30, "referenceResourceId": "cpu", "id": "cpu" }, { "alertPercentLevel": 40, "referenceResourceId": "machine", "id": "machine" }] }, "extensionData": { "entries": [{ "key": "key4", "value": { "type": "string", "value": "custom-property-value4" } }, { "key": "key3", "value": { "type": "string", "value": "custom-property-value3" } }, { "key": "reservationNetworks", "value": { "type": "multipl
Programming Guide "value": { "type": "entityRef", "componentId": null, "classId": "Network", "id": "44cb65d5-b321-43dd-a2ab-8ecf387bff8f", "label": "VM Network SQA" } }] } }] } }, { "key": "key0", "value": { "type": "string", "value": "custom-property-value0" } }, { "key": "key2", "value": { "type": "string", "value": "custom-property-value2" } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "value": { "type": "string", "value": "custom-property-value-Updated" } }, { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "047e00f5-5424-4ed2-a751-4a334aeaff54", "label": "VC51-Cluster" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 2 } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.
Programming Guide { "key": "reservationStoragePath", "value": { "type": "entityRef", "componentId": null, "classId": "StoragePath", "id": "f48a527b-30a6-4d54-8829-f549bc195b69", "label": "VNXe:qe-vnxe-nfs-1" } }, { "key": "storageFreeSizeGB", "value": { "type": "integer", "value": 120 } }, { "key": "reservationStorageReservationPriority", "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "value": { "type": "entityRef", "componentId": null, "classId": "ResourcePools", "id": "4
Programming Guide Parameter Description URL https://$host/reservation-service/api/reservations/$reservationId Method Put $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. $reservationId Specifies the unique identifier of the reservation to update. For information about how to obtain the reservation ID, see Syntax for Displaying a List of Reservations.
Programming Guide "alerts": [{ "alertPercentLevel": 10, "referenceResourceId": "storage", "id": "storage" }, { "alertPercentLevel": 20, "referenceResourceId": "memory", "id": "memory" }, { "alertPercentLevel": 30, "referenceResourceId": "cpu", "id": "cpu" }, { "alertPercentLevel": 40, "referenceResourceId": "machine", "id": "machine" }] }, "extensionData": { "entries": [{ "key": "key4", "value": { "type": "string", "value": "custom-property-value4" } }, { "key": "key3", "value": { "type": "string", "value"
Programming Guide "label": "TestNetworkProfile" } }, { "key": "reservationNetworkPath", "value": { "type": "entityRef", "componentId": null, "classId": "Network", "id": "44cb65d5-b321-43dd-a2ab-8ecf387bff8f", "label": "VM Network SQA" } }] } }] } }, { "key": "key0", "value": { "type": "string", "value": "custom-property-value0" } }, { "key": "key2", "value": { "type": "string", "value": "custom-property-value2" } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.
Programming Guide } } }, { "key": "key1", "value": { "type": "string", "value": "custom-property-value-Updated" } }, { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "047e00f5-5424-4ed2-a751-4a334aeaff54", "label": "VC51-Cluster" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 2 } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeI
Programming Guide "value": { "type": "boolean", "value": true } }, { "key": "reservationStoragePath", "value": { "type": "entityRef", "componentId": null, "classId": "StoragePath", "id": "f48a527b-30a6-4d54-8829-f549bc195b69", "label": "VNXe:qe-vnxe-nfs-1" } }, { "key": "storageFreeSizeGB", "value": { "type": "integer", "value": 120 } }, { "key": "reservationStorageReservationPriority", "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "value": { "type": "entityRef", "compone
Programming Guide Delete a Reservation You can use the vRealize Automation REST API reservation service to delete an existing reservation. Prerequisites n Log in to vRealize Automation as a fabric group administrator. 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.
Programming Guide Parameter Description $token Specifies a valid HTTP bearer token with necessary credentials. $reservationId Specifies the unique identifier of the reservation to delete. For information about how to obtain the reservation ID, see Syntax for Displaying a List of Reservations. Output If the command is successful, the HTTP response body is empty except for a 204 No Content status statement.
Programming Guide Procedure u Run the following example command to list all available reservation policies. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/reservations/policies The following example output lists two reservation policies, named reservationPolicyTest and reservationPolicyTest2. You can use the ID value for each reservation policy to update or delete them.
Programming Guide Parameter Description $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. Output The command output contains property names and values based on the command input parameters. Property Description Links Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link.
Programming Guide Example: JSON Output The following example output lists two reservation policies, named reservationPolicyTest and reservationPolicyTest2. Use the id value for each reservation policy to update or delete them. See Syntax for Updating a Reservation Policyand Syntax for Deleting a Reservation Policy Syntax.
Programming Guide Procedure u Use the reservation service to create a reservation policy as shown in the following sample command. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/reservations/policies -d “ { "name": "ABXReservationPolicyTest", "description": "ABXReservationPolicyDescTest", "reservationPolicyTypeId": "Infrastructure.Reservation.Policy.
Programming Guide Property Description status When the reservation policy is successfully created, the HTTP response status is 201 created. Header.Location The HTTP response contains a Location attribute that is format as https://$host /reservationservice/api/reservations/policies/$reservationPolicyId. $reservationPolicyId Specifies the new reservation policy ID. Obtain this ID by listing your available reservation policies.
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 Obtain the reservation policy ID of the reservation policy to query. See Syntax for Listing Reservation Policies. Procedure u Display information about the reservation policy ID. The following example displays information about reservation policy 8adafb54-4c85-4478-86f0b6ae80ab5ca4.
Programming Guide Parameter Description $id Specifies the reservation policy ID. $name Specifies the reservation policy name. $description Specifies the reservation policy description. $reservationPolicyTypeId Specifies the reservation policy type ID. Example: Example: curl Command The following example command retrieves information for the reservation policy with an ID of 8adafb54-4c85-4478-86f0-b6ae80ab5ca4.
Programming Guide Procedure 1 Query the reservation policy and copy the response output to an editor. 2 Change the following information to use as the basis of the command input for this task. 3 n Reservation policy name n Reservation policy description n Reservation policy type ID Update the name and description values for the reservation policy ID. The following example syntax updates the information for reservation policy ID 94d74105-831a-4598-8f42-efd590fea15c.
Programming Guide Parameter Description $token Specifies a valid HTTP bearer token with necessary credentials. HTTP body Describes the reservation policy to update. To obtain the value, query the reservation policy and copy the response output to an editor for use as the basis of your command input. See Syntax for Displaying a Reservation Policy by ID.
Programming Guide 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 Get the required reservation policy ID. See Syntax for Listing Reservation Policies. Procedure u Delete the reservation policy ID.
Programming Guide Example: Example: curl Command The following example command deletes a reservation policy with an ID of 8adafb54-4c85-4478-86f0b6ae80ab5ca4. curl –X “Delete” --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/reservations/policies/8adafb54-4c85-4478-86f0-b6ae80ab5ca4 Example: Example: JSON Output If the command is successful, the HTTP response body is empty except for a 204 No Content status statement.
Programming Guide "@type": "KeyPair", "id": 26, "name": "TestKeyPair", "computeResourceId": "ca4dcca0-85ce-49dd-8371-4ce7c8e2d5e6", "secretKey": "" }, { "@type": "KeyPair", "id": 27, "name": "EC2KeyPair", "computeResourceId": "ca4dcca0-85ce-49dd-8371-4ce7c8e2d5e6", "secretKey": "jmfhkPFLe1xF4LsgxyYDlBH65IjiKsNH3xgeUhNt6AyIcSA2eZsxH9FNFcDst1cRLQUmLYLUCN6ZlrVtD3C5CYAOEE9UplO +YKnAcqUSyXB6PQ3I/NuebdtGrx38fkTJsEpRqxLppWPJpVlHYRO2O7GhhWnE6F3bPwwg3dWwymqWHxBZlCcuEcztovbhN8r7/h KsXKbNSJz +J8DVhPB7PPdHJJ4E/6a9IXkN
Programming Guide Syntax for Getting a Key Pair List You can use the vRealize Automation REST API to get a list of valid key pairs. Input Use the supported input parameters to control the command output. Parameter Description URL https://$host/iaas-proxy-provider/api/keyPairs Method Get $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.
Programming Guide Parameter Description Links Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link. n n Self refers to the object that was returned or requested. First, Previous, Next, and Last refer to corresponding pages of pageable lists. n n Specifies the application or service that determines the other names. href Specifies the URL that produces the result.
Programming Guide Example: JSON Output The following JSON output is returned based on the command input.
Programming Guide "totalPages": 1, "number": 1, "offset": 0 } } Create a Key Pair You can use the vRealize Automation REST API to create a key pair. Prerequisites n Log in to vRealize Automation as a tenant administrator. 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.
Programming Guide CeGr7ynhOTEEQiAOWqgIUyDvrvc2Ma4RjjI4b3eFfBMkLWqTqs33+/5QktQz +p5JrIb192STI/PwHY51MfkbDErpeNFY479P7yKlZGbB8WVBfFpJCoVTQoZNio1ZhA7nA+rkqNbM4mcHQ +ZaYfxCc1UKO1AYBGS9ARz5OtYQU64Ei7tpWUbsYDXIA9Ss4VRASHvA7M3s +N61TPQ9HZuof/c6TbzOWE0ojtxEyO3sDsBWumm13/61+JT3k0rIdmV25aVvxrUv1S3JLI/o/zGgR9yTOeADIXHWsF4lQyai9Mn mEaclHVWmK+LiVZSAfk6auEm +13a24+UM9Mg6ninfzeIq0cjdT3OUweXgDnK0BMGX0wfSIYIrpRrDr9QdVoHGtdqZvJ62F8aITjO8urIK +bXZzwgFQ2JE4SYxojNHPYwBjadFm0A2eVPtOivMYYYr8FCUYtfbjjIS1TyJaKIFhhqs6bA6/PH +NvBmbo
Programming Guide Parameter Description status If the command is successful, the HTTP status is 201 Created. Header.Location The http response should contain a Location attribute that is formatted as https://$host/iaas-proxyprovider/api/keyPairs/$keypairID. $keypairID Specifies the unique identifier of the new key pair.
Programming Guide Example: JSON Output The output returns an empty HTTP response body and the host information and key pair ID in the header statement. Location: https://vcac148-084-241.eng.mycompany.com/iaas-proxy-provider/api/keyPairs/56 Copy the location URL into a text editor for future use. Query a Key Pair You can use the REST API to query a key pair that is available for the vRealize Automation tenant administrator. Prerequisites n Log in to vRealize Automation as a tenant administrator.
Programming Guide Parameters Description URL https://$host/iaas-proxy-provider/api/keyPairs/$ids Method Get $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. $id: Specifies the unique identifier of the key pair. Output The command output contains property names and values based on the command input parameters.
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. Procedure u Use the following sample command to update a key pair.
Programming Guide Syntax for Updating a Key Pair You can update an existing key pair by using the vRealize Automation REST API. Input Use the supported input parameters to control the command output. Parameter Description URL https://$host/iaas-proxy-provider/api/keyPairs/$id Method Put $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.
Programming Guide +J8DVhPB7PPdHJJ4E/6a9IXkNQs/T0NknCOyc0YcFVpgrc3PMGabi8vd/7v0nEtDARyA8WwAGgtedHGtBo2gciY1Bu/0SNr2yCzsZcq bVeg4ufkjlv0G1Ed1FfGHMh5kuVC7alk2aSI5YkWnS4d9YJYi7diYmc7GmrVW0XWNz4kEMdQBkK+CvMxiZ17jyQD +V4NuM4ydNPJJMqpvoAHtLrAmp/hXhInuf8j/l0mbawWSvUDUA3s4ZE55cFp546MJIrVCRyoMoKfxuHquIPdANRAVs7qo9DGxBiCzjv yBqof21y6dhGCd1q48Dkd72QCj6gGV84lHZ/zXWcz4+aKFRVolNqSZEtZ/9wzdjqYdn/ySl0S5GE2rG/xRsh6g +giB9j4VQOMvC/uvhkYUo3WfTgxi8SeipFIVcbvkkOI0ubPU1xnWdDErjji6UwEtmjajHuiA93GtiWIdeCvyKQWmo9jkkLUmQe4XrmR t3P09
Programming Guide Procedure u Use the following sample command to delete a key pair. curl –X “Delete” --insecure -H "Accept:application/json" -H "Authorization: Bearere $token" https://$host/iaas-proxy-provider/api/keyPairs/26 The output contains an empty HTTP response body and the following status code. 204 No Content Syntax for Deleting a Key Pair You can use the vRealize Automation REST API to delete a key pair. Prerequisites n Log in to vRealize Automation as a tenant administrator.
Programming Guide Example: curl Command The following example command deletes a key pair. curl –X “Delete” --insecure -H "Accept:application/json" -H "Authorization: Bearere $token" https://$host/iaas-proxy-provider/api/keyPairs/26 Example: JSON Output The output contains an empty HTTP response body and the following status code. 204 No Content Working with Network Profiles You can work use the vRealize Automation REST API iaas-proxy-provider service to list, create, and update network profiles.
Programming Guide Procedure u Use the following sample command to list all available network profiles. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/ iaas-proxy-provider/api/network/profiles The following JSON output is returned based on the command input. { "links": [ ], "content": [ { "@type": "NATNetworkProfile", "id": "599541aa-ffb0-4a37-9483-4353f3fc6be3", "name": "NATTest", "description": "", "createdDate": "2014-11-11T02:29:09.
Programming Guide "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, { "id": "f21dcbef-037c-48bb-bee9-2c736376ef14", "name": null, "description": null, "IPv4Address": "10.118.190.122", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.000Z", "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, { "id": "ce79de13-91da-4269-9ea2-2de416019ee9", "name": null, "description": null, "IPv4Address": "10.118.190.
Programming Guide "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, { "id": "9d5a9d25-26d7-4ce3-93a2-61242a88c5b2", "name": null, "description": null, "IPv4Address": "10.118.190.110", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.000Z", "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, { "id": "f5cfa798-3237-4891-9baf-6182c17174f2", "name": null, "description": null, "IPv4Address": "10.118.190.
Programming Guide "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, { "id": "5ce0b34c-2e72-42e4-8f1f-91ddb08753c8", "name": null, "description": null, "IPv4Address": "10.118.190.120", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.000Z", "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, { "id": "bea637f2-1e22-4e6a-b646-a21e979c7750", "name": null, "description": null, "IPv4Address": "10.118.190.
Programming Guide "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, { "id": "a17bd3b3-fca1-4248-afed-e509bb1a1b56", "name": null, "description": null, "IPv4Address": "10.118.190.130", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.000Z", "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, { "id": "e8116b71-9864-4dd6-a0f3-f6c1c0de3d23", "name": null, "description": null, "IPv4Address": "10.118.190.
Programming Guide "dnsSearchSuffix": "", "primaryWinsAddress": "10.0.0.1", "secondaryWinsAddress": "", "dhcpStartIPAddress": null, "dhcpEndIPAddress": null, "leaseTimeInSeconds": 0 }, { "@type": "PrivateNetworkProfile", "id": "594e4016-b067-4d19-aa81-63502675f925", "name": "privateTest", "description": "", "createdDate": "2014-11-11T02:26:44.000Z", "lastModifiedDate": "2014-11-11T02:26:44.
Programming Guide "hostName": "", "createdDate": "2014-11-11T02:25:57.000Z", "lastModifiedDate": "2014-11-11T02:25:57.000Z" }, { "id": "f1cc8ce0-97d9-4405-bf23-3cb258ab1c59", "name": null, "description": null, "IPv4Address": "10.118.190.113", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:25:57.000Z", "lastModifiedDate": "2014-11-11T02:25:57.000Z" }, { "id": "d517ede8-ddd6-4a67-bb26-4bbbfd3c5c1b", "name": null, "description": null, "IPv4Address": "10.118.190.
Programming Guide "hostName": "", "createdDate": "2014-11-11T02:25:57.000Z", "lastModifiedDate": "2014-11-11T02:25:57.000Z" }, { "id": "7675008f-289b-40de-8282-922b0e031314", "name": null, "description": null, "IPv4Address": "10.118.190.117", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:25:57.000Z", "lastModifiedDate": "2014-11-11T02:25:57.000Z" }, { "id": "d585d795-8aa0-439c-8977-bde44fbff675", "name": null, "description": null, "IPv4Address": "10.118.190.
Programming Guide "definedRanges": [ { "id": "4d9b291a-841f-4f62-b03e-83781133024c", "name": "Range 1", "description": "", "beginIPv4Address": "10.118.183.1", "endIPv4Address": "10.118.183.254", "state": "UNALLOCATED", "createdDate": "2014-11-11T02:30:34.000Z", "lastModifiedDate": "2014-11-11T02:30:34.000Z", "definedAddresses": [ ] } ], "profileType": "ROUTED", "subnetMask": "255.255.254.0", "primaryDnsAddress": "10.110.182.45", "secondaryDnsAddress": "", "dnsSuffix": "mycompany.
Programming Guide { "id": "f229ea1a-18de-4dae-ae7b-0cec7feaa99b", "name": null, "description": null, "IPv4Address": "10.110.183.201", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "22ed8c63-f34f-454b-9e05-245b65c8deaa", "name": null, "description": null, "IPv4Address": "10.110.183.216", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.
Programming Guide { "id": "3ba70e64-84c6-42bf-a20d-3229de74544a", "name": null, "description": null, "IPv4Address": "10.110.183.220", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "a1777d45-b2d0-4ecd-9d0a-3db499756f0f", "name": null, "description": null, "IPv4Address": "10.110.183.206", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.
Programming Guide { "id": "f1962c5e-6b48-4cd5-9f2d-93b706690b6b", "name": null, "description": null, "IPv4Address": "10.110.183.205", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "cdfc5bcc-1db7-46e7-b8e7-a40d67c92763", "name": null, "description": null, "IPv4Address": "10.110.183.219", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.
Programming Guide { "id": "900fcc08-7713-41fe-9f3a-e5c0da3f02b7", "name": null, "description": null, "IPv4Address": "10.110.183.217", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "4854b7af-13fa-48ed-a69f-e7e428699909", "name": null, "description": null, "IPv4Address": "10.110.183.212", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.
Programming Guide ] }, { "id": "67acdc6f-d0b9-4f47-a74b-ea58ff9ce074", "name": "range2", "description": "", "beginIPv4Address": "10.110.183.180", "endIPv4Address": "10.110.183.199", "state": "UNALLOCATED", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z", "definedAddresses": [ { "id": "37b5c7d1-b82f-4961-a7cc-0117d3610ed7", "name": null, "description": null, "IPv4Address": "10.110.183.
Programming Guide }, { "id": "43d8bae4-7b78-40d2-a9ef-350d28901c24", "name": null, "description": null, "IPv4Address": "10.110.183.180", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "c270ce8e-a418-4d02-89db-3b84f6816a75", "name": null, "description": null, "IPv4Address": "10.110.183.181", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide }, { "id": "9eb818c0-4174-4dbf-99be-4c9e6e83c90f", "name": null, "description": null, "IPv4Address": "10.110.183.189", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "7f2a2483-1562-4e88-9ebd-5c61e75f2d79", "name": null, "description": null, "IPv4Address": "10.110.183.195", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide }, { "id": "f64f36d8-076b-4d74-87d7-78b156b7764e", "name": null, "description": null, "IPv4Address": "10.110.183.199", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "4b03c95a-ebb8-4382-ac10-7bb39173b718", "name": null, "description": null, "IPv4Address": "10.110.183.197", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide }, { "id": "ce67f8a7-c5ca-44d5-bd17-f944f2d3748e", "name": null, "description": null, "IPv4Address": "10.110.183.194", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" } ] } ], "profileType": "EXTERNAL", "subnetMask": "255.255.255.0", "gatewayAddress": "10.110.183.253", "primaryDnsAddress": "10.110.182.45", "secondaryDnsAddress": "", "dnsSuffix": "mycompany.
Programming Guide Output The command output contains property names and values based on the command input parameters. VMware, Inc.
Programming Guide Parameter Description Links Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link. n n Self refers to the object that was returned or requested. First, Previous, Next, and Last refer to corresponding pages of pageable lists. n n Specifies the application or service that determines the other names. href Specifies the URL that produces the result.
Programming Guide Parameter Description n n ROUTED subnetMask: Specifies the subnet mask. n gatewayAddress: Specifies the IP address of the network gateway. n primaryDnsAddress: Specifies the IP address of the primary DNS server. This parameter is only available for external, NAT, and routed network profiles. n secondaryDnsAddress: Specifies the IP address of a secondary DNS server. This parameter is only available for external, NAT, and routed network profiles.
Programming Guide Parameter Description 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 returns a list of network profiles.
Programming Guide }, { "id": "f6802100-1d7e-4f31-bdeb-1b27f7e77766", "name": null, "description": null, "IPv4Address": "10.118.190.115", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.000Z", "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, { "id": "f21dcbef-037c-48bb-bee9-2c736376ef14", "name": null, "description": null, "IPv4Address": "10.118.190.122", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.
Programming Guide }, { "id": "b8f012a1-ea4a-403c-9eef-5d000f2a270f", "name": null, "description": null, "IPv4Address": "10.118.190.123", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.000Z", "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, { "id": "9d5a9d25-26d7-4ce3-93a2-61242a88c5b2", "name": null, "description": null, "IPv4Address": "10.118.190.110", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.
Programming Guide }, { "id": "f6db18f6-f4ca-4f33-95c8-86e4c1ce4722", "name": null, "description": null, "IPv4Address": "10.118.190.121", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.000Z", "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, { "id": "5ce0b34c-2e72-42e4-8f1f-91ddb08753c8", "name": null, "description": null, "IPv4Address": "10.118.190.120", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.
Programming Guide }, { "id": "012075d0-1c54-4792-b0ba-d4d93b002efc", "name": null, "description": null, "IPv4Address": "10.118.190.118", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.000Z", "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, { "id": "a17bd3b3-fca1-4248-afed-e509bb1a1b56", "name": null, "description": null, "IPv4Address": "10.118.190.130", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.
Programming Guide } ] } ], "profileType": "NAT", "subnetMask": "255.255.255.0", "gatewayAddress": "10.118.190.230", "primaryDnsAddress": "10.110.182.45", "secondaryDnsAddress": "", "dnsSuffix": "mycompany.com", "dnsSearchSuffix": "", "primaryWinsAddress": "10.0.0.
Programming Guide "createdDate": "2014-11-11T02:25:57.000Z", "lastModifiedDate": "2014-11-11T02:25:57.000Z" }, { "id": "da85ad6b-840c-4aab-92fe-21200e7e05f6", "name": null, "description": null, "IPv4Address": "10.118.190.120", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:25:57.000Z", "lastModifiedDate": "2014-11-11T02:25:57.000Z" }, { "id": "f1cc8ce0-97d9-4405-bf23-3cb258ab1c59", "name": null, "description": null, "IPv4Address": "10.118.190.
Programming Guide "createdDate": "2014-11-11T02:25:57.000Z", "lastModifiedDate": "2014-11-11T02:25:57.000Z" }, { "id": "37ca8368-5d19-4d23-a6b8-7b233bb2320d", "name": null, "description": null, "IPv4Address": "10.118.190.112", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:25:57.000Z", "lastModifiedDate": "2014-11-11T02:25:57.000Z" }, { "id": "7675008f-289b-40de-8282-922b0e031314", "name": null, "description": null, "IPv4Address": "10.118.190.
Programming Guide "leaseTimeInSeconds": 0 }, { "@type": "RoutedNetworkProfile", "id": "a3dbfc76-7eab-4c1f-8f59-8fcc0b50ec6c", "name": "routedTest", "description": "", "createdDate": "2014-11-11T02:31:11.000Z", "lastModifiedDate": "2014-11-11T02:31:11.000Z", "isHidden": false, "definedRanges": [ { "id": "4d9b291a-841f-4f62-b03e-83781133024c", "name": "Range 1", "description": "", "beginIPv4Address": "10.118.183.1", "endIPv4Address": "10.118.183.
Programming Guide "id": "16ab9e24-7c30-4d6d-85fc-04a6fb72919b", "name": null, "description": null, "IPv4Address": "10.110.183.211", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "f229ea1a-18de-4dae-ae7b-0cec7feaa99b", "name": null, "description": null, "IPv4Address": "10.110.183.201", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.
Programming Guide "id": "7cbe2d40-986d-429a-a91c-30067fff3d94", "name": null, "description": null, "IPv4Address": "10.110.183.213", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "3ba70e64-84c6-42bf-a20d-3229de74544a", "name": null, "description": null, "IPv4Address": "10.110.183.220", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.
Programming Guide "id": "10e85576-95c6-4df3-bff7-7ba590286e1a", "name": null, "description": null, "IPv4Address": "10.110.183.210", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "f1962c5e-6b48-4cd5-9f2d-93b706690b6b", "name": null, "description": null, "IPv4Address": "10.110.183.205", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.
Programming Guide "id": "cd39e786-6490-4c95-8cf7-d6e3b6a0ba67", "name": null, "description": null, "IPv4Address": "10.110.183.200", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "900fcc08-7713-41fe-9f3a-e5c0da3f02b7", "name": null, "description": null, "IPv4Address": "10.110.183.217", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.
Programming Guide "id": "db9b41af-4f7b-41f3-b14e-f373df6dd128", "name": null, "description": null, "IPv4Address": "10.110.183.218", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" } ] }, { "id": "67acdc6f-d0b9-4f47-a74b-ea58ff9ce074", "name": "range2", "description": "", "beginIPv4Address": "10.110.183.180", "endIPv4Address": "10.110.183.199", "state": "UNALLOCATED", "createdDate": "2014-11-11T02:24:04.
Programming Guide { "id": "e13b52fb-7375-4397-a054-24e29c843e6e", "name": null, "description": null, "IPv4Address": "10.110.183.185", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "43d8bae4-7b78-40d2-a9ef-350d28901c24", "name": null, "description": null, "IPv4Address": "10.110.183.180", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide { "id": "0f6dc355-5c71-4c6a-b607-4916804feecc", "name": null, "description": null, "IPv4Address": "10.110.183.190", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "9eb818c0-4174-4dbf-99be-4c9e6e83c90f", "name": null, "description": null, "IPv4Address": "10.110.183.189", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide { "id": "67d43b6f-98f7-442a-a00e-761f2b462118", "name": null, "description": null, "IPv4Address": "10.110.183.198", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "f64f36d8-076b-4d74-87d7-78b156b7764e", "name": null, "description": null, "IPv4Address": "10.110.183.199", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide { "id": "add1df2a-14ec-49d9-832e-d55c3a386926", "name": null, "description": null, "IPv4Address": "10.110.183.187", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "ce67f8a7-c5ca-44d5-bd17-f944f2d3748e", "name": null, "description": null, "IPv4Address": "10.110.183.194", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide 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 u Use the following sample command to create an external, NAT, private, or routed network profile.
Programming Guide Input Use the supported input parameters to control the command output. Input Description URL https://$host/iaas-proxy-provider/api/network/profiles Method Post $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. HTTP Body The HTTP body describes the network profile to create.
Programming Guide "subnetMask": "255.255.255.0", "gatewayAddress": "10.110.183.253", "primaryDnsAddress": "10.110.182.45", "secondaryDnsAddress": "", "dnsSuffix": "mycompany.com", "dnsSearchSuffix": "", "primaryWinsAddress": "10.0.0.1", "secondaryWinsAddress": "" } “ Example: JSON Output The output contains an empty HTTP response body and the location and network profile ID in the header statement. Location: https://vcac148-084-241.eng.mycompany.
Programming Guide Procedure u Use the following command to query the existing network profile ID 68b6a183-fc8a-4592af23-92f8d410ee32. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/ iaas-proxy-provider/api/network/profiles/68b6a183-fc8a-4592-af23-92f8d410ee32 The following JSON output is returned based on the command input.
Programming Guide "name": null, "description": null, "IPv4Address": "10.110.183.216", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "42093f0e-7814-46cf-b3ee-2544aa79a20d", "name": null, "description": null, "IPv4Address": "10.110.183.204", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.
Programming Guide "name": null, "description": null, "IPv4Address": "10.110.183.206", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "8349e9bf-33ff-4382-9d9f-5b05efcf7f9c", "name": null, "description": null, "IPv4Address": "10.110.183.207", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.
Programming Guide "id": "cdfc5bcc-1db7-46e7-b8e7-a40d67c92763", "name": null, "description": null, "IPv4Address": "10.110.183.219", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "b846b73d-950d-4a96-a335-b67d8bf8022b", "name": null, "description": null, "IPv4Address": "10.110.183.202", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.
Programming Guide "id": "4854b7af-13fa-48ed-a69f-e7e428699909", "name": null, "description": null, "IPv4Address": "10.110.183.212", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "4a1b41fe-f585-43b1-8c62-ee8a14f026cf", "name": null, "description": null, "IPv4Address": "10.110.183.203", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.
Programming Guide { "id": "37b5c7d1-b82f-4961-a7cc-0117d3610ed7", "name": null, "description": null, "IPv4Address": "10.110.183.182", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "d6112083-b195-4f94-9b07-0fe490d5caa8", "name": null, "description": null, "IPv4Address": "10.110.183.192", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide }, { "id": "c270ce8e-a418-4d02-89db-3b84f6816a75", "name": null, "description": null, "IPv4Address": "10.110.183.181", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "684bbe43-29ce-4113-92c7-43921c943099", "name": null, "description": null, "IPv4Address": "10.110.183.183", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide }, { "id": "7f2a2483-1562-4e88-9ebd-5c61e75f2d79", "name": null, "description": null, "IPv4Address": "10.110.183.195", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "0e7a8d8d-1bf7-4008-a3ec-634218049722", "name": null, "description": null, "IPv4Address": "10.110.183.196", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide }, { "id": "4b03c95a-ebb8-4382-ac10-7bb39173b718", "name": null, "description": null, "IPv4Address": "10.110.183.197", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "636f224c-8ec4-4b58-9c9f-a847dbff4572", "name": null, "description": null, "IPv4Address": "10.110.183.191", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide } ] } ], "profileType": "EXTERNAL", "subnetMask": "255.255.255.0", "gatewayAddress": "10.110.183.253", "primaryDnsAddress": "10.110.182.45", "secondaryDnsAddress": "", "dnsSuffix": "mycompany.com", "dnsSearchSuffix": "", "primaryWinsAddress": "10.0.0.1", "secondaryWinsAddress": "" } Syntax for Querying a Network Profile You can use the vRealize Automation REST API to query and display an external, NAT, private, or routed network profile.
Programming Guide Parameter Description Links Specifies an array of link objects, each of which contains the following parts: n rel Specifies the name of the link. n n Self refers to the object that was returned or requested. First, Previous, Next, and Last refer to corresponding pages of pageable lists. n n Specifies the application or service that determines the other names. href Specifies the URL that produces the result.
Programming Guide Parameter Description n n ROUTED subnetMask: Specifies the subnet mask. n gatewayAddress: Specifies the IP address of the network gateway. n primaryDnsAddress: Specifies the IP address of the primary DNS server. This parameter is only available for external, NAT, and routed network profiles. n secondaryDnsAddress: Specifies the IP address of a secondary DNS server. This parameter is only available for external, NAT, and routed network profiles.
Programming Guide Parameter Description 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 to queries the existing network profile ID 68b6a183-fc8a-4592af23-92f8d410ee32.
Programming Guide "description": null, "IPv4Address": "10.110.183.201", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "22ed8c63-f34f-454b-9e05-245b65c8deaa", "name": null, "description": null, "IPv4Address": "10.110.183.216", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.
Programming Guide "description": null, "IPv4Address": "10.110.183.220", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "a1777d45-b2d0-4ecd-9d0a-3db499756f0f", "name": null, "description": null, "IPv4Address": "10.110.183.206", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.
Programming Guide "name": null, "description": null, "IPv4Address": "10.110.183.205", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "cdfc5bcc-1db7-46e7-b8e7-a40d67c92763", "name": null, "description": null, "IPv4Address": "10.110.183.219", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.
Programming Guide "name": null, "description": null, "IPv4Address": "10.110.183.217", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, { "id": "4854b7af-13fa-48ed-a69f-e7e428699909", "name": null, "description": null, "IPv4Address": "10.110.183.212", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.
Programming Guide { "id": "67acdc6f-d0b9-4f47-a74b-ea58ff9ce074", "name": "range2", "description": "", "beginIPv4Address": "10.110.183.180", "endIPv4Address": "10.110.183.199", "state": "UNALLOCATED", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z", "definedAddresses": [ { "id": "37b5c7d1-b82f-4961-a7cc-0117d3610ed7", "name": null, "description": null, "IPv4Address": "10.110.183.
Programming Guide { "id": "43d8bae4-7b78-40d2-a9ef-350d28901c24", "name": null, "description": null, "IPv4Address": "10.110.183.180", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "c270ce8e-a418-4d02-89db-3b84f6816a75", "name": null, "description": null, "IPv4Address": "10.110.183.181", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide { "id": "9eb818c0-4174-4dbf-99be-4c9e6e83c90f", "name": null, "description": null, "IPv4Address": "10.110.183.189", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "7f2a2483-1562-4e88-9ebd-5c61e75f2d79", "name": null, "description": null, "IPv4Address": "10.110.183.195", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide { "id": "f64f36d8-076b-4d74-87d7-78b156b7764e", "name": null, "description": null, "IPv4Address": "10.110.183.199", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "4b03c95a-ebb8-4382-ac10-7bb39173b718", "name": null, "description": null, "IPv4Address": "10.110.183.197", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide { "id": "ce67f8a7-c5ca-44d5-bd17-f944f2d3748e", "name": null, "description": null, "IPv4Address": "10.110.183.194", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" } ] } ], "profileType": "EXTERNAL", "subnetMask": "255.255.255.0", "gatewayAddress": "10.110.183.253", "primaryDnsAddress": "10.110.182.45", "secondaryDnsAddress": "", "dnsSuffix": "mycompany.
Programming Guide "name": "externalTestEdit", "description": "", "createdDate": "2014-11-16T09:11:55.000Z", "lastModifiedDate": "2014-11-16T09:11:55.000Z", "isHidden": false, "definedRanges": [ { "id": "ce266d4c-5fbb-47a9-a391-c77444c20b09", "name": "range", "description": "", "beginIPv4Address": "10.110.183.239", "endIPv4Address": "10.110.183.240", "state": "UNALLOCATED", "createdDate": "2014-11-16T09:11:55.000Z", "lastModifiedDate": "2014-11-16T09:11:55.
Programming Guide Output The command output contains a status statement. Parameter Description status If the command is not successful, the HTTP status is 204 No Content. Example: curl Command The following example command updates the network profile with an ID of 263b80f5-d34f-47f2b0b1-5a3db991c2e9.
Programming Guide Example: JSON Output The output contains an empty HTTP response body and the following status code. 204 No Content Delete a Network Profile You can use the vRealize Automation REST API network service to delete an existing network profile. Prerequisites n Log in to vRealize Automation as a tenant administrator. n Verify that the host name and fully qualified domain name of the vRealize Automation instance are available.
Programming Guide Parameter Description $token Specifies a valid HTTP bearer token with necessary credentials. $id: Specifies the unique network profile identifier. Output The command output contains a status statement. Parameter Description status If the command is not successful, the HTTP status is 204 No Content. Example: curl Command The following example command deletes a network profile with an ID of 263b80f5-d34f-47f2b0b1-5a3db991c2e9.
Filtering and Formatting REST API Information 4 You can filter and format your vRealize Automation REST API command line and command line output. You can use filters in your command line to limit JSON output to specific conditions. For example, you can use a filter in a catalog item request to display only catalog items that contain a specific catalog ID. Or you can use the requestID resource call to format the output of a command that displays request status.
Related Tools and Documentation 5 In addition to the provided use case code snippets, you can expand your options for working with the vRealize Automation REST API by using related tools and documentation. You can use the vRealize CloudClient to simplify your interaction with the vRealize Automation REST API. You can also use third party tools such as Chrome Developer Tools or Firebug to further expand your vRealize Automation REST API programming options.
Programming Guide For information about requesting a bearer token, see the Identity option on the REST API Reference landing page. For information about available pagination, sorting, and filtering options for any given command, see the Tips option on the REST API Reference landing page. Using vRealize CloudClient vRealize CloudClient is a separate command-line utility that provides a unified interface for working with the vRealize Automation APIs.
Programming Guide 6 (UNIX only) Determine which version of java the script uses. %sh -x bin/vcac-cli 7 Update your PATH environment variable to include the location of the bin folder. What to do next Choosing Your Mode of Operation The REST API Explorer has three modes of operation to accommodate new and experienced users. n Use the Interactive Mode The easiest way to use and learn the vRealize Automation API Explorer is with the interactive mode.
Programming Guide Prerequisites n Install the API Explorer, if necessary. n Your PATH environment variable must contain the location of the vcac-cli (UNIX) or vcac_cli.bat (Windows) script. Procedure 1 (UNIX) In a shell, entervcac-cli or sh bin/vcac-cli. 2 (Windows) In a Command Prompt window, enter vcac-cli.bat. The vcac-cli banner appears. 3 (Optional) Enter the help command for a list of supported commands. vcac-cli>help * ! - Allows execution of operating system (OS) commands.
Programming Guide Default if unspecified: '__NULL__' Keyword: Keyword: Help: Mandatory: Default if specified: Default if unspecified: u uri URI of resource. e.g.
Programming Guide Use the Script Mode The script mode is similar to the command line mode, except that you can invoke multiple commands in sequence. In script mode, you must first create a text file which contains a series of vcac-cli interactive-mode commands. Vcac-cli executes the commands in sequence. Prerequisites n Install the API Explorer, if necessary. n Your PATH environment variable must contain the location of the vcac-cli (UNIX) or vcac_cli.bat (Windows) script.
Programming Guide Procedure 1 Enter the login command string in a Command Prompt window. Option Description vcac_url vRealize Automation URL username@fqdn vRealize Automation username with fully qualified domain name tname Tenant name login --url vcac_url --user username@fqdn --tenant tname 2 Enter the password, when prompted. 3 If running in script mode, enter the password by redirecting standard input. A successful login returns the vcac-cli> prompt without an error message.
Programming Guide The password is masked for security purposes and does not appear in spring-shell.log. vcac-cli>login --url https://vcac148-084-173.eng.vmware.com --user administrator@vsphere.local < /tmp/password.txt Suppress Log Files The API Explorer updates the spring-shell history file spring-shell.log and the message file vcaccli.log in the vcac-cli_install/bin folder by default. You can suppress output to both of these files. Prerequisites n Install the API Explorer, if necessary.
Programming Guide Using Third Party Tools You can use third party tools such as Chrome Developer Tools or Firebug to reveal the data that you can then use to construct a vRealize Automation REST API service call. You can adapt these steps to perform a different action, such as adding a tenant. Prerequisites This example shows how you might use the Chrome Developer Tools to perform a catalog service query. This option is not available for all vRealize Automation functions.
Programming Guide 6 Enter the following call in the vRealize Automation shell, where the request.json text file contains the JSON data from the postData section. rest post --headers --service catalog-service --uri consumer/requests --data request.json This call makes the same request that was submitted by using the console. VMware, Inc.