API

grid.image.save

From GoGrid



Contents

This call will save a private (visible to only you) server image to your library of available images. The image will be saved from an existing image sandbox. This method is semantically similar to an add method, and therefore follows a common add pattern.



NOTE: Before you save a server image, please read the MyGSI instructions. This API call is the third step to create a server image. The previous steps are:


  1. Add Image Sandbox. See grid.server.add
  2. Configure & Prep Image Sandbox


After the previous two steps are completed a server image can be saved from UI or API based on the target image sandbox.



Request

URL


Role Based Access Control Permissions

  • Super User
  • System 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
  friendlyName 1.2 string The friendly name of the to be saved server image.
  server 1.2 string The id or name of the image sandbox to save.
  • NOTE: Using this parameter may generate an error if one or more image sandboxes share a non-unique name.
Optional description 1.2 string Descriptive text to describe this server.

Sample Request

To save a image sandbox:

https://api.gogrid.com/api/grid/image/save
  ?name=My+First+GSI
  &description=This+is+the+first+gsi+i+have+ever+created
  &server=1234
  ... auth parameters ...


Response


A common add response for Server Images.

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": 1247849147646,
        "description": "CentOS Test MyGSI",
        "friendlyName": "MyGSI Server w Centos",
        "id": 152,
        "isActive": false,
        "isPublic": false,
        "location": "20024/GSI-68e24e6b-b0e5-4593-9123-26c1b203d9cb.img",
        "name": "GSI-68e24e6b-b0e5-4593-9123-26c1b203d9cb",
        "object": "serverimage",
        "os": {
            "description": "CentOS Linux 5.1 (64-bit)",
            "id": 10,
            "name": "CentOS 5.1 (64-bit)",
            "object": "option"
        },
        "ownerCustomerId": 00000,
        "ownerName": "Lebowski",
        "price": 0,
        "state": {
            "description": "Image is being saved",
            "id": 1,
            "name": "Saving",
            "object": "option"
        },
        "type": {
            "description": "This server has a public connection to the Internet.",
            "id": 1,
            "name": "Web Server",
            "object": "option"
        },
        "updatedTime": 1247849147646
    }],
    "method": "/grid/image/save",
    "status": "success",
    "summary": {
        "numpages": 0,
        "returned": 1,
        "start": 0,
        "total": 1
    }
}

XML Response

<gogrid>
  <response method="/grid/image/save" status="success">
    <summary total="1" start="0" numpages="0" returned="1"/>
    <list>
      <object name="serverimage">
        <attribute name="id">153</attribute>
        <attribute name="name">GSI-f5bca107-2e7d-4f40-9fed-15b27add426b</attribute>
        <attribute name="friendlyName">MyGSI Server CentOS LAMP</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="ownerCustomerId">20024</attribute>
        <attribute name="ownerName">Lebowski</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="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">1</attribute>
            <attribute name="name">Saving</attribute>
            <attribute name="description">Image is being saved</attribute>
          </object>
        </attribute>
        <attribute name="description">CentOS LAMP</attribute>
        <attribute name="location">20024/GSI-f5bca107-2e7d-4f40-9fed-15b27add426b.img</attribute>
        <attribute name="price">0.0</attribute>
        <attribute name="isActive">false</attribute>
        <attribute name="isPublic">false</attribute>
        <attribute name="createdTime">1247851822469</attribute>
        <attribute name="updatedTime">1247851822469</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/save, TOTAL, 1, NUMPAGES, 0, START, 0, RETURNED, 1
# server.id,server.name,id,name,friendlyName,os.id,os.name,os.description,ownerCustomerId,ownerName,architecture.id,architecture.name,architecture.description,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
,,155,GSI-2cbae6f4-b01f-41ce-a99b-36e9b666398f,MyGSI Server CentOS LAMP,9,RHEL 5.1 (64-bit),RHEL Linux 5.1 (64-bit),20024,Servepath,2,64-bit,64 bit OS,1,Web Server,This server has a public connection to the Internet.,1,Saving,Image is being saved,CentOS LAMP,20024/GSI-2cbae6f4-b01f-41ce-a99b-36e9b666398f.img,0.0,false,false,1247859179650,1247859179650,20,RHEL 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