vRealize Automation Approval Service API |
Approval Service API Specification
What is the Approval Service REST API?
The approval service provides features for managing and tracking the human approval tasks associated with a service process/artifact in a provider realm. It also provides a record of the approval process when it completes.
The goal of the approval service is to provide a generic approval mechanism that any provider can use for any artifact, such as as a service or a resource action (which follows its own provider specified approval process).
Approval is agnostic to the business artifact it is attached to. There is no representation of the artifact within the approval service. The provider (client of the approval service) stores an identifier of an approval to manage the approvals associated with their artifact.
Typical Use Cases
You can use the approval service REST API to implement approval policies for your service or resource action. You can:
- Define multiple approval levels in which actions must be approved.
- Define approval policies that determine how an artifact is approved.
- Query information about the state of specified approvals and the values of data fields in schemas associated with the service or resource action.
Key Concepts
Approval Level
A level of approval that you define for your service. For each level, you can specify approval criteria.
Approval Modes
Each level supports two modes of approval:
- ANY - If any ONE of the users approves, the approval step is complete and the process moves to the next step; for example, from Level 1 to Level 2. After one approver has approved, the remaining approvers are not allowed to approve that level.
- ALL - All the approvers for the level need to approve. Each approver is assigned a workitem. The approval flow can only move on to the next step after ALL the approvers have approved.
Criteria
Approval criteria are specified in a JSON string of a com.vmware.vcac.platform.content.criteria.Clause
object:
-
Criteria should be set up based on the context that is defined by the corresponding
com.vmware.vcac.core.approvals.domain.policy.ApprovalPolicyType##getClassId()
andcom.vmware.vcac.core.approvals.domain.policy.ApprovalPolicyType##getTypeFilter()
. -
The properties used in the criteria expression must be those of the client side object identified by the
classId
andtypeFilter
.
The CatalogItemRequest
client object provides an example of how criteria are specified. A CatalogItemRequest
has a criteria expression based on Request fields such as RequestedBy
, CatalogItem
, and so on, which are direct properties of the CatalogItemRequest
class.
How the Approval Service Works
Overall High Level Flow
The approval process involves a simple chain of approval steps:
- Currently, the approval service supports only a single series of approval steps.
- Each step in the sequence can contain one or more users.
- Approval flows from level1 to level2 to level3, and so on. The approvers in level2 do not receive an approval request until level1 is approved, and so on for other steps in the series.
- If approvers in ANY level reject the request, the whole approval is rejected. This essentially short circuits the approval process.
- When the final approval step is approved, the Approval instance goes into the APPROVED state.
Notes About Approval Level
- These are referred to as Level N Approval. Each step is activated in sequence, i.e., Level1 Approval is active first, and after it is done, Level2 Approval is active, and so on.
- The users in an approval step can be defined (during approval policy creation/definition) using three different methods, by referring to:
- One or more actual users (hard coding the user ID).
- One or more AD groups (static) and dynamic groups (composed of multiple AD groups and actual users).
- The users from contextual data such as $request.owner or $request.owner.manager, and so on.
- When a step is active, the users in that step are resolved, i.e., groups are expanded and contextual data expression is evaluated. The users in a step are not materialized until that step is active.
- All the users within the step are notified of the pending approval.
- If one of those users reject it, the Approval is short circuited and goes into the REJECTED state.
- A level supports two modes of approval:
- ANY - if any ONE of the users approves, then after the approval step is complete, the the process moves to the next step; for example, from Level1 to Level2. After one approver has approved, the remaining approvers are not allowed to approve that level.
- ALL - All the approvers resolved in this level need to approve. Each approver is assigned a workitem. The approval flow can only move on to the next step after ALL the approvers have approved.
Notes About Criteria Associated with a Level
- Each level has its own criteria that triggers approval from that level.
- Criteria of every level will be evaluated in sequence.
- Criteria is essentially a JSON string of a
com.vmware.vcac.platform.content.criteria.Clause
object. - Criteria should be set up based on the context which is defined by the corresponding
com.vmware.vcac.core.approvals.domain.policy.ApprovalPolicyType##getClassId()
andcom.vmware.vcac.core.approvals.domain.policy.ApprovalPolicyType##getTypeFilter()
- The properties used in the criteria expression must be those of the client-side object identified by the
classId
andtypeFilter
. An example is theCatalogItemRequest
client object, whose criteria expression is based on Request fields such asRequestedBy
,CatalogItem
, and so on, which are direct properties of theCatalogItemRequest
class. - The list of concrete Clauses are:
com.vmware.vcac.platform.content.criteria.AndClause
com.vmware.vcac.platform.content.criteria.OrClause
com.vmware.vcac.platform.content.criteria.NotClause
com.vmware.vcac.platform.content.criteria.ConstantClause
com.vmware.vcac.platform.content.criteria.Expression
com.vmware.vcac.platform.content.criteria.WrapperClause
Related Documentation
Related SDKs
Related Sample Code
- vRealize Automation - WorkItem ServicevRealize Automation - WorkItem Service The work item service provides a standard way for services to present work items to users. It manages the life-cycle of a work item and passes events back to the ...api_vra_approval api_vra_workitem vRealize Automation POSTMAN Collection
- vRealize Automation - Approval ServicevRealize Automation - Approval Service The approval service provides features for managing and tracking the human approval tasks associated with a service process/artifact in a provider realm. It also ...api_vra_approval vRealize Automation POSTMAN Collection
- 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