List Load Balancers

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
(Response Body)
m (1 revision: Release 109)
 

Latest revision as of 12:13, 24 July 2015

Contents

[edit] GET /accounts/{accountId}/loadbalancers

This operation lists existing load balancers.

[edit] Request

GET /accounts/{accountId}/loadbalancers

[edit] Request Parameters

accountId - string
The selected account id.

[edit] 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.

[edit] Response

[edit] 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.

[edit] 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"
        }
    ]
}

    ]
}

[edit] 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

[edit] Examples

[edit] 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"
        }
    ]
}

[edit] 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