Events

Contents
casp1032
 
 
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>
POST events (GET Tunneling)
This API is used to retrieve events of a model handle.
This API is supported only on device models.
Attributes
Description
model handle
Specifies the device model handles to retrieve events
start time and end time
Specifies the start and end time in the epoch format.
subcomponents events
Specifies the events for subcomponents. Set to True if sub-components events are needed.
exclude events
Specifies the events which are excluded. These events if more than one are separated by coma.
tags
Specifies the requested attributes can be customized as per the user's preference, either fewer or more attributes can be requested.
landscape
Only one landscape can be supported.
null
Null value attributes will be returned if there is no existing value for the attribute.
  •  
    URL
     
    http://ocserver:portnumber/spectrum/restful/events/getEvents
  •  
    HTTP Method
    POST
  •  
    Sample Body or Payload
     
    <?xml version="1.0" encoding="UTF-8"?>
    <rs:get-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:get-events-filter
    start-time="1522640184000"
    end-time="1522644324000"
    subcomponents-events="false"
    exclude-events="0x10005,0x10219,0x10706"
    />
    <rs:requested-attribute id="0x11f56"/> <!--Alarm Severity -->
    <rs:requested-attribute id="0x11f4e"/> <!-- Created On -->
    <rs:requested-attribute id="0x129fa"/> <!-- MODEL_HANDLE -->
    <rs:requested-attribute id="0x1006e"/> <!-- Name -->
    <rs:requested-attribute id="0x4820007"/> <!-- Event -->
    <rs:requested-attribute id="0x11fb9"/> <!-- Created By -->
    <rs:requested-attribute id="0x482001b"/> <!--Alarm Cleared On -->
    <rs:requested-attribute id="0x482001c"/> <!--Alarm Cleared By -->
    <rs:requested-attribute id="0x10000"/> <!-- Model type Name -->
    <rs:requested-attribute id="0x11fb8"/> <!-- Event Type -->
    <rs:requested-attribute id="0x12c0a"/> <!-- Event Precedence -->
    <!-- Models of Interest -->
    <rs:target-models>
    <rs:model mh="0x800258"/>
    <!--<rs:model mh="0x100934"/>-->
    <!-- <rs:model mh="0x1000089"/>-->
    </rs:target-models>
    <rs:landscape id="0x800000" />
    </rs:get-event-request>
  •  
    Sample Response 
     
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <get-event-response-list xmlns="http://www.ca.com/spectrum/restful/schema/response" total-events="30" throttle="2">
    <get-event-responses>
    <event id="5abe765b-e8a1-100c-0437-0050568c73e5">
    <attribute id="0x11f56">3</attribute>
    <attribute id="0x11f4e">1522431579</attribute>
    <attribute id="0x129fa">0x1009ae</attribute>
    <attribute id="0x1006e">Cisco7606-96.37.37.ca.com</attribute>
    <attribute id="0x4820007">Device Cisco7606-96.37.37.ca.com of type Rtr_Cisco has stopped responding to polls and/or external requests. An alarm will be generated.</attribute>
    <attribute id="0x11fb9">System</attribute>
    <attribute id="0x482001b">1522432925</attribute>
    <attribute id="0x482001c">System</attribute>
    <attribute id="0x10000">Rtr_Cisco</attribute>
    <attribute id="0x11fb8">0x10d35</attribute>
    <attribute id="0x12c0a">10</attribute>
    </event>
    <event id="5abe765b-e8a3-100c-0437-0050568c73e5">
    <attribute id="0x11f56">null</attribute> , null will be retuned if there is no value exists for the attribute
    <attribute id="0x11f4e">1522431579</attribute>
    <attribute id="0x129fa">0x1009ae</attribute>
    <attribute id="0x1006e">Cisco7606-96.37.37.ca.com</attribute>
    <attribute id="0x4820007">Alarm number 845986 with probable cause id 0x10009 generated for device Cisco7606-96.37.37.ca.com of type Rtr_Cisco. The severity of this alarm is CRITICAL.</attribute>
    <attribute id="0x11fb9">System</attribute>
    <attribute id="0x482001b">null</attribute>
    <attribute id="0x482001c">null</attribute>
    <attribute id="0x10000">Rtr_Cisco</attribute>
    <attribute id="0x11fb8">0x10701</attribute>
    <attribute id="0x12c0a">10</attribute>
    </event>
    </get-event-responses>
    <link type="application/xml" href="http://ocserver-portnumber/spectrum/restful/events/getEvents?id=cdf7caef-9c4a-4f28-9270-6b4b8e87feb6&amp;start=2&amp;throttlesize=2" rel="next"/>
    </get-event-response-list>
  •  
    Body Content 
    application/xml, application
  • Header
    application/xml, application/json
  •  
    Output
    XML or JSON listing of model-response indicating the success or failure of each update.