Skip to main content
Matrix42 Self-Service Help Center

Rest API – Tag Elements

How to create, update, retrieve and delete tag elements in SPM using the FireScope REST API.

Overview

The REST API allows you to work with Tag Elements in FireScope SPM using a REST client in lieu of the SPM user interface. Tag Elements allow existing tags to be associated with various different types of entities to group them together for display or reporting purposes. Specifically, you can:

  • Retrieve
  • Create or Update
  • Delete

Retrieve

To retrieve the current information about a Tag Element, provide the account, tag name and the composite key of the element you want to link it to. The composite key varies depending upon the type. Please see the Composite Foreign Key Format table below.

 Example to tag an Event Definition:

http://localhost:38050/web_services/...1&eventdef=BGP

Note: Don’t forget to change the domain name (localhost) and query parameter values (account, edge_device, ci, and name) to match your environment and data.

A JSON response will be returned similar in structure to the payload for create.

Query Parameter Descriptions

Parameter Description Type Required
account Name of the SPM Account. String Yes
tags Name of the SPM Tag. String Yes

Composite Foreign Key Format

Type Example
servicegroup      “servicegroup” : “US West”
logicalgroup “logicalgroup” : “Databases”
ci “edge_device” : “edge1”, “ci” : “10.0.12.1”
attribute “edge_device” : “edge1”, “ci” : “10.0.12.1”, “attribute” : “ping”
eventdef “edge_device” : “edge1”, “ci” : “10.0.12.1”, “eventdef” : “BGP Changed”
aed “logicalgroup” : “US West”, “aed” : “System outage”
policy “servicegroup” : “Databases”, “policy” : “Database downtime”
graphs “graphs” : “Availability Chart”
bpgroup “bpgroup” : “All Blueprints”


Create or Update

To create or update a Tag Element, POST a JSON document with the specific information for that Tag to the following URL:

http://[SPM IP address]:38050/web_services/tag_elements

{
   "account_id": "firescope",
   "tagid": "Servers",
   "elementid": {
      "edge_device": "edge1",
      "ci": "10.0.12.1",
      "eventdef": "BGP changed"
   }
}

Property Descriptions

Property Description Type Default Value Required
account_id Name of the SPM Account. String   Yes
elementid A composite foreign key that identifies the element you want linked to the tag. The value varies depending which type of entity it refers to. For a list of possible values, see the Composite Foreign Key Format table in the Retrieve section. Object   Yes
tagid Name of the Tag that should be associated with String   Yes

Delete

To delete a tag element, send an HTTP DELETE request with the same query parameters as the GET request.

See the Retrieve for the URL format and query parameter descriptions.

  • Was this article helpful?