/build/static/layout/Breadcrumb_cap_w.png

Query Labels from KACE API

Is this possible?

I'd like to use the API to return a set of machines for a given label. I don't see anything in the documentation that shows how one would fetch this data, if it is possible.

We'd like to use this for integration with other automation workflows in our environment.

I know how to do this using a MySQL client, but I'd prefer to use the REST API so I don't have a Sql dependency.

Can anyone point me in the right direction? 

0 Comments   [ + ] Show comments

Answers (2)

Posted by: chucksteel 6 years ago
Red Belt
3
You want to use a filter on label.name:
/api/inventory/machines?filtering=label.name eq Library Services

In the API reference guide there is a list of Definitions at the end of the Inventory API Reference section. Those definitions define what you can use to filter the results. For instance, the machine schema contains many of the columns from the MACHINE table and this API query will return machines where the OS_Name contains macOS:
/api/inventory/machines?filtering=machine.os_name co macOS




Comments:
  • Awesome. Exactly what I need. Thanks for the answer. - ndelo 6 years ago
Posted by: isudothings 5 years ago
Senior Purple Belt
0
If you use Powershell, there's a community written module that will query the API and return a result.

This will retrieve machines in a smart label called "D - SmartLabel - Test"

Get-SmaMachineInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) -QueryParameters "?shaping=machine all&paging=limit ALL&filtering=label.name eq D - SmartLabel - Test"

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