Create Load Balancer

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

Latest revision as of 12:13, 24 July 2015

Contents

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

This operation creates a new load balancer.

[edit] Request

POST /accounts/{accountId}/loadbalancers

[edit] Request Parameters

accountId - string
The selected account id.

[edit] Request Body

{
    "region": "{regionTextKey}",
    "displayName": "{lbName}"
}

[edit] Parameters

region - string
region TextKey where LB will be created
displayName - string
Display name for this load balancer.

[edit] Response

[edit] Response Codes

201 Created
400 Bad Request
The request has wrong data
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.
409 Conflict
The resource already exists. (there is already a load balancer with that name or a load balancer already bound to the virtualIp/port combination specified)

[edit] Response Headers

Location
Returned with successful 201 response. Contains the new LB URI. The client must use this URI for all subsequent operations with the LB.

[edit] Examples

[edit] create a LB

Request

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

{
    "region": "AUSTIN",
    "displayName" : "Test Load Balancer",
}

Response

201 Created
Content-Type: application/json; charset=UTF-8
Location : http://{api-server}/account/{accountId}/loadbalancers/{newLbId}

[edit] Failure while trying to make unauthorized access

Request

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

Response

HTTP/1.1 401 Unauthorized

[edit] Failure while trying to pass invalid account number

Request

POST /accounts/fake/loadbalancers
Content-Type:application/json
Charset=UTF-8
Authorization: Basic {wrong credential}

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