Add or update load balancer's health monitor

From Hostway API Documentation
Revision as of 15:57, 9 January 2014 by Youngbae.oh (Talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This operation will add or modify a load balancer's health monitor

=PUT /accounts/{accountId}/loadbalancers/{lbId}/healthmonitor

Contents

Request

URI Parameters

accountId - string
The selected account Id
lbId
The unique identifier of the load balancer.

Request Body

{ 
    "protocol":"{protocol}",
    "interval":{interval},
    "port":{port},
    "attemptsBeforeActivation":{count},
    "attemptsBeforeDeactivation":{count},
    "uri": "{uri}"
}

Parameters

protocol - string
protocol of health monitor (TCP or HTTP)
interval - integer
The number of seconds between subsequent health monitor check messages
port - integer
port for health monitor
attemptsBeforeActivation - integer
Number of successful health monitor checks allowed before this load balancer is activated
attemptsBeforeDeactivation - integer
Number of failed health monitor checks allowed before this load balancer is deactivated
uri - string
optional, http path for monitor, if the protocol is HTTP

Response

Response Codes

204 No Content
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.

Examples

Successfully update contents of specified load balancer health monitor

Request

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

{
    "protocol":"TCP",
    "interval":20,
    "port":80,
    "attemptsBeforeActivation":3,
    "attemptsBeforeDeactivation":3
}

Response

HTTP/1.1 204 No Content

Failure while trying to update the health monitor of a non-existent load balancer

Request

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

{
    "protocol":"TCP",
    "interval":20,
    "port":10,
    "attemptsBeforeActivation":3,
    "attemptsBeforeDeactivation":3
}

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