ヘルスモニタ作成
Description
ヘルスモニタを作成します。
Request URL
Network API v2.0 POST /v2.0/lb/health_monitors
Request Json
{
"health_monitor":{
"type":"プロトコル",
"delay":監視間隔,
"url_path":"チェック先のパス(HTTPプロトコルの場合のみ)",
"expected_codes":"期待するレスポンスのステータスコード(HTTPプロトコルの場合のみ)"
}
}
Request Parameters
| Parameter | Value | Style | Description |
|---|---|---|---|
| X-Auth-Token | トークンID | header | トークン発行 にて払い出されたID |
| type | PINGTCPHTTP | plain | プロトコルの種類を指定します。 |
| delay | 5 ~ 10 | plain | ヘルスチェック(監視)間隔を指定します。※5~10秒の範囲内で指定可能 |
| url_path (Optional) | / | plain | チェック先のパスを指定します。※HTTPプロトコルの場合のみ |
| expected_codes (Optional) | 200200,201,204200-204 | plain | 期待するレスポンスのステータスコードを指定します。※HTTPプロトコルの場合のみ |
Response
-
Normal response codes
201
Example
-
Request
curl -i -X POST \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "X-Auth-Token: トークンID" \ -d '{"health_monitor":{"type":"プロトコル","delay":"監視間隔"}}' \ ネットワークエンドポイント/lb/health_monitors
-
Response
HTTP/1.1 201 Created
Date: Sat, 07 Apr 2018 17:46:08 GMT
Server: Apache
Content-Length: 211
Content-Type: application/json
{
"health_monitor": {
"admin_state_up": true,
"tenant_id": "テナントID",
"delay": 監視間隔,
"max_retries": 3,
"timeout": 5,
"pools": [],
"type": "プロトコル",
"id": "ヘルスモニタID"
}
}