Navigation
This version of the documentation is archived and no longer supported. To learn how to upgrade your version of MongoDB Ops Manager, refer to the upgrade documentation.
You were redirected from a different version of the documentation. Click here to go back.

Group Server Pool Servers

The groups/GROUP-ID/serverPool/servers resource lets you retrieve servers from the Ops Manager server pool for use by the group’s MongoDB processes. The resource also lets you terminate servers and return them to the pool.

For a list of all server pool API resources, see Server Pool. For information on the server pool, see Provision Servers for the Server Pool.

Endpoints

Get All Servers Bound to the Group

GET /api/public/v1.0/groups/GROUP-ID/serverPool/servers

Get a Server by ID

GET /api/public/v1.0/groups/GROUP-ID/serverPool/servers/SERVER-ID

SERVER-ID is the string specified in the id field in the groups/GROUP-ID/serverPool/servers entity.

Get a Server by Hostname

GET /api/public/v1.0/groups/GROUP-ID/serverPool/servers/byName/HOSTNAME

HOSTNAME is the string specified in the hostname field in the groups/GROUP-ID/serverPool/servers entity.

Terminate a Server

DELETE /api/public/v1.0/groups/GROUP-ID/serverPool/servers/SERVER-ID

SERVER-ID is the string specified in the id field in the groups/GROUP-ID/serverPool/servers entity.

You must have the Automation Admin role to use this endpoint.

Sample Entity

{
  "id" : "561a80ef518b82957d",
  "hostname" : "example.net",
  "properties" : { ... },
  "created": "2016-11-01T05:05:05Z",
  "recycled" : "1970-01-01T00:00:00Z",
  "statusName" : "BOUND"
  "boundGroupId": "56a49b06a2a9c39a1b",
  "links": [ ... ]
}

Entity Fields

Name Type Description
id string A unique identifier for the server.
hostname string The hostname that identifies the server.
properties object of key/value pairs The custom properties assigned to the server. Administrators control which properties to expose to end users. If properties are exposed, users must select property values when requesting servers. For more information, see Servers Request Options.
created date The date the server was added to the server pool.
recycled date The date the server was returned to the pool.
statusName string

The server’s availability. Possible values are:

AVAILABLE The server is available to host new MongoDB instances. It is not bound to a group.
RESERVED The server has been selected as part of a multi-server request that is still executing.
BOUND The server is hosting one or more MongoDB processes. The server is visible only to the group that is running the processes.
NEEDS_CLEAN The server is no longer hosting MongoDB processes and no longer bound to a group, but the server still contains the MongoDB data and logs. The server has not yet been returned to the server pool and is not visible to Ops Manager users.
TRASH The server is no longer hosting MongoDB processes and no longer bound to a group. The server no longer contains the MongoDB data and logs. The server has not yet been returned to the server pool and is not visible to Ops Manager users.
DELETED The server has been removed from Ops Manager.
boundGroupId string The ID of the group where this server is in use.

Examples

Get the State of the Server Pool

Request

curl -i -u "username:apiKey" --digest "https://<ops-manager-host>/api/public/v1.0/groups/56a49b06a2a9c39a1b/serverPool"

Response

HTTP/1.1 200 OK

{
  "enabled" : true,
  "links" : [ ... ]
}

Get All Servers Bound to the Group

Request

curl -i -u "username:apiKey" --digest "https://<ops-manager-host>/api/public/v1.0/groups/56a49b06a2a9c39a1b/serverPool/servers"

Response

HTTP/1.1 200 OK

{
  "links" : [ ... ],
  "results" : [ {
    "created" : "2016-11-02T22:22:22Z",
    "hostname" : "525.example.net",
    "id" : "57d0561a80ef518b829",
    "links" : [ ... ],
    "properties" : { "region" : "west", "ram" : "16", ... },
    "recycled" : "1970-01-01T00:00:00Z",
    "statusName" : "BOUND",
    "boundGroupId": "56a49b06a2a9c39a1b"
  },
  ... ,
  { ... }
  ],
  "totalCount" : 6
}

Get a Server by ID

Request

curl -i -u "username:apiKey" --digest "https://<ops-manager-host>/api/public/v1.0/groups/56a49b06a2a9c39a1b/serverPool/servers/57d0561a80ef518b829"

Response

HTTP/1.1 200 OK

{
  "created" : "2016-11-02T22:22:22Z",
  "hostname" : "525.example.net",
  "id" : "57d0561a80ef518b829",
  "links" : [ ... ],
  "properties" : { "region" : "west", "ram" : "16", ... },
  "recycled" : "1970-01-01T00:00:00Z",
  "statusName" : "BOUND",
  "boundGroupId": "56a49b06a2a9c39a1b"
}

Get a Server by Hostname

Request

curl -i -u "username:apiKey" --digest "https://<ops-manager-host>/api/public/v1.0/groups/56a49b06a2a9c39a1b/byName/525.example.net"

Response

HTTP/1.1 200 OK

{
  "created" : "2016-11-02T22:22:22Z",
  "hostname" : "525.example.net",
  "id" : "57d0561a80ef518b829",
  "links" : [ ... ],
  "properties" : { "region" : "west", "ram" : "16", ... },
  "recycled" : "1970-01-01T00:00:00Z",
  "statusName" : "BOUND",
  "boundGroupId": "56a49b06a2a9c39a1b"
}

Terminate a Server

Request

curl -i -u "username:apiKey" --digest -X DELETE "https://<ops-manager-host>/api/public/v1.0/groups/56a49b06a2a9c39a1b/serverPool/servers/57d0561a80ef518b829"

Response

HTTP/1.1 200 OK

{}