API

grid.server.list

From GoGrid



Contents

This call will list all the servers in the system. This method follows a common list pattern.


Request

URL


Role Based Access Control Permissions

  • Super User
  • System User
  • Billing User
  • Read Only User

Input Request Query Parameters

Required Name Version Type Description
Required api_key 1.0 string An API Key generated by GoGrid.
  sig 1.0 string An MD5 Signature that signs each and every API request. Instructions on how to generate this signature can be found here.
v 1.0 string The version of the API. For more information, see API Versions.
  • For version 1.3, set parameter to 1.3
Optional
  num_items 1.0 int The number of items to return. Specifying this value will effectively paginate the results of a list call into a number of pages with this number of items per page. This makes it easier and faster to access large lists. This makes it easier and faster to access large lists. If not specified, result will not be paginated.
  page 1.0 int The page index to return for paginated results, indexed from 0, so a value of 0 will return the first available page, 1 will return the second page and so forth.

This parameter is ignored if num_items is not specified.

  server.type 1.0 string Using the server.type parameter, a user can filter the results of the list to list just web/app servers or just database servers.
  isSandbox 1.2 boolean The filter to return only Image Sandbox servers when set to true or only Web/App and Database servers when set to false.

Sample Request

To list all servers:

https://api.gogrid.com/api/grid/server/list
  ? ... auth parameters...

To list database servers:

https://api.gogrid.com/api/grid/server/list
  ?server.type=Database+Server
  ... auth parameters...

To list Image Sandbox servers:

https://api.gogrid.com/api/grid/server/list
  ?isSandbox=true
  ... auth parameters...


Response

A common list response of Servers. The list is a list of all servers in the system.

JSON Response

{
    "list": [{
        "description": "Test Sandbox Server",
        "image": {
            "description": "Windows 2008 (32-bit) w/ IIS 7.0 + PHP 5.2 + MySQL 5.0",
            "id": 57,
            "name": "w2k8_32_iis_php_mysql",
            "object": "option"
        },
        "ip": {
            "id": 499,
            "ip": "111.111.11.111",
            "object": "ip",
            "public": true,
            "state": {
                "description": "IP is reserved or in use",
                "id": 2,
                "name": "Assigned",
                "object": "option"
            },
            "subnet": "111.111.11.110/255.255.255.240"
        },
        "isSandbox": true,
        "name": "Sandbox Server",
        "object": "server",
        "os": {
            "description": "Windows 2008 Server (32-bit)",
            "id": 11,
            "name": "Windows 2008 Server (32-bit)",
            "object": "option"
        },
        "ram": {
            "description": "SandBox Server with 2GB RAM",
            "id": 7,
            "name": "2GB",
            "object": "option"
        },
        "state": {
            "description": null,
            "id": 3,
            "name": "Off",
            "object": "option"
        },
        "type": {
            "description": "This server has a public connection to the Internet.",
            "id": 1,
            "name": "Web Server",
            "object": "option"
        }
    }],
    "method": "/grid/server/list",
    "status": "success",
    "summary": {
        "numpages": 0,
        "returned": 1,
        "start": 0,
        "total": 1
    }
}

XML Response

