Navigation
You were redirected from a different version of the documentation. Click here to go back.

Server Pool Servers

The serverPool/servers resource provides access to the server pool’s servers. The pool provides Ops Manager users with pre-provisioned servers for deploying MongoDB.

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 in the Server Pool

GET /api/public/v1.0/serverPool/servers

To filter by server status, use the status query parameter:

GET /api/public/v1.0/serverPool/servers?status=STATUS

STATUS can be one of the following values: AVAILABLE or TRASH.

STATUS cannot be RESERVED, BOUND, NEEDS_CLEAN, or DELETED.

You must have the Global Read Only role to use this endpoint.

Get a Server by ID

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

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

You must have the Global Read Only role to use this endpoint.

Get a Server by Hostname

GET /api/public/v1.0/serverPool/servers/byName/HOSTNAME

HOSTNAME is the string specified in the hostname field in the serverPool/servers entity.

You must have the Global Read Only role to use this endpoint.

Remove a Server from the Server Pool

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

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

You must have the Global Owner role to use this endpoint.

Note

If the Automation Agent is still running on the server, the server will appear again in the server pool the next time the Automation Agent pings Ops Manager.

Sample Entity

{
  "id": "561a80ef518b82957d",
  "hostname" : "example.net",
  "properties" : { ... },
  "created": "2016-11-01T05:05:05Z",
  "recycled" : "1970-01-01T00:00:00Z",
  "statusName": "AVAILABLE",
  "boundGroupId": "28db9982157d787ffb",
  "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 All Servers in the Server Pool

Request

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

Response

HTTP/1.1 200 OK

{
  "links" : [ ... ],
  "results" : [ {
    "created" : "2016-11-01T18:02:02Z",
    "hostname" : "635.example.net",
    "id" : "57d0561a80ef518b829",
    "links" : [ ... ],
    "properties" : { "region" : "east", "ram" : "16", ... },
    "recycled" : "1970-01-01T00:00:00Z",
    "statusName" : "AVAILABLE"
  },
  ... ,
  { ... }
  ],
  "totalCount" : 20
}

Get a Server by ID

Request

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

Response

HTTP/1.1 200 OK

{
  "created" : "2016-11-01T18:02:02Z",
  "hostname" : "635.example.net",
  "id" : "57d0561a80ef518b829",
  "links" : [ ... ],
  "properties" : { "region" : "east", "ram" : "16", ... },
  "recycled" : "1970-01-01T00:00:00Z",
  "statusName" : "AVAILABLE"
}

Get A Server by Hostname

Request

curl -i -u "username:apiKey" --digest "https://<ops-manager-host>/api/public/v1.0/serverPool/servers/byName/635.example.net"

Response

HTTP/1.1 200 OK

{
  "created" : "2016-11-01T18:02:02Z",
  "hostname" : "635.example.net",
  "id" : "57d0561a80ef518b829",
  "links" : [ ... ],
  "properties" : { "region" : "east", "ram" : "16", ... },
  "recycled" : "1970-01-01T00:00:00Z",
  "statusName" : "AVAILABLE"
}

Remove a Server from Ops Manager

Request

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

Response

HTTP/1.1 200 OK

{}