This page describes the Events API methods that you can use to create, manage, and monitor events.

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:
BEFORE_NOW 
To use the "BEFORE_NOW" option, you must also specify the "duration-in-mins" parameter.
BEFORE_TIME  
To use the "BEFORE_TIME" option, you must also specify the "duration-in-mins" and "end-time" parameters.
AFTER_TIME
To use the "AFTER_TIME" option, you must also specify the "duration-in-mins" and "start-time" parameters.

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

http://demo.appdynamics.com/controller/rest/applications/7/problems/healthrule-violations?time-range-type=BEFORE_NOW&duration-in-mins=15 
<policy-violations><policy-violation>
  <id>266</id>
  <name>CPU utilization is too high</name>
  <startTimeInMillis>1452630655000</startTimeInMillis>
  <detectedTimeInMillis>0</detectedTimeInMillis>
  <endTimeInMillis>1452630715000</endTimeInMillis>
  <incidentStatus>RESOLVED</incidentStatus>
  <severity>WARNING</severity>
  <triggeredEntityDefinition>
    <entityType>POLICY</entityType>
    <entityId>30</entityId>
    <name>CPU utilization is too high</name>
  </triggeredEntityDefinition>
  <affectedEntityDefinition>
    <entityType>APPLICATION_COMPONENT_NODE</entityType>
    <entityId>16</entityId>
    <name>Fulfillment</name>
  </affectedEntityDefinition>
  <deepLinkUrl>http://demo.appdynamics.com/controller/#location=APP_INCIDENT_DETAIL&amp;incident=266</deepLinkUrl>
  <description>AppDynamics has detected a problem.<br><b>errorAbhi</b> is violating.
</description>
</policy-violation>
<policy-violation>
  <id>268</id>
  <name>CPU utilization is too high</name>
  <startTimeInMillis>1452630655000</startTimeInMillis>
  <detectedTimeInMillis>0</detectedTimeInMillis>
  <endTimeInMillis>1452630715000</endTimeInMillis>
  <incidentStatus>RESOLVED</incidentStatus>
  <severity>WARNING</severity>
  <triggeredEntityDefinition>
    <entityType>POLICY</entityType>
    <entityId>30</entityId>
    <name>CPU utilization is too high</name>
  </triggeredEntityDefinition>
  <affectedEntityDefinition>
    <entityType>APPLICATION_COMPONENT_NODE</entityType>
    <entityId>20</entityId>
    <name>FulfillmentClient</name>
  </affectedEntityDefinition>
  <deepLinkUrl>http://demo.appdynamics.com/controller/#location=APP_INCIDENT_DETAIL&amp;incident=268</deepLinkUrl>
  <description>AppDynamics has detected a problem with Node &lt;b&gt;FulfillmentClient&lt;/b&gt;.&lt;br&gt;&lt;b&gt;CPU utilization is too high&lt;/b&gt; started violating and is now &lt;b&gt;warning&lt;/b&gt;.&lt;br&gt;All of the following conditions were found to be violating&lt;br&gt;For Node &lt;b&gt;FulfillmentClient&lt;/b&gt;:&lt;br&gt;1) Hardware Resources|CPU|%Busy Condition&lt;br&gt;&lt;b&gt;%Busy's&lt;/b&gt; value &lt;b&gt;76.0&lt;/b&gt; was &lt;b&gt;greater than&lt;/b&gt; the threshold &lt;b&gt;75.0&lt;/b&gt; for the last &lt;b&gt;30&lt;/b&gt; minutes&lt;br&gt;</description>
</policy-violation>
</policy-violations>

Retrieve Event Data

You can capture data for the event types listed in the eventtypes parameter.

URI 

/controller/rest/applications/application_id/events

Input Parameters

Parameter Name

Parameter Type

Value

Mandatory

application_id

URI

Provides either the application name or application id.

Yes

summaryQueryProvides the summary for the event.Yes
commentQueryProvides the comments (if any) for the event.No
eventtypeQueryAPPLICATION_DEVELOPMENTYes

time-range-type

Query

Possible values are:
BEFORE_NOW 
To use the "BEFORE_NOW" option, you must also specify the "duration-in-mins" parameter.
BEFORE_TIME  
To use the "BEFORE_TIME" option, you must also specify the "duration-in-mins" and "end-time" parameters.
AFTER_TIME
To use the "AFTER_TIME" option, you must also specify the "duration-in-mins" and "start-time" parameters.

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

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 Events Reference.

Yes

severity

Query

Provides the severity level. Specify the comma-separated list of severities for which you want to retrieve event information.
Allowed values are:

  • INFO
  • WARN
  • ERROR

In the UI these values become Info, Warning, and Critical.

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

tierQueryName of the tier in the applicationNo

This API can retrieve 600 events at a time.

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:your_password 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&amp;eventSummary=44658</deepLinkUrl>
</event>
</events>

Create Events

Application deployment events notify Cisco AppDynamics when you upgrade your application, push new code, etc. This lets you correlate these application deployment activities with other data inside Cisco AppDynamics. This is useful for regression analysis, root cause analysis, and performance studies. It is beneficial to inject your application deployment event into Cisco AppDynamics as part of the build process for deploying a new version of your application.

The Cisco AppDynamics REST API lets you integrate events of type APPLICATION_DEPLOYMENT with other systems.

For example, to create an event automatically in your Cisco AppDynamics monitored system for every new release you would integrate these systems and use the following REST API to create an event of type "APPLICATION_DEPLOYMENT" in your managed environment.

You should receive the event ID after the successful invocation of the request.

Roles and Permissions

Creating events requires the Create Events permission. See Application Permissions.

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 the comments (if any) for the event.

No

eventtype

Query

APPLICATION_DEPLOYMENT

Yes

severityQueryProvide a severity level. Allowed values include:
  • "INFO"
  • "WARN"
  • "ERROR"

In the UI, these become "Info", "Warning", and "Critical"

Yes

Create a Custom Event

You can create custom events to be reported in the Cisco AppDynamics event viewer and in the event panels on the Cisco AppDynamics dashboards. See Monitor Events to learn how to filter on your custom events. Then you can create alerts triggered by these events as you do for Cisco AppDynamics standard events.

You should receive the event ID after the successful invocation of the request.

Roles and Permissions

Creating a custom event requires the Create Events permission. See Application Permissions.

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

severityQuery

Provide a severity level. Allowed values include:

  • "INFO"
  • "WARN"
  • "ERROR"

In the UI, these become "Info", "Warning", and "Critical"

Yes

eventtype

Query

CUSTOM

Yes

customeventtypeQueryProvide a name for the "type". For example, the source could be "nagios".No
nodeQueryProvide the affected node name.No
tierQueryProvide the affected tier name.Yes, if node and bt are specified
btQueryProvide the affected business transaction name.No
propertynamesQueryProvide 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
propertyvaluesQueryProvide the property value as a pair, i.e., the "value". The value is limited to 5000 characters.

No, but if one element of the pair is defined, the other must be defined also

Example 

curl -X POST --user user1@customer1:your_password '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'

Notice 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 or vanity URL for notification purposes. Instead of a URL such as paid8.appdynamics.com being displayed as the host, the custom URL can be displayed as yourcompany.appdynamics.com in the notification.

URI

POST /controller/rest/accounts/customer_name/update-controller-url

Input parameters

Parameter Name

Parameter Type

Value

Mandatory

customer_nameURIThe customer account nameYes

Body Parameter 

As Application/JSON content:

{
   "controllerURL": "http://<my-custom-hostname:port>"
}
CODE

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
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 as upgrading it will reset the deep link URL settings.