Using Alarm Resources

Contents
csp
Contents
Use the Alarms resource to read, modify, and delete
CA Spectrum
alarms. Asynchronous responses are supported.
  • Base URL
    http://<hostname><:portnumber>/spectrum/restful/alarms
POST alarms (GET Tunneling)
Use POST alarms (GET Tunneling) to get all alarm IDs. POSTing an alarms request allows you to provide an XML document that specifies the alarms to be retrieved. The document can specify specific alarms by ID or by a model specification. A model specification can be a list of model handles, XML search criteria or a reference to existing search criteria on the OneClick server. It is also possible to GET alarms that satisfy a specific alarm attribute filter. An attribute filter is a subset of the search criteria.
This POST is a form of GET Tunneling. You cannot create an alarm with POST alarms.
CA Spectrum
alarms are created in response to events, as defined by the Event Disposition files.
  • URL
    http://<hostname><:portnumber>/spectrum/restful/alarms
  • HTTP Method
    POST
  • Body
    Examples are provided in <
    $SPECROOT
    >/RestfulExamples/xml/Alarms. These XML files provide examples of properly formed XML for different purposes. Use these examples as a basis for your own XML:
    • GetAlarmsByModelHandles.xml
    • GetAlarmsBySearchCriteria.xml
    • GetAlarmsForAllDevices.xml
    • GetAlarmsByAlarmIDs.xml
    • GetAlarmsByAttributeFilter.xml
  • Body Content
    application/xml
  • Header
    application/xml, application/json
  • Output
    XML or JSON listing all alarms in the
    SpectroSERVER
    or distributed
    SpectroSERVER
Example
The following is an example call:
Java GenericPoster noun=Alarms file=resources/xml/Alarms/GetAlarmsBySearch.xml server=localhost username=jdoe password=spectrum port=8080
GET alarms
GET alarms returns alarm IDs. You can retrieve specific alarm attributes by using the &attr=<
attr_id
> parameter.
  • URL
    http://<hostname><:portnumber>/spectrum/restful/alarms[?attr=<attr_ID>][&landscape=<landscape_handle>][&throttlesize=<num>]
  • HTTP Method
    GET
  • Body
    None
  • Body Content
    Not used
  • Header
    application/xml, application/json
  • Output
    XML or JSON listing alarms in the
    SpectroSERVER
    or distributed
    SpectroSERVER
URL Parameters
  • &attr=<
    attr_ID
    >
    (Optional) Specifies the requested attributes. Multiple attribute parameters can be specified.
    There are many attributes on a model; for best performance you should limit attribute selection to attributes of interest.
  • &landscape=<
    landscape_handle
    >
    (Optional) Filters which landscapes are queried. Multiple landscape parameters can be specified.
  • &throttlesize=<
    num
    >
    (Optional) Specifies a throttle size.
PUT alarms
Use PUT alarms to update alarm attributes.
  • URL
    http://<hostname><:portnumber>/spectrum/restful/alarms/<alarm_id>?attr=<attr_ID>&val=<num>
  • HTTP Method
    PUT
  • Body
    None
  • Body Content
    Not Used
  • Header
    application/xml, application/json
  • Output
    XML or JSON listing indicating success or failure
URL Parameters
  • alarm_ID
    Specifies the alarm ID.
  • &attr=<
    attr_ID
    >&val=<
    num
    >
    Specifies the attributes and values. Multiple attribute-value pairs can be specified.
DELETE alarms
To delete an alarm using DELETE alarms, include the alarm ID without any other parameters.
  • URL
    http://<hostname><:portnumber>/spectrum/restful/alarms/<alarm_id>
  • HTTP Method
    DELETE
  • Body
    None
  • Body Content
    Not Used
  • Header
    application/xml, application/json
  • Output
    XML or JSON listing indicating success or failure
URL Parameters
  • alarm_ID
    Specifies the alarm to delete.