List Load Balancers

(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 97)
(Response Body)
Line 3: Line 3:
  
 
== Request ==
 
== Request ==
<code>GET /accounts/{accountId}/loadbalancers?virtualIp={virtualIp}&region={region}
+
<code>GET /accounts/''{accountId}''/loadbalancers</code>
  
 
=== Request Parameters ===
 
=== Request Parameters ===
 
; accountId - ''string''
 
; accountId - ''string''
: The selected account Id.
+
: The selected account id.
  
 
=== URI Parameters ===
 
=== URI Parameters ===
; virtualIp - ''string''
+
; filterVirtualIp - ''string''
: optional, only loadbalancers with specified virtualIp will be returned
+
: Optional, only loadbalancers with specified virtualIp will be returned
  
; region - ''string''
+
; filterRegion - ''string''
: optional, only loadbalancers in the specified region will be returned
+
: Optional, only loadbalancers in the specified region will be returned
  
;sortField
+
; sortField - ''string''
: Indicates which field should be used for sorting.
+
: Optional. Specifies a field upon which to sort the data. If not set no sorting is preformed.
: Legal values are 'region', 'displayName', 'virtualIp' and 'virtualIpPort'
+
: Allowed values are '''region''', '''displayName''', '''virtualIp'''
: This parameter is optional
+
  
;sortOrder
+
; sortOrder - ''string''
: Indicates the order in which the result should be sorted.
+
: Optional. Specifies the order in which the data is sorted. If not set no sorting is preformed.
: Legal values are 'asc' and 'desc'
+
: Allowed values are '''asc''', '''desc'''. If sortField is not set, defaults to '''asc''' otherwise.  
: This parameter is optional. If 'sortField' was specified and 'sortOrder' was omitted, then the result will be sorted in ascending order.
+
  
;pageSize
+
; pageSize - ''integer''
: Indicates the number of prices to be included on each page of the result (if pagination is desired)
+
: Optional. Specifies the number of records per page. Default 10, Max 100.
: This parameter is optional. If 'page' is specified and 'pageSize' is omitted, then the result will show 100 prices per page.
+
  
;page
+
; page - ''integer''
: Indicates the 1-based index of the page to view.
+
: Optional. Specifies the page to return in paginated response. Default is 1.
: The value must be an integer between 1 and the maximum number of pages (returned in the 'last' element of the 'links' attribute of the result)
+
: This parameter is optional, but if 'pageSize' was specified, then 'page' is also required.
+
  
 
== Response ==
 
== Response ==
Line 48: Line 43:
 
=== Response Body ===
 
=== Response Body ===
 
  <nowiki>
 
  <nowiki>
{
+
{
     "list" : [
+
     "list": [
      {
+
        {
          "id": "743",
+
            "id": "{lbId}",
          "protocol": "HTTP",
+
            "displayName": "{name}",
          "algorithm": "ROUND_ROBIN",
+
            "region": "{region-textkey}",
          "region": "ote.2008.tampa",
+
            "virtualIp": "{ipaddr}",
          "virtualIp": "10.140.141.88",
+
            "links": [{"href": "https://{api-server}/accounts/{accountId}/loadbalancers/{lbId}", "rel": "self"}]
          "port": 80,
+
        }
          "healthMonitor": {},
+
          "timeout": 5,
+
          "displayName": "test-lb-name",
+
          "nodes": [
+
              {
+
                  "serverRef": "http://localhost:6543/accounts/jello614636/flexcloud/servers/jello614636-USOTE-2008-TAMPA-0002",
+
                  "id": "1344",
+
                  "condition": "ENABLED",
+
                  "port": 80
+
              }
+
          ],
+
          "sessionPersistence": {}
+
      }
+
 
     ],
 
     ],
     "links" : [
+
     "links": [
      {
+
        {
          "href" : "http://{api-server}/accounts/{accountId}/loadbalancers",
+
            "href": "http://{api-server}/account/{accountId}/loadbalancers?pageSize={pageSize}&page={page}",
          "rel" : "self"
+
            "rel": "self"
      }
+
        },
     ],
+
        {
}</nowiki>
+
            "href": "http://{api-server}/account/{accountId}/loadbalancers?pageSize={pageSize}&page={page}",
 +
            "rel": "first"
 +
        },
 +
        {
 +
            "href": "http://{api-server}/account/{accountId}/loadbalancers?pageSize={pageSize}&page={page}",
 +
            "rel": "previous"
 +
        },
 +
        {
 +
            "href": "http://{api-server}/account/{accountId}/loadbalancers?pageSize={pageSize}&page={page}",
 +
            "rel": "next"
 +
        },
 +
        {
 +
            "href": "http://{api-server}/account/{accountId}/loadbalancers?pageSize={pageSize}&page={page}",
 +
            "rel": "last"
 +
        }
 +
     ]
 +
}
 +
 
 +
    ]
 +
}</nowiki>
  
 
==== Parameters ====
 