<gogrid>
  <response method="/grid/server/list" status="success">
    <summary total="1" start="0" numpages="0" returned="1"/>
    <list>
      <object name="server">
        <attribute name="id"></attribute>
        <attribute name="name">Sandbox Server</attribute>
        <attribute name="description">Test Sandbox Server</attribute>
        <attribute name="ip">
          <object name="ip">
            <attribute name="id">499</attribute>
            <attribute name="ip">111.111.111.111</attribute>
            <attribute name="state">
              <object name="option">
                <attribute name="id">2</attribute>
                <attribute name="name">Assigned</attribute>
                <attribute name="description">IP is reserved or in use</attribute>
              </object>
            </attribute>
            <attribute name="subnet">111.111.111.111/255.255.255.240</attribute>
            <attribute name="public">true</attribute>
          </object>
        </attribute>
        <attribute name="ram">
          <object name="option">
            <attribute name="id">7</attribute>
            <attribute name="name">2GB</attribute>
            <attribute name="description">SandBox Server with 2GB RAM</attribute>
          </object>
        </attribute>
        <attribute name="image">
          <object name="serverimage">
            <attribute name="id">57</attribute>
            <attribute name="name">w2k8_32_iis_php_mysql</attribute>
            <attribute name="friendlyName"></attribute>
            <attribute name="ownerCustomerId"></attribute>
            <attribute name="ownerName"></attribute>
            <attribute name="description">Windows 2008 (32-bit) w/ IIS 7.0 + PHP 5.2 + MySQL 5.0</attribute>
            <attribute name="location"></attribute>
            <attribute name="price"></attribute>
            <attribute name="isActive"></attribute>
            <attribute name="isPublic"></attribute>
            <attribute name="createdTime"></attribute>
            <attribute name="updatedTime"></attribute>
          </object>
        </attribute>
        <attribute name="state">
          <object name="option">
            <attribute name="id">3</attribute>
            <attribute name="name">Off</attribute>
            <attribute name="description"></attribute>
          </object>
        </attribute>
        <attribute name="type">
          <object name="option">
            <attribute name="id">1</attribute>
            <attribute name="name">Web Server</attribute>
            <attribute name="description">This server has a public connection to the Internet.</attribute>
          </object>
        </attribute>
        <attribute name="os">
          <object name="option">
            <attribute name="id">11</attribute>
            <attribute name="name">Windows 2008 Server (32-bit)</attribute>
            <attribute name="description">Windows 2008 Server (32-bit)</attribute>
          </object>
        </attribute>
        <attribute name="isSandbox">true</attribute>
      </object>
    </list>
  </response>
</gogrid>

CSV Response

# SUCCESS, /grid/server/list, TOTAL, 1, NUMPAGES, 0, START, 0, RETURNED, 1
# id,name,description,ip.id,ip.ip,ip.state.id,ip.state.name,ip.state.description,ip.subnet,ip.public,ram.id,ram.name,ram.description,image.server.id,image.server.name,image.id,image.name,image.friendlyName,image.os.id,image.os.name,image.os.description,image.ownerCustomerId,image.ownerName,image.architecture.id,image.architecture.name,image.architecture.description,image.type.id,image.type.name,image.type.description,image.state.id,image.state.name,image.state.description,image.description,image.location,image.price,image.isActive,image.isPublic,image.createdTime,image.updatedTime,,state.id,state.name,state.description,type.id,type.name,type.description,os.id,os.name,os.description,isSandbox
,Sandbox Server,Test Sandbox Server,499,111.111.111.111,2,Assigned,IP is reserved or in use,111.111.111.110/255.255.255.240,true,7,2GB,SandBox Server with 2GB RAM,,,57,w2k8_32_iis_php_mysql,,,,,,,,,,,,,,,,Windows 2008 (32-bit) w/ IIS 7.0 + PHP 5.2 + MySQL 5.0,,,,,,,,3,Off,,1,Web Server,This server has a public connection to the Internet.,11,Windows 2008 Server (32-bit),Windows 2008 Server (32-bit),true

Error Codes

Status Code Description
400 IllegalArgumentException Any problems with input parameters will generate an IllegalArgumentException.
401 Unauthorized This error code will occur when the role tied to the API Key in your request has the wrong Access Controls.
403 Authentication Failed This error code will occur when your request is not properly signed. Make sure your have a valid API key and secret and that you are properly generating a request signature. Ensure that the clock on the computer from which you are making the request is synchronized woth the GoGrid API Server.
404 Not Found This error will occur if you have specified a method that does not exist or any other URL does not exists on the API Server.
500 UnexpectedError These types of errors indicate an internal system problem. Depending on the severity of the error and whether not it is blocking your development, report the error to GoGrid support by emailing the response to apisupport@gogrid.com.
Personal tools