vRealize Automation Properties Service API |
Property Service API Specification
What Is the Property Service?
The property service provides APIs to manage property definitions and property groups.
Typical Use Cases
You can use the property service REST API to:
- Create, update, and delete property definitions.
- Retrieve permissible values for property definitions.
- Create, update, and delete property groups.
Key Concepts
Custom Property
A custom property is a string key-value pair that can be associated with some object types in vRealize Automation. Custom properties provide a mechanism to annotate objects with custom attributes and can be used to invoke custom behavior during provisioning.
Custom properties have the following attributes:
- Name - the identifier for this custom property. It is a user-provided string value and must be unique within the object on which the property is defined.
- Value - the value to assign to this property. The value is optional.
- Show in Request - a flag indicating whether this property should be shown on a request form. If true, the request form will present this property as an input for the requesting user.
- Encrypted - a flag indicating whether the value of the property should be encrypted.
Property Definition
A property definition provides request-time enhancement for custom properties. Without a corresponding property definition, a custom property that is displayed on a request form appears as a simple text input field.
Property definitions allow you to customize the way a property appears to show a type-specific control. For example, by defining a property definition, you can configure a custom property that represents a true or false value to appear as a checkbox.
Property Groups
A property group is a named collection of custom properties. Some vRealize Automation objects (for example, blueprints) allow linking property groups as well as individual custom properties. This allows properties to be grouped into logically dependent sets. For example, a property group might define a set of custom properties that configure a virtual machine to be deployed into a particular environment.
Custom properties in property groups behave the same way as custom properties defined directly on any other type of vRealize Automation object.
Tenancy
Property groups and property definitions may be either tenanted or global:
- Tenanted property groups and definitions are accessible only in the tenant they are defined in. Tenanted property groups and definitions may be created by tenant administrators.
- Global property groups and definitions are accessible to any tenant. Global property groups and definitions may be created by fabric group administrators and system administrators.
A user who is both a tenant administrator and a fabric group administrator or system administrator can create either global or tenanted property groups and definitions.
Unique Identifiers
Property groups and property definitions have user-specified unique identifiers. This supports referencing both types of object in blueprints as code. However, to maximize portability of both types of object across tenants and vRealize Automation systems, the tenant ID is not part of the reference. This requires that unique identifiers satisfy the following uniqueness constraint:
- A tenanted property group cannot have the same ID as another global property group. It may, however, have the same ID as a property group in another tenant.
- A global property group cannot have the same ID as another tenanted property group in any tenant.
In effect, a property group's identifier can be used by either:
- Any number of tenanted property groups but no global ones.
- A single global property group but no tenanted ones.
The same rules apply for property definitions.
Permissible Values
A property definition may define a field as a dropdown. In this case, the definition must also define the values of that dropdown. It may do this in one of two ways:
- A static list of values.
- A list of values retrieved by executing a vRealize Orchestrator (vRO) script action.
The property service provides an API to retrieve the permissible values of a property definition. In the case of a static list, this is redundant, because the list is also provided as part of the property definition object itself. However, in the case where the list if populated by a vRO script action, the action is invoked every time the list must be rendered and so the values API must be called to retrieve these values.
How the Property Service Works
The property service works as follows:
- Tenant administrators and fabric administrators define property groups and property definitions as required.
- Blueprint authors link property groups to their blueprints and define other custom properties as required.
- At request time, references to property groups are resolved and properties from any linked property groups are unwrapped and set directly on the component to which the property group was attached.
- At request time, the request form queries the property dictionary for any property definitions matching custom properties that are to be displayed on the request form.
- The request form renders the custom properties according to their corresponding property definitions
API Usage Examples
Retrieve Dropdown Values for a Property Definition
First, create a property definition. In this example, the property definition is for a property called "costcenter" that retrieves a set of cost centers from an external system via a vRO script action.
PUT /api/propertydefinitions/costcenter
{
"id" : "costcenter",
"label" : "Cost Center",
"description" : null,
"dataType" : {
"type" : "primitive",
"typeId" : "STRING"
},
"isMultiValued" : false,
"displayAdvice" : "DROPDOWN",
"tenantId" : "tenant1",
"orderIndex" : null,
"permissibleValues" : {
"type" : "dynamic",
"customAllowed" : false,
"dependencies" : [ ],
"context" : {
"providerEntityId" : "org.example.accounts/getCostCenters"
}
}
}
Now, the values associated with this property definition can be retrieved by calling the API below:
POST /api/propertydefinitions/costcenter/values
{
"tenantId" : "pepsi",
"dependencyValues" : {
"entries" : [ ]
},
"associateValue" : null
}
The response from this call is the list of values:
{
"values": [
{
"underlyingValue": {
"type": "string",
"value": "1003"
},
"label": "Research & Development"
},
{
"underlyingValue": {
"type": "string",
"value": "4896"
},
"label": "Human Resources"
},
{
"underlyingValue": {
"type": "string",
"value": "6783"
},
"label": "Manufacturing"
}
]
}
Additional Information
For more detailed information on using the property service API, refer to:
-
The Custom Properties Reference topic in the VMWare vRealize Automation Information Center documentation.
-
The vRA Programming Guide.
-
The vRO User Guide.
Related Documentation
Related SDKs
Related Sample Code
- vRealize Automation - Properties ServicevRealize Automation - Properties Service The property service provides APIs to manage property definitions and property groups. Available Use Cases Manage property definitions Manage property groups ...api_vra_properties vRealize Automation POSTMAN Collection
- vRealize Automation property definition and property group tool kitI figured I'd share what I just put together since the vRO plugin for vRA only has create and delete workflows and associated actions. This package adds the ability to copy between vRA instances, ove ...vRealize Automation vRealize Orchestrator Plug-in SDK vRO Package
- VMware vRealize Automation PluginJenkins vRealize Automation Plugin The vRealize Automation Jenkins plugin enables Jenkins to provision vRealize Automation 7 Blueprints. Requirements Jenkins 1.58+ Java 8 to compile plugin or Java 7 ...vRealize Automation Java
- vRealize Automation API Samples for PostmanvRealize Automation API Samples for Postman Overview The vRealize Automation REST API provides consumers and administrators access to all services in its service catalog that support the vRealize Auto ...vRealize Automation POSTMAN Collection
- Project BosphorusProject Bosphorus Background This project is aimed at providing a custom portal framework for vRealize Automation (vRA) along with a reference implementation. It is intended for advanced users/develop ...vRealize Automation Java
- vRealize Automation Reference ApplicationvRealize Automation Reference Application Overview This is a sample project that demonstrates how to create a simple self-service portal for vRealize Automation using only RESTful APIs. You are encour ...vRealize Automation JavaScript
- chef-client example of a bootstrap install on Ubuntu 16.04A basic example to install the chef-client via the install.sh from Chef Software. This should be noted that this only requires wget and bash, so this can work for CentOS, RHEL, debian, Ubuntu, and the ...vRealize Automation vRA Blueprint
- chef-client example of a bootstrap install on Windows using Powershell 3 and upA basic example to install the chef-client via the install.ps1 from Chef Software. This should be noted that this requires Powershell and should work on any version of Windows with Powershell 3+. You ...vRealize Automation vRA Blueprint
- Find all VMs with a particular property value in vRAFind all VMs with a particular property value in vRAvRealize Automation vRealize Orchestrator Plug-in SDK JavaScript
- Rename a vRA IaaS virtual machineRename a vRA IaaS virtual machinevRealize Automation vRealize Orchestrator Plug-in SDK JavaScript
- vRA 7 and above prepare_vra_template.ps1Powershell script designed to deploy the needed agents on your windows template. This mimics the prepare_vra_template.sh file for linux and will deploy java, bootstrap and gugent agents from the vRA a ...vRealize Automation PowerShell
- Get the Reservation of a vRA VMGet the Reservation of a vRA VMvRealize Automation vRealize Orchestrator Plug-in SDK JavaScript
-
- Get the Reservation Policy ID of a vRA ReservationGet the ID of the Reservation Policy of a vRA ReservationvRealize Automation vRealize Orchestrator Plug-in SDK JavaScript
- CentOS Base vRA BlueprintSimple vRA Blueprint for 64-bit CentOS 7.0 VMvRealize Automation vRA Blueprint
- Kubernetes as a Service BlueprintThis blueprint currently requires RHEL/CENTOS 7 Atomic. I do plan to port this to Photon OS as soon as it is GA. Live demo of this solution here > https://youtu.be/X8QfAQmcVjA Full instructions to in ...vRealize Automation vRA Blueprint
- Create Cloud management portal based on VRA APIsThis sample web app shows how to create your own cloud management portal based on vRealize Automation Rest APIs. Key part of this sample is the javascript file https://github.com/chicm/vraclient/blob/ ...vRealize Automation JavaScript
- Add Disk and New SCSI AdapaterSimple vRO package that has the workflows needed to deploy a new disk, to the same datastore as the chosen VM while adding the next available SCSI adapter. See this post for the best usagevRealize Orchestrator Plug-in SDK vRO Package
- prepare_vra_template.ps1 7.0.1UPDATED Script - for combined 7.0, 7.0.1, and 7.1 go to https://developercenter.vmware.com/samples?id=1136vRealize Automation PowerShell
- Chef Server BlueprintThis is for RHEL/CENTOS7 See my guide here for instruction on importing this to your environment.vRealize Automation vRA Blueprint