API

grid.server.add

From GoGrid



Contents

This call will add a single server object to your grid. This method follows a common add pattern.

To create an image sandbox pass the optional isSandbox parameter to true.

Data Center-Specific Behavior

Your GoGrid account includes IP addresses in both our US-West-1 and US-East-1 data centers, with each data center having its own IP address range. The IP address you choose for your server determines the data center to which it will be added.

To access data center functionality, you must set your version parameter (v) to 1.5 or higher.


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
  name string The friendly name of this server. There is a 20 character limit on this field.
  image 1.0 string The desired server image's id or name.
  server.ram 1.0 string The id or name of the desired ram option for this server.
  ip 1.0 string The initial public ip for this server.
Optional description 1.0 string Descriptive text to describe this server.
  isSandbox 1.2 boolean Is this server intended to be a sandbox instance?
  • true creates an image sandbox. If set to true, the request parameter server.ram is ignored and non-mandatory.
  • false creates a regular cloud server
  • Default is false

Sample Request

To add a server with an initial public IP address of 192.200.10.101 with 512 MB of RAM.

https://api.gogrid.com/api/grid/server/add
  ?name=My+First+Server
  &image=centos44_32_apache22php5
  &server.ram=512MB
  &description=This+is+text+to+describe+this+server
  &ip=192.200.10.101
  ... auth parameters ...


Response


A common add response for Servers.

JSON Response

{
    "list": [
       {
            "datacenter": {
                "description": "US West 1 Datacenter",
                "id": 1,
                "name": "US-West-1",
                "object": "option"
            },
            "id": 3212,
            "image": {
                "billingtokens": [{
                    "id": 46,
                    "name": "CentOS 5.3 64bit",
                    "object": "billingtoken",
                    "price": 0
                }],
                "description": "CentOS 5.3 (64-bit) w/ None",
                "friendlyName": "CentOS 5.3 (64-bit) w/ None",
                "id": 117,
                "isActive": true,
                "isPublic": true,
                "location": "gogrid/GSI-939ef909-84b8-4a2f-ad56-02ccd7da05ff.img",
                "name": "centos5.3_64_base",
                "object": "serverimage",
                "os": {
                    "description": "CentOS 5.3 (64-bit)",
                    "id": 47,
                    "name": "CentOS 5.3 (64-bit)",
                    "object": "option"
                },
                "owner": {
                    "id": -1,
                    "name": "GoGrid",
                    "object": "customer"
                },
                "price": 0,
                "state": {
                    "description": "Image is available for adds",
                    "id": 2,
                    "name": "Available",
                    "object": "option"
                },
                "type": {
                    "description": "Web or Application Server",
                    "id": 1,
                    "name": "Web Server",
                    "object": "option"
                },
                "updatedTime": 1257789076417
            },
            "ip": {
                "datacenter": {
                    "description": "US West 1 Datacenter",
                    "id": 1,
                    "name": "US-West-1",
                    "object": "option"
                },
                "id": 65667,
                "ip": "208.113.110.130",
                "object": "ip",
                "public": true,
                "state": {
                    "description": "IP is reserved or in use",
                    "id": 2,
                    "name": "Assigned",
                    "object": "option"
                },
                "subnet": "208.113.110.128/255.255.255.240"
            },
            "isSandbox": false,
            "name": "ws01",
            "object": "server",
            "os": {
                "description": "CentOS 5.3 (64-bit)",
                "id": 47,
                "name": "CentOS 5.3 (64-bit)",
                "object": "option"
            },
            "ram": {
                "description": "Server with 1GB RAM",
                "id": 2,
                "name": "1GB",
                "object": "option"
            },
            "state": {
                "description": "Server is in active state.",
                "id": 1,
                "name": "On",
                "object": "option"
            },
            "type": {
                "description": "Web or Application Server",
                "id": 1,
                "name": "Web Server",
                "object": "option"
            }
        }
    ],
    "method": "/grid/server/add",
    "status": "success",
    "summary": {
        "numpages": 0,
        "returned": 1,
        "start": 0,
        "total": 1
    }
}

XML Response

<gogrid>
  <response method="/grid/server/add" status="success">
    <summary total="1" start="0" numpages="0" returned="1"/>
    <list>
      <object name="server">
        <attribute name="id">3212</attribute>
        <attribute name="name">ws01</attribute>
        <attribute name="description"></attribute>
        <attribute name="ip">
          <object name="ip">
            <attribute name="id">65667</attribute>
            <attribute name="ip">208.113.110.130</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">208.113.110.128/255.255.255.240</attribute>
            <attribute name="public">true</attribute>
            <attribute name="datacenter">
              <object name="option">
                <attribute name="id">1</attribute>
                <attribute name="name">US-West-1</attribute>
                <attribute name="description">US West 1 Datacenter</attribute>
              </object>
            </attribute>
          </object>
        </attribute>
        <attribute name="ram">
          <object name="option">
            <attribute name="id">2</attribute>
            <attribute name="name">1GB</attribute>
            <attribute name="description">Server with 1GB RAM</attribute>
          </object>
        </attribute>
        <attribute name="image">
          <object name="serverimage">
            <attribute name="id">117</attribute>
            <attribute name="friendlyName">CentOS 5.3 (64-bit) w/ None</attribute>
            <attribute name="name">centos5.3_64_base</attribute>
            <attribute name="os">
              <object name="option">
                <attribute name="id">47</attribute>
                <attribute name="name">CentOS 5.3 (64-bit)</attribute>
                <attribute name="description">CentOS 5.3 (64-bit)</attribute>
              </object>
            </attribute>
            <attribute name="owner">
              <object name="customer">
                <attribute name="id">-1</attribute>
                <attribute name="name">GoGrid</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">2</attribute>
                <attribute name="name">Available</attribute>
                <attribute name="description">Image is available for adds</attribute>
              </object>
            </attribute>
            <attribute name="description">CentOS 5.3 (64-bit) w/ None</attribute>
            <attribute name="location">gogrid/GSI-939ef909-84b8-4a2f-ad56-02ccd7da05ff.img</attribute>
            <attribute name="price">0.0</attribute>
            <attribute name="isActive">true</attribute>
            <attribute name="isPublic">true</attribute>
            <attribute name="createdTime"></attribute>
            <attribute name="updatedTime">1257789076417</attribute>
            <attribute name="billingtokens">
	    <list>
                <object name="billingtoken">
                  <attribute name="id">46</attribute>
                  <attribute name="name">CentOS 5.3 64bit</attribute>
                  <attribute name="price">0.0</attribute>
                </object>
            </list>
	</attribute>
	</object>
        </attribute>
        <attribute name="state">
          <object name="option">
            <attribute name="id">1</attribute>
            <attribute name="name">On</attribute>
            <attribute name="description">Server is in active state.</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="os">
          <object name="option">
            <attribute name="id">47</attribute>
            <attribute name="name">CentOS 5.3 (64-bit)</attribute>
            <attribute name="description">CentOS 5.3 (64-bit)</attribute>
          </object>
        </attribute>
        <attribute name="isSandbox">false</attribute>
        <attribute name="datacenter">
          <object name="option">
            <attribute name="id">1</attribute>
            <attribute name="name">US-West-1</attribute>
            <attribute name="description">US West 1 Datacenter</attribute>
          </object>
        </attribute>
      </object>
    </list>
  </response>
</gogrid>

CSV Response

# SUCCESS, /grid/server/add, 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
,Test Server,Test Server,502,208.113.75.245,2,Assigned,IP is reserved or in use,208.113.75.240/255.255.255.240,true,7,2GB,SandBox Server with 2GB RAM,,,3,w2k3r2dc_32_iis6,,,,,,,,,,,,,,,,Windows 2003 (32-bit) w/ IIS 6.0,,,,,,,,3,Off,,1,Web Server,This server has a public connection to the Internet.,1,Windows 2003 Standard (32-bit),Windows 2003 Standard (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