This page applies to an earlier version of the AppDynamics App IQ Platform.
See the latest version of the documentation.


Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 25 Next »

On this page:


Your Rating:
Results:
1 Star2 Star3 Star4 Star5 Star
1 rates
This page describes the AppDynamics API methods you can use to import and export various types of configuration settings in the Controller.

About the Configuration Import/Export APIs

The Configuration Import/Export APIs enables you to migrate configuration settings across Controller accounts, business applications, or Controller instances. You can also use it to add configuration artifacts—such as transaction detection rules, health rules or custom dashboards—to an existing configuration programmatically. 

An exported configuration is an XML or JSON formatted definition file for the configuration. 

<<<TBD

When posting the file, note that the file parameter names differ depending on the type of the API:

  • For transaction detection configuration upload, the parameter name is file: 
    -F file=@filetoimport.xml
  • For health rule upload, the parameter name is fileUpload: 
    -F fileUpload=@myHealthRule.xml 

Export Actions from an Application

Exports all actions in the specified application to a JSON file. If you can view an action or an action template in the application you are exporting from, you have permission to export one.

Format

GET /controller/actions/application_name 

Input parameters

Parameter Name

Parameter Type

Value

Mandatory

application_name

URI

The application name or application ID.

Yes

Example

curl --user user1@customer1:secret http://demo.appdynamics.com/controller/actions/7

[
   {
      actionType: "EmailAction",
      name: "6DA8942B-DF4A-417A-E1NF-59F14231D670",
      priority: 1,
      description: null,
      toAddress: "user1@example.com",
      subject: "",
      timeZone: null
   },
   {
      actionType: "DiagnosticSessionAction",
      name: "MyDiagnotic",
      priority: 0,
      description: null,
      businessTransactionTemplates: [ ],
      numberOfSnapshotsPerMinute: 5,
      durationInMinutes: 10,
      adjudicate: false,
      adjudicatorEmail: null
   }
]

Import Actions to an Application

After you have exported actions, you can import them to a different application passing the JSON file created by the export operation as the payload to a POST request.

The user account you use to make the API call must have permissions to create an action or action template in the account.

Actions in the import file that have conflicting names with actions in the existing configuration are not imported. The import for those actions fail, while new actions are imported successfully.

Use UTF-8 URL encoding of the URI before posting; for example, do not replace a space (" ") with "%20" in the URI.

Format

POST /controller/actions/application_name 

Input parameters

Parameter Name

Parameter Type

Value

Mandatory

application_name

URI

The application name or application ID.

Yes

Example

curl  -X POST --user user1@customer1:secret http://demo.appdynamics.com/controller/actions/38 -F file=@ExportActions.json
 
{"success":true,"errors":[],"warnings":[]}

If there are actions in the file with the same name as ones in the configuration, those actions are not imported, and the response indicates the success of the request as false, as follows:  

{"success":false,"errors":["Not importing Action with name: DuplicateExportedDiagnosticAction, since it already exists."],"warnings":["Imported 1 out of 2 actions"]}  

Export Email Action Templates from an Account

This API exports all the email action templates in the current account in JSON format. 

Format

GET /controller/actiontemplate/email

Example

curl --user user1@customer1:secret http://demo.appdynamics.com/controller/actiontemplate/email

[ {
  "actionPlanType" : "email",
  "name" : "MyCustomEmailTemplate",
  "oneEmailPerEvent" : true,
  "eventClampLimit" : 100,
  "defaultCustomProperties" : [ {
    "id" : 0,
    "version" : 0,
    "name" : "env",
    "value" : "%OS"
  } ],
  "allowCustomRecipients" : true,
  "toRecipients" : [ ],
  "ccRecipients" : [ ],
  "bccRecipients" : [ ],
  "headers" : [ ],
  "subject" : "We've got a situation...",
  "includeTextBody" : true,
  "textBody" : "<h1>Summary of events occurring during the ${policy.digestDurationInMins}+ minute(s) prior to ${action.triggerTime}:</h1> <table> #foreach(${eventList} in ${fullEventsByTypeMap.values()}) #foreach(${event} in ${eventList}) <tr> <td> <!-- Event icon --> <img src="${event.severityImage.mimeContentRef}" alt="${event.severity}" /> </td> <td> <!-- Event name with event link --> <a href="${event.deepLink}">${event.displayName}</a> </td> <td> <!-- Event message --> ${event.eventMessage} </td> </tr> #end #end </table>"",
  "includeHtmlBody" : true,
  "htmlBody" : "<p>Please look into it.</p>",
  "testLogLevel" : "DEBUG",
  "testPropertiesPairs" : [ ],
  "testToRecipients" : [ ],
  "testCcRecipients" : [ ],
  "testBccRecipients" : [ ],
  "eventTypeCountPairs" : [ ]
} ]

