This API is used to create a security group.
Name |
Mandatory |
Type |
Description |
---|---|---|---|
security_group |
Yes |
security_group object |
Specifies the security group objects. For details, see Table 3. |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
|
vpc_id |
No |
String |
Specifies the resource ID of the VPC to which the security group belongs. NOTE:
This parameter has been discarded, it is not recommended to use it. |
enterprise_project_id |
No |
String |
NOTE:
This parameter is unsupported. Do not use it. |
POST https://{Endpoint}/v1/{project_id}/security-groups { "security_group": { "name": "qq", "vpc_id": "3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85" "enterprise_project_id": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2" } }
Name |
Type |
Description |
---|---|---|
security_group |
security_group object |
Specifies the security group objects. For details, see Table 5. |
Name |
Type |
Description |
---|---|---|
name |
String |
Specifies the security group name. |
description |
String |
Provides supplementary information about the security group. |
id |
String |
Specifies the security group ID, which uniquely identifies the security group. |
vpc_id |
String |
Specifies the resource ID of the VPC to which the security group belongs. NOTE:
This parameter has been discarded, it is not recommended to use it. |
security_group_rules |
Array of security_group_rule objects |
Specifies the default security group rules, which ensure that resources in the security group can communicate with one another. |
enterprise_project_id |
String |
NOTE:
This parameter is unsupported. Do not use it. |
Name |
Type |
Description |
---|---|---|
id |
String |
Specifies the security group rule ID, which uniquely identifies the security group rule. |
description |
String |
|
security_group_id |
String |
Specifies the security group rule ID, which uniquely identifies the security group rule. |
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 |
|
{ "security_group": { "id": "16b6e77a-08fa-42c7-aa8b-106c048884e6", "name": "qq", "description": "", "vpc_id": "3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85", "enterprise_project_id": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2", "security_group_rules": [ { "direction": "egress", "ethertype": "IPv4", "id": "369e6499-b2cb-4126-972a-97e589692c62", "description": "", "security_group_id": "16b6e77a-08fa-42c7-aa8b-106c048884e6" }, { "direction": "ingress", "ethertype": "IPv4", "id": "0222556c-6556-40ad-8aac-9fd5d3c06171", "description": "", "remote_group_id": "16b6e77a-08fa-42c7-aa8b-106c048884e6", "security_group_id": "16b6e77a-08fa-42c7-aa8b-106c048884e6", "remote_address_group_id": null } ] } }
See Status Codes.
See Error Codes.