Feature Idea: REST API v2 delete labels from particular applications

Hello colleagues
There is discepancy between the official documentation about deleting lables:
On https://docs.newrelic.com/docs/apis/rest-api-v2/labels-examples-v2/delete-labels-apps-v2
it states that the API will delete the label from the system
and https://rpm.newrelic.com/api/explore/labels/delete states that you can point from which applications to remove the label from.

We have the use case that we need to create automation to delete a label from particular applications. Is it possible to point from which applications to delete it using the v2 of the REST API?

Thank you in advance and best regards
Denitsa Evtimova


New Relic Edit

  • I want this too
  • I have more info to share (reply below)
  • I have a solution for this

0 voters

We take feature ideas seriously and our product managers review every one when plotting their roadmaps. However, there is no guarantee this feature will be implemented. This post ensures the idea is put on the table and discussed though. So please vote and share your extra details with our team.

1 Like

Hey @Denitsa.Evtimova - I think the docs are correct here (and I’ll file a request internally to get the API explorer more in line with docs on this)

There is no available parameter for Application Name or Application ID in the Labels Delete endpoint - so it looks like this isn’t yet possible. I’ll add a feature request to your post for this.

2 Likes

Hi @RyanVeitch,

I work with @Denitsa.Evtimova. I was wondering are there any estimated time frames for such features, so we can decided whether we want to wait or implement our tool to work in a different way, until there is the possibility to delete a label from a single application.

Best Regards,
Stoyko

Hey @stoyko.kodzhabashev & @Denitsa.Evtimova I would suggest go with your solution for now - we can just get these ideas in front of the product development teams, it’s up to them to determine implementation and timeline. As such I don’t have a timeline I can share with you at the moment.

As a potential workaround, could you write a selenium script to go through the New Relic UI and remove the labels? You could then pass the script the parameters of application name and labels to be removed.

Thanks for sharing that workaround @stefan_garnham - @stoyko.kodzhabashev @Denitsa.Evtimova - let us know if that is a possbility for you?

1 Like

Hi Ryan, Stefan,

I wouldn’t say that using selenium is an option for us. I’ve checked whether I can use the same requests that the UI is using in order to delete a label from a single application in script, but it seems to be restricted through rest API (403 Forbidden is the status code).

Thanks for the suggestion, but for us it would be better to modify our tool to achieve our goal with the current API rather than using selenium.

2 Likes

Thanks for confirming that @stoyko.kodzhabashev

Possible workaround with the current API

Downside is that this operation is error prone. And results in 3 API calls instead of one leading to slowing the automation.

Please advise if there is better alternative.

1 Like

Hey @Denitsa.Evtimova - that sounds like a functional workaround, though as you point out, it is far from ideal.

I don’t know of any better options at the moment, but as you know we have got a feature request filed to hopefully get a better out of the box solution for this.

1 Like

Hi is there any update on this feature?
Can someone suggest if is there a way to delete the labels that are associated with applications?

As per my understanding the below API would delete the labels from account based on the {key} provided regardless of any specific applications right?
It would delete form all the applications that bounds the {key}
curl -X DELETE 'https://api.newrelic.com/v2/labels/{key}.json' \ -H 'X-Api-Key:{api_key}' -i ?

Hi there @madhura.d - no update on this right now. That said - you got it right. The API will delete the labels from all apps in the account, not from specific apps.

1 Like

What is the type of API Key that we need to use to delete the labels? Is it the Admin API Key or any other API Key?

@siddhant.agarwal

The Admin user API key should be the one you need.

1 Like