Domain name for API request: vpc.tencentcloudapi.com.
This API is used to create a security group policy (SecurityGroupPolicy).
For parameters of SecurityGroupPolicySet,
A maximum of 100 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: CreateSecurityGroupPolicies. |
Version | Yes | String | Common Params. The value used for this API: 2017-03-12. |
Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
SecurityGroupId | Yes | String | The security group instance ID, such as sg-33ocnj9n . This can be obtained through DescribeSecurityGroups. |
SecurityGroupPolicySet | Yes | SecurityGroupPolicySet | Security group policy set. |
Parameter Name | Type | Description |
---|---|---|
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: vpc.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateSecurityGroupPolicies
<Common request parameters>
{
"SecurityGroupId": "sg-ohuuioma",
"SecurityGroupPolicySet": {
"Ingress": [
{
"PolicyIndex": 0,
"Protocol": "All",
"PolicyDescription": "Test",
"AddressTemplate": {
"AddressGroupId": "ipmg-o8w64jdg",
"AddressId": "ipm-ngk4c2dw"
},
"Ipv6CidrBlock": "::/0",
"SecurityGroupId": "sg-ohuuioma",
"ModifyTime": "2020-12-03 16:12:15",
"Action": "accept",
"ServiceTemplate": {
"ServiceGroupId": "sg-ohuuioma",
"ServiceId": "ppm-f5n1f8da"
},
"CidrBlock": "0.0.0.0/0",
"Port": "80"
}
],
"Egress": [
{
"PolicyIndex": 0,
"Protocol": "All",
"PolicyDescription": "Test",
"AddressTemplate": {
"AddressGroupId": "ipmg-o8w64jdg",
"AddressId": "ipm-ngk4c2dw"
},
"Ipv6CidrBlock": "::/0",
"SecurityGroupId": "sg-ohuuioma",
"ModifyTime": "2020-12-03 16:12:15",
"Action": "accept",
"ServiceTemplate": {
"ServiceGroupId": "sg-ohuuioma",
"ServiceId": "ppm-f5n1f8da"
},
"CidrBlock": "0.0.0.0/0",
"Port": "80"
}
]
}
}
{
"Response": {
"RequestId": "53ee3ed3-c9ed-48ba-8a57-8624b9c0d3b8"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
InvalidParameter | A parameter error occurred. |
InvalidParameter.Coexist | The parameters cannot be specified at the same time. |
InvalidParameterValue | Incorrect parameter value. |
InvalidParameterValue.LimitExceeded | The parameter value exceeds the limit. |
InvalidParameterValue.Malformed | Invalid input parameter format. |
InvalidParameterValue.TooLong | Invalid parameter value. The parameter value is too long. |
LimitExceeded | Quota limit is reached. |
LimitExceeded.SecurityGroupPolicySet | The number of security group rules exceeds the upper limit. |
ResourceNotFound | The resource does not exist. |
UnknownParameter.WithGuess | Unknown parameter. Try similar parameters. |
UnsupportedOperation.ClbPolicyLimit | Public network CLB does not support this policy. |
UnsupportedOperation.DuplicatePolicy | The security group policies are repeated. |
UnsupportedOperation.VersionMismatch | The specified version number of the security group policy is inconsistent with the latest version. |
本页内容是否解决了您的问题?