Client Groups
Rport client group can be created by:
- adding single clients to it;
- dynamic criteria using wildcards.
Managing client groups is done via the API. The /client-groups
endpoints allow you to create, update, delete and list them.
As listed in the API docs Client Group is defined by:
id
- unique group identifierdescription
- group descriptionparams
- parameters that define what clients belong to a current group. Each parameter can be specified by:- exact match of the property (ignoring case). For example,Means only clients with
params: { "client_id": ["test-win2019-tk01", "qa-lin-ubuntu16"] }
id
equals totest-win2019-tk01
orqa-lin-ubuntu16
belong to a current group. - dynamic criteria using wildcards (ignoring case). For example,Means all clients with
params: { "os_family": ["linux*", "*win*"] }
os_family
that starts withlinux
OR that containswin
belong to a current group.
NOTE: if few different parameters are given then a client belongs to this group only if client properties match all the given group parameters. If client parameter has multiple values (like
tags
,ipv4
,ipv6
, etc) then he belongs to a group if at least one client param matches one of group parameters. For example,params: { "tag": ["QA", "my-tag*"], "os_family": ["linux*", "ubuntu*"] }
Means clients belong to this group only if both conditions are met:
- has
tag
equals toQA
ORtag
that starts withmy-tag
; - its
os_family
starts withlinux
orubuntu
.
- exact match of the property (ignoring case). For example,
client_ids
- read-only field that is populated with IDs of active clients that belong to this group.
Manage client groups via the API
Here are some examples how to manage client groups.
Create
curl -X POST 'http://localhost:3000/api/v1/client-groups' \
-u admin:foobaz \
-H 'Content-Type: application/json' \
--data-raw '{
"id": "group-1",
"description": "This is my super client group.",
"params":
{
"tag": ["QA"],
"os_family": ["linux*", "ubuntu*"]
}
}'
Update
Note all the parameters will be overridden.
curl -X PUT 'http://localhost:3000/api/v1/client-groups/group-1' \
-u admin:foobaz \
-H 'Content-Type: application/json' \
--data-raw '{
"id": "group-1",
"description": "This is my super client group.",
"params":
{
"tag": ["QA", "my-tag*"],
"os_family": ["linux*", "ubuntu*"]
}
}'
List all client groups
curl -s -u admin:foobaz http://localhost:3000/api/v1/client-groups/group-1|jq
{
"data": {
"id": "group-1",
"description": "This is my super client group.",
"params": {
"client_id": null,
"name": null,
"os": null,
"os_arch": null,
"os_family": [
"linux*",
"ubuntu*"
],
"os_kernel": null,
"hostname": null,
"ipv4": null,
"ipv6": null,
"tag": [
"QA",
"my-tag*"
],
"version": null,
"address": null,
"client_auth_id": null
},
"client_ids": [
"qa-lin-ubuntu16",
"qa-lin-ubuntu19",
"qa-lin-ubuntu23"
]
}
}
Delete
curl -u admin:foobaz -X DELETE 'http://localhost:3000/api/v1/client-groups/group-1'