2 Posts
0
806
REST API - obtaining the CID for a VM
HI all,
I'm reading through the REST API documentation and testing commands via swagger-ui, however pretty much all client commands require knowledge of the client's CID but for the use-case of this application we'd only know the client name, not it's CID.
Is there a simple way to pass the client name to REST API and obtain it's CID please? The only option I'm seeing at the moment is performing a recursive GET Clients on the 1000+ clients in our estate and working out the CID from there.
TIA!
nakniks
2 Posts
0
May 11th, 2023 08:00
To answer my own question, you need to use "Get Clients" (/v1/clients), which returns info for all Avamar clients in the given domain/etc..
The CID is returned in the "id" field.
So you could build an array or strip out what you want in a calling script, or to get details for a specific client use filter: name=="vmName"
dynamox
1 Rookie
1 Rookie
•
20.4K Posts
0
May 12th, 2023 07:00
yep, something like this:
/api/v1/clients?domain=/&recursive=true&size=100&filter=domainFqdn!=/MC_RETIRED&fields=id,name
If you have a lot of clients, you will need to "page" through them.