Create session persistence for a load balancer
From Hostway API Documentation
Revision as of 16:42, 2 July 2014 by Mike.robski (Talk | contribs)
This operation will add or modify the session persistence of an existing load balancer
=PUT /accounts/{accountId}/loadbalancers/{lbId}/sessionpersistence
Contents |
Request
URI Parameters
- accountId - string
- The selected account Id
- lbId
- The unique identifier of the load balancer.
Request Body
{ "persistenceType":"{type}", }
Parameters
- type - string
- type of session persistence (currently, only HTTP_COOKIE is supported)
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.
- 400 Invalid
- The request was invalid (bad arguments).
Examples
Successfully add persistence to a load balancer (whether or not persistence was already enabled)
Request
PUT /accounts/{accountId}/loadbalancers/0001/sessionpersistence Content-Type:application/json Charset=UTF-8 Authorization:Base64-encoded username & password string { "persistenceType":"HTTP_COOKIE" }
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/sessionpersistence Content-Type:application/json Charset=UTF-8 Authorization:Base64-encoded username & password string
Response
HTTP/1.1 404 Not Found { "itemNotFound": { "message": "Resource not found", "code": 404, "details": "", "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" } }
Failure while trying to set a load balancer's session persistence to some unknown persistence type
Request
PUT /accounts/{accountId}/loadbalancers/0001/sessionpersistence Content-Type:application/json Charset=UTF-8 Authorization:Base64-encoded username & password string { "persistenceType":"UNKNOWN_PERSISTENCE_TYPE" }
Response
HTTP/1.1 400 Invalid { "itemNotFound": { "message": "Bad request", "code": 404, "details": "", "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" } }