Events

Contents
casp102
Contents
Use the events resource to create events.
The events resource operates on a single model or groups of models.
  • Base URL
    http://<hostname><:portnumber>/spectrum/restful/events
POST event
POST event creates a new event.
  • URL
    http://<hostname><:portnumber>/spectrum/restful/events/<eventType>/model/<model_handle>[?varbind=<varbind id>][&val=<varbind value>]
  • HTTP Method
    POST
  • Body
    None
  • Body Content
    Not Used
  • Header
    application/xml, application/json
  • Encoding
    UTF-8
  • Output
    XML or JSON listing the model handle of the created model or the error if the model cannot be created.
URL Parameters
  • <eventType>
    Specifies the event type to be created.
  • <model_handle>
    Specifies the model handle on which the event will be created.
  • <varbind id>
    Specifies the varbind id.
  • <varbind value>
    Specifies the varbind value.
POST events
Use POST events to create one or more events on one or more models. POSTing an event request lets you provide an XML document that specifies the events to create and the models on which to create them. The document contains a list of model handles, XML search criteria, or a reference to the existing search criteria on the OneClick server.
  • URL
    http://<hostname><:portnumber>/spectrum/restful/events
  • HTTP Method
    POST
  • Body
    Examples are provided in <$SPECROOT>/RestfulExamples/xml/Events. These XML files provide examples of properly formed XML for different purposes. Use these examples as a basis for your own XML:
    • CreateEventByModelHandleList.xml
    • CreateEventByModelSearch.xml
    • CreateMultipleEventsByModelHandle.xml
  • Body Content
    application/xml
  • Header
    application/xml, application/json
  • Encoding
    UTF-8
  • Output
    XML or JSON listing of models satisfying the request input in the SpectroSERVER or distributed SpectroSERVER
Example: Create an event 0x10f06 on all RTR_Cisco Model Types, with 4 varbinds
The following is an example of creating an event 0x10f06 on all RTR_Cisco Model Types, with 4 varbinds
  • URL
Post the following XML body to:
http://<hostname><:portnumber>/spectrum/restful/events
  • Body
<?xml version="1.0" encoding="UTF-8"?> <!--This sample event request will create an event of type 0x10f06 (generates a High Memory Utilization alarm) on all models found by the specified locater search (all models derived from RTR_Cisco) --> <rs:event-request throttlesize="10" xmlns:rs="http://www.ca.com/spectrum/restful/schema/request" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd"> <rs:event> <rs:target-models> <rs:models-search> <rs:search-criteria xmlns="http://www.ca.com/spectrum/restful/schema/filter"> <filtered-models> <is-derived-from> <attribute id="AttributeID.MTYPE_HANDLE"> <value>0x21000c</value> <!-- RTR_Cisco --> </attribute> </is-derived-from> </filtered-models> </rs:search-criteria> </rs:models-search> </rs:target-models> <!-- event ID --> <rs:event-type id="0x10f06"/> <!-- attributes/varbinds --> <rs:varbind id="0">75</rs:varbind> <rs:varbind id="1">99</rs:varbind> <rs:varbind id="3">mem_instance</rs:varbind> <rs:varbind id="5">name</rs:varbind> </rs:event> </rs:event-request>