Import Email Action Templates

Enables you to import email action templates to an account as JSON file. The import fails if you attempt to import a template with the same name as an existing template of the same type in the destination account.

Use UTF-8 URL encoding of the URI before posting; for example, do not replace a space (" ") with "%20" in the URI.

Format

POST /controller/actiontemplate/email

Example

curl  -X POST --user user1@customer1:secret http://demo.appdynamics.com/controller/actiontemplate/email -F file=@emailactiontemplate.json

{"success":true,"errors":[],"warnings":[]}

Export HTTP Request Action Templates from an Account

This API exports all the HTTP request action templates in the current account to a JSON file.

Format

GET /controller/actiontemplate/httprequest/ 

Example:

curl --user user1@customer1:secret http://demo.appdynamics.com/controller/actiontemplate/httprequest

[ {
  "actionPlanType" : "httprequest",
  "name" : "MyCustomHTTPTemplate",
  "oneRequestPerEvent" : false,
  "eventClampLimit" : -1,
  "defaultCustomProperties" : [ ],
  "method" : "GET",
  "scheme" : "HTTP",
  "host" : "http",
  "port" : 0,
  "path" : "//demo.appdynamics.com//controller/rest/applications/${latestEvent.application.name}/nodes/${latestEvent.node.name}",
  "query" : "",
  "urlCharset" : "UTF_8",
  "authType" : "BASIC",
  "authUsername" : "user1",
  "authPassword" : "secret",
  "headers" : [ ],
  "payloadTemplate" : {
    "httpRequestActionMediaType" : "text/plain",
    "charset" : "UTF_8",
    "formDataPairs" : [ ],
    "payload" : ""
  },
  "connectTimeoutInMillis" : 5000,
  "socketTimeoutInMillis" : 15000,
  "maxFollowRedirects" : 0,
  "responseMatchCriteriaAnyTemplate" : [ ],
  "responseMatchCriteriaNoneTemplate" : [ ],
  "testLogLevel" : "DEBUG",
  "testPropertiesPairs" : [ ],
  "eventTypeCountPairs" : [ ]
} ]

Import HTTP Action Templates to an Account

After you have exported HTTP request action templates, you can import them to a different account by logging into the destination account and passing the JSON file created by the export operation as the payload to the POST request.

You can modify the exported file before you import it. You might want to do this to remove one or more template configurations or to change their names. The import will fail if you attempt to import a template with the same name as an existing template of the same type in the destination account.

Use UTF-8 URL encoding of the URI before posting; for example, do not replace a space (" ") with "%20" in the URI.

Format

GET /controller/actiontemplate/httprequest  

Example

curl  -X POST --user user1@customer1:secret http://demo.appdynamics.com/controller/actiontemplate/httprequest -F file=@httpactiontemplate.json

{"success":true,"errors":[],"warnings":[]}

Export Custom Dashboards and Templates

You can export and import custom dashboards and custom dashboard templates interactively from the Controller UI or programmatically as described here.

The export operation returns a JSON-formatted response, which you can import to another controller.

See Import and Export Custom Dashboards and Templates Using the UI for information on importing and exporting custom dashboards and dashboard templates from the AppDynamics UI.

Export Custom Dashboards

You can use a REST API to export and import custom dashboards and dashboard templates. To get the JSON representation of a custom dashboard, use this API, passing the numeric identifier of the custom dashboard. 

To export the dashboard, the user making the API call must have permissions to view the custom dashboard. 

Format

GET /controller/CustomDashboardImportExportServlet?dashboardId=<dashboard_id>

Input Parameters

Parameter Name

Parameter Type

Value

Mandatory

dashboardId

Query

The numeric ID of the custom dashboard.

You can discover the ID from the end of the URL of the dashboard that you are exporting when you have it open in the controller UI. For example, the end of the URL of this custom dashboard shows that the dashboard id is 3:


location=CDASHBOARD_DETAIL&mode=MODE_DASHBOARD&dashboard=3

Yes

Example

curl --user user1@customer1:secret http://demo.appdynamics.com/controller/CustomDashboardImportExportServlet?dashboardId=8

{
  "schemaVersion" : null,
  "dashboardFormatVersion" : "3.0",
  "name" : "Analytics-BrowserData",
   ...
  "warRoom" : false,
  "template" : false
}

Click the following link to view a complete response example: 

 Click to view dashboard export sample...
{
  "schemaVersion" : null,
  "dashboardFormatVersion" : "3.0",
  "name" : "Analytics-BrowserData",
  "description" : null,
  "properties" : null,
  "templateEntityType" : "APPLICATION_COMPONENT_NODE",
  "associatedEntityTemplates" : null,
  "minutesBeforeAnchorTime" : 15,
  "startDate" : null,
  "endDate" : null,
  "refreshInterval" : 120000,
  "backgroundColor" : 15395562,
  "color" : 15395562,
  "height" : 768,
  "width" : 1024,
  "canvasType" : "CANVAS_TYPE_GRID",
  "layoutType" : "",
  "widgetTemplates" : [ {
    "widgetType" : "AnalyticsWidget",
    "title" : "Browser_data",
    "height" : 4,
    "width" : 4,
    "x" : 0,
    "y" : 0,
    "label" : "",
    "description" : "",
    "drillDownUrl" : "",
    "useMetricBrowserAsDrillDown" : false,
    "backgroundColor" : 16777215,
    "backgroundColors" : null,
    "backgroundColorsStr" : null,
    "color" : 4210752,
    "fontSize" : 12,
    "useAutomaticFontSize" : false,
    "borderEnabled" : false,
    "borderThickness" : 0,
    "borderColor" : 0,
    "backgroundAlpha" : 1.0,
    "showValues" : false,
    "compactMode" : false,
    "showTimeRange" : false,
    "renderIn3D" : false,
    "showLegend" : false,
    "legendPosition" : null,
    "legendColumnCount" : null,
    "startTime" : null,
    "endTime" : null,
    "minutesBeforeAnchorTime" : 0,
    "isGlobal" : true,
    "propertiesMap" : null,
    "dataSeriesTemplates" : null,
    "adqlQueries" : [ "SELECT appkey, pageexperience, distinctcount(pageurl) AS \"URL (Count Distinct)\" FROM browser_records LIMIT 100,100" ],
    "analyticsWidgetType" : "COLUMN",
    "maxAllowedYAxisFields" : 3,
    "maxAllowedXAxisFields" : 2,
    "min" : null,
    "interval" : 98,
    "max" : null,
    "intervalType" : "By Fixed Number",
    "showMinExtremes" : null,
    "showMaxExtremes" : null,
    "displayPercentileMarkers" : null,
    "percentileValue1" : null,
    "percentileValue2" : null,
    "percentileValue3" : null,
    "percentileValue4" : null,
    "resolution" : "1m",
    "dataFetchSize" : null,
    "percentileLine" : null,
    "timeRangeInterval" : null,
    "pollingInterval" : null,
    "unit" : null
  } ],
  "warRoom" : false,
  "template" : false
}o

Import Custom Dashboards and Templates

You can import custom dashboard and templates based on a previously exported JSON definition, which has optionally been modified. Import the definition as an application/json content type.

Use UTF-8 URL encoding of the URI before posting; for example, do not replace a space (" ") with "%20" in the URI.

To import a dashboard, the user making the API call must have create dashboard permissions in the Controller. 

Prior to version 4.1, exported custom dashboards were in XML format. You can import the custom dashboards in XML format into the current Controller. The next time you export the custom dashboard, it will be exported in JSON format.

Format

POST /controller/CustomDashboardImportExportServlet 

Example

curl  -X POST --user user1@customer1:secret http://demo.appdynamics.com/controller/CustomDashboardImportExportServlet -F file=@customdashboards.json

{"success":true,"errors":[],"warnings":[],"createdDashboardName":"Uploaded-Analytics-BrowserData"}

Retrieves Health Rules from an Application

Returns the health rules configured in an application in XML format. 

The user account you use to make the API call must have permissions to view the health rule. 

 

 

 

 

Exporting Health Rules from an Application

Exports are HTTP GET operations.

Export the configurations for all health rules in an application

http://<controller-host>:<controller-port>/controller/healthrules/<application-name|application-id>

Example

http://pm1.appdynamics.com:80/controller/healthrules/3

produces the output in all_health_rules.

Export the configuration for a single health rule

http://<controller-host>:<controller-port>/controller/healthrules/<application-name|application-id>?name=<health_rule_name>

For example:

http://pm1.appdynamics.com/controller/healthrules/3?name=Business Transaction response time is much higher than normal

produces the output in one_health_rule.

Importing Health Rules to an Application

Imports are HTTP POST operations.

After you have exported health rules you can import them to a different application passing the xml file created by the export operation as payload to the POST. You can modify the exported file before you import it. You might want to do this to add or remove one or more health rule configurations or to change their names.

Use UTF-8 URL encoding of the URI before posting; for example, do not replace a space (" ") with "%20" in the URI.

The default behavior is not to overwrite an existing health rule of the same name. If you want to overwrite an existing health rule of the same name, specify the overwrite=true parameter. since the default is false.

The syntax is the same for importing one health rule configuration or several. All the health rule configurations in the xml file are imported.

Import the configurations for health rules in an application

http://<controller-host>:<controller-port>/controller/healthrules/<application-name|application-id>?overwrite=true|false

This example imports the health rules in the uploaded file, overwriting any health rules of the same name.

The next example imports the health rules without overwriting. In this case, any health rules in the destination controller that have the same names as health rules in the all_health_rules file are not overwritten.

 

 


Transaction Detection Rules

You can import and export all your entry point configurations or one entry point configuration in a single request. You cannot import or export multiple entry points in a single request unless you import/export all of them.

You can import to or export from the following application-level and tier-level configurations:

  • Auto-detected entry point configurations

  • Custom match rules

  • Exclude rules

Guidelines for exporting entry point configurations:

  • Use the HTTP GET method.
  • Encode the URI using UTF-8 URL encoding.

  • The Controller exports the configurations to an XML file. If necessary, you can edit the XML file before you import it.
    For example, if you export all auto-detected entry points but don't want to import them all, delete the ones you do not want from the file before import.

Guidelines for importing entry point configurations:

  • Export the auto-detected entry point configuration, custom match rule, or exclude rule from the Controller.
    Alternately, you can manually create the XML.

  • Use the HTTP POST method.
  • Encode the URI using UTF-8 URL encoding.

  • Include the XML configuration as a file attachment to the request.

  • Use UTF-8 URL encoding of the URI before posting.

  • A successful import request returns HTTP status code 200.

Overwrite Parameter

Use the overwrite parameter to overwrite a configuration of the same name. Without this parameter, if the import encounters a configuration for a component of the same name, the request will fail.

For example, to import a configuration for a custom match rule named "My Rule" to an application that has an existing "My Rule" custom match rule that you want to overwrite use:

http://demo.appdynamics.com:8090/controller/transactiondetection/Wine+Cellar/custom/nodeJsWeb/My+Rule?overwrite=true

The default is overwrite=false.

Auto-Detected Entry Point Configurations

Import or export the configurations for all the auto-detected entry-points to or from an application

http://<controller host>:<controller port>/controller/transactiondetection/<application name>/auto

exports all the auto-detected entry point types for all agents: ASP.NET, Java, PHP, NodeJS, etc.

For example:

http://appdcontroller.example.com/controller/transactiondetection/Howdy+World+Travel/auto

produces the output in auto_all.xml.

Import or export the configuration for a single auto-detected entry point type to or from an application

http://<controller-host>:<controller-port>/controller/transactiondetection/<application name>/auto/<entry point type name>

The following entry point type names are valid for their respective agents. Entry point types names are case insensitive.

Java.NETPHPNode.js
binaryRemoting (for Thrift)
servlet
strutsAction
springBean
ejb
pojo
jms
webService

aspDotNet (for ASP.NET)
dotNetWebService (for Web Service)
wcf
poco (for .NET Class/Method)
dotNetJms (for Message Queues)
dotNetRemoting

phpWeb
phpMvc
phpDrupal
phpWordpress
phpCli
phpWebService

nodeJsWeb

Import or export the configurations for all the auto-detected entry-points to or from a tier

http://<controller-host>:<controller-port>/controller/transactiondetection/<application name>/<tier name>/auto

Import or export the configuration for a single auto-detected entry point type to or from a tier

http://<controller host>:<controller port>/controller/transactiondetection/<application name>/<tier name>/auto/<entry point type name>

Custom Match Rule Configurations

Import or export a single custom match rule to or from an application

http://<controller_host>:<controller–port>/controller/transactiondetection/<application name>/custom/<entry point type name>/<custom rule name>

Import or export a single custom match rule to or from a tier

http://<controller host>:<controller port>/controller/transactiondetection/<application name>/<tier name>/custom/<entry point type name>/<custom rule name>

Exclude Rules Configurations

Import or export a single exclude rule to or from an application

http://demo.appdynamics.com:8090/controller/transactiondetection/<application name>/exclude/<entry point type name>/<exclude rule name>

Import or export a single exclude rule to or from a tier

http://demo.appdynamics.com:8090/controller/transactiondetection/<application name>/<tier name>/exclude/<entry point type name>/<exclude rule name>
  • No labels