This page applies to an earlier version of the AppDynamics App IQ Platform.
See the latest version of the documentation.
On this page:
For information about the alert and response features, see Alert and Respond.
Retrieve All Health Rule Violations in a Business Application
Returns all health rule violations that have occurred in an application within a specified time frame.
URI
/controller/rest/applications/application_id/problems/healthrule-violations
Input parameters
Parameter Name | Parameter Type | Value | Mandatory |
---|---|---|---|
application_id | URI | Provide either the application name or application id. | Yes |
time-range-type | Query | Possible values are: BETWEEN_TIMES To use this option, you must also specify the "start-time" and "end-time" parameters. The "BETWEEN_TIMES" range includes the start- time and excludes the end-time. | Yes |
duration-in-mins | Query | Duration (in minutes) to return the metric data. | If time-range-type is BEFORE_NOW, BEFORE_TIME, or AFTER_TIME |
start-time | Query | Start time (in milliseconds) from which the metric data is returned. | If time-range-type is AFTER_TIME or BETWEEN_TIMES |
end-time | Query | End time (in milliseconds) until which the metric data is returned. | If time-range-type is BEFORE_TIME or BETWEEN_TIMES |
output | Query | HTTP Request parameter included as part of the URL to change the output format. Valid values are "XML" (default) or "JSON". | No |
Retrieve Event Data
You can capture data for the event types listed in the event-types parameter.
URI
/controller/rest/applications/application_id/events
Input Parameters
Parameter Name | Parameter Type | Value | Mandatory |
---|---|---|---|
application_id | URI | Provide either the application name or application id. | Yes |
time-range-type | Query | Possible values are: | Yes |
duration-in-mins | Query | Specify the duration (in minutes) to return the metric data. | If time-range-type is BEFORE_NOW, BEFORE_TIME, or AFTER_TIME |
start-time | Query | Specify the start time (in milliseconds) from which the metric data is returned. | If time-range-type is AFTER_TIME or BETWEEN_TIMES |
end-time | Query | Specify the end time (in milliseconds) until which the metric data is returned. | If time-range-type is BEFORE_TIME or BETWEEN_TIMES |
event-types | Query | Specify the comma-separated list of event types for which you want to retrieve event information. See the Events Reference for the valid event types. | Yes |
severities | Query | Specify the comma-separated list of severities for which you want to retrieve event information.
| Yes |
output | Query | HTTP Request parameter included as part of the URL to change the output format. Valid values are "XML" (default) or "JSON". | No |
Example
Retrieve the list of events of type "APPLICATION_ERROR" or "DIAGNOSTIC_SESSION" of any severity that occurred in the specified time range:
curl --user user1@customer1:secret http://demo.appdynamics.com//controller/rest/applications/6/events?time-range-type=BEFORE_NOW\&duration-in-mins=30\&event-types=%20APPLICATION_ERROR,DIAGNOSTIC_SESSION\&severities=INFO,WARN,ERROR <events><event> <id>44658</id> <type>DIAGNOSTIC_SESSION</type> <subType>ERROR_DIAGNOSTIC_SESSION</subType> <eventTime>1451343453085</eventTime> <severity>WARN</severity> <summary>Starting Diagnostic Session after series of errors for a Business Transaction 18% (2/11) of requests had errors in the last minute starting 12/28/15 10:57 PM local time</summary> <affectedEntities> <entity-definition> <entityType>APPLICATION</entityType> <entityId>6</entityId> <name>ECommerce</name> </entity-definition> <entity-definition> <entityType>APPLICATION_COMPONENT</entityType> <entityId>11</entityId> <name>ECommerce-Services</name> </entity-definition> <entity-definition> <entityType>APPLICATION_COMPONENT_NODE</entityType> <entityId>19</entityId> <name>ECommerce_WEB2</name> </entity-definition> <entity-definition> <entityType>BUSINESS_TRANSACTION</entityType> <entityId>35</entityId> <name>/items/all.GET</name> </entity-definition> <entity-definition> <entityType>MACHINE_INSTANCE</entityType> <entityId>8</entityId> <name>ECommerce-web1</name> </entity-definition> </affectedEntities> <triggeredEntity> <entityType>APPLICATION_COMPONENT_NODE</entityType> <entityId>19</entityId> <name>ECommerce_WEB2</name> </triggeredEntity> <markedAsRead>false</markedAsRead> <markedAsResolved>false</markedAsResolved> <archived>false</archived> <deepLinkUrl>http://demo.appdynamics.com:8090/controller/#location=APP_EVENT_VIEWER_MODAL&eventSummary=44658</deepLinkUrl> </event> </events>
Create Events
Application deployment events notify AppDynamics when you upgrade your application, push new code, etc. This lets you correlate these application deployment activities with other data inside AppDynamics. This is useful for regression analysis, root cause analysis, and performance studies. A useful practice is to include injection of your application deployment event into AppDynamics as part of the build process for deploying a new version of your application.
The AppDynamics REST API lets you integrate events of type "APPLICATION_DEPLOYMENT" with other systems.
For example, suppose you want to create an event automatically in your AppDynamics monitored system for every new release. To integrate these systems, use the following REST API to create an event of type "APPLICATION_DEPLOYMENT" in your managed environment.
You should receive the event ID after successful invocation of the request.
URI
POST /controller/rest/applications/application_id/events
Input parameters
Parameter Name | Parameter Type | Value | Mandatory |
---|---|---|---|
application_id | URI | Provide either application name or application id. | Yes |
summary | Query | Provide the summary for the event. | Yes |
comment | Query | Provide the comments (if any) for the event. | No |
eventtype | Query | APPLICATION_DEPLOYMENT | Yes |
severity | Query | Provide a severity level. Allowed values
In the UI, these become "Info", "Warning", and "Critical" | Yes |
Create a Custom Event
You can create custom events to be reported in the AppDynamics event viewer and in the events panels on the AppDynamics dashboards. See Monitor Events to learn how to filter on your custom events so that you can find them. Then you can create alerts triggered by these events as you do for AppDynamics standard events.
You should receive the event ID after successful invocation of the request.
URI
POST /controller/rest/applications/application_id/events
Input parameters
Parameter Name | Parameter Type | Value | Mandatory |
---|---|---|---|
application_id | URI | Provide either application name or application id. | Yes |
summary | Query | Provide a summary describing the event. | Yes |
comment | Query | Provide a comment for the event. | No |
severity | Query | Provide a severity level. Allowed values
In the UI, these become "Info", "Warning", and "Critical" | Yes |
eventtype | Query | CUSTOM | Yes |
customeventtype | Query | Provide a name for the "type"; for example, the source, like "nagios" | No |
node | Query | Provide the affected node name | No |
tier | Query | Provide the affected tier name | Yes, if node and bt are specified |
bt | Query | Provide the affected business transaction name | No |
propertynames | Query | Provide a property name as a pair, i.e., the "key" | No, but if one element of the pair is defined, the other must be defined also |
propertyvalues | Query | Provide the property value as a pair, i.e., the "value" | No, but if one element of the pair is defined, the other must be defined also |
Example
curl -X POST --user user1@customer1:secret 'http://demo.appdynamics.com/controller/rest/applications/5/events?severity=INFO&summary=test1&eventtype=CUSTOM&customeventtype=mycustomevent&propertynames=key1&propertynames=key2&propertyvalues=value1&propertyvalues=value'
Note the pattern for custom properties: propertynames and propertyvalues get matched up by order position, so to set N property values, you need N occurrences of propertynames and N occurrences of propertyvalues.
Create Custom URLS for Notifications
Single tenants in a multi-tenant Controller instance should use this API method to specify a custom "vanity" URL for notification purposes. So instead of a URL such as paid8.appdynamics.com being displayed as the host, the custom URL can be displayed as something like "mycompany.appdynamics.com" in the notification.
URI
POST /controller/rest/accounts/customer_name/update-controller-url
Input parameters
Parameter Name | Parameter Type | Value | Mandatory |
---|---|---|---|
customer_name | URI | The customer account name | Yes |
Body Parameter
As Application/JSON content:
{ "controllerURL": "http://<my-custom-hostname:port>" }
If the URL in the alerts is invalid, you can set it using the following curl command:
curl -k --basic --user root@system --header "Content-Type: application/json" --data '{ "controllerURL": "http://<controller>:<port>" }' http://<controller>:<port>/controller/rest/accounts/<ACCOUNT-NAME>/update-controller-url
For example:
curl -k --basic --user root@system --header "Content-Type: application/json" --data '{ "controllerURL": "https://myVIP:443" }' https://myhost:8181/controller/rest/accounts/customer1/update-controller-url
There is no need to reset the controller. Upgrading the controller will reset the deeplink URL settings.
Create and Delete Action Suppressions
By default any response is in JSON, although XML can be requested by using the following header:
Retrieve All Existing Action Suppressions
Gets a list of all existing action suppressions.
URI
GET /controller/api/accounts/account_id/applications/application_id/actionsuppressions
Input parameters
Parameter Name | Parameter Type | Value | Mandatory |
---|---|---|---|
account_id | URI | The account ID | Yes |
application_id | URI | The application ID | Yes |
Example request to get all action suppressions:
/controller/api/accounts/2/applications/9/actionsuppressions
Example response:
Status : 200 ok Output Data : {"actionSuppressions": [{"id": "15","name": "App-ASW","timeRange": {"startTimeMillis": "2014-10-25T04:16:30+0000","endTimeMillis": "2014-10-25T06:16:30+0000"},"affects": {"type": "APP"}},{"id": "16","name": "Node-ASW","timeRange": {"startTimeMillis": "2014-10-25T04:16:57+0000","endTimeMillis": "2014-10-25T05:16:57+0000"},"healthRuleIds": [60,61],"affects": {"type": "NODE","nodeAffectedEntities": {"type": "SPECIFIC","nodeType": "ALL","nodes": [17,18]}}}],"actions": [{"href": "http://demo.appdynamics.com:8090/controller/api/accounts/2/applications/9/actionsuppressions/%7Bactionsuppressions.id%7D/%7Bactions.name%7D","method": ["POST","DELETE"],"name": "enabled"}],"links": [{"href": "http://ec2-54-80-163-175.compute-1.amazonaws.com:8090/controller/api/accounts/2/applications/9/actionsuppressions/%7Bactionsuppressions.id%7D","name": "actionsuppressions"}]}
Retrieve a Specific Action Suppression by ID
Get the action suppression by specified ID.
URI
/controller/api/accounts/account_id/applications/application_id/actionsuppressions/actionsuppression_id
Input parameters
Parameter Name | Parameter Type | Value | Mandatory |
---|---|---|---|
account_id | URI | The account id | Yes |
application_id | URI | The application id | Yes |
actionsuppressions_id | URI | The action suppression id | Yes |
Example request:
/controller/api/accounts/2/applications/9/actionsuppressions/15
Example response:
Status : 200 ok Output Data : {"id": "15","name": "App-ASW","timeRange": {"startTimeMillis": "2014-10-25T04:16:30+0000","endTimeMillis": "2014-10-25T06:16:30+0000"},"affects": {"type": "APP"}}
Create a New Action Suppression
This is a POST request. Should return a 201 - created response.
URI
POST /controller/api/accounts/account_id/applications/application_id/actionsuppressions
Input parameters
Parameter Name | Parameter Type | Value | Mandatory |
---|---|---|---|
account_id | URI | The account id | Yes |
application_id | URI | The application id | Yes |
name | body key | The name of the action suppression window | Yes |
timeRange | body key | The start and end time of the window | Yes |
healthRuleIds | body key | The ids of the affected health rules. If not provided, all rules affected | No |
affects | body key | Type of entity and corresponding ids (see below) | Yes |
Content of "affects"
Scope | Type | Value | Example |
---|---|---|---|
Application | APP | Covers the entire application | "affects": {"type": "APP"} |
Business Transaction | BT | Covers one or more Business Transactions | |
All Business Transactions | "affects": {"type": "BT","btAffectedEntities": {"type": "ALL"}} | ||
Business Transactions from specific tiers | "affects": {"type": "BT","btAffectedEntities": {"type": "WITHIN_TIERS","tiers": [11,12]}} where 11,12 are Tier Ids | ||
Specific Business Transactions by id | "affects": {"type": "BT","btAffectedEntities": {"type": "SPECIFIC","bts": [1,2]}} where 1,2 are BT Ids | ||
Business Transactions that match criteria | "affects": {"type": "BT","btAffectedEntities": {"type": "CRITERIA","matchesOperator": "CONTAINS","matchesValue": "pojo"}}
| ||
Tier | TIER | Covers one or more tiers | |
All tiers | "affects": {"type": "TIER","tierAffectedEntities": {"type": "ALL"}} | ||
Specific tiers | "affects": {"type": "TIER","tierAffectedEntities": {"type": "SPECIFIC","tiers": [11,12]}} where 11,12 are Tier Ids | ||
Node | NODE | Covers one or more nodes | |
All nodes | "affects": {"type": "NODE","nodeAffectedEntities": {"type": "ALL","nodeType": "ALL"}} | ||
Nodes belonging to specific tiers | "affects": {"type": "NODE","nodeAffectedEntities": {"type": "WITHIN_TIERS","nodeType": "ALL","tiers": [11,12]}} where 11,12 are Tier Ids | ||
Specific nodes | "affects": {"type": "NODE","nodeAffectedEntities": {"type": "SPECIFIC","nodeType": "ALL","nodes": [9,10]}} where 9,10 are Node Ids | ||
Nodes that match criteria | "affects": {"type": "NODE","nodeAffectedEntities": {"type": "NAME_CRITERIA","nodeType": "ALL","nameMatchesOperator": "EQUALS","nameMatchesValue": "Node"}} - String match "affects": {"type": "NODE","nodeAffectedEntities": {"type": "PROPERTY_CRITERIA","nodeType": "ALL","metaInfoProperties": [{"name": "ProcessID","value": "12343"}]}} - Meta Info Properties match where "matchesOperator" can be:
| ||
Machine | MACHINE | Covers one or more machines | "affects": {"type": "MACHINE","machineAffectedEntities": {"type": "SPECITIC","machines": [4,5]}} where 4,5 are Machine Ids |
Example request
/controller/api/accounts/2/applications/9/actionsuppressions
Header
- Name: Content-Type
- Value: application/vnd.appd.cntrl+json;v=1
Body
{"name": "App-ASW_2","timeRange": {"startTimeMillis": "2014-10-25T04:16:30+0000","endTimeMillis": "2014-10-25T06:16:30+0000"},"affects": {"type": "APP"}}
or
{"name": "Node-ASW_1","timeRange": {"startTimeMillis": "2014-10-25T04:16:57+0000","endTimeMillis": "2014-10-25T05:16:57+0000"},"healthRuleIds": [60,61],"affects": {"type": "NODE","nodeAffectedEntities": {"type": "SPECIFIC","nodeType": "ALL","nodes": [17,18]}}}
Delete a Specific Action Suppression by ID
This is a DELETE request. Should return a 204 - No Content.
URI
DELETE /controller/api/accounts/account_id/applications/application_id/actionsuppressions/actionsuppression_id
Input parameters
Parameter Name | Parameter Type | Value | Mandatory |
---|---|---|---|
account_id | URI | The account id | Yes |
application_id | URI | The application id | Yes |
actionsuppression_id | URI | The id of the action suppression to be deleted | Yes |