6. Application Group Management
What This Chapter Does
It manages application groups and server groups through the API. An application group is the unit that bundles instances by service, and most of the console's screens show data at this unit. A server group bundles SYS agent servers -- see the Server Groups section.
When to use it -- in deployment automation, to create the group at the same time a new
service goes up. The group name has to match application.name in the agent configuration for the
instance to land in that group.
Application Groups
Query
Fetches the registered application groups and the hosts and instances in each.
| Item | Description |
|---|---|
| URL | /monitoring/api/metrics/APP?exclusion=false |
| Example request URL | /monitoring/api/metrics/APP?exclusion=false |
| HTTP METHOD | GET |
| Content-Type | application/json; charset=UTF-8 |
| Body | |
| Response | See below |
Example response
{
"applications": [
{
"name": "ALL",
"uuid": "87DC0B05-AB5C-4667-9493-CB08D8619E84",
"builtIn": false,
"enable": true,
"firstDate": 1527052065813,
"lastDate": 1534469380921,
"hosts": [ … ]
}
]
}
firstDate and lastDate are when data first and last arrived for this group (Unix epoch
milliseconds). When builtIn is true, the group was created by the product and cannot be renamed
or deleted.
Create
Creates a new group. The name has to match application.name in the agent configuration for
that instance to land in this group.
| Item | Description |
|---|---|
| URL | /monitoring/api/customgroup/group |
| Example request URL | /monitoring/api/customgroup/group |
| HTTP METHOD | PUT |
| Content-Type | application/json; charset=UTF-8 |
| Body | {groupId: "EAP_GROUPS1", uuid: "89A43B84-7D49-466C-A172-8F28AAA29ED9"} |
| Response | {"status": 200} |
Update and Registering an Instance Regular Expression
Renames the group, or bundles instances with a regular expression. Where a naming rule is fixed, one regular expression brings new instances in automatically.
| Item | Description |
|---|---|
| URL | /monitoring/api/customgroup/uuid/${UUID} |
| Example request URL | /monitoring/api/customgroup/uuid/89A43B84-7D49-466C-A172-8F28AAA29ED9 |
| HTTP METHOD | PUT |
| Content-Type | application/json; charset=UTF-8 |
| Body | { uuid: "89A43B84-7D49-466C-A172-8F28AAA29ED9", groupId: "EAP_GROUPS", regexp: "^eap71-.*"} |
| Response | {"status": 200} |
Delete
Deletes the group. The collected data is not deleted -- only the grouping disappears.
| Item | Description |
|---|---|
| URL | /monitoring/api/customgroup/uuid/${UUID} |
| Example request URL | /monitoring/api/customgroup/uuid/89A43B84-7D49-466C-A172-8F28AAA29ED9 |
| HTTP METHOD | DELETE |
| Content-Type | application/json; charset=UTF-8 |
| Body | |
| Response | {"status": 200} |
Server Groups
It queries and manages server groups through the API. A server group bundles the servers collected by SYS agents, by host name or IP pattern or by direct choice, and is managed apart from application groups. The console's Access Management ▸ Server Groups screen and the TV wallboard's server view use this API.
- Queries (
GET) and preview can be called by any logged-in user. For a user who is not an administrator, servers outside that user group's permissions are left out of the results (the groups themselves are not). - Create, update, and delete are for administrators only. A non-administrator gets
403with the message "시스템 그룹은 관리자만 바꿀 수 있습니다." (only administrators can change system groups). - Invalid input returns
400, with what to fix as a sentence inreason(for example, the message that CIDR is not supported yet and a value like192.168.23.*should be used). The messages are in Korean. - A successful response has the form
{"status": 200, "result": …}.
Group Fields
| Field | Description |
|---|---|
uuid | The group identifier. The server creates it on registration |
groupId | The group name. Up to 40 characters, unique regardless of case |
matchField | What the pattern is matched against. hostname (default) or ip |
patternType | The pattern syntax. glob (default, for example worker*) or regex (a regular expression) |
patternSource | The pattern as written. Leaving it empty makes a directly chosen group, whose servers are set by members. A value containing / (CIDR) is not accepted |
regexp | The regular expression the server built from patternSource on save (read-only). glob matches the whole value (^…$); regex is used as written (partial match) |
members | The server list of a directly chosen group. An array of { "ip": "…", "hostname": "…" } |
sortNumber | The display order |
Note In
glob,*also matches the empty string, and the pattern must match the whole name.regexis a partial match, so write^…$yourself when a whole match is needed.
Querying the Group List
| Item | Description |
|---|---|
| URL | /monitoring/api/systemgroup/groups |
| Example request URL | /monitoring/api/systemgroup/groups |
| HTTP METHOD | GET |
| Content-Type | application/json; charset=UTF-8 |
| Body | |
| Response | An array of groups in result. An empty array when there are no groups |
Querying One Group
| Item | Description |
|---|---|
| URL | /monitoring/api/systemgroup/uuid/${UUID} |
| Example request URL | /monitoring/api/systemgroup/uuid/89A43B84-7D49-466C-A172-8F28AAA29ED9 |
| HTTP METHOD | GET |
| Content-Type | application/json; charset=UTF-8 |
| Body | |
| Response | One group in result. 404 for an unknown uuid |
Querying the Resolved Result
Receives, in one call, every group resolved against the servers registered now.
| Item | Description |
|---|---|
| URL | /monitoring/api/systemgroup/resolved |
| Example request URL | /monitoring/api/systemgroup/resolved |
| HTTP METHOD | GET |
| Content-Type | application/json; charset=UTF-8 |
| Body | |
| Response | See the fields below |
result field | Description |
|---|---|
groups | The per-group results. The group fields (uuid, groupId, matchField, patternType, patternSource, sortNumber) plus matchMode (pattern / manual), the servers now in the group hosts, and the directly chosen servers that have no agent now missing |
noGroup | The servers that belong to no group |
missing | All the per-group missing entries together |
hostCount | The number of SYS servers registered now (regardless of groups; a server in several groups is counted once) |
Previewing a Pattern
Shows the servers that match a pattern now, without saving.
| Item | Description |
|---|---|
| URL | /monitoring/api/systemgroup/preview |
| Example request URL | /monitoring/api/systemgroup/preview |
| HTTP METHOD | POST |
| Content-Type | application/json; charset=UTF-8 |
| Body | { "matchField": "hostname", "patternType": "glob", "patternSource": "worker*" } |
| Response | In result: regexp (the converted regular expression), count (the number of matching servers), hosts (the matching servers). 400 if the pattern is empty or invalid |
Create (Administrator)
| Item | Description |
|---|---|
| URL | /monitoring/api/systemgroup/group |
| Example request URL | /monitoring/api/systemgroup/group |
| HTTP METHOD | POST |
| Content-Type | application/json; charset=UTF-8 |
| Body | A pattern group: { "groupId": "worker nodes", "matchField": "hostname", "patternType": "glob", "patternSource": "worker*" }A directly chosen group: { "groupId": "DB servers", "matchField": "hostname", "patternSource": "", "members": [ { "ip": "10.0.0.21", "hostname": "db01" } ] } |
| Response | The saved group (with uuid) in result. 400 on validation failure, 403 for a non-administrator |
Update (Administrator)
Updates the group the uuid in the path points to. A uuid in the body is not used.
| Item | Description |
|---|---|
| URL | /monitoring/api/systemgroup/update/${UUID} |
| Example request URL | /monitoring/api/systemgroup/update/89A43B84-7D49-466C-A172-8F28AAA29ED9 |
| HTTP METHOD | POST |
| Content-Type | application/json; charset=UTF-8 |
| Body | The same format as Create |
| Response | The updated group in result. 400 on validation failure or an unknown group, 403 for a non-administrator |
Delete (Administrator)
Deletes only the group definition. The servers and the collected data stay as they are.
| Item | Description |
|---|---|
| URL | /monitoring/api/systemgroup/remove/${UUID} |
| Example request URL | /monitoring/api/systemgroup/remove/89A43B84-7D49-466C-A172-8F28AAA29ED9 |
| HTTP METHOD | POST |
| Content-Type | application/json; charset=UTF-8 |
| Body | |
| Response | {"status": 200}. 400 for an unknown group, 403 for a non-administrator |