Request VM using VRA7 REST API – VMWare vRealize Automation

REST: Rest is used to connect between machines/applications using HTTP protocol. Restful applications supports CRUD (Create/Read/Update/Delete) operations. REST is a Client-Server architecture model. VRA is REST Server and client can be Custom Web portal, ServiceNow, vRealize Orchestrator or any other Rest clients like POSTMAN.

Using VRA REST API Service calls, we can programmatically perform actions (requesting a VM, create a business group, etch) that we perform through VRA Console. The typical use cases for VRA Rest APIs are 1). Requesting VMS through custom developed web portal 2). Requesting VMs through service now.

Request Catalog item using VRA 7 Rest API

This blog post covers the procedure to request a catalog item using a Rest Client Postman

  1. Acquire a HTTP Bearer Token for authentication
  2. Get VRA Catalog items
  3. Get the json template required to request the catalog item
  4. Request Catalog item
  5. Check status of the request

Let us see the detailed steps

Step1 : Acquire a HTTP Bearer Token for authentication

  • url :https://<vrafqdn>/identity/api/tokens
  • type: Post
  • Headers : Content-type : application/json
  • Body :

    {

    “username” : “userid”,

    “password” : “passd”,

    “tenant” : “tenant name”

    }



Status 200 means post operation is succeeded and you can see the token generated. By default this token is valid for 24 hours. If you want to change the duration then you need to edit the value of identity.basic.token.lifetime.hours=N (N = # of hours) in /etc/vcac/security.properties file in VRA appliance

Copy the token

Step2 : Get VRA Catalog Items

  • url : https://<vra fqdn>/catalog-service/api/consumer/catalogitems
  • Type : Get
  • Headers : Content-type : application/json , Authorizaton : Bearer <token> , Accept : application/json


Now you can see the list of catalogitems


Step3 : Get the json template required to request the catalog item

Click on the hyperlink of request template

  • Type : Get
  • Headers : Accept : application/json , Authorization : Bearer <token>
  • Click Send

In the response we can see all the properties and required data we need to provide while submitting the request


Step4 : Request Catalog item


You can see the request in VRA Console requests tab

Step5 : Check status of the request


VMWare vRealize Automation REST API
VRA Event Broker Service (EBS)
No tags for this post.

Leave a Comment