using New Relic Rest API v2, is there a way to fetch all associated labels on a sever? i.e. I have the server ID, but I want the labels attached to it? Just like you would in AWS EC2 Tags or Chef Tag attributes. I've checked their API docs, but I haven't found anything relevant yet... Thanks!
Probably not with out a little coding. This command:
curl -X GET 'https://api.newrelic.com/v2/labels.json' \ -H 'X-Api-Key:{api_key}' -i
will return all the labels on the account. Part of the output returned contains a "links" section for each label that will list the applications and servers the label is applied to. It will appear like this (in part) showing a single server, in this case:
"links": { "applications": [], "servers": [ 5980960 ]
You would have to 'walk' through the list of labels returned by that request, looking for the server ID of the one you are interested in. Remember that the output is paginated so you you may have more than one page to investigate.
This would be worth contacting New Relic support and suggesting a Feature Request.