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 as your virtual IP address determines the data center to which the load balancer is added. For example, your load balancer will be added to US-East-1 if you specify a US-East-1 IP as the virtual IP address. Note that the virtual and real IP addresses must be from the same data center.
To access data center functionality, you must set your version parameter (v) to 1.5 or higher.
A common add response for Load Balancers.
JSON Response
{
"list": [{
"datacenter": {
"description": "US West 1 Datacenter",
"id": 1,
"name": "US-West-1",
"object": "option"
},
"name": "lb05",
"object": "loadbalancer",
"os": {
"description": "The F5 Load Balancer.",
"id": 1,
"name": "F5",
"object": "option"
},
"persistence": {
"description": "",
"id": 1,
"name": "None",
"object": "option"
},
"realiplist": [
{
"ip": {
"datacenter": {
"description": "US West 1 Datacenter",
"id": 1,
"name": "US-West-1",
"object": "option"
},
"id": 204896,
"ip": "204.113.12.38",
"object": "ip",
"public": true,
"state": {
"description": "IP is available to use",
"id": 1,
"name": "Unassigned",
"object": "option"
},
"subnet": "204.113.12.26/255.255.255.240"
},
"object": "ipportpair",
"port": 80
},
{
"ip": {
"datacenter": {
"description": "US West 1 Datacenter",
"id": 1,
"name": "US-West-1",
"object": "option"
},
"id": 204895,
"ip": "204.113.12.39",
"object": "ip",
"public": true,
"state": {
"description": "IP is available to use",
"id": 1,
"name": "Unassigned",
"object": "option"
},
"subnet": "204.113.12.26/255.255.255.240"
},
"object": "ipportpair",
"port": 80
}
],
"state": {
"description": "Loadbalancer is enabled and on.",
"id": 1,
"name": "On",
"object": "option"
},
"type": {
"description": "",
"id": 1,
"name": "Round Robin",
"object": "option"
},
"virtualip": {
"ip": {
"datacenter": {
"description": "US West 1 Datacenter",
"id": 1,
"name": "US-West-1",
"object": "option"
},
"id": 204894,
"ip": "204.113.12.40",
"object": "ip",
"public": true,
"state": {
"description": "IP is reserved or in use",
"id": 2,
"name": "Assigned",
"object": "option"
},
"subnet": "204.113.12.26/255.255.255.240"
},
"object": "ipportpair",
"port": 80
}
}],
"method": "/grid/loadbalancer/add",
"status": "success",
"summary": {
"numpages": 0,
"returned": 1,
"start": 0,
"total": 1
}
}
XML Response
<gogrid>
<response method="/grid/loadbalancer/add" status="success">
<summary total="1" start="0" numpages="0" returned="1"/>
<list>
<object name="loadbalancer">
<attribute name="id"></attribute>
<attribute name="name">lb05</attribute>
<attribute name="description"></attribute>
<attribute name="virtualip">
<object name="ipportpair">
<attribute name="ip">
<object name="ip">
<attribute name="id">204894</attribute>
<attribute name="ip">204.113.12.40</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">204.113.12.26/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="port">8080</attribute>
</object>
</attribute>
<attribute name="type">
<object name="option">
<attribute name="id">1</attribute>
<attribute name="name">Round Robin</attribute>
<attribute name="description"></attribute>
</object>
</attribute>
<attribute name="persistence">
<object name="option">
<attribute name="id">1</attribute>
<attribute name="name">None</attribute>
<attribute name="description"></attribute>
</object>
</attribute>
<attribute name="realiplist">
<list>
<object name="ipportpair">
<attribute name="ip">
<object name="ip">
<attribute name="id">204896</attribute>
<attribute name="ip">204.113.12.38</attribute>
<attribute name="state">
<object name="option">
<attribute name="id">1</attribute>
<attribute name="name">Unassigned</attribute>
<attribute name="description">IP is available to use</attribute>
</object>
</attribute>
<attribute name="subnet">204.113.12.26/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="port">8080</attribute>
</object>
<object name="ipportpair">
<attribute name="ip">
<object name="ip">
<attribute name="id">204895</attribute>
<attribute name="ip">204.113.12.39</attribute>
<attribute name="state">
<object name="option">
<attribute name="id">1</attribute>
<attribute name="name">Unassigned</attribute>
<attribute name="description">IP is available to use</attribute>
</object>
</attribute>
<attribute name="subnet">204.113.12.26/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="port">8080</attribute>
</object>
</list>
</attribute>
<attribute name="os">
<object name="option">
<attribute name="id">1</attribute>
<attribute name="name">F5</attribute>
<attribute name="description">The F5 Load Balancer.</attribute>
</object>
</attribute>
<attribute name="state">
<object name="option">
<attribute name="id">1</attribute>
<attribute name="name">On</attribute>
<attribute name="description">Loadbalancer is enabled and on.</attribute>
</object>
</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/loadbalancer/add, TOTAL, 1, START, 0, RETURNED, 1
# id,name,description,virtualip.ip.id,virtualip.ip.ip,virtualip.ip.subnet,virtualip.ip.public,virtualip.port,type.id,type.name,type.description,persistence.id,persistence.name,persistence.description,os.id,os.name,os.description,state.id,state.name,state.descriptionrealiplist.1.ip.id,realiplist.1.ip.ip,realiplist.1.ip.subnet,realiplist.1.ip.public,realiplist.1.port
,Test,My Load Balancer,138803,216.121.62.34,216.121.62.32/255.255.255.240,true,2300,1,Round Robin,,1,None,,1,F5,The F5 Load Balancer.,1,On,Loadbalancer is enabled and on.138806,216.121.62.37,216.121.62.32/255.255.255.240,true,2400,
Error Codes
| 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.
|