tags.php¶
Tag management module for infrastructure components: adding, removing, clearing, searching, and displaying tag lists for servers and variables.
API Methods¶
| Method | Action | Description |
|---|---|---|
add | add tag | Adds a custom tag to a server or component. Supports bulk addition via an ID list. |
clear | clear tags | Clears all or non-essential tags from a component. For clients, only public tags are available. |
get | get tags | Retrieves tags for a component. (Implementation is empty in code, method is in whitelist) |
list | list tags | Returns a list of tags for a specific server or component. For clients, there is a restriction by component type (eq, vars). |
remove | remove tag | Removes a tag by its name for a specific component or removes all specified tags from an ID list. If id_list is passed, the operation is performed in bulk. |
search | search tags | Searches for components matching a specific tag and value. |
search_user | search user equipment | Searches for user equipment by tag value. Used in global search form. |
show | show possible tags | Shows possible tags for a component. (Implementation is empty in code, method is in whitelist) |
tags/add¶
Adds a custom tag to a server or component. Supports bulk addition via an ID list.
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: add |
| token | ✅ | string | Authorization token |
| id | ❌ | int | Server/component ID |
| tag | ✅ | string | Tag name (max. 32 characters, alphanumeric) |
| value | ❌ | string | Tag value |
| extra | ❌ | string | Additional information |
| id_list | ❌ | string | Comma-separated list of IDs for bulk addition |
Example Request
Example of a successful response
Failure response
```json { "code": -1, "message": "tag/add: invalid token data, too long" }
```
tags/clear¶
Clears all or non-essential tags from a component. For clients, only public tags are available.
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: clear |
| token | ✅ | string | Authorization token |
| id | ✅ | int | Server (component) ID |
| component | ❌ | string | Component type (default 'eq') |
| tag | ❌ | string | Clearing filter. If 'all', all tags are cleared, including excluded ones |
Example Request
Example of a successful response
Failure response
tags/get¶
Retrieves tags for a component. (Implementation is empty in code, method is in whitelist)
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: get |
| token | ✅ | string | Authorization token |
| component | ❌ | string | Component type (eq, vars, etc.) |
| component_id | ❌ | int | Component ID |
| internal | ❌ | int | Internal tags visibility flag (0 or 1) |
Example Request
tags/list¶
Returns a list of tags for a specific server or component. For clients, there is a restriction by component type (eq, vars).
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: list |
| token | ✅ | string | Authorization token |
| id | ❌ | int | Server or component ID |
| component | ❌ | string | Component type (eq, vars) |
Example Request
Example of a successful response
Failure response
```json { "code": -1, "message": "invalid server id" }
```
tags/remove¶
Removes a tag by its name for a specific component or removes all specified tags from an ID list. If id_list is passed, the operation is performed in bulk.
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Action (remove) |
| token | ✅ | string | Authorization token |
Example Request
Example of a successful response
Failure response
```json { "code": -1, "message": "module/remove: tag example_tag not found for element 789 on eq" }
```
tags/search¶
Searches for components matching a specific tag and value.
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: search |
| token | ✅ | string | Authorization token |
| tag | ❌ | string | Tag name for search |
| value | ❌ | string | Tag value for search (supports LIKE) |
| component | ❌ | string | Component type (default eq) |
| internal | ❌ | int | Internal tags visibility flag (0 or 1) |
Example Request
Example of a successful response
tags/search_user¶
Searches for user equipment by tag value. Used in global search form.
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: search_user |
| token | ✅ | string | Authorization token |
| value | ✅ | string | Tag value for searching user equipment |
Example Request
Example of a successful response
tags/show¶
Shows possible tags for a component. (Implementation is empty in code, method is in whitelist)
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: show |
| token | ✅ | string | Authorization token |
Example Request
Failure response
```json { "code": -1, "message": "Method not implemented" }