CreateSecurityGroupPolicies

Last Updated At: 2026-08-02 00:06:20

1. Interface Description

Interface request domain name: vpc.api3.convergecloud.com.

This API is used to create a security group rule.

  • Version indicates the version number of a security group rule. Each time you update a security group rule, the version number automatically increases by 1 to prevent the updated rule from expiring. This parameter is optional.
  • The Protocol field supports TCP, UDP, ICMP, ICMPV6, GRE, and ALL.
  • The CidrBlock field supports any string conforming to the CIDR format standard (complete form). On a basic network, if the CidrBlock field values contain the private IP addresses of devices other than CVM instances under your account, it does not mean that the rule allows you to access these devices. The tenant network isolation rules have a higher priority than the private network rules of security groups.
  • The Ipv6CidrBlock field supports any string conforming to the IPv6 CIDR format standard (complete form). On a basic network, if the Ipv6CidrBlock field values contain the private IPv6 addresses of devices other than CVM instances under your account, it does not mean that the rule allows you to access these devices. The tenant network isolation rules have a higher priority than the private network rules of security groups.
  • The SecurityGroupId field supports the ID of a security group in the same project as the security group to be modified and the ID of the security group to be modified. The private IP addresses of all CVM instances associated with the security group are used as source IP addresses. When this field is specified, the network packet matching process of the rule will change as the CVM instance associated with the corresponding security group changes. The source IP addresses do not need to be modified again.
  • The Port field supports a single port number or a port range. For example, 80 or 8000-8010. The Port field is valid only when the Protocol field is set to TCP or UDP. In other words, when the Protocol field is not set to TCP or UDP, the Protocol and Port fields cannot be specified at the same time. Otherwise, an API error will occur.
  • The Action field supports only ACCEPT and DROP.
  • CidrBlock, Ipv6CidrBlock, SecurityGroupId, and AddressTemplate cannot be specified at the same time. ServiceTemplate cannot be specified if Protocol or Port is specified.
  • One request allows you to create rules in only one direction. If the PolicyIndex parameter needs to be specified, the indexes of multiple rules should be consistent.

Default interface request rate limit: 100 times per second.

Interface update time: 2020-03-31 23:50:32.

The interface only verifies the signature but does not authenticate.

2. Input Parameters

The following list of request parameters only lists interface request parameters and some public parameters, For a complete list of public parameters see public request parameters.

Parameter name Required Allow NULL Type Description
Action Yes No String Public parameter, The value of this interface: CreateSecurityGroupPolicies
Version Yes No String Public parameter, The value of this interface: 2017-03-12
Region No No String Public parameter,Regional information A list of supported geographies is available through the DescribeRegions interface
SecurityGroupId Yes No String Security group instance ID, e.g., sg-33ocnj9n, which can be accessed through DescribeSecurityGroups.
Example: sg-33ocnj9n
SecurityGroupPolicySet Yes No SecurityGroupPolicySet Security group policy collection.
Example:View

3. Output Parameters

Parameter name Type Description
RequestId String Unique request id, Each request will return. The RequestId of the request needs to be provided when locating the problem.

4. Error Code

The following lists only the error codes related to the interface business logic, For other error codes, see public ErrorCode.

Error Code Description
InvalidParameterValue The parameter value is invalid.
InvalidParameter Invalid input parameters.
LimitExceeded Exceeded the limit
InvalidParameterValue.Malformed Invalid input format.
ResourceNotFound The resource does not exist
UnsupportedOperation.VersionMismatch The specified security group rule version number is inconsistent with the latest version.
UnsupportedOperation.DuplicatePolicy Duplicate security group rules.