VMware Cloud Community
ramprasadram
Contributor
Contributor
Jump to solution

How to find request id after executing VM Action on VM using vRA REST API

Hi Everyone.

I'm trying to find out request id of VM Action (reboot, poweroff or poweron etc) when triggered on VM using vRA REST API but looks like vRA API [

POST​/api​/consumer​/resources​/{resourceId}​/actions​/{resourceActionId}​/requests] doesn't return the request id of VM action executed on VM. It returns  resouceId, actionId but not request id. Following is response body documented in VMware API 7.x Guide which doesn't have request id.

{
 
"resourceId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
 
"reasons": "string",
 
"data": {
  
"additionalProp1": {},
  
"additionalProp2": {},
  
"additionalProp3": {}
 
},
 
"actionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
 
"description": "string"
}

Also, I have verified executed VM Action using vRA UI portal, and I can see request id in the vRA UI portal URL for each VM action which are executed on VM. I believe the same should be also possible using vRA APIs and should be able to get request id of VM Action.

I need your help please check if you have any idea. Thanks in Advance.

Regards,

Ramprasad

0 Kudos
1 Solution

Accepted Solutions
Hejahida82
VMware Employee
VMware Employee
Jump to solution

From memory the request id is returned in the headers of the response and not the body. Check the headers for a value named location, that value should be a url that you can use to monitor the status of the request e.g. https://<vra fqdn>/catalog-service/api/consumer/requests/288d64a4-c344-4d7d-b08e-c9a7a6189935 that last part of the url is the request id, it does not provide the simple id value you see in the vRA gui.

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.

View solution in original post

0 Kudos
1 Reply
Hejahida82
VMware Employee
VMware Employee
Jump to solution

From memory the request id is returned in the headers of the response and not the body. Check the headers for a value named location, that value should be a url that you can use to monitor the status of the request e.g. https://<vra fqdn>/catalog-service/api/consumer/requests/288d64a4-c344-4d7d-b08e-c9a7a6189935 that last part of the url is the request id, it does not provide the simple id value you see in the vRA gui.

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.

0 Kudos