Get a Load Balancer

(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 95)
(Response Body)
Line 1: Line 1:
 
= '''GET''' /accounts/''{accountId}''/loadbalancers/''{lbId}'' =
 
= '''GET''' /accounts/''{accountId}''/loadbalancers/''{lbId}'' =
This operation will list the details for the specified load balancer
+
This operation lists the details for the specified load balancer
  
 
== Request ==
 
== Request ==
=== URI Parameters ===
+
<code>GET /accounts/''{accountId}''/loadbalancers/''{lbId}''</code>
 +
 
 +
=== Request Parameters ===
 
; accountId - ''string''
 
; accountId - ''string''
: The selected account Id.
+
: The selected account id.
  
 
; lbId - ''string''
 
; lbId - ''string''
: The unique identifier of the load balancre.
+
: The selected load balancer id.
  
 
== Response ==
 
== Response ==
Line 23: Line 25:
 
=== Response Body ===
 
=== Response Body ===
 
  <nowiki>
 
  <nowiki>
{
+
{
      "id" : {lbId}",
+
    "id": "{lbId}",
      "displayName" : "{lbName}",
+
    "displayName": "{lbName}",
      "protocol" : {lbProtocol}",
+
    "virtualIp": "{lbVirtualIp}",
      "port" : {lbPort}",
+
    "region": "{regionTextKey}",
      "algorithm" : {lbAlgorithm}",
+
    "nodePools": [{"href": "http://{api-server}/account/{accountId}/loadbalancers/{lbId}/nodepools", "rel": "related"}],
      "virtualIp" : {lbVirtualIp}",
+
    "links": [{"href": "http://{api-server}/accounts/{accountId}/loadbalancers/{lbId}", "rel": "self"}]
      "region" : "{regionTextKey}",
+
}</nowiki>
      "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}
+
                              },
+
}</nowiki>
+
  
 
==== Parameters ====
 
==== Parameters ====
 
; id - ''string''
 
; id - ''string''
: The id of this Load Balancer.*(Unique identifier for this firewall group.)
+
: The id of this Load Balancer.
  
 
; displayName - ''string''
 
; displayName - ''string''
: The display name of the firewall group.
+
: The display name of the load balancer
  
 
; region - ''string''
 
; region - ''string''
: the region which this vm belongs to
+
: 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''
 
; 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.
+
: The public-facing ip address to be used for load-balancing (either an IPv4 or IPv6 address)
: 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''
+
; nodePools - ''list''
: range 1 ~ 65535
+
: [[Hypermedia]] to a resource of the node pools under this load balancer
: the ports on node that LB forward traffic to
+
  
; nodes.condition - ''string''
+
; links - ''list''
: the condition of a node, ENABLED or DISABLED
+
: [[Hypermedia]] for this resource. Links to self.
  
 
== Examples ==
 
== Examples ==
Line 108: Line 59:
 
'''Request'''
 
'''Request'''
 
<pre>
 
<pre>
GET /accounts/{accountId}/loadbalancers/0001
+
GET /accounts/{accountId}/loadbalancers/123
 
Content-Type:application/json
 
Content-Type:application/json
 
Charset=UTF-8
 
Charset=UTF-8
Authorization:Base64-encoded username & password string
+
Authorization: Basic {Base64-encoded username & password string}
 
</pre>
 
</pre>
  
Line 119: Line 70:
  
 
{
 
{
      "id" : "123",
+
    "id" : "123",
      "displayName" : "test Load Balancer",
+
    "displayName" : "test Load Balancer",
      "region" : "region-A",
+
    "region" : "region-A",
      "protocol" : "HTTP",
+
    "virtualIps" : "2001:cdba:0000:0000:0000:0000:3257:9652",
      "port" : 80,
+
    "nodePools": [{"href": "http://{api-server}/accounts/{accountId}/loadbalancers/123/nodepools", "rel": "related"}],
      "algorithm" : "ROUND_ROBIN",
+
    "links" : [{"href" : "http://{api-server}/accounts/{accountId}/loadbalancers/123", "rel" : "self"}]
      "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
+
                              },
+
}
+
 
</pre>
 
</pre>
  
Line 161: Line 86:
 
Content-Type:application/json
 
Content-Type:application/json
 
Charset=UTF-8
 
Charset=UTF-8
Authorization:Base64-encoded username & password string
+
Authorization: Basic {Base64-encoded username & password string}
 
</pre>
 
</pre>
  
Line 168: Line 93:
 
HTTP/1.1 404 Not Found
 
HTTP/1.1 404 Not Found
  
{
+
{
 
     "itemNotFound":  
 
     "itemNotFound":  
      {
+
        {
          "message": "Resource not found",  
+
            "message": "Resource not found",  
          "code": 404,  
+
            "code": 404,  
          "details": "",
+
            "details": "",
          "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
+
            "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
      }
+
        }
}
+
}
</pre>
+
 
+
=== Failure while trying to make unauthorized access ===
+
 
+
'''Request'''
+
<pre>
+
GET /accounts/{accountId}/loadbalancers/0001
+
Content-Type:application/json
+
Charset=UTF-8
+
Authorization:Base64-encoded fake_authentication_string
+
</pre>
+
 
+
'''Response'''
+
<pre>
+
HTTP/1.1 401 Unauthorized
+
</pre>
+
 
+
=== Failure while trying to pass invalid account number ===
+
 
+
'''Request'''
+
<pre>
+
GET /accounts/fake/loadbalancers/0001
+
Content-Type:application/json
+
Charset=UTF-8
+
Authorization:Base64-encoded fake_authentication_string
+
</pre>
+
 
+
'''Response'''
+
<pre>
+
HTTP/1.1 404 Not Found
+
 
</pre>
 
</pre>
  
{{disqus}}
 
 
[[Category:Hostway API]]
 
[[Category:Hostway API]]
 
[[Category:Load Balancer API]]
 
[[Category:Load Balancer API]]

Revision as of 16:47, 4 February 2015

Contents

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

This operation lists the details for the specified load balancer

Request

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

Request Parameters

accountId - string
The selected account id.
lbId - string
The selected load balancer id.

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}",
    "virtualIp": "{lbVirtualIp}",
    "region": "{regionTextKey}",
    "nodePools": [{"href": "http://{api-server}/account/{accountId}/loadbalancers/{lbId}/nodepools", "rel": "related"}],
    "links": [{"href": "http://{api-server}/accounts/{accountId}/loadbalancers/{lbId}", "rel": "self"}]
}

Parameters

id - string
The id of this Load Balancer.
displayName - string
The display name of the load balancer
region - string
The region which this vm belongs to
virtualIp - string
The public-facing ip address to be used for load-balancing (either an IPv4 or IPv6 address)
nodePools - list
Hypermedia to a resource of the node pools under this load balancer
links - list
Hypermedia for this resource. Links to self.

Examples

Successfully list details for specified load balancer

Request

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

Response

HTTP/1.1 200 OK

{
    "id" : "123",
    "displayName" : "test Load Balancer",
    "region" : "region-A",
    "virtualIps" : "2001:cdba:0000:0000:0000:0000:3257:9652",
    "nodePools": [{"href": "http://{api-server}/accounts/{accountId}/loadbalancers/123/nodepools", "rel": "related"}],
    "links" : [{"href" : "http://{api-server}/accounts/{accountId}/loadbalancers/123", "rel" : "self"}]
}

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: Basic {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"
        }
}
Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox