nakniks

updated

3 years ago

Closed

N

nakniks

1 Rookie

2 Posts

0

1378

May 3rd, 2023 01:00

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

    1 Rookie

    2 Posts

    682

    0

    Posted 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

    11 Legend

    20419 Posts

    87439 Points

    648

    0

    Posted 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.