This page applies to an earlier version of the AppDynamics App IQ Platform.
For documentation on the latest version, see the 4.4 Documentation.


Skip to end of metadata
Go to start of metadata

You can fetch the contents of the AppDynamics REST API calls using curl. curl dumps the XML results to standard output.

The syntax for a GET is:

curl --user <appdynamics-username>@<appdynamics-account-name:<appdynamics-password> '<URI>'

The syntax for a POST is:

curl -x POST --user <appdynamics-username>@<appdynamics-account-name:<appdynamics-password> '<URI>'

For example, this command gets the applications on the "demo" server:

curl --user user1@customer1:secret 'http://demo.appdynamics.com/controller/rest/applications'

This command gets the tiers in application 2:

curl --user user1@customer1:secret 'http://demo.appdynamics.com/controller/rest/applications/2/tiers'

This command gets the average response time in the Ecommerce tier of the ACME Online Book Store application over the past two hours:

curl --user user1@customer1:secret 'http://demo.appdynamics.com/controller/rest/applications/Acme%20Online%20Book%20Store/metric-data?metric-path=Business%20Transaction%20Performance%7CBusiness%20Transactions%7CE-Commerce-2%7CCheckout%7CAverage%20Response%20Time%20(ms)&time-range-type=BEFORE_NOW&duration-in-mins=120'

This command uses the -F curl option to import transaction detection rules from the file TEST01.transdetection.aspDotNet.xml into TestApp.

curl --user user1@customer1:secret -F file=@TEST01.transdetection.aspDotNet.xml 'http://demo.appdynamics.com/controller/transactiondetection/TestApp/auto/aspDotNet'

Note that there is a discrepancy in the file parameter specification that the controller expects for the file parameter depending on the type of the API:

  • For transaction detection configuration upload: -F file=@filetoimport.xml
  • For health rule upload: -F fileUpload=@myHealthRule.xml

This command creates an Application Deployment event:

curl -X POST --user admin@customer1:secret "http://demo.appdynamics.com/controller/rest/applications/2/events?eventtype=APPLICATION_DEPLOYMENT&summary=CodePush&comment=134&severity=INFO"

Notice that the URI argument to the curl command is enclosed in quotes. The argument either needs to be enclosed as shown, or you need to escape special characters. Otherwise, you will get misleading errors indicating missing elements from the command, such as a missing summary. Using escapes, the equivalent command would be as follows: 

 

curl -X POST --user admin@customer1:secret http://demo.appdynamics.com/controller/rest/applications/2/events\?eventtype=APPLICATION_DEPLOYMENT\&summary=CodePush\&comment=134\&severity=INFO


  • No labels