Get a Load Balancer

From Hostway API Documentation
Revision as of 16:43, 2 July 2014 by Mike.robski (Talk | contribs)
Jump to: navigation, search

Contents

GET /accounts/{accountId}/loadbalancers/{lbId}

This operation will list the details for the specified load balancer

Request

URI Parameters

accountId - string
The selected account Id.
lbId - string
The unique identifier of the load balancre.

Response

Response Codes

200 OK
401 Unauthorized
This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
404 Not Found
The resource does not exist.

Response Body

 {
       "id" : {lbId}",
       "displayName" : "{lbName}",
       "protocol" : {lbProtocol}",
       "port" : {lbPort}",
       "algorithm" : {lbAlgorithm}",
       "virtualIp" : {lbVirtualIp}",
       "region" : "{regionTextKey}",
       "timeout": {timeout},
         
       "nodes" : [
          {
             "id" : "{lbNodeId1}",
	     "serverRef" : "{serverRefURL}",
             "port": "{lbNodePort1}",
	     "condition" : "{lbCondition1}"
	  },
          {
             "id" : "{lbNodeId2}",
	     "serverRef" : "{serverRefURL}",
             "port": "{lbNodePort2}",
	     "condition" : "{lbCondition2}"
	  },
       ],
       "sessionPersistence" : {
                                  "persistenceType":"HTTP_COOKIE"
                              },          
       "healthMonitor" :      {
                                  "protocol":"{hcProtocol}",
                                  "interval": {hcInterval},
                                  "port": {hcPort},
                                  "attemptsBeforeDeactivation": {hcAttemptsBeforeDeactivation},
                                  "attemptsBeforeActivation" : {hcAttemptsBeforeActivation}
                              },
 }

Parameters

id - string
The id of this Load Balancer.*(Unique identifier for this firewall group.)
displayName - string
The display name of the firewall group.
region - string
the region which this vm belongs to
protocol - string
The protocol to be balanced by this load balancer (either 'TCP' or 'HTTP'. Note: HTTPS is not supported)
port - string
the tcp port the load balancer will act on
algorithm - string
Load balancing algorithm to be used (either ROUND_ROBIN or SOURCE_IP. Note: LEAST_CONNECTIONS is not supported
virtualIp - string
the outward-facing ip address to be used for load-balancing (note: this attribute may be either an IPv4 or IPv6 addres. The format should determine which variation.
e.g. 10.1.2.3 is an IPv4 address, whereas 2001:cdba:0000:0000:0000:0000:3257:9652 indicates an IPv6 address
timeout - integer
timeout
nodes
list of node
should include at least one node when creating a LB
nodes.id - string
unique id for node
nodes.serverRef - string
the URL ref of a node
nodes.port - integer
range 1 ~ 65535
the ports on node that LB forward traffic to
nodes.condition - string
the condition of a node, ENABLED or DISABLED

Examples

Successfully list details for specified load balancer

Request

GET /accounts/{accountId}/loadbalancers/0001
Content-Type:application/json
Charset=UTF-8
Authorization:Base64-encoded username & password string

Response

HTTP/1.1 200 OK

{
       "id" : "123",
       "displayName" : "test Load Balancer",
       "region" : "region-A",
       "protocol" : "HTTP",
       "port" : 80,
       "algorithm" : "ROUND_ROBIN",
       "virtualIps" : "2001:cdba:0000:0000:0000:0000:3257:9652",
       "timeout": 30,
       "nodes" : [
          {
             "id" : "1401",
	     "serverRef" : "http://host.com/accounts/accountId/flexcloud/servers/serverId-1",
             "port": "80",
	     "condition" : "ENABLED"
	  },
          {
             "id" : "1411",
	     "serverRef" : "http://host.com/accounts/accountId/flexcloud/servers/serverId-2",
             "port": "80",
	     "condition" : "ENABLED"
	  },
       ],
       "sessionPersistence" : {
                                  "persistenceType":"HTTP_COOKIE"
                              },          
       "healthMonitor" :      {
                                  "protocol": "HTTP",
                                  "interval": 10,
                                  "port": 80,
                                  "attemptsBeforeDeactivation": 5,
                                  "attemptsBeforeActivation": 1
                              },
 }

Failure while trying to request details for a load balancer that does not exist

Request

GET /accounts/{accountId}/loadbalancers/{fake_load_balancer_id}
Content-Type:application/json
Charset=UTF-8
Authorization:Base64-encoded username & password string

Response

HTTP/1.1 404 Not Found

 {
    "itemNotFound": 
       {
          "message": "Resource not found", 
          "code": 404, 
          "details": "",
          "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
       }
 }

Failure while trying to make unauthorized access

Request

GET /accounts/{accountId}/loadbalancers/0001
Content-Type:application/json
Charset=UTF-8
Authorization:Base64-encoded fake_authentication_string

Response

HTTP/1.1 401 Unauthorized

Failure while trying to pass invalid account number

Request

GET /accounts/fake/loadbalancers/0001
Content-Type:application/json
Charset=UTF-8
Authorization:Base64-encoded fake_authentication_string

Response

HTTP/1.1 404 Not Found


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox