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 19 Next »

On this page:


Your Rating:
Results:
1 Star2 Star3 Star4 Star5 Star
1 rates
The configuration import/export APIs allow you import and export AppDynamics configurations to avoid having to manually reconfigure across multiple applications, or in some cases multiple accounts.

About the Configuration Import/Export APIs

The Configuration Import/Export APIs let you migrate configuration settings across Controller accounts, business applications, or Controller instances. It also lets you supplement an existing configuration with new artifacts, such as new transaction detection rules or health rules, programmatically.  

The import API methods are POST methods that take XML or JSON formatted files with the configuration definition.

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 

Actions and Action Templates

You can export and import your policy actions and your email and HTTP request action templates. This capability allows you to re-use action configurations in different applications, and action templates in different accounts, instead of re-configuring each application or account manually.

Exports are HTTP GET operations. If you can view an action or an action template in the application you are exporting from, you have permission to export one.

Imports are HTTP POST operations. If you can create an action or an action template in the account you are importing to, you have permission to import one.

Export Actions from an Application

Exports all actions in the specified application to a JSON file.

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
   }
]

Importing 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.

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 in the same import file succeed, as indicated in the following response message: 

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

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 fileUpload=@ExportActions.json
 
{"success":true,"errors":[],"warnings":[]}

Exporting Email Action Templates from an Account

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

URI:

http://<controller-host>:<controller-port>/controller/actiontemplate/email

Example:

https://demo:80/controller/actiontemplate/email

Importing Email Action Templates to an Account

After you have exported email 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 payload to the POST.

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.

URI:

http://<controller-host>:<controller-port>/controller/actiontemplate/email

Example:

This example imports the templates in the EmailActionPlan1.json file to the current account.

Exporting HTTP Request Action Templates from an Account

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

URI:

http://<controller-host>:<controller-port>/controller/actiontemplate/httprequest/

Example:

http://demo:80/controller/actiontemplate/httprequest

Importing 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 payload to the POST.

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.

URI:

http://<controller-host>:<controller-port>/controller/actiontemplate/httprequest

This example imports the templates in the HTTPActionPlan1 file.

Example:

 

Custom Dashboards and Templates

You can export and import custom dashboards and custom dashboard templates interactively from the Controller UI or programatically using the special REST API described here.

The export operation creates a JSON file, which you can then import to another controller.

JSON files being imported must be UTF-8-encoded.

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 and Import Custom Dashboards Using a REST API

You can use a REST API to export and import custom dashboards and dashboard templates.

If you can view a custom dashboard, you can export it.

If you can create a custom dashboard, you can import it.

Export Custom Dashboards and Templates with the REST API

This is a GET operation. It outputs the dashboard configuration to a JSON file.

http://<controller host:port>/controller/CustomDashboardImportExportServlet?dashboardId=<unique_dashboard_ID>

For example:

 http://cents-docdemo-01:8080/controller/CustomDashboardImportExportServlet?dashboardId=3

You can get the unique dashboard 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

Import Custom Dashboards and Templates with the REST API

This is a POST operation. Use the same syntax for the URL as used for the export but with no dashboard parameter.

Upload the exported JSON as an application/json content type. The form field for the POST operation is "fileUpload".

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

For added security, this operation requires that you specify a CSRF token in the header of the upload code path. You can get this token in the browser cookie for the controller url. Get the token when you are ready to do the the POST, because the token is valid only for the current session. See http://www.wikihow.com/View-Cookies for tips on how to find the cookie or use the following example from Chrome Version 43.

 Find the CSRF token in the browser cookie on Chrome
  1. In the browser from which you will make the POST request, click Settings in the browser menu icon.
  2. Scroll down to the bottom and click Show advanced settings.
  3. In the Privacy section click Content Settings.
  4. In the Content settings window under Cookies, click All cookies and site data.
  5. In the Cookies and site data window, filter on the first segment of the controller url.
  6. Click the X-CSRF-TOKEN button.
  7. Copy the the Content, which is the token.

Add the token preceded by "X-CSRF-TOKEN:" to the request headers.

For example:

Importing Custom Dashboards Exported with an Earlier Controller

Prior to release 4.1 AppDynamics exported custom dashboards in XML format.

You can still import these XML files into a 4.1 controller. The next time you export the custom dashboard, it will be exported in JSON format.


Health Rules


You can export your health configurations from one application to another using a special AppDynamics REST API. This capability allows you to re-use health rule configurations in different applications instead of re-configuring each application manually from the AppDynamics console.

If you can view a health rule, you can export it.

If you can create a health rule, you can import it.

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