Add or update load balancer's health monitor
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision: Release 95) |
Mike.robski (Talk | contribs) m (1 revision: Release 109) |
||
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
− | + | ='''PUT''' /accounts/''{accountId}''/loadbalancers/''{lbId}''/nodePools/''{nodePoolId}''/healthMonitor= | |
− | + | This operation adds or modify a load balancer's health monitor | |
− | ='''PUT''' /accounts/''{accountId}''/loadbalancers/''{lbId}''/ | + | |
== Request == | == Request == | ||
+ | <code>PUT /accounts/''{accountId}''/loadbalancers/''{lbId}''/nodePools/''{nodePoolId}''/healthMonitor</code> | ||
− | === | + | === Request Parameters === |
; accountId - ''string'' | ; accountId - ''string'' | ||
− | : The selected account | + | : The selected account id. |
+ | |||
+ | ; lbId - ''string'' | ||
+ | : The selected loadbalancer id. | ||
− | ; | + | ; nodePoolId - ''string'' |
− | : The | + | : The selected node pool id. |
=== Request Body === | === Request Body === | ||
− | < | + | partial update is not supported, need all data to add or update |
+ | <nowiki> | ||
{ | { | ||
− | "protocol":"{protocol}", | + | "protocol": "{protocol}", |
− | "interval":{interval}, | + | "interval": {interval}, |
− | "port":{port}, | + | "port": {port}, |
− | "attemptsBeforeActivation":{count}, | + | "attemptsBeforeActivation": {count}, |
− | "attemptsBeforeDeactivation":{count}, | + | "attemptsBeforeDeactivation": {count}, |
"uri": "{uri}" | "uri": "{uri}" | ||
− | } | + | }</nowiki> |
− | </ | + | |
==== Parameters ==== | ==== Parameters ==== | ||
; protocol - ''string'' | ; protocol - ''string'' | ||
− | : protocol | + | : The protocol to be used by health monitor |
+ | : Allowed values are '''TCP''' or '''HTTP''' | ||
; interval - ''integer'' | ; interval - ''integer'' | ||
Line 32: | Line 36: | ||
; port - ''integer'' | ; port - ''integer'' | ||
− | : port for health monitor | + | : The port for health monitor to monitor |
; attemptsBeforeActivation - ''integer'' | ; attemptsBeforeActivation - ''integer'' | ||
− | : | + | : The number of successful health monitor checks allowed before this load balancer is activated |
; attemptsBeforeDeactivation - ''integer'' | ; attemptsBeforeDeactivation - ''integer'' | ||
− | : | + | : The number of failed health monitor checks allowed before this load balancer is deactivated |
; uri - ''string'' | ; uri - ''string'' | ||
− | : | + | : Optional, http path for monitor, needed only if the protocol is HTTP |
== Response == | == Response == | ||
Line 47: | Line 51: | ||
=== Response Codes === | === Response Codes === | ||
; 204 No Content | ; 204 No Content | ||
+ | |||
+ | ; 400 Bad Request | ||
+ | : The request has wrong data | ||
; 401 Unauthorized | ; 401 Unauthorized | ||
Line 59: | Line 66: | ||
'''Request''' | '''Request''' | ||
<pre> | <pre> | ||
− | PUT /accounts/{accountId}/loadbalancers/0001/ | + | PUT /accounts/{accountId}/loadbalancers/0001/nodePools/123/healthMonitor |
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} |
{ | { | ||
− | "protocol":"TCP", | + | "protocol": "TCP", |
− | "interval":20, | + | "interval": 20, |
− | "port":80, | + | "port": 80, |
− | "attemptsBeforeActivation":3, | + | "attemptsBeforeActivation": 3, |
− | "attemptsBeforeDeactivation":3 | + | "attemptsBeforeDeactivation": 3 |
} | } | ||
</pre> | </pre> | ||
Line 79: | Line 86: | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Hostway API]] | [[Category:Hostway API]] | ||
[[Category:Load Balancer API]] | [[Category:Load Balancer API]] |
Latest revision as of 12:13, 24 July 2015
Contents |
PUT /accounts/{accountId}/loadbalancers/{lbId}/nodePools/{nodePoolId}/healthMonitor
This operation adds or modify a load balancer's health monitor
Request
PUT /accounts/{accountId}/loadbalancers/{lbId}/nodePools/{nodePoolId}/healthMonitor
Request Parameters
- accountId - string
- The selected account id.
- lbId - string
- The selected loadbalancer id.
- nodePoolId - string
- The selected node pool id.
Request Body
partial update is not supported, need all data to add or update
{ "protocol": "{protocol}", "interval": {interval}, "port": {port}, "attemptsBeforeActivation": {count}, "attemptsBeforeDeactivation": {count}, "uri": "{uri}" }
Parameters
- protocol - string
- The protocol to be used by health monitor
- Allowed values are TCP or HTTP
- interval - integer
- The number of seconds between subsequent health monitor check messages
- port - integer
- The port for health monitor to monitor
- attemptsBeforeActivation - integer
- The number of successful health monitor checks allowed before this load balancer is activated
- attemptsBeforeDeactivation - integer
- The number of failed health monitor checks allowed before this load balancer is deactivated
- uri - string
- Optional, http path for monitor, needed only if the protocol is HTTP
Response
Response Codes
- 204 No Content
- 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.
- 404 Not Found
- The resource does not exist.
Examples
Successfully update contents of specified load balancer health monitor
Request
PUT /accounts/{accountId}/loadbalancers/0001/nodePools/123/healthMonitor Content-Type:application/json Charset=UTF-8 Authorization: Basic {Base64-encoded username & password string} { "protocol": "TCP", "interval": 20, "port": 80, "attemptsBeforeActivation": 3, "attemptsBeforeDeactivation": 3 }
Response
HTTP/1.1 204 No Content