Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
06-22-2017 08:10 AM
Hi ,
In AppDynamics we can get the Events Details using the REST URI like the following
http://<IP:PORT>/controller/rest/applications/8/events?time-range-type=BEFORE_NOW&duration-in-mins=300&event-types=APPLICATION_CONFIG_CHANGE,APPLICATION_ERROR,DIAGNOSTIC_SESSION,APPLICATION_CONFIG_CHANGE,APPLICATION_DEPLOYMENT,APPLICATION_ERROR,APP_SERVER_RESTART&severities=ERROR,INFO,WARN&output=JSON
I am looking for a method in the AppDynamicsREST Python API at http://appdynamicsrest.readthedocs.io/en/latest/api.html
But so far unable to to figure out any .
Can anybody provide some pointer on this ?
Solved! Go to Solution.
06-23-2017 02:09 AM - edited 06-23-2017 02:18 AM
Hi Ayan,
Can you please try using the following API
def get_events(self, app_id=None, event_types='ALL', severities='ERROR', time_range_type='BEFORE_NOW', duration_in_mins=15, start_time=None, end_time=None): """ Retrieves events. :param int app_id: Application ID to retrieve nodes for. If :const:`None`, the value stored in the `app_id` property will be used. :param str event_types: CSV of the events types to search on :param str severities: CSV of the severities to search on :param str time_range_type: Must be one of :const:`BEFORE_NOW`, :const:`BEFORE_TIME`, :const:`AFTER_TIME`, or :const:`BETWEEN_TIMES`. See :ref:`time-range-types` for a full explanation. :param int duration_in_mins: Number of minutes before now. Only valid if the :attr:`time_range_type` is :const:`BEFORE_NOW`. :param long start_time: Start time, expressed in milliseconds since epoch. Only valid if the :attr:`time_range_type` is :const:`AFTER_TIME` or :const:`BETWEEN_TIMES`. :param long end_time: End time, expressed in milliseconds since epoch. Only valid if the :attr:`time_range_type` is :const:`BEFORE_TIME` or :const:`BETWEEN_TIMES`. :param bool rollup: If :const:`False`, return individual data points for each time slice in the given time range. If :const:`True`, aggregates the data and returns a single data point. :returns: A list of events for the specified app, filtered by the event type and severities desired. :rtype: appd.model.Events """
GIT Hub reference link:
https://github.com/Appdynamics/AppDynamicsREST
Thanks and Regards,
Sajna
06-27-2017 02:28 AM
Hi ,
On which object I need to invoke this method ?
Once the client is created like the following
client=AppDynamicsClient("URL","uid","pwd")
The client has methods like get_metrics,get_snapshots etc but not anything like get_events.
Could you please explain bit further ?
07-13-2017 10:58 PM
Hi Ayan,
Sorry for the late reply.
The client should have the method like get_events.For some reason it is missing in the http://appdynamicsrest.readthedocs.io/en/latest/api.html.I will look into it.
In your case, you can call it like
client=AppDynamicsClient("URL","uid","pwd")
resp = client.get_events(app_id=16,
event_types='APPLICATION_CONFIG_CHANGE',
severities='INFO,WARN,ERROR',
time_range_type='BEFORE_NOW',
duration_in_mins='60000')
Let me know whether it works.
GIT Hub reference link:
https://github.com/Appdynamics/AppDynamicsREST
Thanks and Regards,
Sajna Sreenivasan
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form