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–2016 VMware, Inc. All rights reserved. Copyright and trademark information. VMware, Inc.
Contents vRealize Automation Programming Guide 6 1 Overview of the vRealize Automation REST API 7 2 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 3 REST API Use Cases 16 Create a Tenant 17 Syntax for Displaying Your Current Tenants Syntax for Requesting a New Tenant 20 23 Syntax for Listing All Tenant Identity Stores 26 Syntax for Linkin
Programming Guide Manage Provisioned Deployments 97 Syntax for Getting Deployment Details 99 Syntax for Navigating to the Children of a Deployed Resource 103 Perform a Day 2 Action: Power Off 109 Perform a Day 2 Action: Change Lease Working with Reservations Create a Reservation 112 113 Display a List of Reservations Update a Reservation Delete a Reservation 263 274 283 Working with Reservation Policies List Reservation Policies 285 285 Create a Reservation Policy 288 Display a Reservation
Programming Guide 4 Related Tools and Documentation 385 Using the vRealize Automation API Reference View Reference Information for an API Using vRealize CloudClient Using Third Party Tools 385 386 386 387 5 Filtering and Formatting REST API Information 389 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.
Overview of the vRealize Automation REST API 1 The vRealize Automation REST API provides consumer, administrator, and provider-level access to the service catalog with the same services that support the vRealize Automation console user interface. You can perform vRealize Automation functions programmatically by using REST API service calls. The vRealize Automation REST API offers the following services and functions. Table 1‑1.
Programming Guide Table 1‑1. vRealize Automation REST API Services (Continued) Service Description Identity Service Manage tenants, business groups, SSO and custom groups, users, and identity stores. IP Address Management Service Allocate and deallocate IP addresses from IP address management (IPAM) providers. Licensing Service Retrieve permissions and post serial keys. Management Service (Reclamation Service) Retrieve work item forms, callbacks, and tasks.
Programming Guide When a service request contains a resource URL, the first part of the URL identifies the service and the last part identifies the resource.
REST API Authentication 2 In the REST API, vRealize Automation requires HTTP bearer tokens in request headers for authentication of consumer requests. A consumer request applies to tasks that you can perform in the vRealize Automation console, such as requesting a machine. To acquire an HTTP bearer token, you authenticate with an identity service that manages the communication with the SSO server.
Programming Guide The effective duration or lifetime of an HTTP bearer token depends on the duration of its corresponding SAML token, which the SSO server creates at request time. An HTTP bearer token expires when it reaches the end of its configured duration, or at the end of the configured duration of the SAML token, whichever comes first. For example, if the configured duration is three days for the HTTP bearer token and two days for the SAML token, the HTTP bearer token expires in two days.
Programming Guide Procedure u Enter a curl command in the following format, replacing the variables with the correct values. The variable $vRA used in this example represents the host name.domain name of the vRealize Automation server, for example, mycompany.mktg.mydomain.com.
Programming Guide A consumer request must specify the correct component registry service and resource. For example, the URL to obtain an HTTP bearer token must contain the identity service and token resource values. Input Description host host name.domain name of the vRealize Automation server, for example, mycompany.mktg.mydomain.com. usrname Specifies the tenant administrator user name. passwd Specifies the tenant administrator password.
Programming Guide Validate an HTTP Bearer Token You can validate an existing HTTP bearer token. Prerequisites n Request an HTTP Bearer Token. Procedure u Create the request to validate the HTTP bearer token, as in the following example.
Programming Guide Status Code Description 204 NO CONTENT The request succeeded. The resource has been deleted. 401 UNAUTHORIZED You must have authentication credentials to access the resource. All requests must be authenticated. 403 FORBIDDEN Your authentication credentials do not provide sufficient access to the resource. 404 NOT FOUND Could not locate the resource based on the specified URI. 405 METHOD NOT ALLOWED The DELETE method is not supported for the resource.
REST API Use Cases 3 Available use cases provide the prerequisite, command line options and format, and sample results to help you perform a variety of vRealize Automation functions, such as requesting a machine or creating a reservation. You can find information about all of the available vRealize Automation REST API calls in the vRealize Automation API Reference zip file located in the vRealize Automation Documentation Center.
Programming Guide n Working with Reservation Policies You can use the vRealize Automation REST API to work with the reservation service to perform a variety of functions, such as creating and updating reservation policies. n Working with Key Pairs You can work with the keyValuePair data element of the REST API workitem service to list, create, and update key pairs.
Programming Guide n Syntax for Listing All Tenant Identity Stores You can use the REST API identity service to list all available identity stores for a named vRealize Automation tenant, such as the default tenant vsphere.local. n 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.
Programming Guide "description" : "Tenant for all developers", "contactEmail" : "admin@mycompany.com", "defaultTenant" : false } Examples Example 1 Call the above newTenant.json file, which contains parameters for the tenant request. Example 2 Specify the parameters for the tenant request by using inline text. 3 Command curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$host/identity/api/tenants/development --data @C:\Temp\newTenant.
Programming Guide "url": "ldap://10.000.00.000:389", "userBaseSearchDn": "ou=demo,dc=example,dc=mycompany,dc=com", "userNameDn": "cn=demoadmin,ou=demo,dc=example,dc=mycompany,dc=com" } Use the following command to call the example JSON text file and link an identity store to a tenant. The command also tests that vRealize Automation can connect to the identity store successfully. If the command finishes successfully, vRealize Automation succeeded in connecting to the identity store.
Programming Guide Parameter Description URL https://$host/identity/api/tenants $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. 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 Self refers to the object that was returned or requested. This parameter does not appear when you query a single profile. n 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 Self refers to the object that was returned or requested. This parameter does not appear when you query a single profile. n 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 Submit a request for a new tenant and either call a JSON file that contains tenant request parameters or specify those parameters using inline text. The first example uses a JSON file as input. The second example uses inline text as input. The first example calls the following sample newTenant.json file.
Programming Guide Output The command output contains property names and values based on the command input parameters. 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 Self refers to the object that was returned or requested. This parameter does not appear when you query a single profile. n First, Previous, Next, and Last refer to corresponding pages of pageable lists.
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 Self refers to the object that was returned or requested. This parameter does not appear when you query a single profile. n 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 Self refers to the object that was returned or requested. This parameter does not appear when you query a single profile. n n First, Previous, Next, and Last refer to corresponding pages of pageable lists.
Programming Guide "locked" : false, "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 Syntax for Displaying all Roles Assigned to a User You can use the REST API identity service to display all of the roles assigned to a user. 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.
Programming Guide "name" : "Tenant Administrator", "description" : "ABX Tenant Administrator", "assignedPermissions" : [ { "id" : "CATALOG_CONSUME_TENANT_MGMT", "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 "totalElements" : 1, "totalPages" : 1, "number" : 1, "offset" : 0 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 n Syntax for Requesting a Machine You can use the REST API catalog service to submit a machine request. n Syntax for Viewing Details of a Machine Request You can use the vRealize Automation REST API catalog service to view the details of a machine request. Procedure 1 List all shared catalog items in the catalog. You can browse the API and use HATEOAS links to navigate to additional API calls that are relevant to the current context.
Programming Guide Review the contents of the template and edit the values if you want to change them from the default prior to submitting the request. For example, you can specify a value for the description field or change the values for the machine resources if the blueprint allows for a range. 5 Submit the request.
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 For specific information about catalog service filters, see the "Important Notes About catalog-service and OData Queries" topic located at https://$host/catalog-service/api/docs/index.html. Input Use the supported input parameters to control the command output. Parameter Description URL https://$host/catalog-service/api/consumer/catalogItems $host Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server.
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 a Template Request for a Catalog Item You can use the REST API catalog service to request catalog items. VMware supplies a number of templates to help you create different types of machine requests.
Programming Guide Input Use the supported input parameters to control the command output. Parameter Description id The UUID of the catalog item. Output The command output contains property names and values based on the command input parameters. Property Description entitledOrganizations The list of organizations in which the current user can consume the catalog item. catalogItemId Specifies the catalog item identifier.
Programming Guide "vSphere-Linux": { "componentTypeId": "com.vmware.csp.component.cafe.composition", "componentId": null, "classId": "Blueprint.Component.Declaration", "typeFilter": "LinuxDemo*vSphere-Linux", "data": { "Cafe.Shim.VirtualMachine.MaxCost": 0, "Cafe.Shim.VirtualMachine.
Programming Guide }, "max_network_adapters": 0, "max_per_user": 0, "max_volumes": 60, "memory": 4096, "nics": [ { "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Compute.Machine.
Programming Guide Syntax for Requesting a Machine You can use the REST API catalog service to submit a machine request.
Programming Guide Property Description version Displays the object version number. state Specifies the item state, such as submitted. approvalStatus Specifies a status indicating whether this request has been approved, rejected, or is still pending some form of approval. waitingStatus Specifies a status indicating whether this request is waiting on any external users or services before it is able to progress. requestNumber Specifies a more user-friendly identifier for this request.
Programming Guide Property Description requestedItemDescription Specifies the item description. components Returns the list of components associated with the request. The provider supplies this list of components after request initialization.
Programming Guide Vary = Accept-Encoding,User-Agent Keep-Alive = timeout=15, max=100 Connection = Keep-Alive } null Syntax for Viewing Details of a Machine Request You can use the vRealize Automation REST API catalog service to view the details of a machine request. Request Status Typically, the request status information is the most important part of request details. The phase field corresponds to the status displayed in the Requests tab in the interface.
Programming Guide Property Description version Displays the object version number. state Specifies the item state, such as submitted. approvalStatus Specifies a status indicating whether this request has been approved, rejected, or is still pending some form of approval. waitingStatus Specifies a status indicating whether this request is waiting on any external users or services before it is able to progress. requestNumber Specifies a more user-friendly identifier for this request.
Programming Guide Property Description requestedItemDescription Specifies the item description. components Returns the list of components associated with the request. The provider supplies this list of components after request initialization. Example: curl Command The following example command displays details of a request.
Programming Guide "requestedItemName": "Linux", "requestedItemDescription": "Linux blueprint for API demo", "stateName": "Successful", "approvalStatus": "POST_APPROVED", "executionStatus": "STOPPED", "waitingStatus": "NOT_WAITING", "phase": "SUCCESSFUL", "catalogItemRef": { "id": "7c8275d6-1bd6-452a-97c4-d6c053e4baa4", "label": "Linux" } } Approve a Machine Request You can use a sequence of REST API workitem service commands to approve a machine request.
Programming Guide n Syntax for Updating Cost Information You can use the composition service to update and display cost information for a deployment. The cost of a deployment is based on which blueprint you request plus details of the specific request. For example, if the blueprint allows for a range of CPU, memory, or storage values, the cost depends on the value requested. Procedure 1 List all available work item IDs.
Programming Guide Inputs Use the supported input parameters to control the command output. Parameter Description URL https://$host/workitem-service/api/workitems $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.
Programming Guide Property Description completedBy Specifies the principal ID of user who completed the work item. availableActions Contains a list of relevant work item actions. Metadata Specifies the paging-related data: n Size: Specifies the maximum number of rows per page. n totalElement: Specifies the number of rows returned. n totalPages: Specifies the total number of pages of data available. n Number: Specifies the current page number. n Offset: Specifies the number of rows skipped.
Programming Guide } }, { "id" : "com.mycompany.cafe.samples.travel.workItem.cancel", "name" : "Workspace Unavailable", "stateName" : "Cancelled", "icon" : { "id" : "b03f994a-e1ec-4aae-8fae-e747ed680a5e", "name" : "Cancel Action Icon", "contentType" : "image/png", "image" : null } } ], "completeByEmail" : true, "commentsField" : null, "listView" : { "columns" : [ { "id" : "duration", "label" : "Duration", "description" : "The length of stay, measured in days.
Programming Guide "dataType" : { "type" : "primitive", "typeId" : "DATE_TIME" }, "displayAdvice" : null, "state" : { "dependencies" : [ ], "facets" : [ ] }, "filterable" : false, "sortable" : false, "isMultiValued" : false } ], "defaultSequence" : [ "location", "arrivalDate", "duration" ] }, "version" : 3, "forms" : { "workItemDetails" : { "type" : "external", "formId" : "travel.seating.task" }, "workItemSubmission" : { "type" : "external", "formId" : "travel.seating.
Programming Guide } }, { "key" : "approvalId", "value" : { "type" : "string", "value" : "7a8b6054-1922-4f82-9266-245dffaa957c" } }, { "key" : "requestClassId", "value" : { "type" : "string", "value" : "request" } }, { "key" : "requestedFor", "value" : { "type" : "string", "value" : "tony@example.mycompany.
Programming Guide "type" : "timeSpan", "unit" : "DAYS", "amount" : 1 } } }, { "key" : "requestingServiceId", "value" : { "type" : "string", "value" : "f91d044a-04f9-4b96-8542-375e3e4e1dc1" } }, { "key" : "policy", "value" : { "type" : "string", "value" : "test travel approval policy" } }, { "key" : "phase", "value" : { "type" : "string", "value" : "Pre Approval" } }, { "key" : "requestDescription", "value" : { "type" : "string", "value" : "t" } }, { "key" : "requestLease", "value" : { "type" : "timeSpan",
Programming Guide "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. Input Use the supported input parameters to control the command output.
Programming Guide Property Description completedDate Specifies the date when the work item was completed. assignedDate Specifies the date when the work item was assigned. createdDate Specifies the created date of this instance. assignedOrCompletedDate Specifies the date to be displayed on UI. formUrl Specifies the URL from which the layout for this work item can be retrieved. serviceId Specifies the service ID that generated this work item instance.
Programming Guide "tenantId" : "MYCOMPANY", "callbackEntityId" : "069dc3ce-a260-4d6a-b191-683141c994c0", "workItemType" : { "id" : "com.mycompany.csp.core.approval.workitem.request", "name" : "Approval", "pluralizedName" : "Approvals", "description" : "", "serviceTypeId" : "com.mycompany.csp.core.cafe.approvals", "actions" : [ { "id" : "com.mycompany.csp.core.approval.action.approve", "name" : "Approve", "stateName" : "Approved", "icon" : { "id" : "c192b6a7-5b35-4a3b-8593-107ffcf8c3a8", "name" : "approved.
Programming Guide "id" : "requestLease", "label" : "Lease", "description" : "", "dataType" : { "type" : "primitive", "typeId" : "TIME_SPAN" }, "displayAdvice" : null, "state" : { "dependencies" : [ ], "facets" : [ ] }, "filterable" : false, "sortable" : false, "isMultiValued" : false } ], "defaultSequence" : [ "requestRef", "requestedItemName", "requestedFor", "requestLease", "requestLeaseRate", "requestLeaseTotal" ] }, "version" : 1, "forms" : { "workItemDetails" : { "type" : "external", "formId" : "appro
Programming Guide }, { "key" : "requestClassId", "value" : { "type" : "string", "value" : "request" } }, { "key" : "requestedFor", "value" : { "type" : "string", "value" : "fritz@example.mycompany.com" } }, { "key" : "requestReasons", "value" : { "type" : "string", "value" : "" } }, { "key" : "requestedItemName", "value" : { "type" : "string", "value" : "test-blueprint" } . . . }, { "key" : "requestLease" }, { "key" : "requestedBy", "value" : { "type" : "string", "value" : "fritz@example.mycompany.
Programming Guide Template JSON File Values Copy the following template to start constructing a properly formatted JSON file in a text editor. Replace the highlighted values with your obtained work item details. After you create the JSON file, you can include it, or its contents, when you approve a submitted machine request. See Syntax for Approving a Submitted Machine Request. { "formData": { "entries": [ { "key": "source-source-provider-Cafe.Shim.VirtualMachine.
Programming Guide Table 3‑2. JSON Template Value Table JSON File Parameter Name Description of Value workItemId Specifies the value of the corresponding work item ID obtained from the work item list. source-source-providerCafe.Shim.VirtualMachine.NumberOfInstances value Specifies the number of instances requested. source-source-provider-VirtualMachine.Memory.Size Specifies the amount of memory requested in GB. source-source-provider-VirtualMachine.CPU.Count Specifies the number of CPUs requested.
Programming Guide "value": "fritz@example.mycompany.com" } }, { "key": "provider-VirtualMachine.CPU.Count", "value": { "type": "integer", "value": 1 } }, { "key": "provider-VirtualMachine.Memory.Size", "value": { "type": "integer", "value": 1024 } }, { "key": "provider-VirtualMachine.LeaseDays", "value": { "type": "integer", "value": 30 } }, { "key": "provider-__Notes", "value": { "type": "string", "value": "MYCOMPANY machine" } }, { "key": "provider-VirtualMachine.Disk0.
Programming Guide Syntax for Approving a Submitted Machine Request You can approve a work item request to complete the request by using the vRealize Automation REST API. To construct the approval command, you add work item and work item form details to a JSON file, and call that JSON file from the command line. Use a template to correctly format the JSON file content. Input Use the supported input parameters to control the command output.
Programming Guide Property Description assignedDate Specifies the date when the work item was assigned. createdDate Specifies the created date of this instance. assignedOrCompletedDate Specifies the date to be displayed on UI. formUrl Specifies the URL from which the layout for this work item can be retrieved. serviceId Specifies the service ID that generated this work item instance. work itemRequest Specifies the corresponding work item request object.
Programming Guide If a user who is not authorized to approve the request submits the request, the following error response is received: Command failed [Rest Error]: {Status code: 400}, {Error code: 12017} , {Error Source: null}, {Error Msg: User fritz@example.mycompany.com not authorized to complete work item with ID 5e3e9519-78ea-4409-a52c-e4aa3bc56511.}, {System Msg: User fritz@example.mycompany.com not authorized to complete Work item with id 5e3e9519-78ea-4409-a52c-e4aa3bc56511.
Programming Guide Parameter Description $token Specifies a valid HTTP bearer token with necessary credentials. HTTP Body Specifies the blueprint ID for the blueprint for which you are requesting cost information and other information. n Blueprint ID: Specifies the blueprint ID. n requestedFor: The user for whom this request is being made. Must be the fully qualified user ID.
Programming Guide Example: curl Command The following sample command updates and displays the cost of a sample blueprint with one node. The HTTP body is included as part of the command line input. curl -- insecure -H “Content Type: application/json” -H "Authorization: Bearer $token" https://$host/composition-service/api/blueprints/$BlueprintId/costs/upfront" { "blueprintId": "myblueprintId", "requestedFor": "fritz@coke.sqa-horizon.
Programming Guide Example: JSON Output for a Blueprint Cost Update [{"componentId":"vSphere_Machine_1", "setupFee":"$0.00", "totalLeasePriceInfo":{"min":50.0543225806451601,"max":50.0543225806451601,"displayString":"$50.05"}, "averageDailyPriceInfo":{"min":16.6847741935483867,"max":16.6847741935483867,"displayString":"$16.68"}, "count":3 "fieldMap":{"setup_fee":{"min":0,"max":0,"displayString":"$0.00"}, "memory":{"min":8.00,"max":8.00,"displayString":"$8.00"}, "additional":{"min":8.
Programming Guide n Syntax for Viewing Machine Details You can use the vRealize Automation REST API catalog service to display the machine details for a provisioned machine. Procedure 1 Display a list of all the provisioned resources. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$host/catalog-service/api/consumer/resources/?page=n&limit=n 2 Display a list of the provisioned resources filtered by machine resource type.
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 n Verify that you have a valid HTTP bearer token that matches your login credentials. See Chapter 2 REST API Authentication. n Obtain the business group subtenant ID values to specify on the command line. See Syntax for Getting Deployment Details. n Syntax for Getting Deployment Details You can use the REST API catalog service to identify provisioned items from a given request.
Programming Guide Then POST the unmodified template to the corresponding URI. $curl --insecure -s -H" Content-Type: multipart/form-data" -H "Authorization: Bearer $token"https://$host/catalog-service/api/consumer/resources/dd37b7a1-829c-4773-b5beb229453eca4a/actions/02bad06d-f92b-4cf8-b964-37bb5d57be38/requests { "type": "com.vmware.vcac.catalog.domain.request.
Programming Guide Accessing Links to Provisioned Items You can access links to provisioned items from a given request by appending /resourceViews to the request details URI. For instance, you can edit the example request URI from as follows: http://$host/catalog-service/api/consumer/requests/$requestId/resourceViews In addition to the general information about the provisioned deployment returned in the response, such as its name, description and ID, the response contains additional HATEOAS links.
Programming Guide Output The command output contains property names and values based on the command input parameters. Table 3‑5. Output Parameters Property Description resourceId The unique identifier of the resource. iconId Specifies an icon for this request based on the requested object type. name The user friendly name of the resource. description An extended user friendly description of the resource. status The status of the resource. For example, On, Off, etc.
Programming Guide Example: JSON Output { "links": [], "content": [ { "@type": "CatalogResourceView", "links": [ { "@type": "link", "rel": "GET: Catalog Item", "href": "https://$host/catalogservice/api/consumer/entitledCatalogItemViews/7c8275d6-1bd6-452a-97c4-d6c053e4baa4" }, { "@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.
Programming Guide "Connie Summers" ], "businessGroupId": "c0683388-6db2-4cb5-9033-b24d15ad3766", "tenantId": "mycompany", "dateCreated": "2015-07-29T13:51:36.368Z", "lastUpdated": "2015-07-29T13:55:35.
Programming Guide Parameter Description URL https://$host/catalog-service/api/consumer/resources/$resourceId $host Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server. $token Specifies a valid HTTP bearer token with necessary credentials. $resourceID Specifies a resource ID. See Syntax for Getting Deployment Details to view all of your requests and search for a request ID.
Programming Guide Table 3‑7. Output Parameters (Continued) Property Description lastUpdated The date and time at which the resource was most recently modified. lease The current lease of the resource. costs An optional rate card of the costs and charges levied against the resource. costToDate An optional rate card of the existing costs and charges levied against the resource. totalCost An optional rate card of the costs and charges levied for the entire lease period.
Programming Guide { "@type": "link", "rel": "GET Template: {com.vmware.csp.component.iaas.proxy.provider@resource.action.name.machine.PowerOff}", "href": "https://$host/catalog-service/api/consumer/resources/dd37b7a1-829c-4773b5be-b229453eca4a/actions/02bad06d-f92b-4cf8-b964-37bb5d57be38/requests/template" }, { "@type": "link", "rel": "POST: {com.vmware.csp.component.iaas.proxy.provider@resource.action.name.machine.
Programming Guide }, "totalCost": null, "parentResourceId": "c4d3db3e-e397-44ff-a1c9-0ecebdba12f4", "hasChildren": false, "data": { "ChangeLease": true, "ConnectViaRdp": true, "ConnectViaVmrc": true, "DISK_VOLUMES": [ { "componentTypeId": "com.vmware.csp.component.iaas.proxy.provider", "componentId": null, "classId": "dynamicops.api.model.DiskInputModel", "typeFilter": null, "data": { "DISK_CAPACITY": 6, "DISK_INPUT_ID": "DISK_INPUT_ID1" } }, { "componentTypeId": "com.vmware.csp.component.iaas.proxy.
Programming Guide "NETWORK_MAC_ADDRESS": "00:50:56:ba:6b:85", "NETWORK_NAME": "VM Network SQA" } } ], "PowerOff": true, "Reboot": true, "Reconfigure": true, "Reprovision": true, "Reset": true, "SNAPSHOT_LIST": [], "Shutdown": true, "Suspend": true, "ip_address": "10.118.194.
Programming Guide twork.Network.Existing}", "owners": [ "Connie Summers" ], "businessGroupId": "c0683388-6db2-4cb5-9033-b24d15ad3766", "tenantId": "mycompany", "dateCreated": "2015-07-29T13:55:14.095Z", "lastUpdated": "2015-07-29T13:55:17.
Programming Guide Procedure 1 Get the template for the resource action request. $curl --insecure -s -H" Content-Type: multipart/form-data" -H "Authorization: Bearer $token" https://$host/catalog-service/api/consumer/resources/dd37b7a1-829c-4773-b5beb229453eca4a/actions/02bad06d-f92b-4cf8-b964-37bb5d57be38/requests/template This example command returns a response. HTTP/1.1 200 OK Server: Apache-Coyote/1.
Programming Guide Perform a Day 2 Action: Change Lease You can use the REST API catalog service to change a lease. For actions that require user input, you may need to edit the template prior to submitting the request. This command leverages the links for the change lease 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.csp.component.iaas.proxy.provider@resource.action.name.machine.
Programming Guide 2 Edit the template as desired. The template is populated with default values. In this example, the value of provider-ExpirationDate is set to the time at which the template was requested in UTC. Edit this value (for example, to change the expiration to a month from now). 3 Use a POST command to send the template without modification to the corresponding URI.
Programming Guide A reservation must belong to a business group, also referred to as a subtenant. A business group can have multiple reservations on the same resources or on different resources. Note The Reservation API now returns compute resource endpoint names within parentheses. You may need to update any client code which contains logic that uses compute resource names to account for this change.
Programming Guide 2 Display a schema definition for a reservation. a Display a schema definition 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 b Display a schema definition for an Amazon reservation.
Programming Guide 4 Obtain a compute resource for the vRealize Automation reservation by using the reservation service. Use the following command to get a compute resource for a vSphere reservation. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/dataservice/schema/Infrastructure.Reservation.Virtual.
Programming Guide 5 Use the vRealize Automation REST API reservation service to get a resources schema for any supported reservation type, including a vSphere, Amazon, or vCloud Air reservation. a Display information about available resources, such as storage and network information, for a vSphere reservation by using the reservation service. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/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 Verify that you have a valid HTTP bearer token that matches your login credentials. See Chapter 2 REST API Authentication. Procedure u Display a list of 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 3‑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 3‑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 Verify that you have a valid HTTP bearer token that matches your login credentials. See Chapter 2 REST API Authentication. n Obtain the schema class ID of the reservation type to create. See Display a List of Supported Reservation Types.
Programming Guide ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "networkProfile", "label": "Network Profile", "description": "The Network Profile", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "computeResource" ] }, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": true }, { "id": "allocationModel", "label": "Allocation Model", "description": "The allocation model for the reservation", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "readOnly", "value": { "type": "cons
Programming Guide "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide } }, "displayAdvice": "DATA_TABLE", "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false }, { "id": "computeResource", "label": "Compute Resource", "description": "The compute resource for the reservation", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "description": "The machine quota for the reservation", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false }, { "id": "reservationStorages", "label": "Storage", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide } ] }, "isMultiValued": false }, { "id": "storageReservationPriority", "label": "Priority", "description": "The reservation priority for the storage", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "computeResourceStorageTotalSizeGB", "label": "Total (GB)", "descrip
Programming Guide } } ] }, "isMultiValued": false }, { "id": "storageReservedSizeGB", "label": "This reservation reserved (GB)", "description": "The reserved capacity size (GB) for the storage", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false }, { "id": "storageEnabled", "label": "Enabled", "description": "Whether the storage is enabled to reserve", "dataType": { "type": "primitive", "typeId": "BOOLEAN"
Programming Guide "label": "Free (GB)", "description": "The free capacity (GB) for the storage", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "readOnly", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false } ] } }, "displayAdvice": "DATA_TABLE", "permissibleValues": { "type": "dynamic", "customAllowed": false, "dependencies": [ "computeResource" ] }, "stat
Programming Guide "isMultiValued": true } ] } Syntax for Displaying a Schema Definition for a vCloud 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 3‑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 Verify that you have a valid HTTP bearer token that matches your login credentials. See Chapter 2 REST API Authentication. Procedure u Get business group ID for a vRealize Automation reservation with the reservation service.
Programming Guide }, { "@type": "Subtenant", "id": "ef58f604-528d-4441-a219-4725bead629b", "name": "Test Sub Tenant", "description": "VMPS", "subtenantRoles": null, "extensionData": { "entries": [] }, "tenant": "qe" }, { "@type": "Subtenant", "id": "92926c91-37de-4647-9aee-70b8d557ce8d", "name": "Quality Engineering", "description": "created by demo content", "subtenantRoles": null, "extensionData": { "entries": [{ "key": "iaas-manager-emails", "value": { "type": "string", "value": " user1@mycompany.
Programming Guide Parameter Description $host Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server. $token Specifies a valid HTTP bearer token with necessary credentials. $tenantId Specifies the ID of the tenant. Use to indicate the tenant ID to be queried. Each subtenant, or business group, must belong to a tenant. Output The command output contains property names and values based on the command input parameters.
Programming Guide Example: curl Command The following example command retrieves all available business group, or subtenant, IDs. insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/identity/api/tenants/qe/subtenants Example: JSON Output In this example, all available business group, or subtenant, IDs are displayed. For related information about the subtenant ID ef58f604-528d-4441-a219-4725bead629b, see Create a Reservation.
Programming Guide "name": "Test Sub Tenant", "description": "VMPS", "subtenantRoles": null, "extensionData": { "entries": [] }, "tenant": "qe" }, { "@type": "Subtenant", "id": "92926c91-37de-4647-9aee-70b8d557ce8d", "name": "Quality Engineering", "description": "created by demo content", "subtenantRoles": null, "extensionData": { "entries": [{ "key": "iaas-manager-emails", "value": { "type": "string", "value": " user1@mycompany.
Programming Guide For example, for a vSphere, Amazon EC2, or vCloud reservation type schema definition, the following permissibleValues field in the compute resource output indicates if the compute resource is available and if it has any dependencies. “permissibleValues": {"type": "dynamic","customAllowed": false, "dependencies": []} Procedure u Use the following command to get a compute resource. Command to get a compute resource for vSphere reservation.
Programming Guide "id": "a4349488-9a56-4906-83a5-7d8b33c9d435", "label": "NSX61-RC-ManagementCluster" }, "label": "NSX61-RC-ManagementCluster" }, { "underlyingValue": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "40b151ce-e409-4d2a-8dae-bb456139a660", "label": "NSX61-RC-ComputeClusterB" }, "label": "NSX61-RC-ComputeClusterB" }, { "underlyingValue": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "cc254a84-95b8-434a-874d-bdfef8e8ad2c", "labe
Programming Guide "componentId": null, "classId": "ComputeResource", "id": "9d1a3b5a-7162-4a5a-85b7-ec1b2824f554", "label": "EC2 841 Endpoint-us-east-1" }, "label": "EC2 841 Endpoint-us-east-1" } ] } JSON output for a vCloud Reservation { "values": [ { "underlyingValue": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "c527a0f5-b1ae-4b61-8145-ad9d5c434dc7", "label": "Engineering Allocation VDC" }, "label": "Engineering Allocation VDC" } ] } Syntax for Getting a Compute Res
Programming Guide Parameter Description $schemaclassid Specifies the schema class ID. For a vSphere reservation, specify Infrastructure.Reservation.Virtual.vSphere as the $schemaclassid value. For an Amazon EC2 reservation, specify Infrastructure.Reservation.Cloud.Amazon as the the $schemaclassid value. For a vCloud reservation, specify Infrastructure.Reservation.Cloud.vCloud as the the $schemaclassid value.
Programming Guide Example: curl Command for a vSphere reservation The following command retrieves a compute resource for a vSphere reservation. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/dataservice/schema/Infrastructure.Reservation.Virtual.vSphere/default/computeResource/values -d “{}” Example: curl Command for an Amazon EC2 reservation The following command retrieves a compute resource for an Amazon EC2 reservation.
Programming Guide "id": "a4349488-9a56-4906-83a5-7d8b33c9d435", "label": "NSX61-RC-ManagementCluster" }, "label": "NSX61-RC-ManagementCluster" }, { "underlyingValue": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "40b151ce-e409-4d2a-8dae-bb456139a660", "label": "NSX61-RC-ComputeClusterB" }, "label": "NSX61-RC-ComputeClusterB" }, { "underlyingValue": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "cc254a84-95b8-434a-874d-bdfef8e8ad2c", "labe
Programming Guide }, { "underlyingValue": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "9d1a3b5a-7162-4a5a-85b7-ec1b2824f554", "label": "EC2 841 Endpoint-us-east-1" }, "label": "EC2 841 Endpoint-us-east-1" } ] } Example: Output for a vCloud Reservation In this example, there is 1 available compute resource that you can use to create a vCloud reservation.
Programming Guide Procedure u Display information about available resources. The following example command queries resource pool information for the compute resource cc254a84-95b8-434a-874d-bdfef8e8ad2c. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/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 3‑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 3‑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 3‑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 Verify that you have a valid HTTP bearer token that matches your login credentials. See Chapter 2 REST API Authentication. n Finish creating a new reservation. Obtain the reservation ID from the output URL. See Syntax for Creating a vSphere Reservation.
Programming Guide "referenceResourceId": "cpu", "id": "cpu" }, { "alertPercentLevel": 40, "referenceResourceId": "machine", "id": "machine" }] }, "extensionData": { "entries": [{ "key": "key4", "value": { "type": "string", "value": "custom-property-value4" } }, { "key": "key3", "value": { "type": "string", "value": "custom-property-value3" } }, { "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.
Programming Guide }] } }] } }, { "key": "key0", "value": { "type": "string", "value": "custom-property-value0" } }, { "key": "key2", "value": { "type": "string", "value": "custom-property-value2" } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "047e00f5-5424-4ed2-a751-4a334aeaff54", "label": "VC51-Cluster" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 2 } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide } }, { "key": "storageFreeSizeGB", "value": { "type": "integer", "value": 120 } }, { "key": "reservationStorageReservationPriority", "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "value": { "type": "entityRef", "componentId": null, "classId": "ResourcePools", "id": "4e51fabc-19e8-4e79-b413-d52309b3bb62", "label": "CoreDev" } }] } } Example Output for a vCloud Reservation { "id": "bf922450-d495-460d-9dbf-1c09b0692db2", "name": "TestvAppReservation", "rese
Programming Guide { "alertPercentLevel": 80, "referenceResourceId": "memory", "id": "memory" }, { "alertPercentLevel": 80, "referenceResourceId": "cpu", "id": "cpu" }, { "alertPercentLevel": 80, "referenceResourceId": "machine", "id": "machine" } ] }, "extensionData": { "entries": [ { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "c527a0f5-b1ae-4b61-8145-ad9d5c434dc7", "label": "Engineering Allocation VDC" } }, { "key": "machineQuota", "v
Programming Guide "values": { "entries": [ { "key": "networkPath", "value": { "type": "entityRef", "componentId": null, "classId": "Network", "id": "42c5063c-5422-448f-aac7-22ebe941ac8e", "label": "VM Network SQA" } } ] } } ] } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [ { "type": "complex", "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide }, { "key": "storageReservedSizeGB", "value": { "type": "integer", "value": 100 } }, { "key": "storageEnabled", "value": { "type": "boolean", "value": true } }, { "key": "computeResourceStorageFreeSizeGB", "value": { "type": "integer", "value": 691 } } ] } } ] } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide } ] } } Syntax for Verifying a Reservation and Getting Reservation Details After you create a vRealize Automation reservation, you can use the REST API reservation service and the reservation ID to verify that the reservation exists. You can also use the ID to get information about the reservation in preparation for updating or deleting it. Input Use the supported input parameters to control the command output.
Programming Guide Example: JSON Output for a vSphere Reservation The following JSON output is returned based on the command input. Copy the output response into an XML editor for future step usage. { "id": "94d74105-831a-4598-8f42-efd590fea15c ", "name": "TestReservation", "reservationTypeId": "Infrastructure.Reservation.Virtual.
Programming Guide } }, { "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "componentId": null, "classId": "reservationStorage", "typeFilter": null, "values": { "entries": [{ "key": "storageTotalSizeGB", "value": { "type": "integer", "value": 394 } }, { "key": "reservationStorageReservedSizeGB", "value": { "type": "integer", "value": 31 } }, { "key": "reservationStorageEnabled", "value": { "type": "boolean", "value": true } }, { "key": "reservationStoragePath", "value": { "type": "entityRef", "componentId": null, "classId": "StoragePath", "id": "f48a527b-30a6-4d
Programming Guide "value": { "type": "entityRef", "componentId": null, "classId": "ResourcePools", "id": "4e51fabc-19e8-4e79-b413-d52309b3bb62", "label": "CoreDev" } }] } } Example: Example Output for a vCloud Reservation { "id": "bf922450-d495-460d-9dbf-1c09b0692db2", "name": "TestvAppReservation", "reservationTypeId": "Infrastructure.Reservation.Cloud.
Programming Guide { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "c527a0f5-b1ae-4b61-8145-ad9d5c434dc7", "label": "Engineering Allocation VDC" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 0 } }, { "key": "allocationModel", "value": { "type": "integer", "value": 0 } }, { "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [ { "type": "complex", "componentTypeId": "com.
Programming Guide "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [ { "type": "complex", "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide "value": 691 } } ] } } ] } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
Programming Guide n Verify that you have a valid HTTP bearer token that matches your login credentials. See Chapter 2 REST API Authentication. Procedure u Display a list of existing vRealize Automation reservations. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/reservation-service/api/reservations The following sample output lists two vSphere reservations, named MyTestReservation1 and MyTestReservation2 .
Programming Guide "key": "key4", "value": { "type": "string", "value": "custom-property-value4" } }, { "key": "key3", "value": { "type": "string", "value": "custom-property-value3" } }, { "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide }, { "key": "key2", "value": { "type": "string", "value": "custom-property-value2" } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "value": 2 } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "value": { "type": "entityRef", "componentId": null, "classId": "ResourcePools", "id": "4e51fabc-19e8-4e79-b413-d52309b3bb62", "label": "CoreDev" } }], "metadata": { "size": 0, "totalElements": 1, "totalPages": 1, "number": 1, "offset": 0 } } Syntax for Displaying a List of Reservations You can use the REST API reservation service to display a list of existing vRealize Automation reservations.
Programming Guide Property Description Links Species an array of link objects, each of which contains the following parts: rel href Specifies the name of the link. n Self refers to the object which was returned or requested. n First, Previous, Next, and Last refer to corresponding pages of pageable lists. n Specifies the application or service that determines the other names. Specifies the URL that produces the result.
Programming Guide "emailBgMgr": false, "recipients": ["user1@mycompany.com", "user2@mycompany.
Programming Guide "componentId": null, "classId": "NetworkProfile", "id": "ed5d1503-08ac-42ca-804d-9167834a63a5", "label": "ETEDoNotDelete2014-10-13 13:10:56" } }, { "key": "reservationNetworkPath", "value": { "type": "entityRef", "componentId": null, "classId": "Network", "id": "44cb65d5-b321-43dd-a2ab-8ecf387bff8f", "label": "VM Network SQA" } }] } }] } }, { "key": "key0", "value": { "type": "string", "value": "custom-property-value0" } }, { "key": "key2", "value": { "type": "string", "value": "custom-pr
Programming Guide } }] } } }, { "key": "key1", "value": { "type": "string", "value": "custom-property-value-Updated" } }, { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "047e00f5-5424-4ed2-a751-4a334aeaff54", "label": "VC51-Cluster" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 2 } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "component
Programming Guide { "key": "reservationStorageEnabled", "value": { "type": "boolean", "value": true } }, { "key": "reservationStoragePath", "value": { "type": "entityRef", "componentId": null, "classId": "StoragePath", "id": "f48a527b-30a6-4d54-8829-f549bc195b69", "label": "VNXe:qe-vnxe-nfs-1" } }, { "key": "storageFreeSizeGB", "value": { "type": "integer", "value": 120 } }, { "key": "reservationStorageReservationPriority", "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "v
Programming Guide Update a Reservation You can use the REST API reservation service to update an existing vRealize Automation reservation. Prerequisites n Log in to vRealize Automation as a fabric group administrator. n Verify that the host name and fully qualified domain name of the vRealize Automation instance are available. n Verify that you have a valid HTTP bearer token that matches your login credentials. See Chapter 2 REST API Authentication.
Programming Guide { "alertPercentLevel": 20, "referenceResourceId": "memory", "id": "memory" }, { "alertPercentLevel": 30, "referenceResourceId": "cpu", "id": "cpu" }, { "alertPercentLevel": 40, "referenceResourceId": "machine", "id": "machine" }] }, "extensionData": { "entries": [{ "key": "key4", "value": { "type": "string", "value": "custom-property-value4" } }, { "key": "key3", "value": { "type": "string", "value": "custom-property-value3" } }, { "key": "reservationNetworks", "value": { "type": "multipl
Programming Guide "value": { "type": "entityRef", "componentId": null, "classId": "Network", "id": "44cb65d5-b321-43dd-a2ab-8ecf387bff8f", "label": "VM Network SQA" } }] } }] } }, { "key": "key0", "value": { "type": "string", "value": "custom-property-value0" } }, { "key": "key2", "value": { "type": "string", "value": "custom-property-value2" } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
Programming Guide "value": { "type": "string", "value": "custom-property-value-Updated" } }, { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "047e00f5-5424-4ed2-a751-4a334aeaff54", "label": "VC51-Cluster" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 2 } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.
Programming Guide { "key": "reservationStoragePath", "value": { "type": "entityRef", "componentId": null, "classId": "StoragePath", "id": "f48a527b-30a6-4d54-8829-f549bc195b69", "label": "VNXe:qe-vnxe-nfs-1" } }, { "key": "storageFreeSizeGB", "value": { "type": "integer", "value": 120 } }, { "key": "reservationStorageReservationPriority", "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "value": { "type": "entityRef", "componentId": null, "classId": "ResourcePools", "id": "4
Programming Guide Parameter Description URL https://$host/reservation-service/api/reservations/$reservationId Method Put $host Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server. $token Specifies a valid HTTP bearer token with necessary credentials. $reservationId Specifies the unique identifier of the reservation to update. For information about how to obtain the reservation ID, see Syntax for Displaying a List of Reservations.
Programming Guide "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 Verify that you have a valid HTTP bearer token that matches your login credentials. See Chapter 2 REST API Authentication. n Obtain the reservation ID of the reservation that you want to delete. This information is required API command input. See Syntax for Displaying a List of Reservations.
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 Verify that you have a valid HTTP bearer token that matches your login credentials. See Chapter 2 REST API Authentication. n Obtain the reservation policy ID of the reservation policy to query. See Syntax for Listing Reservation Policies. Procedure u Display information about the reservation policy ID. The following example displays information about reservation policy 8adafb54-4c85-4478-86f0b6ae80ab5ca4.
Programming Guide Parameter Description $id Specifies the reservation policy ID. $name Specifies the reservation policy name. $description Specifies the reservation policy description. $reservationPolicyTypeId Specifies the reservation policy type ID. Example: Example: curl Command The following example command retrieves information for the reservation policy with an ID of 8adafb54-4c85-4478-86f0-b6ae80ab5ca4.
Programming Guide Procedure 1 Query the reservation policy and copy the response output to an editor. 2 Change the following information to use as the basis of the command input for this task. 3 n Reservation policy name n Reservation policy description n Reservation policy type ID Update the name and description values for the reservation policy ID. The following example syntax updates the information for reservation policy ID 94d74105-831a-4598-8f42-efd590fea15c.
Programming Guide Parameter Description $token Specifies a valid HTTP bearer token with necessary credentials. HTTP body Describes the reservation policy to update. To obtain the value, query the reservation policy and copy the response output to an editor for use as the basis of your command input. See Syntax for Displaying a Reservation Policy by ID.
Programming Guide n Verify that the host name and fully qualified domain name of the vRealize Automation instance are available. n Verify that you have a valid HTTP bearer token that matches your login credentials. See Chapter 2 REST API Authentication. n Get the required reservation policy ID. See Syntax for Listing Reservation Policies. Procedure u Delete the reservation policy ID. The following example syntax updates the information for reservation policy ID8adafb54-4c85-4478-86f0-b6ae80ab5ca4.
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 Self refers to the object that was returned or requested. This parameter does not appear when you query a single profile. n 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 Verify that you have a valid HTTP bearer token that matches your login credentials. See Chapter 2 REST API Authentication. n Get the required compute resource ID.
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 Verify that you have a valid HTTP bearer token that matches your login credentials. See Chapter 2 REST API Authentication. Procedure u Use the following sample command to update a key pair.
Programming Guide Syntax for Updating a Key Pair You can update an existing key pair by using the vRealize Automation REST API. Input Use the supported input parameters to control the command output. Parameter Description URL https://$host/iaas-proxy-provider/api/keyPairs/$id Method Put $host Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server. $token Specifies a valid HTTP bearer token with necessary credentials.
Programming Guide +J8DVhPB7PPdHJJ4E/6a9IXkNQs/T0NknCOyc0YcFVpgrc3PMGabi8vd/7v0nEtDARyA8WwAGgtedHGtBo2gciY1Bu/0SNr2yCzsZcq bVeg4ufkjlv0G1Ed1FfGHMh5kuVC7alk2aSI5YkWnS4d9YJYi7diYmc7GmrVW0XWNz4kEMdQBkK+CvMxiZ17jyQD +V4NuM4ydNPJJMqpvoAHtLrAmp/hXhInuf8j/l0mbawWSvUDUA3s4ZE55cFp546MJIrVCRyoMoKfxuHquIPdANRAVs7qo9DGxBiCzjv yBqof21y6dhGCd1q48Dkd72QCj6gGV84lHZ/zXWcz4+aKFRVolNqSZEtZ/9wzdjqYdn/ySl0S5GE2rG/xRsh6g +giB9j4VQOMvC/uvhkYUo3WfTgxi8SeipFIVcbvkkOI0ubPU1xnWdDErjji6UwEtmjajHuiA93GtiWIdeCvyKQWmo9jkkLUmQe4XrmR t3P09
Programming Guide Procedure u Use the following sample command to delete a key pair. curl –X “Delete” --insecure -H "Accept:application/json" -H "Authorization: Bearere $token" https://$host/iaas-proxy-provider/api/keyPairs/26 The output contains an empty HTTP response body and the following status code. 204 No Content Syntax for Deleting a Key Pair You can use the vRealize Automation REST API to delete a key pair. Prerequisites n Log in to vRealize Automation as a tenant administrator.
Programming Guide Example: curl Command The following example command deletes a key pair. curl –X “Delete” --insecure -H "Accept:application/json" -H "Authorization: Bearer $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.
Programming Guide Network Profile Type External Description All network profiles use the elements in the object definition for external network. The network definition specifies the network address configuration for the network. The external network definition can specify: n Existing network addresses configured on the vSphere server. They are the external part of the NAT and routed networks types. An external network profile can define a range of static IP addresses available on the external network.
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": "f6deba8c-fbf4-4ea0-9d9c-325e9db2f13e", "name": null, "description": null, "IPv4Address": "10.118.190.114", "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.
Programming Guide "dnsSuffix": "mycompany.com", "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 "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:25:57.000Z", "lastModifiedDate": "2014-11-11T02:25:57.000Z" }, ] } ], "profileType": "PRIVATE", "subnetMask": "255.255.255.0", "gatewayAddress": "10.118.190.230", "dhcpStartIPAddress": null, "dhcpEndIPAddress": null, "leaseTimeInSeconds": 0 }, { "@type": "RoutedNetworkProfile", "id": "a3dbfc76-7eab-4c1f-8f59-8fcc0b50ec6c", "name": "routedTest", "description": "", "createdDate": "2014-11-11T02:31:11.
Programming Guide "isHidden": false, "definedRanges": [ { "id": "3a85a049-522f-4b64-8f60-6e7b252ad204", "name": "range", "description": "", "beginIPv4Address": "10.110.183.200", "endIPv4Address": "10.110.183.201", "state": "UNALLOCATED", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z", "definedAddresses": [ { "id": "f229ea1a-18de-4dae-ae7b-0cec7feaa99b", "name": null, "description": null, "IPv4Address": "10.110.183.
Programming Guide "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.000Z", "lastModifiedDate": "2014-11-11T02:24:04.000Z" }, { "id": "c270ce8e-a418-4d02-89db-3b84f6816a75", "name": null, "description": null, "IPv4Address": "10.110.183.
Programming Guide "number": 1, "offset": 0 } } Syntax for Getting a Network Profile List You can use the vRealize Automation IaaS proxy provider REST API to get a list of current network profiles. Input Use the supported input parameters to control the command output. Parameter Description URL https://$host/iaas-proxy-provider/api/network/profiles Method Get $host Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server.
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 Self refers to the object that was returned or requested. This parameter does not appear when you query a single profile. n 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 If you are creating or querying an external network profile that uses extrernal, IPAM , specifies the endpoint ID for the external IPAM provider. If you are creating a network profile and the profile does not use external IPAM, code null for this value. n subnetMask: n gatewayAddress: Specifies the subnet mask. Specifies the IP address of the network gateway. n primaryDnsAddress: Specifies the IP address of the primary DNS server.
Programming Guide Parameter Description n baseIP: Specifies the base IP address. This parameter is only supported by routed network profiles. Metadata Specifies the following paging-related data: n Size: Specifies the maximum number of rows per page. n totalElement: Specifies the number of rows returned. This parameter is not output when you query for a single profile. n totalPages: Specifies the total number of pages of data available. n Number: Specifies the current page number.
Programming Guide "name": null, "description": null, "IPv4Address": "10.118.190.111", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.000Z", "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, { "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.
Programming Guide "name": null, "description": null, "IPv4Address": "10.118.190.112", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "createdDate": "2014-11-11T02:29:05.000Z", "lastModifiedDate": "2014-11-11T02:29:05.000Z" }, ] } ], "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 }, { "id": "7eebd0ad-0dde-4fa1-aad3-750498214caf", "name": null, "description": null, "IPv4Address": "10.118.190.110", "IPSortValue": 0, "state": "UNALLOCATED", "hostName": "", "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.
Programming Guide ], "profileType": "ROUTED", "subnetMask": "255.255.254.0", "primaryDnsAddress": "10.110.182.45", "secondaryDnsAddress": "", "dnsSuffix": "mycompany.com", "dnsSearchSuffix": "", "primaryWinsAddress": "10.0.0.1", "secondaryWinsAddress": "", "baseIP": "10.118.183.1" }, { "@type": "ExternalNetworkProfile", "id": "68b6a183-fc8a-4592-af23-92f8d410ee32", "name": "externalTest", "description": "", "createdDate": "2014-11-11T02:24:07.000Z", "lastModifiedDate": "2014-11-11T02:24:07.
Programming Guide "id": "67acdc6f-d0b9-4f47-a74b-ea58ff9ce074", "name": "range2", "description": "", "beginIPv4Address": "10.110.183.180", "endIPv4Address": "10.110.183.183", "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 ], "profileType": "EXTERNAL", "IPAMEndpointId": null, "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 Procedure u Use the following sample command to create a network profile. You can create an external, NAT, or routed network profile. The code in the sample command creates an external network profile without IPAM.
Programming Guide 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. Sample HTTP body field values are presented in the JSON Output section of the Syntax for Getting a Network Profile List topic.
Programming Guide "dnsSuffix": "mycompany.com", "dnsSearchSuffix": "", "primaryWinsAddress": "10.0.0.1", "secondaryWinsAddress": "" } “ Example: JSON Output The JSON output consists of a location URL, which points to the newly created network profile. The output contains an empty HTTP response body and the following or similar header statement. Copy the location URL into a text editor for future use. Location: https://vcac148-084-241.eng.mycompany.
Programming Guide Input Description $token Specifies a valid HTTP bearer token with necessary credentials. HTTP Body The HTTP body specifies the information for creating an external IPAM profile. n profileType Specify EXTERNAL for this paramter. n id Specifies null. n name Specifies the name of the profile. n IPAMEndpointId Specifies the endpoint ID for an external IPAM provider. n addressSpaceExternalId Must specify the value that is chosen in the vRealize Automation UI for Address Space.
Programming Guide Example: curl Command The following example command creates an external IPAM profile.
Programming Guide n Obtain the network profile ID to query. See Get a Network Profile List. Procedure u Use the following command to query the existing network profile ID 68b6a183-fc8a-4592af23-92f8d410ee32. Note The output shown in the following example, shows profile for one address range. A network profile can also contain multiple ranges.
Programming Guide "hostName": "", "createdDate": "2014-11-11T02:23:38.000Z", "lastModifiedDate": "2014-11-11T02:23:38.000Z" }, } ], "profileType": "EXTERNAL", "IPAMEndpointId": null, "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 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 Self refers to the object that was returned or requested. This property does not exist when you query for a single profile. n 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 IPAMEndpointId If you are querying an external network profile that uses external IPAM, shows the endpoint ID for the external IPAM provider. n subnetMask: n gatewayAddress: Specifies the subnet mask. 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.
Programming Guide Parameter Description n Size: Specifies the maximum number of rows per page. n totalElement: Specifies the number of rows returned. This parameter is not output when you query for a single profile. 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 { "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" }, } ], "profileType": "EXTERNAL", "IPAMEndpointId": null, "subnetMask": "255.255.255.0", "gatewayAddress": "10.110.183.253", "primaryDnsAddress": "10.110.182.45", "secondaryDnsAddress": "", "dnsSuffix": "mycompany.
Programming Guide "name": "externalTestEdit", "description": "", "createdDate": "2014-11-16T09:11:55.000Z", "lastModifiedDate": "2014-11-16T09:11:55.000Z", "isHidden": false, "definedRanges": [ { "id": "ce266d4c-5fbb-47a9-a391-c77444c20b09", "name": "range", "description": "", "beginIPv4Address": "10.110.183.239", "endIPv4Address": "10.110.183.240", "state": "UNALLOCATED", "createdDate": "2014-11-16T09:11:55.000Z", "lastModifiedDate": "2014-11-16T09:11:55.
Programming Guide 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 a status statement. Parameter Description status If the command is not successful, the HTTP status is 204 No Content.
Programming Guide "primaryWinsAddress": "10.0.0.1", "secondaryWinsAddress": "" } “ 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 URL https://$host/iaas-proxy-provider/api/network/profiles/$id Method Delete $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 network profile identifier. Output The command output contains a status statement.
Programming Guide Procedure u Use the following command to query an IPAM endpoint for a list of configured IP address ranges. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$host/ ipam-service/api/providers//ip-ranges where ENDPOINT_ID is the endpoint ID of the external IPAM service provider. The following JSON output is returned based on the command input. { "links": [], "content": [ { "@type": "IPRange", "id": null, "name": "192.168.0.
Programming Guide "dnsSearchSuffixes": "search.sqa.local,search2.sqa.local", "preferredWINS": "", "alternateWINS": "" }, "addressSpaceId": "default" }, { "@type": "IPRange", "id": null, "name": "192.168.1.
Programming Guide "description": "Created by vRO package stub workflow", "extensionData": { "entries": [ { "key": "Building", "value": { "type": "string", "value": "Building 2" } }, { "key": "City", "value": { "type": "string", "value": "Santa Clara" } } ] }, "providerEndpointId": "C20F305C-07A5-4BA7-88AC-35DA7B9713E0", "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.2.
Programming Guide { "key": "City", "value": { "type": "string", "value": "Boston" } } ] }, "providerEndpointId": "C20F305C-07A5-4BA7-88AC-35DA7B9713E0", "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.3.0", "subnetPrefixLength": 24, "externalId": "network-3", "dnsInfo": { "@type": "DNSInfo", "id": null, "name": null, "description": null, "dnsSuffix": "sqa.local", "primaryDNS": "", "secondaryDNS": "", "dnsSearchSuffixes": "search.sqa.local,search2.sqa.
Programming Guide "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.4.0", "subnetPrefixLength": 24, "externalId": "network-4", "dnsInfo": { "@type": "DNSInfo", "id": null, "name": null, "description": null, "dnsSuffix": "sqa.local", "primaryDNS": "", "secondaryDNS": "", "dnsSearchSuffixes": "search.sqa.local,search2.sqa.local", "preferredWINS": "", "alternateWINS": "" }, "addressSpaceId": "default" }, { "@type": "IPRange", "id": null, "name": "192.168.5.
Programming Guide "name": null, "description": null, "dnsSuffix": "sqa.local", "primaryDNS": "", "secondaryDNS": "", "dnsSearchSuffixes": "search.sqa.local,search2.sqa.local", "preferredWINS": "", "alternateWINS": "" }, "addressSpaceId": "default" }, { "@type": "IPRange", "id": null, "name": "192.168.6.
Programming Guide }, { "@type": "IPRange", "id": null, "name": "192.168.7.0/24", "description": "Created by vRO package stub workflow", "extensionData": { "entries": [ { "key": "Building", "value": { "type": "string", "value": "Building 7" } }, { "key": "City", "value": { "type": "string", "value": "Boston" } } ] }, "providerEndpointId": "C20F305C-07A5-4BA7-88AC-35DA7B9713E0", "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.7.
Programming Guide "value": { "type": "string", "value": "Building 8" } }, { "key": "City", "value": { "type": "string", "value": "Santa Clara" } } ] }, "providerEndpointId": "C20F305C-07A5-4BA7-88AC-35DA7B9713E0", "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.8.0", "subnetPrefixLength": 24, "externalId": "network-8", "dnsInfo": { "@type": "DNSInfo", "id": null, "name": null, "description": null, "dnsSuffix": "sqa.
Programming Guide } } ] }, "providerEndpointId": "C20F305C-07A5-4BA7-88AC-35DA7B9713E0", "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.9.0", "subnetPrefixLength": 24, "externalId": "network-9", "dnsInfo": { "@type": "DNSInfo", "id": null, "name": null, "description": null, "dnsSuffix": "sqa.local", "primaryDNS": "", "secondaryDNS": "", "dnsSearchSuffixes": "search.sqa.local,search2.sqa.
Programming Guide "subnetPrefixLength": 24, "externalId": "network-10", "dnsInfo": { "@type": "DNSInfo", "id": null, "name": null, "description": null, "dnsSuffix": "sqa.local", "primaryDNS": "", "secondaryDNS": "", "dnsSearchSuffixes": "search.sqa.local,search2.sqa.local", "preferredWINS": "", "alternateWINS": "" }, "addressSpaceId": "default" }, { "@type": "IPRange", "id": null, "name": "192.168.11.
Programming Guide "dnsSearchSuffixes": "search.sqa.local,search2.sqa.local", "preferredWINS": "", "alternateWINS": "" }, "addressSpaceId": "default" }, { "@type": "IPRange", "id": null, "name": "192.168.12.
Programming Guide "description": "Created by vRO package stub workflow", "extensionData": { "entries": [ { "key": "Building", "value": { "type": "string", "value": "Building 13" } }, { "key": "City", "value": { "type": "string", "value": "Boston" } } ] }, "providerEndpointId": "C20F305C-07A5-4BA7-88AC-35DA7B9713E0", "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.13.
Programming Guide { "key": "City", "value": { "type": "string", "value": "Santa Clara" } } ] }, "providerEndpointId": "C20F305C-07A5-4BA7-88AC-35DA7B9713E0", "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.14.0", "subnetPrefixLength": 24, "externalId": "network-14", "dnsInfo": { "@type": "DNSInfo", "id": null, "name": null, "description": null, "dnsSuffix": "sqa.local", "primaryDNS": "", "secondaryDNS": "", "dnsSearchSuffixes": "search.sqa.local,search2.
Programming Guide "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.15.0", "subnetPrefixLength": 24, "externalId": "network-15", "dnsInfo": { "@type": "DNSInfo", "id": null, "name": null, "description": null, "dnsSuffix": "sqa.local", "primaryDNS": "", "secondaryDNS": "", "dnsSearchSuffixes": "search.sqa.local,search2.sqa.local", "preferredWINS": "", "alternateWINS": "" }, "addressSpaceId": "default" }, { "@type": "IPRange", "id": null, "name": "192.168.16.
Programming Guide "name": null, "description": null, "dnsSuffix": "sqa.local", "primaryDNS": "", "secondaryDNS": "", "dnsSearchSuffixes": "search.sqa.local,search2.sqa.local", "preferredWINS": "", "alternateWINS": "" }, "addressSpaceId": "default" }, { "@type": "IPRange", "id": null, "name": "192.168.17.
Programming Guide }, { "@type": "IPRange", "id": null, "name": "192.168.18.0/24", "description": "Created by vRO package stub workflow", "extensionData": { "entries": [ { "key": "Building", "value": { "type": "string", "value": "Building 18" } }, { "key": "City", "value": { "type": "string", "value": "Santa Clara" } } ] }, "providerEndpointId": "C20F305C-07A5-4BA7-88AC-35DA7B9713E0", "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.18.
Programming Guide "value": { "type": "string", "value": "Building 19" } }, { "key": "City", "value": { "type": "string", "value": "Boston" } } ] }, "providerEndpointId": "C20F305C-07A5-4BA7-88AC-35DA7B9713E0", "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.19.0", "subnetPrefixLength": 24, "externalId": "network-19", "dnsInfo": { "@type": "DNSInfo", "id": null, "name": null, "description": null, "dnsSuffix": "sqa.
Programming Guide vRealize Automation customers often experiment with system artifacts such as catalog items, XaaS services, resource actions, and IaaS blueprints in their development or staging environments. When appropriate, users need to move these artifacts to their production environments. Note You cannot import/export approval policies or entitlements. Also, you cannot import or export any content that is in a draft state.
Programming Guide Procedure 1 (Optional) Use the REST API content service to display a list of supported vRealize Automation content types. Typically, this step is required only if you are not familiar with the content on your system or if you need to verify the content. A content type describes the content that you can import or export using the content management service.
Programming Guide 7 Validate the package prior to importing it. The example uses the 'DukesBankApp.zip' which is out-of-box content provided on the vRealize Automation virtual appliance. You can copy the file from /usr/lib/vcac/tools/initialconfig/sample-oob-content/DukesBankApp.zip using WinSCP (Windows) or scp (Mac). $curl --insecure -s -H "Content-Type: multipart/form-data"-H "Authorization: Bearer $token" https://$host/content-management-service/api/packages/validate-F" file=@DukesBankApp.
Programming Guide Name Description Type page Page Number. Default is 1. Query limit Number of entries per page. Default is 20. Query $orderby Multiple comma-separated properties sorted in ascending or descending order. Query $top The number of returned entries from the top of the response (total number per page in relation to skip). Query $skip The number of entries to skip. Query $filter Boolean expression for whether a particular entry should be included in the response.
Programming Guide Example Curl Command The following example command returns a list of supported content types. $curl --insecure -s -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$host/content-management-service/api/provider/contenttypes Example: JSON Output The following JSON output is returned based on the command input.
Programming Guide "serviceTypeId": "com.vmware.csp.core.designer.service" }, { "@type": "ContentType", "id": "asd-resource-type", "name": "{com.vmware.csp.core.designer.service@resource.type.content.type.name}", "description": "{com.vmware.csp.core.designer.service@resource.type.content.type.description}", "classId": "asdResourceType", "serviceTypeId": "com.vmware.csp.core.designer.service" }, { "@type": "ContentType", "id": "asd-resource-mapping", "name": "{com.vmware.csp.core.designer.service@resource.
Programming Guide Name Description Type page Page Number. Default is 1. Query limit Number of entries per page. Default is 20. Query $orderby Multiple comma-separated properties sorted in ascending or descending order. Query $top The number of returned entries from the top of the response (total number per page in relation to skip). Query $skip The number of entries to skip. Query $filter Boolean expression for whether a particular entry should be included in the response.
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 Self refers to the object that was returned or requested. This parameter does not appear when you query a single profile. n 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 $curl --insecure -s -H "Content-Type: application/json"-H "Authorization: Bearer $token" https://$host/content-management-service/api/contents 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": [], "cr
Programming Guide "version": 0 }, { "@type": "Content", "id": "3922fda1-b5fd-4c51-997d-5f803ec6fb6e", "contentId": "e8ae6093-18a9-4ec9-a415-1ef850f243f9", "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.
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 Self refers to the object that was returned or requested. This parameter does not appear when you query a single profile. n 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 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 3‑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 3‑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 3‑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 2 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 3‑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.
Related Tools and Documentation 4 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 n As a zip file on the Product Documentation and Related Information page of the vRealize Automation Information Center. n In the Developer Resources section of the vRealize Automation Information Center. For information about requesting a bearer token, and about available pagination, sorting, and filtering options for any given command, see the Tips option on the vRealize Automation API landing page for the selected service API.
Programming Guide Using Third Party Tools You can use third party tools such as Chrome Developer Tools or Firebug to reveal the data that you can then use to construct a vRealize Automation REST API service call. You can adapt these steps to perform a different action, such as adding a tenant. Prerequisites This example shows how you might use the Chrome Developer Tools to perform a catalog service query. This option is not available for all vRealize Automation functions.
Programming Guide 6 Enter the following call in the vRealize Automation shell, where the request.json text file contains the JSON data from the postData section. rest post --headers --service catalog-service --uri consumer/requests --data request.json This call makes the same request that was submitted by using the console. VMware, Inc.
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.