Solved

Rest API for VMs

  • 18 February 2022
  • 6 replies
  • 202 views

Badge +4

I am trying to determine the correct REST API “get” to list all VM clients (guests) being protected. Maybe I am missing it or it’s more difficult than I think. I can list all VM hosts, VSAs, datastores, etc, but I just need a list of VMs being backed up. 

Any help would be greatly appreciated!

Thanks!

icon

Best answer by tgladson 3 March 2022, 19:27

View original

If you have a question or comment, please create a topic

6 replies

Userlevel 3
Badge +4

Hi @tgladson ,

I looked into this and can agree that it’s at least not easy to find this particular information with REST api (protected vm’s as opposed to just a list of all vm’s). We do have a VM backup report available on the store.

https://documentation.commvault.com/search?q=protected%20vm%20report&oem=commvault&majorVersion=11&minorVersion=24&site=essential

 

I understand that you are looking to pull this from and api call though.  A suggestion is that you use the api to pull report data from this report. A starting point for pulling report information via api calls is in the link below

https://documentation.commvault.com/11.24/essential/115048_rest_apis_for_reports.html

 

Regards

Joe

 

Badge +4

Thanks, @JBuratti !

I hadn’t looked at getting the data using the report api. I took a quick look and...well….the data is there. Now to figure out how to get it in the format I want. 

 

Badge +4

@JBuratti  Using the API I have tried https://<<commserv>>/webconsole/api/VM?status=1 but it is only pulling about 70 VMs and it should be listing thousands. Am I missing something to pull all VMs?

Userlevel 7
Badge +23

@tgladson , have you looked at GET VM Details?

https://api.commvault.com/#c39d4219-26e0-4090-b6a0-103f8319330b

That should give you the backup status and a lot more.

Badge +4

I figured it out with the help of Commvault Support. You need to put the pagesize in the header of the API request.

Userlevel 7
Badge +23

Glad to hear it!