Programming Guide vRealize Automation 7.
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–2018 VMware, Inc. All rights reserved. Copyright and trademark information. VMware, Inc.
Contents vRealize Automation Programming Guide 6 1 Updated Information 7 2 Overview of the vRealize Automation REST API 8 3 REST API Authentication 10 Using HTTP Bearer Tokens 10 Configure the Duration of an HTTP Bearer Token Request an HTTP Bearer Token 11 Validate an HTTP Bearer Token 14 Delete an HTTP Bearer Token 10 14 4 REST API Use Cases 16 Create a Tenant 16 Syntax for Displaying Your Current Tenants Syntax for Requesting a New Tenant 19 21 Syntax for Listing All Tenant Identity Store
Programming Guide Syntax for Viewing Machine Details Manage Provisioned Deployments 87 91 Syntax for Getting Deployment Details 93 Syntax for Navigating to the Children of a Deployed Resource Perform a Day 2 Action: Power Off 103 Perform a Day 2 Action: Change Lease Working with Reservations Create a Reservation 106 Update a Reservation Delete a Reservation 256 267 276 Working with Reservation Policies List Reservation Policies 278 278 Create a Reservation Policy 281 Display a Reservation
Programming Guide 6 Related Tools and Documentation 397 Using the vRealize Automation REST API Reference Using vRealize CloudClient Using Third Party Tools VMware, Inc.
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 1 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-001841-01 n Removed the section titled Logging in Programmatically. n Removed the section titled Using the API Explorer. EN-001841-00 VMware, Inc. Initial 6.2 release.
Overview of the vRealize Automation REST API 2 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 2‑1.
Programming Guide Table 2‑1. vRealize Automation REST API Services (Continued) Service Description Management Service Retrieve work item forms, callbacks, and tasks. Manage endpoint details including tenant, password, user name, and endpoint URL. Retrieve performance metrics. Retrieve and cancel reclamation requests.
REST API Authentication 3 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 4 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 there is access to a functional LDAP, Active Directory, or Native Active Directory identity server. 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 3 REST API Authentication.
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 5 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 Request a Machine You can use Rest API catalog service commands to complete a variety of tasks related to requesting a machine. This procedure provides sample command line syntax for machine request tasks. Supporting information regarding available input and output parameters, command-line entry samples, and sample JSON output samples is available in the subsequent topics that explain syntax for the various tasks.
Programming Guide 2 Locate the details of a specific catalog item by name. Note that the vRealize Automation API supports OData filtering.
Programming Guide Syntax for Listing Shared and Private Catalog Items You can use the REST API catalog service to retrieve a list of all shared viewable catalog items for the current user. Shared catalog items do not belong to a specific business group. Also, this service retrieves a list of all shared and private catalog items that can be viewed, including their business groups. Input Use the supported input parameters to control the command output.
Programming Guide Parameter Description $filter Boolean expression for whether a particular entry should be included in the response. Valid OData properties include the following: n name - filter based on catalog item name. n status - filter based on catalog item status. n service/id - filter based on catalog item service id. n service/name - filter based on catalog item service name.
Programming Guide Example Curl Command The following example command retrieves information about all the available shared catalog items of the type ConsumerEntitledCatalogItemView. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token” https://$host/catalog-service/api/consumer/entitledCatalogItemViews Example: JSON Output The following JSON output is returned based on the command input.
Programming Guide }, "outputResourceTypeRef": { "id": "composition.resource.type.deployment", "label": "Deployment" } } ], "metadata": { "size": 20, "totalElements": 1, "totalPages": 1, "number": 1, "offset": 0 } } Syntax for Getting Information for a Catalog Item You can use the REST API catalog service to get information about a specific catalog item if desired. REST API Catalog Service The REST API supports OData filtering.
Programming Guide Parameter Description $orderby Multiple comma-separated properties sorted in ascending or descending order. Valid OData properties include the following: n name - filter based on catalog item name. n status - filter based on catalog item status. n service/id - filter based on catalog item service id. n service/name - filter based on catalog item service name.
Programming Guide Output The command output contains property names and values based on the command input parameters. Property Description outputResourceTypeRef Specifies the type of the resource that results from requesting the catalog item. catalogItemId Specifies the catalog item identifier. 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.
Programming Guide } ], "entitledOrganizations": [ { "tenantRef": "mycompany", "tenantLabel": "mycompany", "subtenantRef": "c0683388-6db2-4cb5-9033-b24d15ad3766", "subtenantLabel": "Demo Group" } ], "catalogItemId": "7c8275d6-1bd6-452a-97c4-d6c053e4baa4", "name": "Linux", "description": "Linux blueprint for API demo", "isNoteworthy": false, "dateCreated": "2015-07-29T03:54:28.141Z", "lastUpdatedDate": "2015-07-29T12:46:56.
Programming Guide Overview In the entitledCatalogItemViews response, there is a link field that contains a value similar to the following: { "@type":"link", "href":"https://$host/catalog-service/api/consumer/entitledCatalogItems/dc808d12-3786-4f7cb5a1-d5f997c8ad66/requests/template", "rel":"GET: Request Template" } This URL is a HATEOAS link for a template request for this catalog item.
Programming Guide Example Curl Command The following example command retrieves the catalog item with an ID of dc808d12-3786-4f7c-b5a1d5f997c8ad66. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token” https://$host/catalogservice/api/consumer/entitledCatalogItems/dc808d12-3786-4f7c-b5a1-d5f997c8ad66/requests/template Example: JSON Output The following JSON output is returned based on the command input. { "type": "com.vmware.vcac.catalog.domain.request.
Programming Guide "description": null, "disks": [ { "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Compute.Machine.
Programming Guide } } ], "number_of_instances": 1, "os_arch": "x86_64", "os_distribution": null, "os_type": "Linux", "os_version": null, "platform_name": "vsphere", "platform_type": "virtual", "property_groups": [ null ], "provisioning_workflow": { "componentId": null, "classId": "Infrastructure.Compute.ProvisioningWorkflow", "id": "CloneWorkflow" }, "reservation_policy": { "componentId": null, "classId": "Infrastructure.Reservation.Policy.
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. catalogItemId The identifier of a catalog item.
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 The following example command submits a machine request using appropriately edited template content from the entitledCatalogItemViews response.
Programming Guide Table 4‑1. Request Phase Status Phase Description End State? UNSUBMITTED Request was saved but not submitted. No PENDING_PRE_APPROVAL Request is subject to approval - pre-provisioning approval required. No IN_PROGRESS Request is in progress, machine is being provisioned. No PENDING_POST_APPROVAL Request is subject to approval, post-provisioning approval required. No SUCCESSFUL Request completed successfully.
Programming Guide Property Description phase Specifies the current phase of the request, which is more coarse grained and easier for users to understand. id Specifies the unique identifier of this resource. iconId Specifies an icon for this request based on the requested object type. description Contains a brief description of this request. reasons Specifies the business reasons entered by the requestor or owner of this request.
Programming Guide Example: JSON Output The following sample output contains information about the catalog item request 7aaf9bafaa4e-47c4-997b-edd7c7983a5b. { "@type": "CatalogItemRequest", "id": "7aaf9baf-aa4e-47c4-997b-edd7c7983a5b", "iconId": "cafe_default_icon_genericCatalogItem", "version": 6, "requestNumber": 8, "state": "SUCCESSFUL", "description": "API test", "reasons": null, "requestedFor": "csummers@example.com", "requestedBy": "csummers@example.
Programming Guide Approve a Machine Request You can use a sequence of REST API workitem service commands to approve a machine request. Prerequisites n Log in to vRealize Automation as an approver with at least one of the following qualifications: n You are designated as an approver in an approval policy. n You belong to a group which has been designated as an approval group in an approval policy. n You are designated as a delegate for someone who is an approver.
Programming Guide 4 Approve the submitted machine request by specifying the work item ID and including the JSON file as part of the command line. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$host/workitem-service/api/workitems/5e3e9519-78ea-4409a52c-e4aa3bc56511/actions/com.mycompany.csp.core.approval.action.approve --d @approve.json If the command is successful, the HTTP status is 201 Created.
Programming Guide Property Description 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. work itemType Specifies the work item type for the work item. completedDate Specifies the date when the work item was completed.
Programming Guide "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.workItem.
Programming Guide "type" : "ref", "componentTypeId" : null, "componentId" : null, "classId" : "location", "typeFilter" : null, "label" : null }, "displayAdvice" : null, "state" : { "dependencies" : [ ], "facets" : [ ] }, "filterable" : false, "sortable" : false, "isMultiValued" : false }, { "id" : "arrivalDate", "label" : "Arrival Date", "description" : "The date of arrival at the destination", "dataType" : { "type" : "primitive", "typeId" : "DATE_TIME" }, "displayAdvice" : null, "state" : { "dependencies"
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 "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 }, { "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 3 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 Using the API to Get Deployment Details You can use the REST API to view deployed machine details by appending /resourceViews to the request details URI that you generated when you retrieved request details. So the syntax the GET statement would read as follows: http://$host/catalog-service/api/consumer/requests/$requestId/resourceViews See Syntax for Viewing Details of a Machine Request.
Programming Guide Parameter Description $orderby Specifies how to order multiple comma-separated properties sorted in ascending or descending order. $top Specifies the number of returned entries from the top of the response (total number per page in relation to skip). $skip Specifies the number of entries to skip. filter Contains a Boolean expression to determine if a particular entry is included in the response.
Programming Guide Example: curl Command The following example command displays machine details for a provisioned machine, where the provisioned machine ID is 7aaf9baf-aa4e-47c4-997b-edd7c7983a5b.
Programming Guide } ], "resourceId": "c4d3db3e-e397-44ff-a1c9-0ecebdba12f4", "iconId": "cafe_default_icon_genericCatalogItem", "name": "Linux-80813151", "description": null, "status": null, "catalogItemId": "7c8275d6-1bd6-452a-97c4-d6c053e4baa4", "catalogItemLabel": "Linux", "requestId": "7aaf9baf-aa4e-47c4-997b-edd7c7983a5b", "resourceType": "{com.vmware.csp.component.cafe.composition@resource.type.deployment.
Programming Guide Procedure 1 Display a list of all provisioned resources. $curl --insecure -s -H" Content-Type: multipart/form-data" -H "Authorization: Bearer $token" http:// $host/catalog-service/api/consumer/requests/7aaf9baf-aa4e-47c4-997bedd7c7983a5b/resourceViews The output from this command includes HATEOAS links that enable you to quickly obtain additional information about specific deployed resources.
Programming Guide n You can modify the HATEOAS links to complete more complex day 2 actions that require user input, such as changing a lease. Use a command like the following to get the template for the resource action request.
Programming Guide Table 4‑4. HATEOAS Link Deployment Details Functions (Continued) Link Description GET:Template URI to get a template request for a specific action that you can perform on this resource. Typically, on a deployment, the action will be Delete. {com.vmware.csp.component.cafe.composition@resour ce.action.deployment.$actionName POST: {com.vmware.csp.component.cafe.composition@resour ce.action.deployment.
Programming Guide Table 4‑5. Output Parameters (Continued) Property Description catalogItemId The identifier of the catalog item associated with this provisioned resource. catalogItemLabel The label of the catalog item associated with this provisioned resource. requestId The unique identifier of the request that created this provisioned resource. businessGroupId The unique identifier of the business group that owns this resource.
Programming Guide "@type": "link", "rel": "GET: Request", "href": "https://$host/catalog-service/api/consumer/requests/7aaf9bafaa4e-47c4-997b-edd7c7983a5b" }, { "@type": "link", "rel": "GET Template: {com.vmware.csp.component.cafe.composition@resource.action.deployment.destroy.name}", "href": "https://$host/catalog-service/api/consumer/resources/c4d3db3e-e397-44ffa1c9-0ecebdba12f4/actions/416e6bb1-3357-448b-8396-e268d5f7343b/requests/template" }, { "@type": "link", "rel": "POST: {com.vmware.csp.component.
Programming Guide "totalElements": 1, "totalPages": 1, "number": 1, "offset": 0 } } Syntax for Navigating to the Children of a Deployed Resource Use the GET: Child Resources link to retrieve a list of the child nodes of a deployment, including virtual machines, networks, and other objects you may have configured on the blueprint canvas.
Programming Guide Parameter Description $top Specifies the number of returned entries from the top of the response (total number per page in relation to skip). $skip Specifies the number of entries to skip. filter Contains a Boolean expression to determine if a particular entry is included in the response. Output The command output contains property names and values based on the command input parameters. Table 4‑7.
Programming Guide $curl --insecure -s -H" Content-Type: multipart/form-data" -H "Authorization: Bearer $token" https:// $host /catalog-service/api/consumer/resourceViews? managedOnly=false&withExtendedData=true&withOperations=true&%24filter=parentResource %20eq%20%27c4d3db3e-e397-44ff-a1c9-0ecebdba12f4%27 Example: JSON Output The validation output displays the validation status of each content item within the package.
Programming Guide "status": "On", "catalogItemId": null, "catalogItemLabel": null, "requestId": null, "resourceType": "{com.vmware.csp.component.iaas.proxy.provider@resource.type.registration.name.Infrastructure.Virtual}" , "owners": [ "Connie Summers" ], "businessGroupId": "c0683388-6db2-4cb5-9033-b24d15ad3766", "tenantId": "mycompany", "dateCreated": "2015-07-29T13:54:58.804Z", "lastUpdated": "2015-07-29T13:55:01.371Z", "lease": { "start": "2015-07-29T13:51:33.
Programming Guide { "componentTypeId": "com.vmware.csp.component.iaas.proxy.provider", "componentId": null, "classId": "dynamicops.api.model.
Programming Guide "links": [ { "@type": "link", "rel": "GET: Parent Resource", "href": "https://$host/catalog-service/api/consumer/resourceViews/c4d3db3ee397-44ff-a1c9-0ecebdba12f4" }, { "@type": "link", "rel": "GET Template: {com.vmware.csp.component.network.service@resource.action.destroy.name, [{{com.vmware.csp.component.iaas.proxy.provider@network.network.type.registration.name.Infrastructure.N etwork.Network.
Programming Guide ], "metadata": { "size": 20, "totalElements": 2, "totalPages": 1, "number": 1, "offset": 0 } } Perform a Day 2 Action: Power Off You can use the REST API catalog service to perform a power off action. For simple actions that require no user input, the process is straightforward. This command leverages the links for the power off action from the command used in the Syntax for Navigating to the Children of a Deployed Resource example. { "@type": "link", "rel": "GET Template: {com.vmware.
Programming Guide { "type": "com.vmware.vcac.catalog.domain.request.CatalogResourceRequest", "resourceId": "dd37b7a1-829c-4773-b5be-b229453eca4a", "actionId": "02bad06d-f92b-4cf8-b964-37bb5d57be38", "description": null, "data": { "description": null, "reasons": null } } 2 Use a POST command to send the template without modification to the corresponding URI.
Programming Guide {com.vmware.csp.component.iaas.proxy.provider@resource.action.name.machine.ChangeLease}", "href": "https://$host/api/consumer/resources/dd37b7a1-829c-4773-b5beb229453eca4a/actions/b5739e30-871d-48c7-9012-f2a7cf431dc1/requests" }, Procedure 1 Get the template for the resource action request.
Programming Guide "data": { "provider-ExpirationDate": "2015-08-29T16:44:13.846Z" } } This POST command returns a response indicating success or failure, such as HTTP/1.1 201 CREATED for success. Working with Reservations You can work with the REST API reservation service to perform a variety of functions, such as creating and updating reservations.
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 3 REST API Authentication. n Obtain the schema class ID of the reservation type to create. See Display a List of Supported Reservation Types. n Display a list of the reservation types that are supported in the vRealize Automation server.
Programming Guide 3 Get the business group ID for a vRealize Automation reservation by using the reservation service. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/identity/api/tenants/qe/subtenants 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.
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/dataservice/schema/Infrastructure.Reservation.
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": "storagePriority", "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "value": { "type": "entityRef", "componentId": null, "classId": "ResourcePools", "id": "4e51fabc-19e8-4e79-b413-d52309b3bb62", "label": "CoreDev" } { "text": "", "dependencyValue
Programming Guide }] } } ” b Create a vCloud Air 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 “ { "id": "bf922450-d495-460d-9dbf-1c09b0692db2", "name": "TestvAppReservation", "reservationTypeId": "Infrastructure.Reservation.Cloud.
Programming Guide "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.mycompany.csp.iaas.blueprint.
Programming Guide "elementTypeId": "COMPLEX", "items": [ { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide ] } } ] } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide "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": "securityGroups", "val
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" } } ] } }” 7 Use the reservation ID to verify that the reservation exists.
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 3 REST API Authentication. Procedure u Display a list of supported vRealize Automation reservation types by using the reservation service.
Programming Guide JSON Output for a vCloud Air Reservation { "links": [], "content": [{ { "@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 Air Reservation", "category": "Cloud", "serviceTypeId": "com.mycompany.csp.iaas.blueprint.service", "tenantId": null, "formReference": { "type": "external", "formId": "Infrastructure.Reservation.
Programming Guide "description": null, "referenceResourceId": "machine" } ] }, //Omit 7 reservation types here ], "metadata": { "size": 20, "totalElements": 8, "totalPages": 1, "number": 1, "offset": 0 } } JSON Output for an Amazon Reservation { "links": [], "content": [{ { "@type": "ReservationType", "createdDate": "2015-10-13T04:44:32.074Z", "lastUpdated": "2015-10-13T04:44:32.075Z", "version": 1, "id": "Infrastructure.Cloud.
Programming Guide "number": 1, "offset": 0 } } Syntax for Displaying a List of Supported Reservation Types You can use the REST API reservation service to display a list of supported vRealize Automation reservation types. Input Use the supported input parameters to control the command output.
Programming Guide Property FormReference SchemaClassId alertTypes Description Specifies the user interface form reference. This field is valid for user interface elements only. n type -- user interface form type n formId -- user interface form ID Specifies the schema class ID of the reservation type. Each supported reservation type contains specific fields. The supported fields are defined in the schema.
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 "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 }] } 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 4‑9.
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 "customAllowed": false, "dependencies": ["computeResource"] }, "state": { "dependencies": [], "facets": [] }, "isMultiValued": true }, { "id": "reservationMemory", "label": "Memory", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "type": "dynamic", "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": [] }, "isMultiValu
Programming Guide "value": { "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": "
Programming Guide "displayAdvice": null, "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": { "t
Programming Guide "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "customAllowed": false, "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",
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.
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 "value": { "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 "typeFilter": null, "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", "sub
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":
Programming Guide "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 pair", "description": "The key pair", "dataType": { "type": "primitive", "typeId": "STRING" }, "displayAdvice": null, "permissibleValues": { "type": "static", "customAllowed": false, "values": [ { "u
Programming Guide "value": "Specific Key Pair" }, "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.
Programming Guide Table 4‑10. 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 3 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 Air 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 Air reservation. Overview SomevRealize 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 4‑13. 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 The following example command retrieves schema definition information for a vCloud Air reservation. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/dataservice/schema/Infrastructure.Reservation.Cloud.vCloudAir/default Example: JSON Output The schema definition in this example includes 6 extension fields that are supported for the vCloud Air type reservation.
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": "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": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id":
Programming Guide "dataType": { "type": "primitive", "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": { "depende
Programming Guide "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 ] }, "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 "typeId": "INTEGER" }, "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": [ {
Programming Guide "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" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMu
Programming Guide "facets": [ { "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 B
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 3 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/dataservice/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 4‑14.
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 Use the reservation service to display resource schema information for an Amazon reservation. The following example command displays storage and network information for the compute resource with an ID of 9d1a3b5a-7162-4a5a-85b7-ec1b2824f554. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/dataservice/schema/Infrastructure.Reservation.Cloud.
Programming Guide Syntax for Getting Resources Schema for an Amazon Reservation You can use the REST API reservation service data and schema service to display resource schema information, such as storage and network data, for an Amazon reservation. 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 reservation. Table 4‑15.
Programming Guide Parameter Description $schemaclassid Specifies the schema class ID. This example illustrates how to use the securityGroups field of an Amazon reservation type as an example. The schema class ID of an Amazon 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 Use the reservation service to display information about available resources. The following example command displays storage and network information. 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 “ The following JSON output is returned based on the command input.
Programming Guide "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide Table 4‑16. 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 Syntax for Getting Resources Schema for a vCloud Air Reservation.
Programming Guide "values": { "entries": [ { "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", "componen
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 "name": "TestCreateReservation", "reservationTypeId": "Infrastructure.Reservation.Virtual.vSphere", "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 "value": 120 } }, { "key": "storagePriority", "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": "storageReservedSizeGB", "value": { "type": "integer", "value": 32 } }, { "key": "storageEnabled", "value": { "type": "boolean", "value": true } }, { "key": "reservationStoragePath", "value": { "type": "entityRef", "componentId": null, "classId": "StoragePath", "id": "f48a527b-30a6-4d54-8829-f549bc195b69",
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 "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 "value": 1000 } }, { "key": "storagePath", "value": { "type": "entityRef", "componentId": null, "classId": "Storage", "id": "e655aa78-e5fb-4722-9e8a-0cd4139248cf", "label": "High Performance Storage" } }, { "key": "storagePriority", "value": { "type": "integer", "value": 1 } }, { "key": "storageReservedSizeGB", "value": { "type": "integer", "value": 100 } }, { "key": "storageEnabled", "value": { "type": "boolean", "value": true } }, { "key": "computeResourceStorageFreeSizeGB", "value": {
Programming Guide "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 Air 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 "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 "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 "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 3 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 3 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 3 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 "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": "custom-pro
Programming Guide } }, { "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.mycompany.csp.iaas.blueprint.
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", "componentTypeId"
Programming Guide "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", "componentId": null
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 3 REST API Authentication. n Obtain the reservation ID of the reservation that you want to delete. This information is required API command input.
Programming Guide Example: curl Command The following example command deletes a reservation with an ID of 94d74105-831a-4598-8f42efd590fea15c. curl –X “Delete” --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/reservations/94d74105-831a-4598-8f42-efd590fea15c Example: JSON 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 3 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 3 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 3 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 3 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 3 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,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 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 "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 "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 "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 "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 "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.182", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:24:04.
Programming Guide "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.000Z", "lastModifiedDate": "2014-11-11T02:24:04.
Programming Guide "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.000Z", "lastModifiedDate": "2014-11-11T02:24:04.
Programming Guide "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.000Z", "lastModifiedDate": "2014-11-11T02:24:04.
Programming Guide "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.com", "dnsSearchSuffix": "", "primaryWinsAddress": "10.0.0.
Programming Guide "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.000Z", "definedAddresses": [ ] } ], "profileType": "EXTERNAL", "subnetMask": "255.255.255.
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.
Programming Guide Some parameters on the API request are common to all content management service import and export commands. These parameters are listed below. Parameter Description $host The host name and fully qualified domain name or IP address of the vRealize Automation identity server. $token A valid HTTP bearer token that includes necessary credentials. Note When exporting content, values of secure strings and encrypted properties are excluded by default.
Programming Guide $curl --insecure -s -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$host/content-management-service/api/contents? %24filter=contentTypeId+eq+%27composite-blueprint%27 4 Create a package that contains the desired content. The following command creates a package named Demo Package with a content ID of 9b348c29-88ff-4fa8-b93e-f80bc7c3e723.
Programming Guide Supported Content Types A content type describes content that you can import or export using the content management service. Content types contain metadata about the content provider and the content itself, such as type information or service type ID. Usually the content provider supplies this information.
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. Content Metadata n id: The unique identifier for the content.
Programming Guide "serviceTypeId": "com.vmware.csp.core.properties.service" }, { "@type": "ContentType", "id": "property-definition", "name": "Property Definition", "description": "Content type corresponding to the property definitions.", "classId": "PropertyDefinition", "serviceTypeId": "com.vmware.csp.core.properties.
Programming Guide "name": "Software Component Content Type", "description": "{com.vmware.csp.component.software.service@software.component.content.type.description}", "classId": "softwareComponentType", "serviceTypeId": "com.vmware.csp.component.software.
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 { "links": [], "content": [ { "@type": "Content", "id": "6ba58cb4-257d-4833-b2dc-f090f92f86be", "contentId": "3482e3a7-c6c2-4372-b8e1-0db517b93406", "name": "Echo String", "description": null, "contentTypeId": "asd-blueprint", "mimeType": null, "tenantId": "qe", "subtenantId": null, "dependencies": [], "createdDate": "2015-08-18T19:14:54.899Z", "lastUpdated": "2015-08-18T19:14:54.
Programming Guide "name": "CustomRes", "description": null, "contentTypeId": "asd-resource-type", "mimeType": null, "tenantId": "qe", "subtenantId": null, "dependencies": [], "createdDate": "2015-08-18T20:56:11.052Z", "lastUpdated": "2015-08-18T20:56:11.052Z", "version": 0 }, { "@type": "Content", "id": "4754ad69-a6a7-447f-96de-2ed6fa260f7c", "contentId": "Software.Apache_LB", "name": "Apache_LB", "description": "Apache 2.
Programming Guide Example: JSON Output In this example the returned IDs correspond to composite blueprints that meet the filtering criteria. { "links": [], "content": [ { "@type": "Content", "id": "9b348c29-88ff-4fa8-b93e-f80bc7c3e723", "contentId": "vSphere", "name": "vSphere", "description": "vSphere", "contentTypeId": "composite-blueprint", "mimeType": null, "tenantId": "qe", "subtenantId": null, "dependencies": [], "createdDate": "2015-08-04T14:46:54.201Z", "lastUpdated": "2015-08-04T16:59:30.
Programming Guide Syntax for Creating a Package for Export You can use the REST API content management service to create a package that contains content for export use. Creating a Package with Content n For import or export purposes you must create a package to contain the desired content. n The package is a logical unit that enables you to piece together different content elements. n You can add multiple content IDs to the package.
Programming Guide Parameter Description id Specifies the unique identifier for the content. This is also used as a folder name to group similar content artifacts. name Specifies the name of a given content type provided in localized message key form. description Specifies additional information describing the package. contents Collection of references that form the contents of the package.
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. Content Metadata n createdDate: The creation date of the content.
Programming Guide Example: JSON Output The following example lists all packages within the content service. { "links": [ ], "content": [ { "@type": "Package", "createdDate": "2015-08-04T22:22:53.490Z", "lastUpdated": "2015-08-04T22:22:53.
Programming Guide Example Curl Command $curl --insecure -s -H "Accept: application/zip" -H "Authorization: Bearer $token" https://$host/content-managementservice/api/packages/54f627bb-2277-48af-9fa0-7d7366b498f3-o package.zip Example: Example: JSON Output The export command returns a message that indicates whether or not the package was exported. A successful export produces a package.zip exported to the specified location.
Programming Guide Table 4‑19. Import and Export Response Body Parameters Parameter Description contentImportStatus Over all status of the import/validation operation, one failure in import/validation result guarantees failed status. Values are as follows: n contentImportResults Success - Denotes the successful import or validation status at a particular component or package level. n Failed - Denotes an import or validation failure at a particular component package level.
Programming Guide }, { "contentId": "JBossAppServer", "contentName": "JBossAppServer", "contentTypeId": "software-component", "contentImportStatus": "SUCCESS", "contentImportErrors": null }, { "contentId": "Dukes-Bank-DB-setup", "contentName": "Dukes-Bank-DB-setup", "contentTypeId": "software-component", "contentImportStatus": "SUCCESS", "contentImportErrors": null }, { "contentId": "Dukes_Bank_App", "contentName": "Dukes_Bank_App", "contentTypeId": "software-component", "contentImportStatus": "SUCCESS", "
Programming Guide Table 4‑20. Import and Export Response Body Parameters Parameter Description contentImportStatus Over all status of the import/validation operation, one failure in import/validation result guarantees failed status. Values are as follows: n contentImportResults Success - Denotes the successful import or validation status at a particular component or package level. n Failed - Denotes an import or validation failure at a particular component package level.
Programming Guide "contentImportErrors": null }, { "contentId": "Dukes-Bank-DB-setup", "contentName": "Dukes-Bank-DB-setup", "contentTypeId": "software-component", "contentImportStatus": "SUCCESS", "contentImportErrors": null }, { "contentId": "Dukes_Bank_App", "contentName": "Dukes_Bank_App", "contentTypeId": "software-component", "contentImportStatus": "SUCCESS", "contentImportErrors": null }, { "contentId": "DukesBankApplication", "contentName": "DukesBankApplication", "contentTypeId": "composite-bluepr
Programming Guide 18. 19. 20. 21. 22. 23. 24. 25. source_machine_name: cbp_centos_63_x86 cost_center: sales _cluster: 2 apache: type: Software.Apache data: host: '${_resource~web}' http_port: 8080 Each of these lines plays an important role in the blueprint structure. n Lines 1 - 4 represent possible top level blueprint fields that provide identifying information. The only other possible field is description. The semantics of these fields is straightforward, but you can refer to java.
Programming Guide Available Constraints To define constraints in any blueprint field. create a new hierarchy or level in YAML, and use any of the keys below to define constraints and their values. Table 4‑21. Blueprint Constraints ID or Key Corresponding CAFE Constraint Description default com.vmware.vcac.platform.content.facets.DefaultValueBehav ior Specifies the value for a field. fixed com.vmware.vcac.platform.content.facets.
Programming Guide Prerequisites n Log in to vRealize Automation with an appropriate role. For example: Software Architect, Application Architect, Infrastructure Architecture or some combination of these depending on the need. n Verify that the host name and fully qualified domain name of the vRealize Automation instance are available. n Verify that there is a valid HTTP bearer token that matches your login credentials. See Chapter 3 REST API Authentication.
Programming Guide Example: JSON Output The output of a successful export command is a .zip file at the specified location. Import XaaS Content You can use the content management service to import an XaaS content bundle. Input Table 4‑23. XaaS Import Input Parameters Name Parameter file Identifies the .zip file that is the content bundle to import. prefix The prefix to use with imported objects. Ensures avoidance of a duplicate name failure.
Programming Guide Example: JSON Output The output of the command is a message indicating the status and details of the import operation. { "importStatus" : "SUCCESSFUL", "data" : [ { "logLevel" : "INFO", "entityType" : "com.vmware.vcac.designer.service.domain.ServiceBlueprint", "entityId" : "4740aa54-61e6-47d7-945f-0bb50ff153c8", "entityName" : "XaaSBlueprint", "messageKey" : "import.blueprint.success", "message" : "Success" } ] } VMware, Inc.
Filtering and Formatting REST API Information 5 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 6 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 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. For information about vRealize CloudClient, see the VMware Developer site at https://developercenter.vmware.com/tools.
Programming Guide The postData section shows the JSON data passed in the HTTP POST call. You can insert the JSON data in a JSON file, for example request.json, and submit it with the POST method in the command line. Note Click Clear to purge the network logs if they become too large to navigate easily. 6 Enter the following call in the vRealize Automation shell, where the request.json text file contains the JSON data from the postData section.