New Relic Labels API
The above page, and associated REST API, does not work if you are creating a new label.
Eg. using the following JSON will return an HTTP 500, assuming the label pair “NewCategory:test” does not already exist in your account:
{ "label": { "category": "NewCategory", "name": "test", "links": { "applications": [], "servers": [<my_server_id>] } } }
If I then go into the New Relic UI and create the label NewCategroy:test, then I can successfully add additional servers / applications using the above JSON, but I need to create each LabelCategory:LabelName pair in the UI before this will work, which is far from ideal when we want to automate the (re)creation of an environment in a reproduce-able manner.
Note, I did try a curl issuing a POST rather than a PUT on the off chance this would allow creation of a new label, but it acted just like a GET (returned HTTP 200 along with the list of labels).
- Is there a different API to create new labels? There is nothing documented in the Api Explorer.
- If this a bug in the Create Label API?