Description
セキュリティグループ ルールを作成します。
セキュリティグループIDを指定する必要があります。
APIからコントロールパネル上のセキュリティグループにルールは追加することができません。
セキュリティグループ ルールは100個まで作成可能です。
プロトコルに「icmp」を指定する場合、最小ポート番号と最大ポート番号にそれぞれICMP Typeを指定する必要があります。
アウトバウンド(egress)は常に全許可の状態になります。
Request URL
Network API v2.0 POST /v2.0/security-group-rules |
Request Json
{ “security_group_rule”: { “direction”: “適用するトラフィックの向き“, “ethertype”: “イーサタイプ“, “security_group_id”: “セキュリティグループID“, “port_range_min”: “最小ポート番号“, “port_range_max”: “最大ポート番号“, “protocol”: “プロトコル“ } } |
Request Paramters
Parameter | Value | Style | Description |
---|---|---|---|
X-Auth-Token | Userトークン | header | トークンID |
direction | ingress | plain | 指定するルールがどのトラフィックの向きに適用するかを指定します。「インバウンド(ingress)」のみ指定可能です。 |
ethertype | IPv4 IPv6 |
plain | イーサタイプを指定します。 |
port_range_min (Optional) | ポート番号 ICMPタイプ |
plain | 開放するポート番号 もしくは ICMPタイプを指定します。 範囲で設定する場合は最小ポート番号 もしくは ICMPタイプになります。 (ポート開放/ICMP許可) |
port_range_max (Optional) | ポート番号 ICMPタイプ |
plain | 開放するポート番号 もしくは ICMPタイプを指定します。 範囲で設定する場合は最大ポート番号 もしくは ICMPタイプになります。 (ポート開放/ICMP許可) |
protocol (Optional) | tcp udp icmp null |
plain | プロトコルを指定します。 「icmp」を指定する場合、最小ポート番号と最大ポート番号にそれぞれICMP Typeを指定する必要があります。 |
remote_group_id (Optional) | セキュリティグループID | plain | 指定したセキュリティグループIDに紐付いたポートからのトラフィックのみを許可する際に指定します。 |
remote_ip_prefix (Optional) | 許可IP | plain | 指定したIPからのトラフィックのみを許可したい場合に指定します。 (接続元IP制限) |
Response
Normal response codes
201 |
Example
Request
curl -i -X POST \{ -H “Content-Type: application/json” \ -H “X-Auth-Token: トークンID” \ -d ‘{“security_group_rule”: {“direction”: “ルールを適用するトラフィックの向き“, “ethertype”: “イーサタイプ“, “security_group_id”: “セキュリティグループID“, “port_range_min”: “ポート番号“, “port_range_max”: “ポート番号“, “protocol”: “プロトコル“}}’ \ https://networking.odc01.eva-clouds.com/v2.0/security-group-rules |
Response
HTTP/1.1 201 Created Date: Fri, 08 Jul 2016 06:31:48 GMT Server: Apache Content-Length: 340 Content-Type: application/json { |