Contact Us 1-800-596-4880

Get a Server Group

When called with the HTTP GET operation, the resource /mmc/api/serverGroups/<serverGroupId> returns a single server group with the specified ID. You need to substitute the id of the server group for <serverGroupId>.

There are two ways to obtain the URL of a server from the server group:

  • Use the href property of the server when you get a list of servers.

  • Use the redirectOnResult query parameter to look up a server by its name.

Using the redirectOnResult parameter allows you to effectively do a GET on a server without knowing the server object ID. This parameter works as follows. When redirectOnResult is enabled, the expected result should be only one object. Your client receives an HTTP redirect to that single object and the final response is the JSON description of just that one object. Thus, using redirectOnResult removes both the need to test for the case of a single matching object and issuing a second REST API request to retrieve the object.

Example Request

The following is an example of calling this resource.

GET http://localhost:8080/mmc/api/serverGroups/73d89173-290e-4cb3-a61c-e11deb74767d

Example Response

The previous request might return a response such as shown below:

200 OKContent-Type: application/jsonServer: Apache-Coyote/1.1Date: Sun, 08 Nov 2009 00:12:55 GMT {  "name" : "NewGroupName",  "id" : "73d89173-290e-4cb3-a61c-e11deb74767d",  "serverCount" : 0,  "href" : "http://localhost:8080/mmc/api/serverGroups/73d89173-290e-4cb3-a61c-e11deb74767d"}