Nav

List All Servers

The GET operation returns a list of all servers on the specified resource. The resulting JSON contains two properties: total, which returns the number of total servers, and data, which is an array of server types.

Query Parameters:

Name Description

start

The server index to start listing at. Defaults to 0.

count

The number of servers to return. Defaults to 100.

name

The name of the server to search for. Optional.

redirectToResult

Used in conjunction with name to redirect to the server if there is one with the corresponding name. Valid values are true/false. Optional.

Example #1 Request:


       
    
1
GET http://localhost:8080/console/api/servers

Example #1 Response:


       
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
200 OK
Content-Type: application/json
Server: Apache-Coyote/1.1
Date: Mon, 10 Aug 2015 00:12:55 GMT
{
  "total" : 1,
  "data" : [
    {
      "id" : "1234567890",
      "href" : "http://localhost:8080/console/api/servers/1234567890",
      "name" : "DevelopmentServer1",
      "type" : "Apache Tomcat/6.0.20",
      "hosts" : [ "http://192.168.1.105:8090", "http://192.168.1.105:8010" ],
      "groups" : [
        {
          "name" : "Development",
          "href" : "http://localhost:8080/console/api/serverGroups/73d89173-290e-4cb3-a61c-e11deb74767d"
        }
      ],
      "packages" : [
        {
          "name" : "Test",
          "href" : "http://localhost:8080/console/api/packages/local$fb9dcb67-88de-482a-b0a4-50ff1d65a16a"
        }
      ]
    }
  ]
}

Example #2 Request:


       
    
1
GET http://localhost:8080/console/api/servers?name=MyServer&redirectOnResult=true

Example #2 Response:


       
    
1
2
301
Location: http://localhost:8080/console/api/servers/serverId