Skip to content

Tags REST interface

GET requests for getting information about tags:

POST requests to change settings:

Note that the tags assigned to users are used only if authentication is switched on. When authentication is disabled the tags defined by the default_user_tags configuration parameter are used by the REST layer.

Get all available tags

Definition

1
GET /api/tags

Example request

1
curl -X GET "http://127.0.0.1:8080/api/tags"

Example response

1
  ["CustomTag", "alarm", "dev", "metric", "op"]

Returns

A minimal list of known tags that can be assigned to users or be used to reload only the current view on the WombatOAM Dashboard. It excludes object attributes, such as alarm IDs, but includes custom tags, data type tags (e.g. "alarm" and "metric") and the tags announced by the plugins, which are "dev" and "op" by default.

Get the active tags set for a user

Definition

1
GET /api/tags/user/USERNAME

Example request

1
curl -X GET "http://127.0.0.1:8080/api/tags/user/admin"

Example response

1
  ["dev", "op"]

Arguments

Argument Description
UserName The username of the user. If it is not given, the username of the current user will be used.

Returns

If the user exists either the list of tags set for the given user, or the "all" string is returned. The latter means no filtering is switched on for the user. In case of an error (e.g. the user doesn't exist), the {error, REASON_STR} object is returned.

Change the tags set for a user

Definition

1
POST /api/tags/user

Example request

1
2
3
curl -X POST "http://127.0.0.1:8080/api/tags/user" \
     -H "Content-Type: application/json" \
     -d '{"UserName": "admin",  "tags": ["dev", "op"]}'

Example response

1
"ok"

Arguments

Argument Description
UserName Required. The username of the user.
tags Required. Either the list of tags that should be set for the given user, or the "all" string to switch filtering off.

Returns

Either an "ok" string or the {error, REASON_STR} object that describes the reason of the failure.