Create Load Balancer

From Hostway API Documentation
Jump to: navigation, search

Contents

POST /accounts/{accountId}/loadbalancers

This operation creates a new load balancer.

Request

POST /accounts/{accountId}/loadbalancers

Request Parameters

accountId - string
The selected account id.

Request Body

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

Parameters

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

Response

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)

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.

Examples

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}

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

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