功能介紹
創(chuàng)建安全組規(guī)則。
調(diào)試
您可以在API Explorer中調(diào)試該接口。
URI
POST /v1/{project_id}/security-group-rules
請(qǐng)求參數(shù)
名稱 |
是否必選 |
參數(shù)類型 |
說明 |
---|---|---|---|
security_group_rule |
是 |
名稱 |
是否必選 |
參數(shù)類型 |
說明 |
---|---|---|---|
security_group_id |
是 |
String |
所屬安全組ID |
description |
否 |
String |
|
direction |
是 |
String |
|
ethertype |
否 |
String |
|
protocol |
否 |
String |
|
port_range_min |
否 |
Integer |
|
port_range_max |
否 |
Integer |
|
remote_ip_prefix |
否 |
String |
|
remote_group_id |
否 |
String |
|
remote_address_group_id |
否 |
String |
|
請(qǐng)求示例
- 創(chuàng)建一條入方向安全組規(guī)則,所在安全組id為a7734e61-b545-452d-a3cd-0189cbd9747a。
POST https://{Endpoint}/v1/{project_id}/security-group-rules { "security_group_rule": { "direction": "ingress", "port_range_min": "80", "ethertype": "IPv4", "port_range_max": "80", "protocol": "tcp", "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "security_group_id": "a7734e61-b545-452d-a3cd-0189cbd9747a" } }
響應(yīng)參數(shù)
名稱 |
參數(shù)類型 |
說明 |
---|---|---|
security_group_rule |
名稱 |
參數(shù)類型 |
說明 |
---|---|---|
id |
String |
安全組規(guī)則標(biāo)識(shí) |
description |
String |
|
security_group_id |
String |
安全組標(biāo)識(shí) |
direction |
String |
|
ethertype |
String |
|
protocol |
String |
|
port_range_min |
Integer |
|
port_range_max |
Integer |
|
remote_ip_prefix |
String |
|
remote_group_id |
String |
|
remote_address_group_id |
String |
|
tenant_id |
String |
|
響應(yīng)示例
{ "security_group_rule": { "direction": "ingress", "ethertype": "IPv4", "id": "2bc0accf-312e-429a-956e-e4407625eb62", "description": "", "port_range_max": 80, "port_range_min": 80, "protocol": "tcp", "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", "remote_ip_prefix": null, "security_group_id": "a7734e61-b545-452d-a3cd-0189cbd9747a", "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", "remote_address_group_id": null } }
狀態(tài)碼
請(qǐng)參見狀態(tài)碼。
錯(cuò)誤碼
請(qǐng)參考錯(cuò)誤碼。