Question

API Endpoint to GET Storage Policy

  • 2 April 2024
  • 4 replies
  • 36 views

Badge +2

Hey,

Which API endpoint to use to get Storage Policy for a client? My requirement is to get Storage Policy for all clients, preferably without querying for each client individually. For VM client, I can use the /VM endpoint which lists all the VM with their Storage Policy. I need help with FS clients.

 

Thank You.


4 replies

Userlevel 5
Badge +12

Hello @Prashant Mall 

Thanks for the question, i think you got lucky that our VM client is a pseudo client and it contains all the VM’s as all of our API’s are done from a client level.

Can you not get this detail from the GUI or a report? If the goal is to list out all your clients/SP combinations you can view most of this in the JAVA or CC GUI its self.

Can you advise what your end goal is? 

Kind regards

Albert Williams

Badge +2

Hi @Albert Williams ! I can get these details from GUI but my requirement is to use this in an automation. Our team runs automation written in python, and rely on REST APIs to get most of the details to create reports and do automation. One of the requirements was to also get the Storage Policy so I was wondering if there is a way to get this for all clients instead of making individual API calls for each client.

Hello @Prashant Mall 

Thanks for the question, i think you got lucky that our VM client is a pseudo client and it contains all the VM’s as all of our API’s are done from a client level.

Can you not get this detail from the GUI or a report? If the goal is to list out all your clients/SP combinations you can view most of this in the JAVA or CC GUI its self.

Can you advise what your end goal is? 

Kind regards

Albert Williams

 

Userlevel 5
Badge +16

Nowhere because storage policies are applied at the subclient level. 

You best bet is to use the api to get the subcllients for the client, filter by agent and get the subclient properties for the list of subclient ids retrieved. 

 

So your script would look like so:

  1. Get the Subclients for the client here
  2. Filter out for the sub clients you care about by agent id or appname
  3. Get the Subclient properties here

There is no way that I know of to do it en masse using the canned apis, because the subclient properties api requires a subclient id.

 

The alternative is to cook up a workflow that does a query that returns what you are looking for in SQL and call the workflow from the REST API.

 

 

 

Userlevel 5
Badge +16


Can you not get this detail from the GUI or a report? I

This is another way to get this from the API

 

If a report exists that has what you are looking for you can call the report from the API using it’s dataset id.

 

https://documentation.commvault.com/v11/essential/rest_apis_for_reports.html

Reply