- API >
- Public API Resources >
- Groups
Groups¶
On this page
Operations¶
GET /api/public/v1.0/groups/GROUP-ID
- Get a single group by ID.GET /api/public/v1.0/groups
- Get all groups for the current user.POST /api/public/v1.0/groups
- Create a new group. Only thename
field may be specified. ThepublicApiEnabled
field will be set totrue
for groups created with the API. The response entity will include theagentApiKey
for the group.GET /api/public/v1.0/groups/GROUP-ID/users
- Get all users in a group.DELETE /api/public/v1.0/groups/GROUP-ID/users/USER-ID
- Remove a user from a group.POST /api/public/v1.0/groups/GROUP-ID/users
- Add existing user(s) to a group.- You must send an array of entities, even if you’re only adding a single user.
- For each user being added, specify the user ID and role(s) to be assigned.
- If a user is specified that is already part of the group, then their existing role(s) will be overwritten.
DELETE /api/public/v1.0/groups/GROUP-ID
- Delete a group. Once a group is deleted, its name cannot be reclaimed. Thus, if you create a group named My Group and then delete it, you will not be able to create another group named My Group.
Sample Entity¶
Entity Fields¶
Name | Type | Description |
---|---|---|
id | string | Unique identifier. |
name | string | Display name for the group. |
hostCounts | object | The total number of hosts by type. The embedded fields should be self-explanatory. |
lastActiveAgent | date | Date that a ping was last received from one of the group’s Monitoring Agents. |
activeAgentCount | integer | Number of Monitoring Agents sending regular pings to Ops Manager. |
replicaSetCount | integer | Total number of replica sets for this group. |
shardCount | integer | Total number of shards for this group. |
publicApiEnabled | boolean | Is the Public API enabled for this group? This is a read-only field that
will always be true for groups created with the API. Note that for
groups created in the Ops Manager UI, the only way to set this flag to true
is by enabling the Public API for the group in the Settings tab. |
agentApiKey | string | The API key for your agent. This field is only present in the response
entity to a POST request. Thus, the API key will only be exposed at
group creation time. |
Links¶
Relation | Description |
---|---|
self | Me |
hosts | All hosts in the group. |
users | All users in the group. |
clusters | All clusters in the group. |
alerts | All open alerts for the group. |
alertConfigs | All alert configurations for the group. |
backupConfigs | All backup configurations for the group. |