- API >
- Public API Resources >
- Groups
Groups¶
On this page
Endpoints¶
Get All Groups for a User¶
Get all groups for the current user.
Create a Group¶
Specify only the name
field.
The publicApiEnabled
field is automatically set to true
for
groups created with the API. The response includes the agentApiKey
for the group.
Get a Group¶
Get a single group by its 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.
Get All Users in a Group¶
Add Users to a Group¶
Add one or more existing users to a group.
You must send an array of entities, even if you’re only adding a single user. For each user that you wish to add, specify the user ID and the roles that the user should possess.
If you specify a user that is already a member of the group, their existing roles will be overwritten with the specified permissions.
Remove a User from a Group¶
Sample Entity¶
Entity Fields¶
Name | Type | Description |
---|---|---|
id |
string | The unique identifier for the group. |
name |
string | The display name for the group. |
hostCounts |
object | The total number of hosts by type. The embedded fields should be self-explanatory. |
lastActiveAgent |
date | The time Ops Manager last updated the activeAgentCount total for the
group. Ops Manager runs a job every 30 minutes to record the number of active
agents of all types, Monitoring, Backup, Automation. |
activeAgentCount |
number | The number of active agents of any type (Monitoring, Backup, Automation) sending regular pings to Ops Manager. The value is refreshed every 30 minutes. If you start a new agent or
stop an existing one, the change can take up to 30 minutes to show up
in the |
replicaSetCount |
number | The total number of replica sets for this group. |
shardCount |
number | The 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 |
http://mms.mongodb.com/hosts |
All hosts in the group. |
http://mms.mongodb.com/users |
All users in the group. |
http://mms.mongodb.com/clusters |
All clusters in the group. |
http://mms.mongodb.com/alerts |
All open alerts for the group. |
http://mms.mongodb.com/alertConfigs |
All alert configurations for the group. |
http://mms.mongodb.com/backupConfigs |
All backup configurations for the group. |
http://mms.mongodb.com/agents |
All agents for the group. |