Contact Us 1-800-596-4880

Get a Server

The resource /mmc/api/servers/<myServerId>) retrieves a single server. You invoke this resource using the HTTP GET operation and replace myServerId with the identifier of a particular server.

You can obtain the URL from the server by using the href property of the server when listing servers.

As an option, you can 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 a request to this method.

GET http://localhost:8080/console/api/servers/local$b15ecba1-9f97-4b16-8127-9b137cdbb2e1

Example Response

The response with the JSON result to the above request might look as follows:

200 OK
Content-Type: application/json
Server: Apache-Coyote/1.1
Date: Sun, 08 Nov 2009 00:12:55 GMT


{
  "name" : "Test",
  "id" : "local$b15ecba1-9f97-4b16-8127-9b137cdbb2e1",
  "href" : "http://localhost:8080/mmc/api/servers/local$b15ecba1-9f97-4b16-8127-9b137cdbb2e1",
  "agentUrl" : "https://localhost:7777/mmc-support",
  "hostIp" : "192.168.0.13",
  "muleServerId" : "d9505d40-2c5c-11df-b832-a32a5a09ec4e",
  "started" : "Wed Mar 10 16:51:59 CET 2010",
  "version" : "2.2.5",
  "agents": [
    {
      "name" : "mmc-support",
      "description" : "Mule Management Console Support (0.0.0.0:7777)"
    },
    {
      "name" : "jmx-agent",
      "description" : "JMX Agent"
     }
   ],
  "groups" : [
    {
      "name" : "Development",
      "href" : "http://localhost:8080/mmc/api/serverGroups/73d89173-290e-4cb3-a61c-e11deb74767d"
    }
  ],
  "runningServices" : 3,
  "pausedServices" : 0,
  "stoppedServices": 0
}