Groups

The set of users who have different roles and access rights forms a certain group. A group, as well as a separate role, is assigned certain rights that all users in this group have.

Using the API with groups, the following actions can be implemented:

  1. Getting a list of groups.
  2. Getting information about one group.
  3. Getting statistics on one group.

Getting a list of groups

To get a complete list of groups that include the user sending the request, you must use the GET method and specify the groups prefix. The response will receive an array of objects, each of which represents a configuration of a separate group.

Request

GET /api/v1/groups HTTP/1.1
Content-Type: application/json
Authorization: Bearer {token}

Response

HTTP/1.1 200 OK

[
    {
        "_id": "5d8a18d4d0025e0012fb6a31",
        "name": "group_name",
        "tagname": "group_tagname",
        "role": "5cc89f6af79a4969291dcbd7"
    }
]

Getting information about one group

If a user is a member of more than one group, he can send a request for information on only one specific group. In response to this request, the group configuration and the result of the request will be received.

Request

GET /api/v1/groups/:id HTTP/1.1
Content-Type: application/json
Authorization: Bearer {token}

Response

HTTP/1.1 200 OK

{
    "_id": "5d8a18d4d0025e0012fb6a31",
    "name": "group_name",
    "tagname": "group_tagname",
    "role": "5cc89f6af79a4969291dcbd7",
    "success": true
}

Getting statistics on one group

Each group has certain statistical information. If you need to get it, just send a request GET /api/v1/groups/:id/stats. The response will receive an array of json format objects. At the same time, each of them will contain fields that are different from the fields of the group, because their values carry statistical data.

Request

GET /api/v1/groups/:id/stats HTTP/1.1
Content-Type: application/json
Authorization: Bearer {token}

Response

HTTP/1.1 200 OK

[
    {
        "name": "services",
        "tags": "gkey=NXfszR",
        "time": 0,
        "gate_read": "",
        "gate_write": "",
        "gate_packets": "",
        "gate_auths": "",
        "gate_cmds": "",
        "gate_errors": "",
        "hndl_start_total": "",
        "hndl_packets_total": "",
        "data_objects": "",
        "data_users": 1,
        "data_object_chains": "",
        "data_object_automatons": "",
        "storage_telemetry": 100,
        "storage_processed": 100
    }
]