Analytics Manager > Using the Analytics Manager Services > Managing Events
  
Managing Events
The services for event management are available in the TW.AnalysisServices.EventManagementServicesAPI resource.
The following table provides information about the purpose, input parameters, and the result of each service:
Service Name and Purpose
Input Parameters
Result
Parameter Name
Base Type
Description
CloneAnalysisEvent — Clones an analysis event, along with input and result mappings, on the specified thing.
eventId
String
Specifies the event ID of the analysis event to be cloned.
Returns information about the cloned analysis event in the form of an infotable that has the TW.AnalysisServices.AnalysisServiceTriggerDataShape data shape.
Throws an exception in case of any errors while specifying the input parameters.
thingName
Thingname
Specifies the name of the thing on which the analysis event is to be cloned.
alertName
String
Specifies the name of the alert. This allows you to customize the cloned event according to alert type. This parameter is optional.
propertyName
String
Specifies the name of the property. This allows you to customize the cloned event according to alert type for a given alert name and property name. This parameter is optional.
CreateAnalysisEvent — Creates an analysis event for a particular provider and model from a specified entity and event.
sourceEntityName
Thingname
Specifies the name of the source entity.
Returns the ID of the analysis event that is created.
eventName
String
Specifies the name of the event on which the analysis is triggered.
eventProperty
String
Specifies the name of the property if the event specified by eventName is a property event. Otherwise, it can be set to null.
alertName
String
Specifies the name of the specific alert on the eventproperty, if the event is a property-based alert. Otherwise, it can be set to null.
providerName
String
Specifies the name of the provider.
modelName
String
Specifies the name of the model for which the analysis must be executed on event trigger.
isSimulation
Boolean
Specifies if the analysis is to be executed as a simulation. Set the value of this parameter to true to run the analysis as simulation. Setting the value of this parameter to false runs the analysis in the discrete mode.
runOnSameHost
Boolean
Specifies if the cascaded event must run on the same host as the event that triggered it.
matchExecutionRate
Boolean
If the value of the isSimulation parameter is set to true, and if you want to execute the analysis only if the interval between executions exceeds the average execution time, then set the value of this parameter to true.
retainJobHistory
String
Specifies if the job details will be stored for the discrete analysis event. The following are the eligible values:
None
Failed
All
The default value is None.
agentName
String
Specifies the name of the agent where the event must be executed.
This parameter is optional.
isTimeSeries
Boolean
Specifies whether the analysis event is instance-based or time series-based. Set to true to configure the event as time-series based.
This parameter is optional.
trailingTimeDuration
Long
If the value of the isTimeSeries parameter is set to true, specify the time in milliseconds for which you want collect the trailing data.
lookBackCount
Integer
If the value of the isTimeSeries parameter is set to false, specify the number of mapped entries’ rows for which you want to collect trailing data.
samplingFrequency
Long
Specifies the frequency in milliseconds at which you want to collect the trailing data for the specified values of the trailingTimeDuration parameter or the lookBackCount parameter.
EntityType
String
Specifies the type of entity that the event is to be created on as one of the following:
Thing
Thing template
Thing shape
This parameter is optional.
customData
Infotable
Specifies any additional information that is customer-specific about an event.
DeleteAnalysisEvent — Deletes the specified analysis event.
eventId
String
Specifies the ID of the analysis event that must be deleted.
Returns a message that states the successful completion or errors that occur during the execution of the service.
DisableAnalysisEvent — Disables the specified analysis event.
eventId
String
Specifies the ID of the analysis event that must be disabled.
Returns a message that states the successful completion or errors that occur during the execution of the service.
EnableAnalysisEvent — Enables the specified analysis event.
eventId
String
Specifies the ID of the analysis event that must be enabled.
Returns a message that states the successful completion or errors that occur during the execution of the service.
FilterAnalysisEvents — Filters analysis events that are present on a specified thing, based on thing name, provider name, and model name.
thingName
Thingname
Specifies the name of the thing based on which the analysis events are filtered on.
Returns the analysis events that match the specified input parameters in the form of an infotable that has the TW.AnalysisServices.AnalysisServiceTriggerDataShape data shape.
Throws an exception if an analysis event is enabled on the specified thing, or in case of any errors while specifying the input parameters.
providerName
String
Specifies the name of the provider.
modelName
String
Specifies the name of the model.
FilterAnalysisEventsForCloning — Filters analysis events that are present on the predecessors (thing templates and thing shapes) of a specified thing that can be cloned based on the thing name, provider name, and model name.
thingName
Thingname
Specifies the name of the thing based on which the analysis events are filtered on for cloning.
Returns the analysis events that can be cloned on the specified thing in the form of an infotable that has the TW.AnalysisServices.AnalysisServiceTriggerDataShape data shape.
Throws an exception if an analysis event is enabled on the specified thing, or in case of any errors while specifying the input parameters.
providerName
String
Specifies the name of the provider.
modelName
String
Specifies the name of the model.
GetAnalysisEvent — Retrieves the analysis event for a particular entity, event, alert, model, and provider.
sourceEntityName
String
Specifies the name of the source entity.
Returns the analysis event entry for the specified entity, event, alert, model, and provider. This is an infotable has the TW.AnalysisServices.AnalysisServiceTriggerDataShape data shape.
* 
The key attribute of the returned infotable is the value of the eventId or the analysisEventId parameter.
eventName
String
Specifies the name of the event on which the analysis is triggered.
eventProperty
String
Specifies the name of the property if the event specified by eventName is a property event. Otherwise, it can be set to null.
alertName
String
Specifies the name of the specific alert on the eventproperty, if the event is a property-based alert. Otherwise, it can be set to null.
providerName
String
Specifies the name of the provider.
modelName
String
Specifies the name of the model for which the analysis must be executed on event trigger.
GetJobsByAnalysisEventID — Retrieves the specified number of latest jobs fired by a particular given analysis event.
analysisEventId
String
Specifies the ID of the analysis event.
Returns an infotable that contains job rows. This infotable is in the same format as TW.AnalysisServices.AnalysisDataShape.
count
Integer
Specifies the number of entries to be returned. By default, it returns 500 entries.
GetLatestJobByAnalysisEventID — Retrieves the latest job (filtered by created timestamp) fired by a particular analysis event.
analysisEventId
String
Specifies the ID of the analysis event.
Returns an infotable that contains the latest job row. This infotable is in the same format as TW.AnalysisServices.AnalysisDataShape.
IsResultMappingAvailableForEventId — Checks if result mapping is available for the specified analysis event.
eventId
String
Specifies the event ID of the analysis event that needs to be checked for result mapping availability.
If the analysis event is enabled, it returns a boolean value of false.
If the analysis event is disabled, and an analysis replay is not created on the event, it returns a boolean value of true.
If the analysis event is disabled, and an analysis replay is created on the event, then depending on the value of the mapResults parameter of the CreateReplay service, it returns the following value:
If mapResults is set to true, returns false.
If mapResults is set to false, returns true.
Throws an exception in case of any errors while specifying the input parameters.
QueryAnalysisEvents — Returns event information based on the query.
* 
Provide inputs for either the values or query parameter.
* 
Use this service to obtain the eventId parameter.
values
Infotable
Specifies the attributes of the event in the form of a collection of multiple value rows.
Returns information about the model in the form of an infotable that has the TW.AnalysisServices.AnalysisServiceTriggerDataShape data shape.
query
Query
Specifies the query that includes what information is required about a particular event.
UpdateRetainJobHistoryValue — Updates the configuration setting of retaining the job history for a particular analysis event.
* 
You can execute this service even after an analysis event has been created.
eventId
String
Specifies the event ID of the analysis event.
Returns a message that states the successful completion or errors that occur during the execution of the service.
retainJobHistory
String
Specifies if the job details will be stored for the analysis event. The following are the eligible values:
None
Failed
All