API

grid.image.restore

From GoGrid



Contents

This call will restore a single image from the trash on your grid. This method follows the same conventions as a common delete pattern.

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
  id * 1.3 string The id of the image to restore.
  name * 1.3 string The name of the image to restore.
  image * 1.3 string The id or name of the image to restore.
Optional

* Only one of these parameters id, name, or image is required per delete method call.

Sample Request

To restore by name:

https://api.gogrid.com/api/grid/image/restore
  ?name=GSI-23hUo-985JHD-Jfkn4-Rhkn4
  ... auth parameters...

To restore by id:

https://api.gogrid.com/api/grid/image/restore
  ?id=203923
  ... auth parameters...

Response


This method follows a common delete response for Images.

JSON Response

{
    "list": [{
        "billingtokens": [{
            "id": 4,
            "name": "Windows 2003 Standard 64bit",
            "price": 0
        }],
        "createdTime": 1248823214367,
        "friendlyName": "iis-saved",
        "id": 195,
        "isActive": true,
        "isPublic": false,
        "location": "17773/GSI-9c885a6c-1ca8-465a-9706-f328fd317984.img",
        "name": "GSI-9c885a6c-1ca8-465a-9706-f328fd317984",
        "object": "image",
        "os": {
            "description": "Windows 2003 Standard (64-bit)",
            "id": 2,
            "name": "Windows 2003 Standard (64-bit)",
            "object": "option"
        },
        "owner": {
            "id": 17773,
            "name": "Servepath",
            "object": "customer"
        },
        "price": 0,
        "state": {
            "description": "Image is marked for deletion",
            "id": 4,
            "name": "Trash",
            "object": "option"
        },
        "type": {
            "description": "Web or Application Server",
            "id": 1,
            "name": "Web Server",
            "object": "option"
        },
        "updatedTime": 1251394961617
    }],
    "method": "/grid/image/restore",
    "status": "success",
    "summary": {
        "numpages": 0,
        "returned": 1,
        "start": 0,
        "total": 1
    }
}

XML Response

<gogrid>
  <response method="/grid/image/restore" status="success">
    <summary total="1" start="0" numpages="0" returned="1"/>
    <list>
      <object name="image">
        <attribute name="id">195</attribute>
        <attribute name="friendlyName">iis-saved</attribute>
        <attribute name="name">GSI-9c885a6c-1ca8-465a-9706-f328fd317984</attribute>
        <attribute name="os">
          <object name="option">
            <attribute name="id">2</attribute>
            <attribute name="name">Windows 2003 Standard (64-bit)</attribute>
            <attribute name="description">Windows 2003 Standard (64-bit)</attribute>
          </object>
        </attribute>
        <attribute name="owner">
          <object name="customer">
            <attribute name="id">17773</attribute>
            <attribute name="name">Servepath</attribute>
          </object>
        </attribute>
        <attribute name="type">
          <object name="option">
            <attribute name="id">1</attribute>
            <attribute name="name">Web Server</attribute>
            <attribute name="description">Web or Application Server</attribute>
          </object>
        </attribute>
        <attribute name="state">
          <object name="option">
            <attribute name="id">4</attribute>
            <attribute name="name">Trash</attribute>
            <attribute name="description">Image is marked for deletion</attribute>
          </object>
        </attribute>
        <attribute name="description"></attribute>
        <attribute name="location">17773/GSI-9c885a6c-1ca8-465a-9706-f328fd317984.img</attribute>
        <attribute name="price">0.0</attribute>
        <attribute name="isActive">true</attribute>
        <attribute name="isPublic">false</attribute>
        <attribute name="createdTime">1248823214367</attribute>
        <attribute name="updatedTime">1251394909270</attribute>
        <attribute name="billingtokens">          <list>
            <object name="billingtoken">
              <attribute name="id">4</attribute>
              <attribute name="name">Windows 2003 Standard 64bit</attribute>
              <attribute name="price">0.0</attribute>
            </object>
          </list>        </attribute>      </object>
    </list>
  </response>
</gogrid>

CSV Response

# SUCCESS, /grid/image/restore, TOTAL, 1, NUMPAGES, 0, START, 0, RETURNED, 1
# server.id,server.name,id,friendlyName,name,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
,,195,iis-saved,GSI-9c885a6c-1ca8-465a-9706-f328fd317984,2,Windows 2003 Standard (64-bit),Windows 2003 Standard (64-bit),,,,17773,Servepath,1,Web Server,Web or Application Server,4,Trash,Image is marked for deletion,,17773/GSI-9c885a6c-1ca8-465a-9706-f328fd317984.img,0.0,true,false,1248823214367,1251394990140,4,Windows 2003 Standard 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