Add or update load balancer's health monitor

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 95)
m (1 revision: Release 109)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This operation will add or modify a load balancer's health monitor
+
='''PUT''' /accounts/''{accountId}''/loadbalancers/''{lbId}''/nodePools/''{nodePoolId}''/healthMonitor=
 
+
This operation adds or modify a load balancer's health monitor
='''PUT''' /accounts/''{accountId}''/loadbalancers/''{lbId}''/healthmonitor
+
  
 
== Request ==
 
== Request ==
 +
<code>PUT /accounts/''{accountId}''/loadbalancers/''{lbId}''/nodePools/''{nodePoolId}''/healthMonitor</code>
  
=== URI Parameters ===
+
=== Request Parameters ===
 
; accountId - ''string''
 
; accountId - ''string''
: The selected account Id
+
: The selected account id.
 +
 
 +
; lbId - ''string''
 +
: The selected loadbalancer id.
  
; lbId
+
; nodePoolId - ''string''
: The unique identifier of the load balancer.
+
: The selected node pool id.
  
 
=== Request Body ===
 
=== Request Body ===
<pre>
+
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>
</pre>
+
  
 
==== Parameters ====
 
==== Parameters ====
 
; protocol - ''string''
 
; protocol - ''string''
: protocol of health monitor (TCP or HTTP)
+
: 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''
: Number of successful health monitor checks allowed before this load balancer is activated
+
: The number of successful health monitor checks allowed before this load balancer is activated
  
 
; attemptsBeforeDeactivation - ''integer''
 
; attemptsBeforeDeactivation - ''integer''
: Number of failed health monitor checks allowed before this load balancer is deactivated
+
: The number of failed health monitor checks allowed before this load balancer is deactivated
  
 
; uri - ''string''
 
; uri - ''string''
: optional, http path for monitor, if the protocol is HTTP
+
: 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/healthmonitor
+
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 77: Line 84:
 
HTTP/1.1 204 No Content
 
HTTP/1.1 204 No Content
  
</pre>
 
 
=== Failure while trying to update the health monitor of a non-existent load balancer ===
 
'''Request'''
 
<pre>
 
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
 
}
 
 
</pre>
 
 
'''Response'''
 
<pre>
 
HTTP/1.1 404 Not Found
 
 
{
 
    "itemNotFound": {
 
        "message": "Resource not found",
 
        "code": 404,
 
        "details": "",
 
        "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
    }
 
}
 
 
</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

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox