-
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–2017 VMware, Inc. All rights reserved. Copyright and trademark information. VMware, Inc.
-
Contents vRealize Automation Programming Guide Updated Information 7 8 1 Overview of the vRealize Automation REST API 9 REST API Services 9 Using the vRealize Automation REST API 11 About the API Use Cases 12 2 REST API Authentication 13 About HTTP Bearer Tokens 13 Configure the Duration of an HTTP Bearer Token Request an HTTP Bearer Token 14 14 Syntax for Requesting an HTTP Bearer Token Validate an HTTP Bearer Token Delete an HTTP Bearer Token 16 17 18 3 Creating a Tenant 20 Prerequisites fo
-
Programming Guide 5 Approving a Machine Request 63 Approve a Machine Request 63 Work Item Service Examples for Approving a Machine Request Syntax for Listing Work Items 64 65 Syntax for Getting Work Item Details 71 Syntax for Constructing a JSON File to Approve a Machine Request Syntax for Approving a Submitted Machine Request Syntax for Updating Price Information 76 79 81 6 Listing Provisioned Resources 85 Prerequisites for Listing Provisioned Resources Display Your Provisioned Resources Exampl
-
Programming Guide Syntax for Displaying a Schema Definition for an Amazon Reservation 206 Syntax for Displaying a Schema Definition for a vCloud Air Reservation Syntax for Getting the Business Group ID for a Reservation Syntax for Getting a Compute Resource for a Reservation 233 236 Syntax for Getting Resources Schema for a vSphere Reservation 240 Syntax for Getting Resources Schema for an Amazon Reservation Syntax for Getting Resources Schema for a vCloud Air Reservation Syntax for Creating a vSpher
-
Programming Guide 13 Importing and Exporting Content 342 Understanding Blueprint Schema 343 Prerequisites for Importing and Exporting Content List Supported Content Types Example List Available Content Example 345 349 Filter Content by Content Type Example Create a Package for Export Example 354 355 List Packages in the Content Service Example Export a Package Example 345 356 360 Validate a Content Bundle Before Importing example Import a Package Example 360 363 Export XaaS Content Example 3
-
vRealize Automation Programming Guide The Programming Guide provides information about the vRealize Automation REST APIs, including how to use the REST API services and resources, create HTTP bearer tokens for authentication and authorization, and construct REST API service calls. Intended Audience This information is intended for administrators and programmers who want to configure and manage vRealize Automation programmatically using the vRealize Automation REST API.
-
Updated Information This Programming Guide is updated with each release of the product or when necessary. This table provides the update history of the Programming Guide. Revision Description 002448-01 n Removed Day 2 action terminology from Chapter 7 Managing Provisioned Deployments. n Clarified procedure in Viewing API Reference Information. 002448-00 VMware, Inc. Initial release.
-
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.
-
Programming Guide Table 1‑1. vRealize Automation REST API Services (Continued) Service Description Event Broker Service Provide a central location and a consistent way of recording events and querying for events. Forms Service Used internally by the vRealize Automation system to create, read, update and delete (perform CRUD operations on) request forms for XaaS components.
-
Programming Guide Table 1‑1. vRealize Automation REST API Services (Continued) Service Description Work Item Service Retrieve, create, update, complete, cancel, and delete a work item. Also retrieve form data, metadata, detail forms, and submission forms from service providers. XaaS Service Manages XaaS elements such as forms, endpoints, XaaS blueprints, tenants, vRealize Orchestrator imports, workflows, and work items.
-
Programming Guide About the API Use Cases While the vRealize Automation API Reference contains a menu that lists all REST API service calls, it does not document use cases. The Programming Guide provides frequently used use cases including sample requests and responses. The following REST API 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.
-
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 Configure the Duration of an HTTP Bearer Token You set the duration of HTTP bearer tokens in the /etc/vcac/security.properties file on the vRealize Automation appliance. 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.
-
Programming Guide Prerequisites n Secure a channel between the web browser and the vRealize Automation server. Open a browser and enter the URL such as: https://vra-appliance-name.company.com The system warns that your connection is not private. Click through to confirm the security exception and establish an SSL handshake. n Log in to vRealize Automation using the applicable credentials. For example, to assign a user to a role, log in as a tenant administrator.
-
Programming Guide If the credentials supplied in the Authorization header are invalid, the response includes status code 401 as in the following output.
Error reportHTTP Status 401 Authentication required
Syntax for Requesting an HTTP Bearer Token An HTTP bearer token is required by the REST client to use the vRealize Automation REST API. You obtain a bearer token by authenticating to the identity service.
-
Programming Guide Example: curl Command to Request HTTP Bearer Token The following example command requests an HTTP bearer token. curl --insecure -H "Accept: application/json" -H 'Content-Type: application/json' --data '{"username":"usrname","password":"passwd","tenant":"tenantURLtoken"}' https://$vRA/identity/api/tokens When your request succeeds, the system returns the expiration date and time of the token, and the HTTP bearer token.
-
Programming Guide Table 2‑1. Status Codes for Validate a Bearer Token Status Code Description 204 NO CONTENT The request succeeded. 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 HEAD method is not supported for the resource.
-
Programming Guide Table 2‑2. Status Codes for Delete a Bearer Token (Continued) Status Code Description 405 METHOD NOT ALLOWED The DELETE method is not supported for the resource. 500 SERVER ERROR Could not create or update the resource because of an internal server error. VMware, Inc.
-
Creating a Tenant 3 You use the identity service to create a tenant. The identity service is comprised of two components: authentication and authorization. The authentication component manages tenants, groups, users, and identity stores. Creating a tenant is an authentication example. Two use cases show how to create a tenant, either with parameters inline or with input values in a JSON file.
-
Programming Guide Prerequisites In addition to the Prerequisites for Creating a Tenant, verify that you have parameter values for the new tenant. Procedure 1 Use the identity service to display all the available tenants. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$vRA/identity/api/tenants For details regarding input and output of this sample, see Syntax for Displaying Your Current Tenants.
-
Programming Guide {"@type":"Tenant", "id":"qe", ...}, {"@type":"Tenant", "id":"management", ...} ], "metadata":{"size":20,"totalElements":3,"totalPages":1,"number":1,"offset":0} } The following sample output for Step 3 shows that the tenant named rainpole has been created.
-
Programming Guide Create a Tenant With a JSON File To create a tenant with a JSON file, you first display all available tenants then request a new tenant with input parameters. The input parameters are specified in a separate JSON file that you call from the request. Prerequisites In addition to the Prerequisites for Creating a Tenant, verify that you have parameter values for the new tenant required for the JSON file input. Procedure 1 Use the identity service to display all the available tenants.
-
Programming Guide 6 Examine the response to verify that the tenant you requested is listed. See the output of the request to verify the new tenant is created Example: Create a Tenant With a JSON File. Example: Create a Tenant With a JSON File The following sample output for Step 1 lists three tenants. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$vRA/identity/api/tenants { "links":[], "content"[ {"@type":"Tenant", "id":"vsphere.local", "urlName":"vsphere.
-
Programming Guide "content":[ {"@type":"Tenant", "id":"vsphere.local", ...}, {"@type":"Tenant", "id":"qe", ...}, {"@type":"Tenant", "id":"management", ...}, {"@type":"Tenant", "id":"rainpole", ...} ], "metadata":{"size":20,"totalElements":4,"totalPages":1,"number":1,"offset":0} } Identity Service Examples for Creating a Tenant Syntax for each service example lists input parameters, output parameters, and curl commands.
-
Programming Guide Syntax for Displaying Your Current Tenants GET /api/tenants lists all the vRealize Automation tenants in your system. Input Use the supported input parameters to control the command output. Parameter Description URL https://$vRA/identity/api/tenants $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials.
-
Programming Guide Parameter 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 Content Metadata n First, Previous, Next, and Last refer to corresponding pages of pageable lists. n Specifies the application or service that determines the other names.
-
Programming Guide "name":"vsphere.
-
Programming Guide Parameter Description $tenantId Specifies the ID of the tenant. $tenantURL Specifies the URL of the tenant. $tenantName Specifies the name of the tenant. $description Specifies a description of the tenant. $emailAddress Specifies the contact email address for the tenant. $password Optional password for the new tenant. If blank, no password is required.
-
Programming Guide Parameter 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 Content Metadata n First, Previous, Next, and Last refer to corresponding pages of pageable lists. n Specifies the application or service that determines the other names.
-
Programming Guide The following example command requests a new tenant by calling the newTenant.json file. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$vRA/identity/api/tenants/rainpole --data @C:\Temp\newTenant.json Example: curl Command to Request a New Tenant With Parameters Inline The following example command requests a new tenant with input parameters specified inline.
-
Programming Guide Parameter 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 Content Metadata n First, Previous, Next, and Last refer to corresponding pages of pageable lists. n Specifies the application or service that determines the other names.
-
Programming Guide "description":null, "alias":"promocom.com", "type":"LDAP", "userNameDn":"cn=promocomadmin,ou=promocom,dc=vcac,dc=mycompany,dc=com", "password":null, "url":"ldap://10.000.00.000:389", "groupBaseSearchDn":"ou=promocom,dc=vcac,dc=mycompany,dc=com", "userBaseSearchDn":"ou=promocom,dc=vcac,dc=mycompany,dc=com" }, { "@type":"IdentityStore", "domain":"example.mycompany.com", "name":"openLDAPDemo", "description":null, "alias":"example.
-
Programming Guide Parameter Description $domainName Specifies the domain of the identity store. $grpBaseSearchDn Specifies the group search base Distinguished Name. $identityStoreName Specifies a description of the new tenant. $password Specifies the password. $identityStoreType Specifies the identity store type for the tenant. The following values are supported: n LDAP n AD n NATIVE_AD $identityServerUrl Specifies the URL of the identity server.
-
Programming Guide Parameter 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 Content Metadata n First, Previous, Next, and Last refer to corresponding pages of pageable lists. n Specifies the application or service that determines the other names.
-
Programming Guide The following example command links an identity store to a tenant by calling the example JSON text file. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token” https://$vRA/identity/api/tenants/development/directories/example.mycompany.com --data @C:\Temp\ldap.json.txt The command also tests that vRealize Automation can connect to the identity store successfully.
-
Programming Guide Unlinked Identity Store Error If an identity store is not linked to the specified tenant, the response includes status code 400 such as in the following output. Command failed [Rest Error]: {Status code: 400}, {Error code: 90027} , {Error Source: null}, {Error Msg: Cannot connect to the directory service.
-
Programming Guide Parameter Description emailAddress Specifies the email address of the user. locked Specifies the Boolean flag indicating if the user is locked out. disabled Specifies the Boolean flag indicating if the user is disabled. principalId Specifies the principal ID of the user in username@domain format. tenantName Specifies the name of tenant to which user belongs. name Specifies the first and last name concatenated.
-
Programming Guide Parameter Description URL https://$vRA/identity/api/authorization/tenants/$tenantId/principals/$principalId/roles/roleId $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials. $tenantId Specifies the ID of the tenant. $principalId Specifies the ID of the user in name@domain format. $roleId Specifies the ID of the user role.
-
Programming Guide Parameter Description id Specifies the role ID. name Specifies the role name. description Specifies the role description. status Specifies the status of this role. assignedPermissions Specifies the set of permissions that are implied by this role assignment. Example: curl Command to Display all Roles Assigned to a User The following example command lists all the roles that are assigned to tony@example.mycompany.com.
-
Programming Guide "description" : "Entitle services, catalog items and actions ... users within a tenant.", "prereqAdminPermissions" : null }, { "id" : "FILE_EDIT_TENANT", "name" : "Manage Tenant Files", "description" : "Upload and delete files belonging to this tenant.", "prereqAdminPermissions" : null }, { "id" : "TENANT_USER_DATA_MANAGEMENT", "name" : "Manage user data (requests, items, tasks etc) within a tenant.", "description" : "Manage user created objects belonging to the tenant.
-
Requesting a Machine 4 You use the catalog service to perform tasks related to requesting a machine. The catalog service is comprised APIs for the consumer, service providers, and service administrators. It is designed to be used by consumers and providers of the service catalog. For example, a consumer would request a catalog item such as a machine. The service provider would fulfill the request. The catalog service includes Hypermedia as the Engine of Application State (HATEOAS) links.
-
Programming Guide Procedure 1 List all shared catalog items in the catalog. curl --insecure -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$vRA/catalog-service/api/consumer/entitledCatalogItemViews For details regarding input and output for this request, see Syntax for Listing Shared and Private Catalog Items. 2 Examine the response to find the catalogItemId 3 Get a template request for a catalog item.
-
Programming Guide 6 (Optional) View the details of your request. You can perform a GET on the URI in the Location header to retrieve the updated request details. In this example, the URI-in-Location-header is 7aaf9baf-aa4e-47c4-997b-edd7c7983a5b.
-
Programming Guide Parameter Description URL https://$vRA/catalog-service/api/consumer/entitledCatalogItemViews $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials. page number The page number. Default is 1. limit The number of entries per page. The default is 20. $orderby Multiple comma-separated properties sorted in ascending or descending order.
-
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 to List All Shared Catalog Items The following example command retrieves information about all shared catalog items of type ConsumerEntitledCatalogItemView. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token” https://$vRA/catalog-service/api/consumer/entitledCatalogItemViews If backward compatibility is required, use the following example command instead.
-
Programming Guide }, "serviceRef": { "id": "057d4095-95f1-47da-b14b-641ac9010c97", "label": "Infrastructure Services" }, "outputResourceTypeRef": { "id": "composition.resource.type.deployment", "label": "Deployment" } } ], "metadata": { "size": 20, "totalElements": 1, "totalPages": 1, "number": 1, "offset": 0 } } Example: curl Command to Locate the Details of a Specific Catalog Item To search for specific catalog item, add the $catalogItemId.
-
Programming Guide Parameter Description URL https://$vRA/catalog-service/api/consumer/entitledCatalogItemViews/{id} $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials. page number The page number. Default is 1. limit The number of entries per page. The default is 20. $orderby Multiple comma-separated properties sorted in ascending or descending order.
-
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 to Get Information for a Catalog Item The following example command retrieves information catalog item with the name $filter=name+eq+ %27$catalogItemName%27. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token” https://$vRA/catalog-service/api/consumer/entitledCatalogItemViews? $filter=name+eq+%27$catalogItemName%27 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 GET /api/consumer/entitledCatalogItems/{id}/requests/template retrieves a template request for a specific catalog item. VMware supplies a number of templates to help you create different types of machine requests.
-
Programming Guide 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 "typeFilter": "LinuxDemo*vSphere-Linux", "data": { "Cafe.Shim.VirtualMachine.MaxCost": 0, "Cafe.Shim.VirtualMachine.MinCost": 0, "_cluster": 1, "_hasChildren": false, "action": "FullClone", "allow_storage_policies": false, "archive_days": 0, "blueprint_type": "1", "cpu": 1, "custom_properties": [], "daily_cost": 0, "datacenter_location": null, "description": null, "disks": [ { "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.
-
Programming Guide "memory": 4096, "nics": [ { "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Compute.Machine.
-
Programming Guide Prepare your Request From the entitledCatalogItemViews response, locate the link field that contains a value similar to the following: { "@type":"link", "href":"https://$vRA/catalog-service/api/consumer/entitledCatalogItems/dc808d12-3786-4f7cb5a1-d5f997c8ad66/requests", "rel":"POST: Submit Request" } Use the information in this response to edit the template construct the URI to request the desired catalog item using a POST command.
-
Programming Guide Property Description waitingStatus Specifies a status indicating whether this request is waiting on any external users or services before it is able to progress. requestNumber Specifies a more user-friendly identifier for this request. executionStatus Specifies the current execution status of the request. stateName Specifies the localized state name. phase Specifies the current phase of the request, which is more coarse grained and easier for users to understand.
-
Programming Guide Example: curl Command to Request a Machine To construct your request, refer to the entitledCatalogItemViews response received when you ran the request described in Syntax for Getting a Template Request for a Catalog Item, locate a link field that contains a value similar to the following: { "@type":"link", "href":"https://$vRA/catalog-service/api/consumer/entitledCatalogItems/f89fcbbf-7716-4a61addd-a822dd4206f6/requests", "rel":"POST: Submit Request" } The following example command submi
-
Programming Guide Syntax for Viewing Details of a Machine Request GET /api/consumer/requests/{requestId} provides the details of a machine request, where requestId is the URI in the Location header. 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. You can rerun this command multiple times to monitor the state of a machine request. Table 4‑1.
-
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 requestedItemDescripti on 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 to View the Details of the Machine Request The following example command displays details of a request.
-
Programming Guide "stateName": "Successful", "approvalStatus": "POST_APPROVED", "executionStatus": "STOPPED", "waitingStatus": "NOT_WAITING", "phase": "SUCCESSFUL", "catalogItemRef": { "id": "7c8275d6-1bd6-452a-97c4-d6c053e4baa4", "label": "Linux" } } Note In the request details, the phase field corresponds to the status that is displayed in the Requests tab in the user interface. VMware, Inc.
-
Approving a Machine Request 5 You use a series of work item service commands to approve a machine request. Basic components of the work item service are the work item and the assignment. The work item service provides a standard way to present work items to users. For example, a user can view all work items and select the item to perform such as approving a machine request.
-
Programming Guide 3 Get details for a specific work item ID. Use the workItemId to get the details for this work item. In this example, the workItemId is 5e3e9519-78ea-4409-a52c-e4aa3bc56511. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$vRA/workitem-service/api/workitems/5e3e9519-78ea-4409-a52c-e4aa3bc56511 For details regarding input and output for this request, see Syntax for Getting Work Item Details.
-
Programming Guide n Syntax for Constructing a JSON File to Approve a Machine Request You can specify a JSON file in your vRealize Automation REST API command line input. For example, when you enter a command to approve a machine request, you can include the name of a JSON file that contains all the parameters required to approve the request and complete the work item.
-
Programming Guide Property Description assignees Displays the list of work item assignees. subTenantId Optionally associates the work item with a specific business group granting users with management responsibilities over that business group permission to see the approval. tenantId Specifies the tenant ID for the work item. callbackEntityId Specifies the callback entity ID for the work item. work itemType Specifies the work item type for the work item.
-
Programming Guide "id" : "1755ef1a-d6f0-4901-9ecd-d03352ae4a05", "version" : 1, "workItemNumber" : 1, "assignees" : [ { "principalId" : "tony@example.mycompany.com", "principalType" : "USER" } ], "tenantId" : "MYCOMPANY", "callbackEntityId" : "1", "workItemType" : { "id" : "com.mycompany.cafe.samples.travel.workItem", "name" : "Workspace Assignment", "pluralizedName" : "Workspace Assignments", "description" : "Location Specific Workspace Assignment", "serviceTypeId" : "com.mycompany.cafe.samples.travel.
-
Programming Guide }, { "id" : "location", "label" : "Destination", "description" : "The destination to which travel is being requested.
-
Programming Guide . . . "completedDate" : null, "assignedDate" : "2014-02-20T23:55:31.600Z", "createdDate" : "2014-02-20T23:55:31.600Z", "assignedOrCompletedDate" : "2014-02-20T23:55:31.600Z", "serviceId" : "2af18227-6a00-49e9-a76b-96de3ee767d2", "workItemRequest" : { "itemId" : "531660fd-b540-4946-9917-38c023b61c02", "itemName" : "test travel 1", "itemDescription" : "test travel 1", "itemRequestor" : "tony@example.mycompany.com", "itemCost" : 0.
-
Programming Guide "value" : "1cfe7177-74e3-4d68-a559-ea17587022ca" } }, { "key" : "requestRef", "value" : { "type" : "string", "value" : "15" } }, { "key" : "requestedItemDescription", "value" : { "type" : "string", "value" : "test travel 1" } }, { "key" : "requestLeaseRate", "value" : { "type" : "moneyTimeRate", "cost" : { "type" : "money", "currencyCode" : null, "amount" : 213.
-
Programming Guide "value" : { "type" : "timeSpan", "unit" : "DAYS", "amount" : 5 } }, { "key" : "requestedBy", "value" : { "type" : "string", "value" : "tony@example.mycompany.com" } } ] } }, "status" : "Active", "availableActions" : [ ] } ], "metadata" : { "size" : 20, "totalElements" : 7, "totalPages" : 1, "number" : 1, "offset" : 0 } } Syntax for Getting Work Item Details GET /api/workitems/{id} retrieves the details of a pending work item. You need these details to submit a completion request.
-
Programming Guide Property Links Description Specifies an array of link objects, each of which contains the following parts: n rel: Specifies the name of the link. n Self refers to the object that was returned or requested. This property does not exist when you query for a single profile. n n First, Previous, Next, and Last refer to corresponding pages of pageable lists. n Specifies the application or service that determines the other names. href: Specifies the URL that produces the result.
-
Programming Guide Example: curl Command The following example command retrieves the necessary details for the specified work item. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token” https://$vRA/workitem-service/api/workitems/5e3e9519-78ea-4409-a52c-e4aa3bc56511 Example: JSON Output The following JSON output is returned based on the command input. Note Price is referred to as cost in API commands and output.
-
Programming Guide "stateName" : "Rejected", "icon" : { "id" : "61c6da67-1164-421d-b575-10a245c89e10", "name" : "rejected.
-
Programming Guide "workItemDetails" : { "type" : "external", "formId" : "approval.details" }, "workItemSubmission" : { "type" : "external", "formId" : "approval.submission" }, "workItemNotification" : { "type" : "external", "formId" : "approval.notification" } } }, "completedDate" : null, "assignedDate" : "2014-02-25T01:26:07.153Z", "createdDate" : "2014-02-25T01:26:07.153Z", "assignedOrCompletedDate" : "2014-02-25T01:26:07.
-
Programming Guide "type" : "string", "value" : "test-blueprint" } . . . }, { "key" : "requestLease" }, { "key" : "requestedBy", "value" : { "type" : "string", "value" : "fritz@example.mycompany.com" } } ] } }, "status" : "Active", "availableActions" : [ ] } Syntax for Constructing a JSON File to Approve a Machine Request You can specify a JSON file in your vRealize Automation REST API command line input.
-
Programming Guide } }, { "key": "source-source-provider-VirtualMachine.CPU.Count", "value": { "type": "integer", "value": 1 } }, { "key": "source-businessJustification", "value": { "type": "string", "value": "solves abx request" } }, { "key": "source-source-provider-VirtualMachine.LeaseDays", "value": { "type": "integer", "value": 0 } } ] }, "workItemId": "5e3e9519-78ea-4409-a52c-e4aa3bc56511", "workItemActionId": "com.mycompany.csp.core.approval.action.
-
Programming Guide Example: JSON Input File Use the following JSON input file sample when constructing a file. { "@type": "CatalogItemRequest", "catalogItemRef": { "id": "65fbca06-a28e-46f3-bced-c6e5fb3a66f9" }, "organization": { "tenantRef": "MYCOMPANY", "subtenantRef": "cccd7a7e-5283-416b-beb0-45eb4e924dcb" }, "requestedFor": "fritz@example.mycompany.
-
Programming Guide "value": { "type": "integer", "value": 30 } }, { "key": "provider-__Notes", "value": { "type": "string", "value": "MYCOMPANY machine" } }, { "key": "provider-VirtualMachine.Disk0.Size", "value": { "type": "string", "value": "1" } }, { "key": "provider-VirtualMachine.Disk0.Letter", "value": { "type": "string", "value": "C" } }, { "key": "provider-VirtualMachine.Disk0.
-
Programming Guide Parameter Description $token Specifies a valid HTTP bearer token with necessary credentials. workitem_ID Specifies the unique identifier of a work item. See Syntax for Listing Work Items. Output The command output contains property names and values based on the command input parameters. Property Links Description Specifies an array of link objects, each of which contains the following parts: n rel: Specifies the name of the link.
-
Programming Guide Property Description availableActions Contains a list of relevant work item actions. Metadata Specifies the paging-related data: n Size: Specifies the maximum number of rows per page. n totalElement: Specifies the number of rows returned. n totalPages: Specifies the total number of pages of data available. n Number: Specifies the current page number. n Offset: Specifies the number of rows skipped.
-
Programming Guide Input Use the supported input parameters to control the command output. Note Price is referred to as cost in API commands and output. Parameter Description URL https://$vRA/compositionservice/api/blueprints/$BlueprintId/costs/upfront Method Post $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials.
-
Programming Guide Property Description count Specifies the instance count of the component. memory Specifies memory requested for this component. additional Specifies the additional price, if any, associated with the component. cpu Specifies the cpu requested for the component. storage Specifies the storage requested for the component. componentId Specifies the component ID, or total price of the deployment.
-
Programming Guide "key": "memory", "value": { "type": "integer", "value": 2048 } } ] } } } ] } } Example: JSON Output for a Blueprint Price Update [{"componentId":"vSphere_Machine_1", "setupFee":"$0.00", "totalEstimatedLeasePriceInfo":{"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.
-
Listing Provisioned Resources 6 You use the catalog service to list provisioned resources. The catalog service is designed to be used by consumers and providers of the service catalog. For example, a consumer might want to list resources provisioned by a provider. The consumer can also list the resources in multiple ways. Each example for this use case lists a curl command with respective JSON response, plus input and output parameters. The same set of prerequisites applies to each example.
-
Programming Guide curl Command The following example displays all applicable provisioned resources. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$vRA/catalog-service/api/consumer/resources/?page=1&limit=n&$orderby=name 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 Parameter Description URL https://$vRA/catalog-service/api/consumer/resources/ $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials. $page Specifies a page number. $limit Specifies the number of entries to display on a page. Maximum value is 5000. If not specified, defaults to 20.
-
Programming Guide Property Description 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. hasCosts Returns true if the resource is subject to per-time price. costs Displays an optional rate of the price charges for the resource. This parameter is deprecated.
-
Programming Guide Display Provisioned Resources by Resource Type Example GET /api/consumer/resourcesTypes/{id} displays a list of the provisioned resources that you own filtered by machine resource type. curl Command The following example displays the provisioned resources by resource type. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token” https://$vRA/catalog-service/api/consumer/resourceTypes/Infrastructure.
-
Programming Guide "tenantLabel" : "QETenant", "subtenantRef" : "eab762cb-6e75-4379-83ef-171a71c9f00e", "subtenantLabel" : "MyTestAgentBusinessGroup" }, … } The output includes the following highlighted items: n Resource ID. 3bfde906-81b9-44c3-8c2d-07d2c9768168 corresponds to a provisioned machine owned by the logged-in user. The resource IDs are used in requests to retrieve the details for the corresponding machines. n subtenantRef ID.
-
Programming Guide n Infrastructure.Cloud n Infrastructure.Physical n Infrastructure.vApp n Infrastructure.Virtual 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. iconId Specifies an icon for this request based on the requested object type. resourceTypeRef Specifies the resource type. name Specifies the resource name. description Specifies the resource description.
-
Programming Guide Display All Available Resource Types Example GET /api/consumer/resourcesTypes displays all the resource types that are available on the system. curl Command The following example displays all available resource types. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$vRA/catalog-service/api/consumer/resourceTypes JSON Output The following JSON output is returned based on the command input.
-
Programming Guide 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. iconId Specifies an icon for this request based on the requested object type. resourceTypeRef Specifies the resource type. name Specifies the resource name. description Specifies the resource description. status Specifies the resource status.
-
Programming Guide Example: curl Command The following example command displays all available resource types. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$vRA/catalog-service/api/consumer/resourceTypes Example: JSON Output The following JSON output is returned based on the command input. { "links" : [ ], "content" : [ { "@type" : "ResourceType", "id" : "Infrastructure.
-
Programming Guide curl Command The following example displays the provisioned resources of one or more business groups. curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$vRA/catalog-service/api/consumer/resources/types/Infrastructure.
-
Programming Guide "type" : "USER", "value" : "Fritz Arbeiter" } ], "organization" : { "tenantRef" : "MYCOMPANY", "tenantLabel" : "QETenant", "subtenantRef" : "eab762cb-6e75-4379-83ef-171a71c9f00e", "subtenantLabel" : "MyTestAgentBusinessGroup" }, "dateCreated" : "2014-09-19T21:19:37.541Z", "lastUpdated" : "2014-09-19T21:19:40.888Z", "hasLease" : true, "lease" : { "start" : "2014-09-19T21:18:57.
-
Programming Guide "extensionId" : "csp.places.iaas.resource.details", "extensionPointId" : null } }, "resourceData" : { "entries" : [ { "key" : "Expire", "value" : { "type" : "boolean", "value" : true } }, { "key" : "MachineGroupName", "value" : { "type" : "string", "value" : "MyTestAgentBusinessGroup" } }, { "key" : "NETWORK_LIST", "value" : { "type" : "multiple", "elementTypeId" : "COMPLEX", "resources" : [ { "type" : "complex", "componentTypeId" : "com.mycompany.csp.component.iaas.proxy.
-
Programming Guide "type" : "boolean", "value" : true } }, { "key" : "MachineStatus", "value" : { "type" : "string", "value" : "On" } }, { "key" : "PowerOff", "value" : { "type" : "boolean", "value" : true } }, { "key" : "DISK_VOLUMES", "value" : { "type" : "multiple", "elementTypeId" : "COMPLEX", "resources" : [ { "type" : "complex", "componentTypeId" : "com.mycompany.csp.component.iaas.proxy.provider", "componentId" : null, "classId" : "vra.api.model.
-
Programming Guide }, { "key" : "Suspend", "value" : { "type" : "boolean", "value" : true } }, { "key" : "Reboot", "value" : { "type" : "boolean", "value" : true } }, { "key" : "Reprovision", "value" : { "type" : "boolean", "value" : true } }, { "key" : "MachineStorage", "value" : { "type" : "integer", "value" : 1 } }, { "key" : "MachineDailyCost", "value" : { "type" : "decimal", "value" : 0.
-
Programming Guide "key" : "ChangeLease", "value" : { "type" : "boolean", "value" : true } }, { "key" : "machineId", "value" : { "type" : "string", "value" : "8a4581a0-84f9-4e80-9af6-75d79633e382" } }, { "key" : "MachineMemory", "value" : { "type" : "integer", "value" : 0 } }, { "key" : "MachineGuestOperatingSystem" }, { "key" : "MachineName", "value" : { "type" : "string", "value" : "test2" } }, { "key" : "MachineDestructionDate" }, { "key" : "MachineCPU", "value" : { "type" : "integer", "value" : 1 } }, {
-
Programming Guide }, { "key" : "Reset", "value" : { "type" : "boolean", "value" : true } } ] } } ], "metadata" : { "size" : 2, "totalElements" : 1, "totalPages" : 1, "number" : 1, "offset" : 0 } } Input Use the supported input parameters to control the command output. Parameter Description URL https://$vRA/catalog-service/api/consumer/resources/type $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server.
-
Programming Guide Parameter Description skip Specifies the number of entries to skip. $filter Contains a Boolean expression to determine if a particular entry is included in the response. Output The command output contains property names and values based on the command input parameters. Property Description id Specifies the unique identifier of this resource. iconId Specifies an icon for this request based on the requested object type. resourceTypeRef Specifies the resource type.
-
Programming Guide View Machine Details Example GET /api/consumer/requests/{id}/resourceViews displays the machine details for a provisioned machine. curl Command The following example displays machine details for a provisioned machine with resourceID=7aaf9bafaa4e-47c4-997b-edd7c7983a5b.
-
Programming Guide "@type": "link", "rel": "GET: Child Resources", "href": "https://$vRA/catalog-service/api/consumer/resourceViews? managedOnly=false&withExtendedData=true&withOperations=true&%24filter=parentResource%20eq %20%27c4d3db3e-e397-44ff-a1c9-0ecebdba12f4%27" } ], "resourceId": "c4d3db3e-e397-44ff-a1c9-0ecebdba12f4", "iconId": "cafe_default_icon_genericCatalogItem", "name": "Linux-80813151", "description": null, "status": null, "catalogItemId": "7c8275d6-1bd6-452a-97c4-d6c053e4baa4", "catalogItemL
-
Programming Guide In addition to general information about the provisioned deployment such as its name, description, and ID, the response contains additional HATEOAS links that enable you to obtain additional details and information. Table 6‑1. HATEOAS Link Functions as Defined by rel Field Link Description GET: Catalog Item URI to get the catalog item details (as described in sections 3.2.1 and 3.2.2) from which this catalog item was provisioned.
-
Programming Guide Property Description id Specifies the unique identifier of this resource. iconId Specifies an icon for this request based on the requested object type. resourceTypeRef Specifies the resource type. name Specifies the resource name. description Specifies the resource 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.
-
Managing Provisioned Deployments 7 You use the catalog service to manage provisioned deployments. The catalog service is designed to be used by consumers of the service catalog. For example, a consumer might want to list all provisioned resources then submit a request to power off a resource.
-
Programming Guide Use the GET: Child Resources HATEOAS link to retrieve a list of child nodes of a deployment.
-
Programming Guide 2 Examine the response. HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Cache-Control: no-cache, no-store Pragma: no-cache Expires: Sat, 01 August 2015 23:04:50 GMT Content-Type: application/json;charset=UTF-8 Date: Sat, 01 August 2015 13:04:50 GMT { "type": "com.vmware.vcac.catalog.domain.request.
-
Programming Guide }, { "@type": "link", "rel": "POST: {com.vmware...iaas.proxy.provider@resource.action.name.machine.ChangeLease}", "href": "https://$vRA/api/consumer/resources/dd3...a4a/actions/b5739e30-.../requests" }, Procedure 1 Get the template for the resource action request.
-
Programming Guide This POST command returns a response indicating success or failure, such as HTTP/1.1 201 CREATED for success. Catalog Service Examples for Managing Provisioned Deployments Syntax for each service example lists input parameters, output parameters, and curl commands. Syntax for Getting Deployment Details n GET /api/consumer/requests/{id}/resourceViews retrieves resources provisioned by a given request.
-
Programming Guide Input Use the supported input parameters to control the command output. Parameter Description URL https://$vRA/catalog-service/api/consumer/resources/$resourceId $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials. id UUID of a request. page Specifies a page number. limit Specifies the number of entries to display on a page.
-
Programming Guide Table 7‑2. Output Parameters (Continued) Property Description parentResourceId The unique identifier of the parent resource. Used for child resources of a multi-machine resource. hasChildren Returns trun if this resource has child resources. Used if this is a multi-machine resource. dateCreated The date and time at which the resource was created. lastUpdated The date and time at which the resource was most recently modified. lease The current lease of the resource.
-
Programming Guide "rel": "GET Template: {com.vmware.csp.component.cafe.composition@resource.action.deployment.destroy.name}", "href": "https://$vRA/catalog-service/api/consumer/resources/c4d3db3e-e397-44ffa1c9-0ecebdba12f4/actions/416e6bb1-3357-448b-8396-e268d5f7343b/requests/template" }, { "@type": "link", "rel": "POST: {com.vmware.csp.component.cafe.composition@resource.action.deployment.destroy.
-
Programming Guide Syntax for Navigating to the Children of a Deployed Resource GET /api/consumer/resourceViews retrieves a list of the child nodes of a deployment, including virtual machines, networks, and other objects you may have configured on the design canvas.
-
Programming Guide Output The command output contains property names and values based on the command input parameters. Note Price is referred to as cost in API commands and output. Table 7‑4. 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.
-
Programming Guide Example Curl Command This example retrieves all children of the resource with an ID of c4d3db3e-e397-44ffa1c9-0ecebdba12f4%27.
-
Programming Guide } ], "resourceId": "dd37b7a1-829c-4773-b5be-b229453eca4a", "iconId": "cafe_default_icon_genericCatalogItem", "name": "DEMO-002", "description": null, "status": "On", "catalogItemId": null, "catalogItemLabel": null, "requestId": null, "resourceType": "{com.vmware.csp.component.iaas.proxy.provider@resource.type.registration.name.Infrastructure.
-
Programming Guide "typeFilter": null, "data": { "DISK_CAPACITY": 6, "DISK_INPUT_ID": "DISK_INPUT_ID1" } }, { "componentTypeId": "com.vmware.csp.component.iaas.proxy.provider", "componentId": null, "classId": "dynamicops.api.model.
-
Programming Guide "ip_address": "10.118.194.213", "machineId": "f3579990-a3c4-4e17-9593-1f8893636876" } }, { "@type": "CatalogResourceView", "links": [ { "@type": "link", "rel": "GET: Parent Resource", "href": "https://$vRA/catalog-service/api/consumer/resourceViews/c4d3db3ee397-44ff-a1c9-0ecebdba12f4" }, { "@type": "link", "rel": "GET Template: {com.vmware.csp.component.network.service@resource.action.destroy.name, [{{com.vmware.csp.component.iaas.proxy.provider@network.network.type.registration.name.
-
Programming Guide "hasChildren": false, "data": { "Description": " ", "Name": "Existing Network" } } ], "metadata": { "size": 20, "totalElements": 2, "totalPages": 1, "number": 1, "offset": 0 } } VMware, Inc.
-
Working with Reservations 8 You can work with the REST API reservation service to perform a variety of functions, such as creating and updating reservations.
-
Programming Guide n Service Examples for Working with Reservations Prerequisites for Working With Reservations Satisfy the following conditions before performing any tasks for this use case. n Log in to vRealize Automation as a fabric group administrator. n Verify that the appliance 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 Display a List of Supported Reservation Types Use the reservation service to display a list of supported reservation types, such as vSphere, Amazon EC2, or vCloud Air. Procedure Display a list of supported vRealize Automation reservation types.
-
Programming Guide "number": 1, "offset": 0 } } The following sample displays 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.Amazon", "name": "Amazon", "description": "Amazon Reservation", "category": "Cloud", "serviceTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide "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.Cloud.vCloudAir.form.new" }, "schemaClassId": "Infrastructure.Reservation.Cloud.vCloudAir", "alertTypes": [ { "createdDate": "2015-11-06T10:21:06.
-
Programming Guide "totalElements": 8, "totalPages": 1, "number": 1, "offset": 0 } } Displaying a Schema Definition for a Reservation After you know the supported reservations types, you can display a schema definition for the vSphere, Amazon EC2, or vCloud Air reservation. Display a Schema Definition for a vSphere Reservation You can use the reservation service to display a schema definition for a specific vRealize Automation reservation type such as a vSphere reservation.
-
Programming Guide "dependencies": ["computeResource"] }, "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 "type": "dynamic", "customAllowed": false, "dependencies": ["computeResource"] }, "state": { "dependencies": [], "facets": [] }, "isMultiValued": true }, { "id": "reservationMemory", "label": "Memory", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide "permissibleValues": { "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": [], "face
-
Programming Guide "type": "mandatory", "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 "facets": [] }, "isMultiValued": true }] } Display a Schema Definition for an Amazon Reservation You can use the reservation service to display a schema definition for a specific vRealize Automation reservation type such as an Amazon reservation. Prerequisites In addition to the Prerequisites for Working With Reservations, obtain the schema class ID of the reservation type to create. See Display a List of Supported Reservation Types.
-
Programming Guide "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": "The locations",
-
Programming Guide "customAllowed": false, "dependencies": [ "computeResource" ] }, "state": { "dependencies": [ ], "facets": [ { "type": "visible", "value": { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "VPC" } } } }, { "type": "mandatory", "value": { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "VPC" } } } } ] }, "isMultiValued": true },
-
Programming Guide "typeFilter": null, "label": "Elastic Load Balancer" }, "displayAdvice": null, "permissibleValues": { "type": "dynamic", "customAllowed": false, "dependencies": [ "locations", "computeResource" ] }, "state": { "dependencies": [ ], "facets": [ { "type": "visible", "value": { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "VPC" } } } } ] }, "isMultiValued": true }, { "id": "specificKeyPairs", "label": "Specif
-
Programming Guide "keyPairs" ] }, "state": { "dependencies": [ ], "facets": [ { "type": "visible", "value": { "type": "and", "subClauses": [ { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "keyPairs" } }, { "type": "expression", "operator": { "type": "equals" }, "leftOperand": { "type": "constant", "value": { "type": "string", "value": "Specific Key Pair" } }, "rightOperand": { "type": "path", "path": "keyPairs" } } ] } }, { "type": "mandatory", "value"
-
Programming Guide "path": "keyPairs" } }, { "type": "expression", "operator": { "type": "equals" }, "leftOperand": { "type": "constant", "value": { "type": "string", "value": "Specific Key Pair" } }, "rightOperand": { "type": "path", "path": "keyPairs" } } ] } } ] }, "isMultiValued": false }, { "id": "computeResource", "label": "Compute Resource", "description": "The compute resource for the reservation", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "VPC", "label": "VPC", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.Cloud.Amazon.VPC", "typeFilter": null, "label": "VPC", "schema": { "fields": [ { "id": "VPCSubnets", "label": "Subnets", "description": "The subnets.
-
Programming Guide } } }, { "type": "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": "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 "displayAdvice": null, "permissibleValues": { "type": "dynamic", "customAllowed": false, "dependencies": [ "VPCSubnets" ] }, "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": true } ] } }, "displayAdvice": "DATA_TABLE", "permissibleValues": { "type": "dynamic", "customAllowed": false, "dependencies": [ "computeResource" ] }, "state": { "dependencies": [ ], "facets": [ { "type": "visible", "value": { "type": "or", "subClauses": [ { "type": "not", "subClause": { "type": "exp
-
Programming Guide "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": "path", "path": "securityGroups"
-
Programming Guide "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false }, { "id": "keyPairs", "label": "Key pair", "description": "The key pair", "dataType": { "type": "primitive", "typeId": "STRING" }, "displayAdvice": null, "permissibleValues": { "type": "static", "customAllowed": false, "values": [ { "underlyingValue": { "type": "string", "value": "Not Specified" }, "label": null }, { "underlyingValue": {
-
Programming Guide } ] }, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false } ] Display a Schema Definition for a vCloud Air Reservation You can use the reservation service to display a schema definition for a specific reservation type such as a vCloud Air reservation.
-
Programming Guide "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.Network", "typeFilter": null, "label": "Network", "schema": { "fields": [ { "id": "networkPath", "label": "Network Path", "description": "Network path of the reservation", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide "type": "dynamic", "customAllowed": false, "dependencies": [ ] }, "state": { "dependencies": [ ], "facets": [ ] }, "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 }, { "id": "allocationModel
-
Programming Guide "state": { "dependencies": [ ], "facets": [ { "type": "readOnly", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "reservationMemory", "label": "Memory", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
-
Programming Guide ] }, "isMultiValued": false }, { "id": "memoryReservedSizeMb", "label": "Memory Reservation (MB)", "description": "The reserved capacity (MB) for the memory", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false } ] } }, "displayAdvice": "DATA_TABLE", "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false }, { "id": "computeResource", "label": "Compute Resource", "descripti
-
Programming Guide ] }, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "machineQuota", "label": "Machine Quota", "description": "The machine quota for the reservation", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false }, { "id": "reservationStorages", "label": "
-
Programming Guide "description": "The storage path of the storage", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide "isMultiValued": false }, { "id": "computeResourceStorageTotalSizeGB", "label": "Total (GB)", "description": "The total physical capacity (GB) for the storage", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "readOnly", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "storageReservedSizeGB", "label": "This reservation reserve
-
Programming Guide "typeId": "BOOLEAN" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "computeResourceStorageFreeSizeGB", "label": "Free (GB)", "description": "The free capacity (GB) for the storage", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ { "type": "rea
-
Programming Guide "type": "dynamic", "customAllowed": false, "dependencies": [ "computeResource" ] }, "state": { "dependencies": [ ], "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": true } ] } Get the Business Group ID for a Reservation You can use reservation service to get the business group ID for a vRealize Automation reservation. The business group is also referred to as the subtenant in the API.
-
Programming Guide "name": "Development", "description": " Development ", "subtenantRoles": null, "extensionData": { "entries": [{ "key": "iaas-manager-emails", "value": { "type": "string", "value": "user1@mycompany.com" } }] }, "tenant": "qe" }, { "@type": "Subtenant", "id": "ade5b8d3-decf-405e-bd0b-297f976ef721", "name": "Finance", "description": "Finance", "subtenantRoles": null, "extensionData": { "entries": [{ "key": "iaas-manager-emails", "value": { "type": "string", "value": " user1@mycompany.
-
Programming Guide }] }, "tenant": "qe" }], "metadata": { "size": 20, "totalElements": 4, "totalPages": 1, "number": 1, "offset": 0 } } Get a Compute Resource for the Reservation You can use the REST API reservation service to obtain compute resources for vRealize Automation reservations. Prerequisites When you create a reservation, you must provide compute resource information that corresponds to the computeResource parameter.
-
Programming Guide Procedure Use the following command to get a compute resource. u Command to get a compute resource for vSphere reservation. n curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$vRA/reservation-service/api/dataservice/schema/Infrastructure.Reservation.Virtual.vSphere/default/computeResource/values “{}” -d Command to get a compute resource for an Amazon EC2 reservation.
-
Programming Guide "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", "label": "NSX61-RC-ComputeClusterA" }, "label": "NSX61-RC-ComputeClusterA" }] } The following sample displays JSON output for an Amazo
-
Programming Guide "label": "EC2 841 Endpoint-us-east-1" } ] } The following sample displays JSON output for a vCloud Air reservation.
-
Programming Guide } }] } }” Example: Get Resources Schema for a vSphere Reservation The following JSON output is returned based on the command input.
-
Programming Guide "entries": [{ "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "9d1a3b5a-7162-4a5a-85b7-ec1b2824f554" } }] } } ” Example: Get Resources Schema for an Amazon Reservation The following JSON output is returned based on the command input.
-
Programming Guide Procedure Use the reservation service to display information about available resources. u The following example command displays storage and network information. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$vRA/reservation-service/api/dataservice/schema/Infrastructure.Reservation.Cloud.
-
Programming Guide }, { "underlyingValue": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
-
Programming Guide Prerequisites In addition to the Prerequisites for Working With Reservations, perform the following tasks before creating a reservation. n Display a list of the reservation types that are supported in the vRealize Automation server. See Display a List of Supported Reservation Types. n Obtain the permissible value field information required to create a new reservation.
-
Programming Guide "extensionData": { "entries": [{ "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide } }, { "key": "memoryReservedSizeMb", "value": { "type": "integer", "value": 15872 } }] } } }, { "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", "compon
-
Programming Guide { "key": "storageEnabled", "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": "storagePriority", "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "value": { "type": "entityRef", "co
-
Programming Guide Create an Amazon Reservation You can use the reservation service to create an Amazon reservation. Prerequisites In addition to the Prerequisites for Working With Reservations, perform the following tasks before creating a reservation. n Display a list of the reservation types that are supported in the vRealize Automation server. See Display a List of Supported Reservation Types. n Obtain the permissible value field information required to create a new reservation.
-
Programming Guide "label": "EC2 841 Endpoint-us-east-1" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 0 } }, { "key": "securityGroups", "value": { "type": "multiple", "elementTypeId": "ENTITY_REFERENCE", "items": [ { "type": "entityRef", "componentId": null, "classId": "AmazonSecurityGroup", "id": "10", "label": "default" } ] } }, { "key": "loadBalancers", "value": { "type": "multiple", "elementTypeId": "ENTITY_REFERENCE", "items": [ { "type": "entityRef", "componentId": null, "class
-
Programming Guide ] } }, { "key": "keyPairs", "value": { "type": "string", "value": "Per Provisioning Group" } } ] } }” Example: Create an Amazon Reservation The output is a sample location URL, including the new Amazon reservation ID. Location: https://$vRA/reservation-service/api/reservations/3289b039-2a11-4ab4-a0bc-b583e4c6d085 Create a vCloud Air Reservation You can use the vRealize Automation REST API reservation service to create a vCloud Air reservation.
-
Programming Guide "recipients": [ ], "alerts": [ { "alertPercentLevel": 80, "referenceResourceId": "storage", "id": "storage" }, { "alertPercentLevel": 80, "referenceResourceId": "memory", "id": "memory" }, { "alertPercentLevel": 80, "referenceResourceId": "cpu", "id": "cpu" }, { "alertPercentLevel": 80, "referenceResourceId": "machine", "id": "machine" } ] }, "extensionData": { "entries": [ { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id":
-
Programming Guide "type": "multiple", "elementTypeId": "COMPLEX", "items": [ { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
-
Programming Guide "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": { "type": "integer", "value": 691 } } ] } } ] } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide "key": "memoryReservedSizeMb", "value": { "type": "integer", "value": 4096 } } ] } } } ] } } “ Example: Create a vCloud Air Reservation The output is a location URL, including the new vCloud Air reservation ID. Location: https://$vRA/reservation-service/api/reservations/3289b039-2a11-4ab4-a0bc-b583e4c6d085 Verify a Reservation and Get Reservation Details After you create a reservation, you can use the reservation service along with reservation ID to verify that the reservation exists.
-
Programming Guide Example: Verify a Reservation and Get Reservation Details The following sample displays JSON output for the request including reservation details. { "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 "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide "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-4d54-8829-f549bc195b69"
-
Programming Guide "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", "reservationTypeId": "Infrastructure.Reservation.Cloud.
-
Programming Guide "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.vmware.csp.iaas.blueprint.
-
Programming Guide "items": [ { "type": "complex", "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
-
Programming Guide } } ] } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
-
Programming Guide Example: Display a List of Reservations The following sample output lists two vSphere reservations named MyTestReservation1 and MyTestReservation2. { "links": [], "content": [{ "id": "94d74105-831a-4598-8f42-efd590fea15c ", "name": "TestReservation", "reservationTypeId": "Infrastructure.Reservation.Virtual.
-
Programming Guide "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": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide }, { "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 } } Update a Reservation You can use the reservation service to update an existing vRealize Automation reservation.
-
Programming Guide "subTenantId": "ef58f604-528d-4441-a219-4725bead629b", "enabled": true, "priority": 3, "reservationPolicyId": "b71c3a5f-087a-4d9e-9a56-fab785a3d128", "alertPolicy": { "enabled": true, "frequencyReminder": 20, "emailBgMgr": false, "recipients": ["user1@mycompany.com", "user2@mycompany.
-
Programming Guide "classId": "reservationNetwork", "typeFilter": null, "values": { "entries": [{ "key": "reservationNetworkProfile", "value": { "type": "entityRef", "componentId": null, "classId": "NetworkProfile", "id": "ed5d1503-08ac-42ca-804d-9167834a63a5", "label": "TestNetworkProfile" } }, { "key": "reservationNetworkPath", "value": { "type": "entityRef", "componentId": null, "classId": "Network", "id": "44cb65d5-b321-43dd-a2ab-8ecf387bff8f", "label": "VM Network SQA" } }] } }] } }, { "key": "key0", "
-
Programming Guide "value": 57187 } }, { "key": "reservationMemoryReservedSizeMb", "value": { "type": "integer", "value": 15888 } }] } } }, { "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": "reservationSt
-
Programming Guide }, { "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-4d54-8829-f549bc195b69", "label": "VNXe:qe-vnxe-nfs-1" } }, { "key": "storageFreeSizeGB", "value": { "type": "integer", "value": 120 } }, { "key": "reservationStorageReservatio
-
Programming Guide }] } } ” Example: Update a Reservation The following output is returned based on the command input. If the command is successful, the HTTP response body is empty except for a 204 No Content status statement. Delete a Reservation You can use the vRealize Automation REST API reservation service to delete an existing reservation. Prerequisites In addition to the Prerequisites for Working With Reservations, obtain the reservation ID of the reservation that you want to delete.
-
Programming Guide n Syntax for Displaying a List of Reservations GET /api/reservations displays a list of existing vRealize Automation reservations. You can use this list to obtain the required reservation ID value in preparation for updating or deleting a reservation. n Syntax for Displaying a Schema Definition for a vSphere Reservation GET /api/data-service/schema/{classId}/default with classId for vSphere, displays the schema definition for a vSphere reservation.
-
Programming Guide n Syntax for Creating an Amazon Reservation POST /api/reservations with a reservationTypeID for Amazon, creates an Amazon reservation. n Syntax for Creating a vCloud Air Reservation POST /api/reservations with a reservationTypeID for vCloud Air, creates a vCloud Air reservation. n Syntax for Verifying a Reservation and Getting Reservation Details GET /api/reservations/{id} retrieves a vRealize Automation reservation.
-
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 "frequencyReminder": 20, "emailBgMgr": false, "recipients": ["user1@mycompany.com", "user2@mycompany.
-
Programming Guide "type": "entityRef", "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"
-
Programming Guide "value": 15888 } }] } } }, { "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": "compl
-
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",
-
Programming Guide Syntax for Displaying a Schema Definition for a vSphere Reservation GET /api/data-service/schema/{classId}/default with classId for vSphere, displays the schema definition for 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. Call a data and schema service to get schema definition information.
-
Programming Guide Table 8‑2. Extension Fields Supported in vSphere Reservations (Continued) Field ID Data Type Type Class Permissible Value Depends on Field machineQuota Integer N/A No NA reservationStorages Complex Type reservationStorage Yes computeResource resourcePool Entity Reference ResourcePools Yes computeResource reservationVCNSRoutedGat eways Complex Type reservationVCNSRoutedGat eway Yes computeResource Note The information in the table is subject to change.
-
Programming Guide Property Description dataType Specifies the dataType field value: n 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. componentTypeid: Specifies the type ID of the component. n component: Specifies the unique identifier of the component.
-
Programming Guide Example: JSON Output The schema definition in this example includes 9 extension fields that are supported for the vSphere type reservation. { "fields": [{ "id": "reservationNetworks", "label": "Network", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide "dependencies": ["computeResource"] }, "state": { "dependencies": [], "facets": [] }, "isMultiValued": false }, { "id": "reservationVCNSSecurityGroups", "label": "Security Groups", "description": "Security groups of the vCNS settings", "dataType": { "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide "value": { "type": "boolean", "value": true } } }] }, "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.
-
Programming Guide }, "isMultiValued": false }, { "id": "reservationVCNSRoutedGateways", "label": "Routed Gateways", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide Table 8‑3. 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 $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. Each supported reservation type contains specific fields. The supported fields are defined in the schema.
-
Programming Guide Property Description Provides a structure for defining the state of a content construct, for example {@link LayoutSection}. The state 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 "computeResource" ] }, "state": { "dependencies": [ ], "facets": [ { "type": "visible", "value": { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "VPC" } } } }, { "type": "mandatory", "value": { "type": "not", "subClause": { "type": "expression", "operator": { "type": "isDefined" }, "leftOperand": { "type": "path", "path": "VPC" } } } } ] }, "isMultiValued": true }, { "id": "locations", "label": "Locations"
-
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": {
-
Programming Guide "type": "ref", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide "type": "dynamic", "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"
-
Programming Guide "type": "isDefined" }, "leftOperand": { "type": "path", "path": "keyPairs" } }, { "type": "expression", "operator": { "type": "equals" }, "leftOperand": { "type": "constant", "value": { "type": "string", "value": "Specific Key Pair" } }, "rightOperand": { "type": "path", "path": "keyPairs" } } ] } } ] }, "isMultiValued": false }, { "id": "computeResource", "label": "Compute Resource", "description": "The compute resource for the reservation", "dataType": { "type": "ref", "componentTypeId"
-
Programming Guide "facets": [ { "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "isMultiValued": false }, { "id": "VPC", "label": "VPC", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.Cloud.Amazon.VPC", "typeFilter": null, "label": "VPC", "schema": { "fields": [ { "id": "VPCSubnets", "label": "Subnets", "description": "The subnets.
-
Programming Guide "type": "constant", "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 "classId": "ElasticLoadBalancer", "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": "visib
-
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": [ {
-
Programming Guide "type": "string", "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 a vCloud Air Reservation GET /api/data-service/schema/{classId}/default with classId for vCloud Air, displays the schema definition for a vCloud Air reservation.
-
Programming Guide Table 8‑5. 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 $token Specifies a valid HTTP bearer token with necessary credentials. $schemaclassid Specifies the schema class of the reservation type. The schema class ID for a vCloud Air reservation is Infrastructure.Reservation.Cloud.vCloudAir. Each supported reservation type contains specific fields. The supported fields are defined in the schema.
-
Programming Guide Property Description Provides a structure for defining the state of a content construct, for example {@link LayoutSection}. The state 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 "componentId": null, "classId": "Network", "typeFilter": null, "label": "Network" }, "displayAdvice": null, "state": { "dependencies": [ ], "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 ] } }, "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 }, { "id": "allocationModel", "label": "Allocation Model", "description": "The allocation model for the reservation", "dataType": { "type": "primitive", "typeId": "INT
-
Programming Guide }, "isMultiValued": false }, { "id": "reservationMemory", "label": "Memory", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
-
Programming Guide ], "facets": [ ] }, "isMultiValued": false } ] } }, "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 } ] }, "isMultiValued": false }, { "id": "machineQuota", "label": "Machine Quota", "description": "The machine quota for the reservation", "dataType": { "type": "primitive", "typeId": "INTEGER" }, "displayAdvice": null, "state": { "dependencies": [ ], "facets": [ ] }, "isMultiValued": false }, { "id": "reservationStorages", "label": "Storage", "dataType": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.
-
Programming Guide "type": "mandatory", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "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 } } } ]
-
Programming Guide { "type": "readOnly", "value": { "type": "constantClause", "value": { "type": "boolean", "value": true } } } ] }, "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", "descript
-
Programming Guide } } ] }, "isMultiValued": false }, { "id": "computeResourceStorageFreeSizeGB", "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": "d
-
Programming Guide "type": "boolean", "value": true } } } ] }, "isMultiValued": true } ] } Syntax for Getting the Business Group ID for a Reservation GET /api/tenants/{tenantId}/subtenants of the identity service API, lists all business groups. The business group is also referred to as the subtenant in the API. When you create a reservation, you must provide the business group ID, also referred to as the subtenant ID, in the REST command line. Use this procedure to obtain the subTenantId value.
-
Programming Guide Property Description @type Constants the ReservationType string. Id Specifies the unique reservation type identifier. name Specifies the reservation type name. description Specifies the reservation type description. subtenantRoles Specifies the business group roles. extensionData Specifies the extension data of the business group. For example, the email address of the vRealize Automation business group manager is user1@mycompany.com.
-
Programming Guide }] }, "tenant": "qe" }, { "@type": "Subtenant", "id": "ade5b8d3-decf-405e-bd0b-297f976ef721", "name": "Finance", "description": "Finance", "subtenantRoles": null, "extensionData": { "entries": [{ "key": "iaas-manager-emails", "value": { "type": "string", "value": " user1@mycompany.
-
Programming Guide "number": 1, "offset": 0 } } Syntax for Getting a Compute Resource for a Reservation POST /api/data-service/schema/{schemaClassId}/default/{fieldId}/values creates a compute resource for a vRealize Automation reservation. Input Use the supported input parameters to control the command output.
-
Programming Guide Property Description underlyingValue Contains a JSON string representing one permissible value of field. n type Specifies one of the following permissible value data types. n entityRef - Indicates that the object references a vRealize Automation entity. n complexRef - Indicates that the object is a user-defined complex structure, for example struct in C or Pojo in Java. n n primary - Indicates the entity type such as string, integer, and so on.
-
Programming Guide Example: JSON Output for a vSphere Reservation In this example, there are 4 available compute resources that you can use to create a vSphere reservation, for example cc254a84-95b8-434a-874d-bdfef8e8ad2c. Save a copy of the underlyingValue section of the compute resource that you want to an XML editor and use the section content later to create a reservation request. The following JSON output is returned based on the command input.
-
Programming Guide Example: JSON Output for an Amazon Reservation In this example, there are 3 available compute resources that you can use to create an Amazon EC2 reservation. Save a copy of the underlyingValue section of the compute resource that you want to an XML editor and use the section content later to create a reservation request.
-
Programming Guide "componentId": null, "classId": "ComputeResource", "id": "c527a0f5-b1ae-4b61-8145-ad9d5c434dc7", "label": "Engineering Allocation VDC" }, "label": "Engineering Allocation VDC" } ] } Syntax for Getting Resources Schema for a vSphere Reservation POST /api/data-service/schema/{schemaClassId}/default/{fieldId}/values with a schemaClassId for vSphere, displays information about available resources for a vSphere reservation, such as storage and network information.
-
Programming Guide Input Description URL https://$vRA/reservation-service/api/dataservice/schema/$schemaclassid/default/$fieldid/values Method Post $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials. $schemaclassid Specifies the schema class ID. This example illustrates how to use the resourcePool field of a vSphere reservation type as an example.
-
Programming Guide "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": " cc254a84-95b8-434a-874d-bdfef8e8ad2c " } }] } }” 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.
-
Programming Guide 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 8‑8.
-
Programming Guide Parameter Description $fieldId Specifies the field ID of the resource. For example, the field ID for the resource pool is securityGroups. For this example, the input value for $fieldId is securityGroups. HTTP body Contains information about dependencies. Because the dependency of this permissible value field is computeResource, you must provide a dependency definition in the HTTP body.
-
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 Table 8‑9. 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 "typeFilter": null, "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":
-
Programming Guide "label": "High Performance Storage" } }, { "key": "computeResourceStorageFreeSizeGB", "value": { "type": "integer", "value": 691 } } ] } }, "label": "High Performance Storage" } ] } Syntax for Creating a vSphere Reservation POST /api/reservations with a reservationTypeID for vSphere, creates a vSphere reservation. Input Use the supported input parameters to control the command output.
-
Programming Guide Property Description status When the reservation is successfully created, the HTTP response status is 201 created. Header.Location The HTTP response contains a Location attribute that is formatted as https://$vRA /reservation-service/api/reservations/$reservationId. $reservationId Specifies the new reservation ID. Example: curl Command The following sample command creates a vSphere reservation. The HTTP body is included as part of the command line input.
-
Programming Guide "entries": [{ "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide }, { "key": "memoryReservedSizeMb", "value": { "type": "integer", "value": 15872 } }] } } }, { "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", "componen
-
Programming Guide "key": "storageEnabled", "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": "storagePriority", "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "value": { "type": "entityRef", "comp
-
Programming Guide Example: JSON Output The following sample location URL is displayed, including the new vSphere reservation ID. Location: https://$vRA/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. Syntax for Creating an Amazon Reservation POST /api/reservations with a reservationTypeID for Amazon, creates an Amazon reservation.
-
Programming Guide Example: curl Command The following example command creates an Amazon reservation. The HTTP body is included as part of the command line input. curl -X POST --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$vRA/reservation-service/api/reservations -d “ { "name": "TestEC2Reservation", "reservationTypeId": "Infrastructure.Reservation.Cloud.
-
Programming Guide "type": "multiple", "elementTypeId": "ENTITY_REFERENCE", "items": [ { "type": "entityRef", "componentId": null, "classId": "AmazonSecurityGroup", "id": "10", "label": "default" } ] } }, { "key": "loadBalancers", "value": { "type": "multiple", "elementTypeId": "ENTITY_REFERENCE", "items": [ { "type": "entityRef", "componentId": null, "classId": "ElasticLoadBalancer", "id": "3", "label": "test1" } ] } }, { "key": "locations", "value": { "type": "multiple", "elementTypeId": "ENTITY_REFERENCE
-
Programming Guide } ] } }” Example: JSON Output The following sample location URL is displayed, including the new Amazon reservation ID. Location: https://$vRA/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. Syntax for Creating a vCloud Air Reservation POST /api/reservations with a reservationTypeID for vCloud Air, creates a vCloud Air reservation.
-
Programming Guide Property Description status When the reservation is successfully created, the HTTP response status is 201 created. Header.Location The HTTP response contains a Location attribute that is formatted as https://$vRA /reservation-service/api/reservations/$reservationId. $reservationId Specifies the new reservation ID. Example: curl Command The following sample command creates a vCloud Air reservation. The HTTP body is included as part of the command line input.
-
Programming Guide }, "extensionData": { "entries": [ { "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": "
-
Programming Guide } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [ { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
-
Programming Guide "key": "computeResourceStorageFreeSizeGB", "value": { "type": "integer", "value": 691 } } ] } } ] } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
-
Programming Guide Syntax for Verifying a Reservation and Getting Reservation Details GET /api/reservations/{id} retrieves a vRealize Automation reservation. After you create a reservation, you can use 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 Copy the output response into an XML editor for future step usage. { "id": "94d74105-831a-4598-8f42-efd590fea15c ", "name": "TestReservation", "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": ["user1@mycompany.
-
Programming Guide "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.
-
Programming Guide "typeFilter": null, "values": { "entries": [{ "key": "hostMemoryTotalSizeMB", "value": { "type": "integer", "value": 57187 } }, { "key": "reservationMemoryReservedSizeMb", "value": { "type": "integer", "value": 15888 } }] } } }, { "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-
-
Programming Guide "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-4d54-8829-f549bc195b69", "label": "VNXe:qe-vnxe-nfs-1" } }, { "key": "storageFreeSizeGB"
-
Programming Guide "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 "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.vmware.csp.iaas.blueprint.
-
Programming Guide "items": [ { "type": "complex", "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
-
Programming Guide } } ] } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.vmware.csp.iaas.blueprint.service", "componentId": null, "classId": "Infrastructure.Reservation.
-
Programming Guide Output The command output contains property names and values based on the command input parameters. Property Description Links Species an array of link objects, each of which contains the following parts: rel href Content Specifies the name of the link. n Self refers to the object that was returned or requested. n First, Previous, Next, and Last refer to corresponding pages of pageable lists. n Specifies the application or service that determines the other names.
-
Programming Guide Property alertTypes Metadata Description Contains the alert type list defined in the reservation type: n createdDate -- Alert type created date n lastUpdated -- Alert type last updated date n version -- Alert type version n id -- Unique identifier of alert type n name -- Name of alert type n description -- Long description of alert type n referenceResourceId -- Unique identifier of reference resource Specifies the paging-related data: n Size: Specifies the maximum number
-
Programming Guide "category": "Virtual", "serviceTypeId": "com.mycompany.csp.iaas.blueprint.service", "tenantId": null, "formReference": { "type": "external", "formId": "Infrastructure.Reservation.Virtual.vSphere.form.new" }, "schemaClassId": "Infrastructure.Reservation.Virtual.vSphere", "alertTypes": [{ "createdDate": "2015-10-13T04:44:32.008Z", "lastUpdated": "2015-10-13T04:44:32.
-
Programming Guide "createdDate": "2015-11-06T10:21:06.010Z", "lastUpdated": "2015-11-06T10:21:06.010Z", "version": 0, "id": "cd707ad2-d504-43e2-8002-11ee670dcf41", "name": "storage", "description": null, "referenceResourceId": "storage" }, { "createdDate": "2015-11-06T10:21:06.010Z", "lastUpdated": "2015-11-06T10:21:06.010Z", "version": 0, "id": "ef96fec4-a607-4944-a0af-fbe7df862ee2", "name": "memory", "description": null, "referenceResourceId": "memory" }, { "createdDate": "2015-11-06T10:21:06.
-
Programming Guide 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.074Z", "lastUpdated": "2015-10-13T04:44:32.075Z", "version": 1, "id": "Infrastructure.Cloud.
-
Programming Guide Parameter Description URL https://$vRA/reservation-service/api/reservations/$reservationId Method Put $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials. $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 Input Use the supported input parameters to control the command output. Parameter Description URL https://$vRA/reservation-service/api/reservations/$reservationId Method Delete $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials. $reservationId Specifies the unique identifier of the reservation to delete.
-
Working with Reservation Policies 9 You use the reservation service to perform a variety of functions, such as creating and updating reservation policies. While many functions are stand-alone, some functions rely on the output of others. For example, to delete a reservation, you must first obtain the ID of the reservation to delete. Each example for this use case lists a curl command with respective JSON response, plus input and output parameters. The same set of prerequisites applies to each example.
-
Programming Guide curl Command List all available reservation policies. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$vRA/reservation-service/api/reservations/policies 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 Update a Reservation Policy Exampleand Deleting a Reservation Policy Example.
-
Programming Guide Parameter Description $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials. 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 "name": "ABXReservationPolicyTest", "description": "ABXReservationPolicyDescTest", "reservationPolicyTypeId": "Infrastructure.Reservation.Policy.ComputeResource" } “ JSON Output The following example output contains the HTTP body and a location URL. The output URL contains the new reservation policy ID, for example 5fd2de36-659f-4beb-97af-77d683feb697.
-
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://$vRA /reservationservice/api/reservations/policies/$reservationPolicyId. $reservationPolicyId Specifies the new reservation policy ID. Obtain this ID by listing your available reservation policies.
-
Programming Guide Example: Output The command output contains property names and values based on the command input parameters. 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. Update a Reservation Policy Example PUT /api/reservations/policies/{id} updates a reservation policy with a reservation policy ID.
-
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 Display a Reservation Policy by ID Example.
-
Programming Guide Parameter Description $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials. $id Specifies the reservation policy ID. To obtain the reservation policy ID to delete, see List Reservation Policies Example. Output If the command is successful, the HTTP response body is empty except for a 204 No Content status statement. VMware, Inc.
-
Working with Key Pairs 10 You use the keyValuePair data element of the work-item service to list, create, and update key pairs. For information about using the vRealize Automation application user interface to work with key pairs, see the IaaS Configuration documentation. Each example for this use case lists a curl command with respective JSON response, plus input and output parameters. The same set of prerequisites applies to each example.
-
Programming Guide curl Command The following example command gets a list of valid key pairs. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$vRA/iaas-proxy-provider/api/keyPairs JSON Output The following JSON output is returned based on the command input.
-
Programming Guide lHVWmK+LiVZSAfk6auEm+13a24+UM9Mg6ninfzeIq0cjdT3OUweXgDnK0BMGX0wfSIYIrpRrDr9QdVoHGtdqZvJ62F8aITjO8urIK +bXZzwgFQ2JE4SYxojNHPYwBjadFm0A2eVPtOivMYYYr8FCUYtfbjjIS1TyJaKIFhhqs6bA6/PH +NvBmbozpDkH9wg3mQ1SOP5iSMAMue6fx+b/SpOZ5MPnNjRo +VXG3qFl936AB4F1F2ObD27GyjibeYmhQkITtp/yGYCZ68PhCun0/eiEjmXiOUx/5jYGOUEZ1Ddojhc5M/PClR46vQ/3Iyv5pUGPno +wkn34lk6s2PO2axrXvQqTwoiYC3f2p1gp0qYidIzKa2KHrUCOF4hnjQ3v3z93ORMCK3wN5uQ3xMFOd7+1XpetxvG9d7L1lU/sgCVmE hdOSnhLC5Jeq70MVwixPocnJR4nyotPE==" },//Omit 18 more key pa
-
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 Content Metadata Specifies the application or service that determines the other names.
-
Programming Guide curl Command The following example command creates a key pair.
-
Programming Guide 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. Input Use the supported input parameters to control the command output.
-
Programming Guide "secretKey": "jmfhkPFLe1xF4LsgxyYDlBH65IjiKsNH3xgeUhNt6AyIcSA2eZsxH9FNFcDst1cRLQUmLYLUCN6ZlrVtD3C5CYAOEE9UplO +YKnAcqUSyXB6PQ3I/NuebdtGrx38fkTJsEpRqxLppWPJpVlHYRO2O7GhhWnE6F3bPwwg3dWwymqWHxBZlCcuEcztovbhN8r7/hKsXK bNSJz +J8DVhPB7PPdHJJ4E/6a9IXkNQs/T0NknCOyc0YcFVpgrc3PMGabi8vd/7v0nEtDARyA8WwAGgtedHGtBo2gciY1Bu/0SNr2yCzsZcq bVeg4ufkjlv0G1Ed1FfGHMh5kuVC7alk2aSI5YkWnS4d9YJYi7diYmc7GmrVW0XWNz4kEMdQBkK+CvMxiZ17jyQD +V4NuM4ydNPJJMqpvoAHtLrAmp/hXhInuf8j/l0mbawWSvUDUA3s4ZE55cFp546MJIrVCRyoMoKfxuHq
-
Programming Guide curl Command The following example command queries a key pair. curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$vRA/iaas-proxy-provider/api/keyPairs/26 JSON Output The following JSON output is returned based on the command input. { "id": 26, "name": "TestKeyPair", "computeResourceId": "ca4dcca0-85ce-49dd-8371-4ce7c8e2d5e6", "secretKey": "" } Input Use the supported input parameters to control the command output.
-
Programming Guide Update a Key Pair Example PUT /api/KeyPairs/{id} updates an existing key pair using the vRealize Automation REST API. curl Command The following example command updates a key pair.
-
Programming Guide JSON Output The output contains an empty HTTP response body and the following status code. 204 No Content Input Use the supported input parameters to control the command output. Parameter Description URL https://$vRA/iaas-proxy-provider/api/keyPairs/$id Method Put $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials.
-
Programming Guide JSON Output The output contains an empty HTTP response body and the following status code. 204 No Content Input Use the supported input parameters to control the command output. Input Description URL https://$vRA/iaas-proxy-provider/api/keyPairs/$id Method Delete $vRA Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. $token Specifies a valid HTTP bearer token with necessary credentials.
-
Working with Network Profiles 11 You use the IaaS proxy provider service and IPAM service to create, list, and update network profiles. You can access the following types of network profile by using the same programming calls. Different types of network profiles contain different fields. VMware, Inc.
-
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 Prerequisites for Working With Network Profiles Satisfy the following conditions before performing any tasks for this use case. n Log in to vRealize Automation as a tenant administrator. n Verify that the appliance 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 "definedAddresses": [ { "id": "6e7dc8c3-dc64-4ebd-a282-05852010310f", "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.
-
Programming Guide }, { "id": "9dd5d265-ec23-42be-9bdb-734c11b1e315", "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.
-
Programming Guide "hostName": "", "createdDate": "2014-11-11T02:25:57.000Z", "lastModifiedDate": "2014-11-11T02:25:57.000Z" }, { "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.
-
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.1", "secondaryWinsAddress": "" } ], "metadata": { "size": 0, "totalElements": 4, "totalPages": 1, "number": 1, "offset": 0 } } Input Use the supported input parameters to control the command output.
-
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 Content Specifies the application or service that determines the other names.
-
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 "gatewayAddress": "10.110.183.253", "primaryDnsAddress": "10.110.182.45", "secondaryDnsAddress": "", "dnsSuffix": "mycompany.com", "dnsSearchSuffix": "", "primaryWinsAddress": "10.0.0.1", "secondaryWinsAddress": "" } “ 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.
-
Programming Guide Property 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://$vRA/iaas-proxyprovider/api/network/profiles/$networkProfileID. $networkProfileID Specifies the unique identifier of the new network profile. Create an External Network Profile Using External IPAM Example POST /api/network/profiles creates a external network profile using external IPAM.
-
Programming Guide JSON Output The output contains an empty HTTP response body and the location and network profile ID in the header statement. Location: https://vcac148-084-241.eng.mycompany.com/iaas-proxy-provider/api/network/profiles/263b80f5-d34f-47f2b0b1-5a3db991c2e9 Copy the location URL into a text editor for future use. Input Use the supported input parameters to control the command output.
-
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 parameter. 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: Specify the address space of the IPAM provider.
-
Programming Guide Query a Network Profile Example GET /api/network/profiles/{id} queries and displays an external, NAT, or routed network profile. For example, you can query an external network profile and use it as the basis for creating a different type of network profile. curl Command The following example command queries the existing network profile ID 68b6a183-fc8a-4592af23-92f8d410ee32.
-
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 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 Content Specifies the application or service that determines the other names.
-
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. n Size: Specifies the maximum number of rows per page. n totalElement: Specifies the number of rows returned.
-
Programming Guide ], "profileType": "EXTERNAL", "subnetMask": "255.255.255.0", "gatewayAddress": "10.110.183.253", "primaryDnsAddress": "10.110.182.45", "secondaryDnsAddress": "", "dnsSuffix": "mycompany.com", "dnsSearchSuffix": "", "primaryWinsAddress": "10.0.0.1", "secondaryWinsAddress": "" } “ JSON Output The output contains an empty HTTP response body and the following status code. 204 No Content Input Use the supported input parameters to control the command output.
-
Programming Guide curl Command The following example command deletes a network profile with an ID of 263b80f5-d34f-47f2b0b1-5a3db991c2e9. curl –X “Delete” --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$vRA/iaas-proxy-provider/api/network/profiles/263b80f5-d34f-47f2-b0b1-5a3db991c2e9 JSON Output The output contains an empty HTTP response body and the following status code. 204 No Content Input Use the supported input parameters to control the command output.
-
Getting a List of Available IP Ranges 12 After creating a network profile, the administrator imports IP address ranges into vRealize Automation from a registered IP address management (IPAM) service provider. Get a List of Available IP Ranges for an IPAM Provider GET /api/providers/{providerEnpointId}/ip-ranges queries a specified IPAM provider endpoint for a list of the available IP address ranges configured on the IPAM provider device.
-
Programming Guide "extensionData": { "entries": [ { "key": "Building", "value": { "type": "string", "value": "Building 0" } }, { "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.0.
-
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.1.0", "subnetPrefixLength": 24, "externalId": "network-1", "dnsInfo": { "@type": "DNSInfo", "id": null, "name": null, "description": null, "dnsSuffix": "sqa.local", "primaryDNS": "", "secondaryDNS": "", "dnsSearchSuffixes": "search.sqa.local,search2.sqa.
-
Programming Guide "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.2.0", "subnetPrefixLength": 24, "externalId": "network-2", "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.3.
-
Programming Guide "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.4.
-
Programming Guide { "@type": "IPRange", "id": null, "name": "192.168.5.0/24", "description": "Created by vRO package stub workflow", "extensionData": { "entries": [ { "key": "Building", "value": { "type": "string", "value": "Building 5" } }, { "key": "City", "value": { "type": "string", "value": "Boston" } } ] }, "providerEndpointId": "C20F305C-07A5-4BA7-88AC-35DA7B9713E0", "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.5.
-
Programming Guide "type": "string", "value": "Building 6" } }, { "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.6.0", "subnetPrefixLength": 24, "externalId": "network-6", "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.7.0", "subnetPrefixLength": 24, "externalId": "network-7", "dnsInfo": { "@type": "DNSInfo", "id": null, "name": null, "description": null, "dnsSuffix": "sqa.local", "primaryDNS": "", "secondaryDNS": "", "dnsSearchSuffixes": "search.sqa.local,search2.sqa.
-
Programming Guide "externalId": "network-8", "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.9.
-
Programming Guide "preferredWINS": "", "alternateWINS": "" }, "addressSpaceId": "default" }, { "@type": "IPRange", "id": null, "name": "192.168.10.
-
Programming Guide "extensionData": { "entries": [ { "key": "Building", "value": { "type": "string", "value": "Building 11" } }, { "key": "City", "value": { "type": "string", "value": "Boston" } } ] }, "providerEndpointId": "C20F305C-07A5-4BA7-88AC-35DA7B9713E0", "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.11.
-
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.12.0", "subnetPrefixLength": 24, "externalId": "network-12", "dnsInfo": { "@type": "DNSInfo", "id": null, "name": null, "description": null, "dnsSuffix": "sqa.local", "primaryDNS": "", "secondaryDNS": "", "dnsSearchSuffixes": "search.sqa.local,search2.sqa.
-
Programming Guide "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.13.0", "subnetPrefixLength": 24, "externalId": "network-13", "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.14.
-
Programming Guide "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.15.
-
Programming Guide { "@type": "IPRange", "id": null, "name": "192.168.16.0/24", "description": "Created by vRO package stub workflow", "extensionData": { "entries": [ { "key": "Building", "value": { "type": "string", "value": "Building 16" } }, { "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.16.
-
Programming Guide "type": "string", "value": "Building 17" } }, { "key": "City", "value": { "type": "string", "value": "Boston" } } ] }, "providerEndpointId": "C20F305C-07A5-4BA7-88AC-35DA7B9713E0", "providerEndpointURI": null, "start": null, "end": null, "ipVersion": "IPv4", "gateway": "192.168.17.0", "subnetPrefixLength": 24, "externalId": "network-17", "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.18.0", "subnetPrefixLength": 24, "externalId": "network-18", "dnsInfo": { "@type": "DNSInfo", "id": null, "name": null, "description": null, "dnsSuffix": "sqa.local", "primaryDNS": "", "secondaryDNS": "", "dnsSearchSuffixes": "search.sqa.local,search2.sqa.
-
Programming Guide "externalId": "network-19", "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" } ], "metadata": { "size": 0, "totalElements": 20, "totalPages": 1, "number": 1, "offset": 0 } } VMware, Inc.
-
Importing and Exporting Content 13 You use the content management service to import and export content such as blueprints, software components, and other artifacts between vRealize Automation systems. vRealize Automation customers often experiment with system artifacts in their development or staging deployments. When ready, they can use the content management service to move the artifacts to production environments or between different tenants.
-
Programming Guide n Import a Package Example n Export XaaS Content Example n Import XaaS Content Example Understanding Blueprint Schema Users who wish to edit blueprints when exporting them to a deployment may need to understand the blueprint schema. Simple Blueprint Structure The following is an example of a simple blueprint. Note that this example includes line number that are referenced later in this topic. 1 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25.
-
Programming Guide n Lines 5 - 19 correspond to the Web component. The following appear under any component data: n The key type is mandatory and must refer to the component type on which the current component is based. n The key dependsOn is optional and contains the list of component IDs current component depends on. Component dependencies are extracted automatically based on property binding expressions. In most cases, you do not need to explicitly specify component dependencies.
-
Programming Guide Table 13‑1. Blueprint Constraints (Continued) ID or Key Corresponding CAFE Constraint Description min com.vmware.vcac.platform.content.facets.MinValueConstraint Indicates the minimum value for a numeric field. max com.vmware.vcac.platform.content.facets.MaxValueConstrain t Indicates the maximum value for a numeric field. minLength com.vmware.vcac.platform.content.facets.MinLengthConstrai nt Indicates the minimum length for a string field. maxLength com.vmware.vcac.platform.
-
Programming Guide The REST API supports import and export of the following registered content types: n composite-blueprint - the content type corresponding to the composite blueprint n software-component - the content type corresponding to the software component n property-group - the content type corresponding to the property groups n property-definition - the content type corresponding to the property definitions Everything as a Service (XaaS) content types: n XaaS-blueprint n XaaS-resource-ac
-
Programming Guide "description": "The content type corresponding to the composite blueprint", "classId": "Composite.Blueprint", "serviceTypeId": "com.vmware.csp.component.cafe.composition" }, { "@type": "ContentType", "id": "asd-blueprint", "name": "{com.vmware.csp.core.designer.service@service.blueprint.content.type.name}", "description": "{com.vmware.csp.core.designer.service@service.blueprint.content.type.description}", "classId": "asdServiceBlueprint", "serviceTypeId": "com.vmware.csp.core.designer.
-
Programming Guide "number": 1, "offset": 0 } } Input Use the supported input parameters with your query URL to control command output. . 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).
-
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 Content Metadata Specifies the application or service that determines the other names.
-
Programming Guide curl Command The following command displays a list of all available content in your vRealize Automation deployment. $curl --insecure -s -H "Content-Type: application/json"-H "Authorization: Bearer $token" https://$vRA/content-management-service/api/contents JSON Output The output includes published artifacts such as blueprints, software, and properties.
-
Programming Guide "tenantId": "qe", "subtenantId": null, "dependencies": [], "createdDate": "2015-08-18T20:53:25.062Z", "lastUpdated": "2015-08-18T20:53:25.062Z", "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.
-
Programming Guide Name Description Type $skip The number of entries to skip. Query $filter Boolean expression for whether a particular entry should be included in the response. Query 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 Content Metadata VMware, Inc. Specifies the application or service that determines the other names.
-
Programming Guide Parameter Description n Offset: Specifies the number of rows skipped. Filter Content by Content Type Example GET /api/provider/contenttypes with parameters to filter a list of returned content type items. curl Command The following command filters content by the contentTypeId named composite-blueprint.
-
Programming Guide "lastUpdated": "2015-08-04T20:47:20.308Z", "version": 0 } ], "metadata": { "size": 20, "totalElements": 2, "totalPages": 1, "number": 1, "offset": 0 } } Input Output The command output contains property names and values based on the command input parameters. Create a Package for Export Example POST /api/packages creates a package for export use. Creating a Package with Content n For import or export purposes you must create a package to contain the desired content.
-
Programming Guide Input Parameter Description createdDate The package creation date. lastUpdated The date when the package was last updated. version The package version identifier. tenantId The ID of the tenant associated with the package. Used to enforce ownership. subTenantId (Optional) The ID of the sub tenant or business group associated with the package id Specifies the unique identifier for the content. This is also used as a folder name to group similar content artifacts.
-
Programming Guide curl Command The following command lists the packages within the content service. $curl --insecure -s -H"Content-Type: application/json" -H "Authorization: Bearer $token"https://$vRA/content-management-service/api/packages JSON Output The following output 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 Name Description Type $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. Query 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 Content Metadata VMware, Inc. Specifies the application or service that determines the other names.
-
Programming Guide Export a Package Example GET /api/packages/{id} exports a package as a .zip file. curl Command The following command exports a package as a .zip file. $curl --insecure -s -H "Accept: application/zip" -H "Authorization: Bearer $token" https://$vRA/content-management-service/api/packages/54f627bb-2277-48af-9fa0-7d7366b498f3-o package.zip JSON Output The export command returns a message that indicates whether or not the package was exported. A successful export produces a package.
-
Programming Guide curl Command The following command validates a content bundle prior to importing it. This example uses the DukesBankApp.zip file which is provided on the vRealize Automation virtual appliance. You can copy the file from /usr/lib/vcac/tools/initial-config/sample-oob-content/DukesBankApp.zip using WinSCP (Windows) or scp (Mac).
-
Programming Guide }, { "contentId": "DukesBankApplication", "contentName": "DukesBankApplication", "contentTypeId": "composite-blueprint", "contentImportStatus": "SUCCESS", "contentImportErrors": null } ] } Input You can use optional request parameters with your query URL to customize the returned content. Table 13‑3.
-
Programming Guide Import a Package Example POST /api/packages imports a package. curl Command The following command imports a .zip file. This example uses the DukesBankApp.zip file which is provided on the vRealize Automation virtual appliance. You can copy the file from /usr/lib/vcac/tools/initial-config/sample-oob-content/DukesBankApp.zip using WinSCP (Windows) or scp (Mac).
-
Programming Guide "contentImportErrors": null }, { "contentId": "Dukes_Bank_App", "contentName": "Dukes_Bank_App", "contentTypeId": "software-component", "contentImportStatus": "SUCCESS", "contentImportErrors": null }, { "contentId": "DukesBankApplication", "contentName": "DukesBankApplication", "contentTypeId": "composite-blueprint", "contentImportStatus": "SUCCESS", "contentImportErrors": null } ] } Output The command output contains property names and values based on the command input parameters.
-
Programming Guide curl Command The following command exports an XaaS package as a .zip file at the specified location. curl -X PUT -H "Authorization: Bearer $token" -H "Content-Type: application/json"-d'{"jsonAccepted" : true, "tenantId" : "qe", "data" : [] }' 'https://$vRA/advanced-designerservice/api/content/bundles/filters' JSON Output The output of a successful export command is a .zip file at the specified location. Input Table 13‑6.
-
Programming Guide "entityType" : "com.vmware.vcac.designer.service.domain.ServiceBlueprint", "entityId" : "4740aa54-61e6-47d7-945f-0bb50ff153c8", "entityName" : "XaaSBlueprint", "messageKey" : "import.blueprint.success", "message" : "Success" } ] } Input Table 13‑7. 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.
-
Related Tools and Documentation 14 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 2 From the pull-down menu on the vRealize Automation API Reference start page, select a service. For example, select approval-service. The Swagger documentation page for the service appears. 3 Scroll to the bottom of the web page to view the API categories included in the service. 4 Select a category or click List Operations to display all HTTP operations for the category.
-
Programming Guide 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. n Open a Chrome browser session and log in to the vRealize Automation console as a business group user with access to catalog items. n Open a command prompt or a shell and log in to the vRealize Automation command line interface. Procedure 1 Click the Catalog tab in the vRealize Automation console.
-
Filtering and Formatting REST API Information 15 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.