Create session persistence for a load balancer

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
(Parameters)
 
m (1 revision: Release 109)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
='''PUT''' /accounts/''{accountId}''/loadbalancers/''{lbId}''/nodePools/''{nodePoolId}''/sessionPersistence=
 
This operation will add or modify the session persistence of an existing load balancer
 
This operation will add or modify the session persistence of an existing load balancer
 
='''PUT''' /accounts/''{accountId}''/loadbalancers/''{lbId}''/sessionpersistence
 
  
 
== Request ==
 
== Request ==
 +
<code>PUT /accounts/''{accountId}''/loadbalancers/''{lbId}''/nodePools/''{nodePoolId}''/sessionPersistence</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>
 
<pre>
 
{  
 
{  
     "persistenceType":"{type}",
+
     "persistenceType": "{type}",
 
}
 
}
 
</pre>
 
</pre>
Line 21: Line 24:
 
==== Parameters ====
 
==== Parameters ====
 
; type - ''string''
 
; type - ''string''
: type of session persistence (currently, only HTTP_COOKIE is supported)
+
: type of session persistence
 +
: Allowed value is '''HTTP_COOKIE''' (currently, only HTTP_COOKIE is supported)
  
 
== Response ==
 
== Response ==
Line 27: Line 31:
 
=== Response Codes ===
 
=== Response Codes ===
 
; 204 No Content
 
; 204 No Content
 +
 +
; 400 Bad Request
 +
: The request has wrong data
  
 
; 401 Unauthorized
 
; 401 Unauthorized
Line 33: Line 40:
 
; 404 Not Found
 
; 404 Not Found
 
: The resource does not exist.
 
: The resource does not exist.
 
; 400 Invalid
 
: The request was invalid (bad arguments).
 
  
 
== Examples ==
 
== Examples ==
Line 42: Line 46:
 
'''Request'''
 
'''Request'''
 
<pre>
 
<pre>
PUT /accounts/{accountId}/loadbalancers/0001/sessionpersistence
+
PUT /accounts/{accountId}/loadbalancers/0001/nodePools/123/sessionPersistence
 
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}
  
 
{
 
{
Line 55: Line 59:
 
<pre>
 
<pre>
 
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/sessionpersistence
 
Content-Type:application/json
 
Charset=UTF-8
 
Authorization:Base64-encoded username & password string
 
</pre>
 
 
'''Response'''
 
<pre>
 
HTTP/1.1 404 Not Found
 
 
{
 
    "itemNotFound": {
 
        "message": "Resource not found",
 
        "code": 404,
 
        "details": "",
 
        "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
    }
 
}
 
</pre>
 
 
=== Failure while trying to set a load balancer's session persistence to some unknown persistence type ===
 
'''Request'''
 
<pre>
 
PUT /accounts/{accountId}/loadbalancers/0001/sessionpersistence
 
Content-Type:application/json
 
Charset=UTF-8
 
Authorization:Base64-encoded username & password string
 
 
{
 
    "persistenceType":"UNKNOWN_PERSISTENCE_TYPE"
 
}
 
</pre>
 
 
'''Response'''
 
<pre>
 
HTTP/1.1 400 Invalid
 
 
{
 
    "itemNotFound": {
 
        "message": "Bad request",
 
        "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

[edit] PUT /accounts/{accountId}/loadbalancers/{lbId}/nodePools/{nodePoolId}/sessionPersistence

This operation will add or modify the session persistence of an existing load balancer

[edit] Request

PUT /accounts/{accountId}/loadbalancers/{lbId}/nodePools/{nodePoolId}/sessionPersistence

[edit] Request Parameters

accountId - string
The selected account id.
lbId - string
The selected loadbalancer id.
nodePoolId - string
The selected node pool id.

[edit] Request Body

{ 
    "persistenceType": "{type}",
}

[edit] Parameters

type - string
type of session persistence
Allowed value is HTTP_COOKIE (currently, only HTTP_COOKIE is supported)

[edit] Response

[edit] 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.

[edit] Examples

[edit] Successfully add persistence to a load balancer (whether or not persistence was already enabled)

Request

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

{
    "persistenceType":"HTTP_COOKIE"
}

Response

HTTP/1.1 204 No Content
Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox