cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

deleting inactive applications through API

pradeep.kumar
Creator

Hi all,

 

I'm working on the automation for removing inactive applications from the controller. For this i'm checking the following:

1) application with tiers having zero(0) node count and no health status(?)

2) applications with tiers having zero(0) node count and 0 calls per month

 

I'm having issues finding the Health status of a node in a particular tier. This can easily found in the UI but I need this through API call. 

 

can someone please help with this. 

 

Thanks,

Pradeep

 

 

4 REPLIES 4

Ryan.Paredez
Community Manager

Hi @pradeep.kumar,

 

Thanks for your post on the community. I found this AppD Docs page that covers the Health Rule API https://docs.appdynamics.com/display/PRO45/Health+Rule+API

 

If you don't find what you are looking for there, take a look at the sidebar on that page as there is a list of all other AppD APIs.

 

If you find anything in the documentation that was helpful, please do share those results back in this post. This helps keep knowledge sharing alive and closes the loop. 


Thanks,

Ryan, Cisco AppDynamics Community Manager




Found something helpful? Click the Accept as Solution button to help others find answers faster.

Liked something? Click the Thumbs Up button.



Check out Observabiity in Action

new deep dive videos weekly in the Knowledge Base.

Thanks for the response, w.r.t. health rules the provided information is useful.  

 

Now, after finding the tiers which are no longer needed I have to delete them. But I did not find any API to delete a specific tier. 

 

And also I need an API to delete a specific application. I found API call in one of our community responses but it's not working as expected.

 

Can you please provide API  to delete a specific tier and an API to delete a specific application.

The above APIs are useful to automate the cleanup of an inactive application in Appdynamics.

 

Thanks for the help.

Regards,

Pradeep

Hi @pradeep.kumar,

 

I don't have answers to those questions. If I find anything, I will share it back here. In the meantime, let's see if the community can jump in and provide any insight. 


Thanks,

Ryan, Cisco AppDynamics Community Manager




Found something helpful? Click the Accept as Solution button to help others find answers faster.

Liked something? Click the Thumbs Up button.



Check out Observabiity in Action

new deep dive videos weekly in the Knowledge Base.

Hi there

 

You can use the below two ways to delete Applications and Tiers via the API

 

First step as you know is to run the auth query to get the JSESSIONID & X-CSRF-TOKEN

Get Auth Details

curl -i --user <username>@<accountname>:<password> https://<controller details>/controller/auth?action=login

 

Applications

To Delete an application, you can use the default API, to get the ID's of the application, once you have the ID of the application you want to delete you can use the following query

 

curl -X POST -H "Cookie:JSESSIONID=e81ba25c363b479b16d49ccc8e75;" -H "X-CSRF-TOKEN:ab45ea344e5178f08862g03f4f4a4ddb25910934" -H "Content-Type: application/json" -H "Accept: application/json" https://<controller details>/controller/restui/allApplications/deleteApplication --data "<application ID>"

 

The same for Tiers

Use the default API's to get the ID's of the tiers you want to delete(ComponentID) and then tun the following query

 

curl -X DELETE -H "Cookie:JSESSIONID=e81ba24c303be79b16d49ccd8e75;" -H "X-CSRF-TOKEN:ab45ea334e7178f00862f03f4f4a4ddb25910934" -H "Content-Type: application/json" -H "Accept: application/json" https://<controller details>/controller/restui/components/deleteComponent/<componentid>

 

Ciao

 

 

 



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A
Join Us On December 10
Learn how Splunk and AppDynamics are redefining observability


Register Now!

Observe and Explore
Dive into our Community Blog for the Latest Insights and Updates!


Read the blog here