API

grid.image.list

From GoGrid



Contents

This call will list all the images 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 isPublic 1.2 boolean The visibility of the image. This can be set to true for images owned by GoGrid or false for personal images.
  type 1.2 string The type of server image. This can be set to Web Server or Database Server
  state 1.2 string The current state of the server image.
  • This value will be Saving if the image is currently being saved
  • This value will be Available if the image is available and can be launched.
  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. 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.

 

Sample Request

To list all available images:

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

Response

A common list response of Server Images. The list is a list of all server images available to you.

JSON Response

{
    "list": [{
        "architecture": {
            "description": "64 bit OS",
            "id": 2,
            "name": "64-bit",
            "object": "option"
        },
        "billingtokens": [{
            "id": 21,
            "name": "CentOS 5.1 64bit",
            "price": 0
        }],
        "createdTime": 1247183325757,
        "description": "My First GSI",
        "friendlyName": "Test GSI",
        "id": 81,
        "isActive": true,
        "isPublic": false,
        "location": "19999/GSI-85aa3887-7767-4325-bd01-9947a25f31ee.img",
        "name": "GSI-85aa3887-7767-4325-bd01-9947a25f31ee",
        "object": "serverimage",
        "os": {
            "description": "CentOS Linux 5.1 (64-bit)",
            "id": 10,
            "name": "CentOS 5.1 (64-bit)",
            "object": "option"
        },
        "owner": {
            "id": 19999,
            "name": "Lebowski",
            "object": "customer"
        },
        "price": 0,
        "state": {
            "description": "Image is available for adds",
            "id": 2,
            "name": "Available",
            "object": "option"
        },
        "type": {
            "description": "This server has a public connection to the Internet.",
            "id": 1,
            "name": "Web Server",
            "object": "option"
        },
        "updatedTime": 1247183667362
    }],
    "method": "/grid/image/list",
    "status": "success",
    "summary": {
        "numpages": 34,
        "returned": 1,
        "start": 0,
        "total": 34
    }
}

XML Response

<gogrid>
  <response method="/grid/image/list" status="success">
    <summary total="34" start="0" numpages="34" returned="1"/>
    <list>
      <object name="serverimage">
        <attribute name="id">81</attribute>
        <attribute name="name">GSI-85aa3887-7767-4325-bd01-9947a25f31ee</attribute>
        <attribute name="friendlyName">MyFirstGSI</attribute>
        <attribute name="os">
          <object name="option">
            <attribute name="id">10</attribute>
            <attribute name="name">CentOS 5.1 (64-bit)</attribute>
            <attribute name="description">CentOS Linux 5.1 (64-bit)</attribute>
          </object>
        </attribute>
        <attribute name="architecture">
          <object name="option">
            <attribute name="id">2</attribute>
            <attribute name="name">64-bit</attribute>
            <attribute name="description">64 bit OS</attribute>
          </object>
        </attribute>
        <attribute name="owner">
          <object name="customer">
            <attribute name="id">19999</attribute>
            <attribute name="name">Lebowski</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="state">
          <object name="option">
            <attribute name="id">2</attribute>
            <attribute name="name">Available</attribute>
            <attribute name="description">Image is available for adds</attribute>
          </object>
        </attribute>
        <attribute name="description">My First Description</attribute>
        <attribute name="location">19999/GSI-85aa3887-7767-4325-bd01-9947a25f31ee.img</attribute>
        <attribute name="price">0.0</attribute>
        <attribute name="isActive">true</attribute>
        <attribute name="isPublic">false</attribute>
        <attribute name="createdTime">1247183325757</attribute>
        <attribute name="updatedTime">1247183667362</attribute>
        <attribute name="billingtokens">          <list>
            <object name="billingtoken">
              <attribute name="id">21</attribute>
              <attribute name="name">CentOS 5.1 64bit</attribute>
              <attribute name="price">0.0</attribute>
            </object>
          </list>        </attribute>      </object>
    </list>
  </response>
</gogrid>

CSV Response

# SUCCESS, /grid/image/list, TOTAL, 34, NUMPAGES, 34, START, 0, RETURNED, 1
# server.id,server.name,id,name,friendlyName,os.id,os.name,os.description,architecture.id,architecture.name,architecture.description,owner.id,owner.name,type.id,type.name,type.description,state.id,state.name,state.description,description,location,price,isActive,isPublic,createdTime,updatedTime,billingtokens.1.id,billingtokens.1.name,billingtokens.1.price
,,81,GSI-85aa3887-7767-4325-bd01-9947a25f31ee,Test Image,10,CentOS 5.1 (64-bit),CentOS Linux 5.1 (64-bit),2,64-bit,64 bit OS,19999,Lebowski,1,Web Server,This server has a public connection to the Internet.,2,Available,Image is available for adds,Test,19999/GSI-85aa3887-7767-4325-bd01-9947a25f31ee.img,0.0,true,false,1247183325757,1247183667362,21,CentOS 5.1 64bit,0.0,

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