==== Parameters ====
 
; list
 
; list
: the list of loadbalancers
+
: [[Hypermedia]] for this load balancer resource. Links to the load balancer
  
 
; links - ''list''
 
; links - ''list''
: [[Hypermedia]] for this resource.
+
: [[Hypermedia]] Link to self and other resources relevant to the lists
  
 
== Examples ==
 
== Examples ==
  
=== Successfully list load balancers ===
+
=== Successfully list load balancers w/o pagination ===
  
 
'''Request'''
 
'''Request'''
Line 95: Line 96:
 
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 102: Line 103:
 
HTTP/1.1 200 OK
 
HTTP/1.1 200 OK
  
{
+
{
 
     "list" : [
 
     "list" : [
      {
+
        {
          "id": "743",
+
            "id": "743",
          "protocol": "HTTP",
+
            "displayName": "test-lb-name",
          "algorithm": "ROUND_ROBIN",
+
            "region": "ote.2008.tampa",
          "region": "ote.2008.tampa",
+
            "virtualIp": "10.140.141.88",
          "virtualIp": "10.140.141.88",
+
            "links" : [{"href" : "https://{api-server}/accounts/{accountId}/loadbalancers/743", "rel" : "self"}]
          "port": 80,
+
        }
          "healthMonitor": {},
+
          "timeout": 5,
+
          "displayName": "test-lb-name",
+
          "nodes": [
+
              {
+
                  "serverRef": "http://{api-server}/accounts/{accountId}/flexcloud/servers/{serverId}",
+
                  "id": "1344",
+
                  "condition": "ENABLED",
+
                  "port": 80
+
              }
+
          ],
+
          "sessionPersistence": {}
+
      }
+
 
     ],
 
     ],
 
     "links" : [
 
     "links" : [
      {
+
        {
          "href" : "http://{api-server}/accounts/{accountId}/loadbalancers",
+
            "href" : "http://{api-server}/account/{accountId}/loadbalancers",
          "rel" : "self"
+
            "rel" : "self"
      }
+
        }
     ],
+
     ]
}
+
}
 
</pre>
 
</pre>
  
Line 141: Line 129:
 
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 148: Line 136:
 
HTTP/1.1 200 OK
 
HTTP/1.1 200 OK
  
{
+
{
 
     "list" : [
 
     "list" : [
      {
+
        {
          "id": "743",
+
            "id": "{lbId}",
          "protocol": "HTTP",
+
            "virtualIp": "10.140.141.88",
          "algorithm": "ROUND_ROBIN",
+
            "displayName": "test-lb-name",
          "region": "ote.2008.tampa",
+
            "links" : [{"href" : "https://{api-server}/accounts/{accountId}/loadbalancers/{lbId}", "rel" : "self"}]
          "virtualIp": "10.140.141.88",
+
        },
          "port": 80,
+
        ...
          "healthMonitor": {},
+
          "timeout": 5,
+
          "displayName": "test-lb-name",
+
          "nodes": [
+
              {
+
                  "serverRef": "http://{api-server}/accounts/{accountId}/flexcloud/servers/{serverId}",
+
                  "id": "1344",
+
                  "condition": "ENABLED",
+
                  "port": 80
+
              }
+
          ],
+
          "sessionPersistence": {}
+
      },
+
      ...
+
 
     ],
 
     ],
 
     "links" : [
 
     "links" : [
      {
+
        {
          "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=2&pageSize=3",
+
            "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=2&pageSize=3",
          "rel" : "self"
+
            "rel" : "self"
      },
+
        },
      {
+
        {
          "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=1&pageSize=3",
+
            "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=1&pageSize=3",
          "rel" : "first"
+
            "rel" : "first"
      },
+
        },
      {
+
        {
          "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=1&pageSize=3",
+
            "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=1&pageSize=3",
          "rel" : "previous"
+
            "rel" : "previous"
      },
+
        },
      {
+
        {
          "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=3&pageSize=3",
+
            "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=3&pageSize=3",
          "rel" : "next"
+
            "rel" : "next"
      },
+
        },
      {
+
        {
          "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=3&pageSize=3",
+
            "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=3&pageSize=3",
          "rel ' : "last"
+
            "rel" : "last"
      }
+
        }
 
     ]
 
     ]
}
+
}
</pre>
+
 
+
=== Failure while trying to make unauthorized access ===
+
 
+
'''Request'''
+
<pre>
+
POST /accounts/{accountId}/loadbalancers
+
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>
+
POST /accounts/fake/loadbalancers
+
Content-Type:application/json
+
Charset=UTF-8
+
Authorization:Base64-encoded <span style="color:red">fake_authentication_string</span>
+
</pre>
+
 
+
'''Response'''
+
<pre>
+
HTTP/1.1 404 Not Found
+
 
+
{
+
    "itemNotFound" : {
+
      "message": "Resource not found",
+
      "code": 404,
+
      "details": "",
+
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
+
    }
+
}
+
 
</pre>
 
</pre>
  
{{disqus}}
 
 
[[Category:Hostway API]]
 
[[Category:Hostway API]]
 
[[Category:Load Balancer API]]
 
[[Category:Load Balancer API]]

Revision as of 17:47, 4 February 2015

Contents

GET /accounts/{accountId}/loadbalancers

This operation lists existing load balancers.

Request

GET /accounts/{accountId}/loadbalancers

Request Parameters

accountId - string
The selected account id.

URI Parameters

filterVirtualIp - string
Optional, only loadbalancers with specified virtualIp will be returned
filterRegion - string
Optional, only loadbalancers in the specified region will be returned
sortField - string
Optional. Specifies a field upon which to sort the data. If not set no sorting is preformed.
Allowed values are region, displayName, virtualIp
sortOrder - string
Optional. Specifies the order in which the data is sorted. If not set no sorting is preformed.
Allowed values are asc, desc. If sortField is not set, defaults to asc otherwise.
pageSize - integer
Optional. Specifies the number of records per page. Default 10, Max 100.
page - integer
Optional. Specifies the page to return in paginated response. Default is 1.

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

{
    "list": [
        {
            "id": "{lbId}",
            "displayName": "{name}",
            "region": "{region-textkey}",
            "virtualIp": "{ipaddr}",
            "links": [{"href": "https://{api-server}/accounts/{accountId}/loadbalancers/{lbId}", "rel": "self"}]
        }
    ],
    "links": [
        {
            "href": "http://{api-server}/account/{accountId}/loadbalancers?pageSize={pageSize}&page={page}",
            "rel": "self"
        },
        {
            "href": "http://{api-server}/account/{accountId}/loadbalancers?pageSize={pageSize}&page={page}",
            "rel": "first"
        }, 
        {
            "href": "http://{api-server}/account/{accountId}/loadbalancers?pageSize={pageSize}&page={page}",
            "rel": "previous"
        }, 
        {
            "href": "http://{api-server}/account/{accountId}/loadbalancers?pageSize={pageSize}&page={page}",
            "rel": "next"
        }, 
        {
            "href": "http://{api-server}/account/{accountId}/loadbalancers?pageSize={pageSize}&page={page}",
            "rel": "last"
        }
    ]
}

    ]
}

Parameters

list
Hypermedia for this load balancer resource. Links to the load balancer
links - list
Hypermedia Link to self and other resources relevant to the lists

Examples

Successfully list load balancers w/o pagination

Request

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

Response

HTTP/1.1 200 OK

{
    "list" : [
        {
            "id": "743",
            "displayName": "test-lb-name",
            "region": "ote.2008.tampa",
            "virtualIp": "10.140.141.88",
            "links" : [{"href" : "https://{api-server}/accounts/{accountId}/loadbalancers/743", "rel" : "self"}]
        }
    ],
    "links" : [
        {
            "href" : "http://{api-server}/account/{accountId}/loadbalancers",
            "rel" : "self"
        }
    ]
}

Successfully list load balancers with pagination

Request

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

Response

HTTP/1.1 200 OK

{
    "list" : [
        {
            "id": "{lbId}",
            "virtualIp": "10.140.141.88",
            "displayName": "test-lb-name",
            "links" : [{"href" : "https://{api-server}/accounts/{accountId}/loadbalancers/{lbId}", "rel" : "self"}]
        },
        ...
    ],
    "links" : [
        {
            "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=2&pageSize=3",
            "rel" : "self"
        },
        {
            "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=1&pageSize=3",
            "rel" : "first"
        },
        {
            "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=1&pageSize=3",
            "rel" : "previous"
        },
        {
            "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=3&pageSize=3",
            "rel" : "next"
        },
        {
            "href" : "http://{api-server}/accounts/{accountId}/loadbalancers?page=3&pageSize=3",
            "rel" : "last"
        }
    ]
}
Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox