doc-exports/docs/vpc/api-ref/vpc_apiv3_0016.html
fanqinying 9e7606681c VPC API 20241009 version
Reviewed-by: Sarda, Priya <prsarda@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: fanqinying <fanqinying@huawei.com>
Co-committed-by: fanqinying <fanqinying@huawei.com>
2024-11-21 09:26:53 +00:00

468 lines
24 KiB
HTML

<a name="vpc_apiv3_0016"></a><a name="vpc_apiv3_0016"></a>
<h1 class="topictitle1">Creating a Security Group Rule</h1>
<div id="body1708331107508"><div class="section"><h4 class="sectiontitle">Function</h4><p>This API is used to create a security group rule.</p>
</div>
<div class="section" id="vpc_apiv3_0016__atuogenerate_1"><h4 class="sectiontitle">URI</h4><p>POST /v3/{project_id}/vpc/security-group-rules</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p>project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p>Project ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_apiv3_0016__request_CreateSecurityGroupRuleRequestBody" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request body parameters</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p>dry_run</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p>Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><ul><li><p>Whether to only send the check request.</p>
</li><li><p>The value can be:</p>
<ul><li><p><strong>true</strong>: A check request will be sent and no security group rule will be created. Check items include mandatory parameters, request format, and permission verification. If the check fails, an error will be returned. If the check succeeds, response code 202 will be returned.</p>
</li><li><p><strong>false</strong> (default value): A request will be sent and a security group rule will be created.</p>
</li></ul>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p>security_group_rule</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p><a href="#vpc_apiv3_0016__request_CreateSecurityGroupRuleOption">CreateSecurityGroupRuleOption</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p>Request body for creating a security group rule.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="vpc_apiv3_0016__request_CreateSecurityGroupRuleOption"></a><a name="request_CreateSecurityGroupRuleOption"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_apiv3_0016__request_CreateSecurityGroupRuleOption" frame="border" border="1" rules="all"><caption><b>Table 3 </b>CreateSecurityGroupRuleOption</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>security_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><ul><li><p>ID of the security group to which the security group rule belongs.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>description</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><ul><li><p>Provides supplementary information about the security group.</p>
</li><li><p>The value can contain no more than 255 characters and cannot contain angle brackets (&lt; or &gt;).</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>direction</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><ul><li><p>Inbound or outbound direction of a security group rule.</p>
</li><li><p>The value can be:</p>
<ul><li><p><strong>ingress</strong>: inbound direction.</p>
</li><li><p><strong>egress</strong>: outbound direction.</p>
</li></ul>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>ethertype</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><ul><li><p>IP version.</p>
</li><li><p>The value can be <strong>IPv4</strong> or <strong>IPv6</strong>.</p>
</li><li><p>If you do not set this parameter, <strong>IPv4</strong> is used by default.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>protocol</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><ul><li><p>Protocol type.</p>
</li><li><p>The value can be <strong>icmp</strong>, <strong>tcp</strong>, <strong>udp</strong>, <strong>icmpv6</strong> or an IP number (0 to 255).</p>
</li><li><p>Constraints:</p>
<ul><li><p>If the parameter is left blank, all protocols are supported.</p>
</li><li><p>When the protocol is <strong>icmpv6</strong>, IP version should be <strong>IPv6</strong>.</p>
</li><li><p>When the protocol is <strong>icmp</strong>, IP version should be <strong>IPv4</strong>.</p>
</li></ul>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>multiport</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><ul><li><p>Port or port range</p>
</li><li><p>The value can be a single port (80), a port range (1-30), or inconsecutive ports separated by commas (22,3389,80).</p>
</li><li><p>The port is from 1 to 65535.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>remote_ip_prefix</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><ul><li><p>Remote IP address. If <strong>direction</strong> is set to <strong>egress</strong>, the parameter specifies the source IP address. If <strong>direction</strong> is set to <strong>ingress</strong>, the parameter specifies the destination IP address.</p>
</li><li><p>The value is an IP address or a CIDR block.</p>
</li><li><p>Constraints:</p>
<ul><li><p>The parameter is mutually exclusive with parameter <strong>remote_group_id</strong>.</p>
</li><li><p>If this parameter is left blank, the remote IP address is not limited, and the traffic from all remote IP addresses is allowed or rejected.</p>
</li></ul>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>remote_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><ul><li><p>ID of the remote security group, which allows or denies traffic to and from the security group.</p>
</li><li><p>Value range: ID of an existing security group.</p>
</li><li><p>The parameter is mutually exclusive with parameter <strong>remote_ip_prefix</strong>.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>action</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><ul><li><p>Action of the security group rule.</p>
</li><li><p>The value can be:</p>
<ul><li><p><strong>allow</strong></p>
</li><li><p><strong>deny</strong></p>
</li></ul>
</li><li><p>The default value is <strong>allow</strong>.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>priority</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><ul><li><p>Rule priority in a security group.</p>
</li><li><p>The value is from <strong>1</strong> to <strong>100</strong>. The value <strong>1</strong> indicates the highest priority.</p>
</li><li><p>The default value is <strong>1</strong>.</p>
</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Response Parameters</h4><p><strong>Status code: 201</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_apiv3_0016__response_CreateSecurityGroupRuleResponseBody" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response body parameters</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.2"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.3.2.4.1.3"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p>request_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p>Request ID.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p>security_group_rule</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p><a href="#vpc_apiv3_0016__response_SecurityGroupRule">SecurityGroupRule</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p>Response body for creating a security group rule.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="vpc_apiv3_0016__response_SecurityGroupRule"></a><a name="response_SecurityGroupRule"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_apiv3_0016__response_SecurityGroupRule" frame="border" border="1" rules="all"><caption><b>Table 5 </b>SecurityGroupRule</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.2"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.4.2.4.1.3"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>Security group rule ID, which uniquely identifies the security group rule.</p>
</li><li><p>The value is in UUID format with hyphens (-).</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>description</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>Provides supplementary information about the security group rule.</p>
</li><li><p>The value can contain no more than 255 characters and cannot contain angle brackets (&lt; or &gt;).</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>security_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>ID of the security group to which the security group rule belongs.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>direction</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>Inbound or outbound direction of a security group rule.</p>
</li><li><p>The value can be:</p>
<ul><li><p>ingress: inbound direction.</p>
</li><li><p>egress: outbound direction.</p>
</li></ul>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>protocol</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>Protocol type</p>
</li><li><p>The value can be <strong>icmp</strong>, <strong>tcp</strong>, <strong>udp</strong>, <strong>icmpv6</strong>, or an IP number.</p>
</li><li><p>Constraints:</p>
<ul><li><p>If the parameter is left blank, all protocols are supported.</p>
</li><li><p>When the protocol is <strong>icmpv6</strong>, IP version should be <strong>IPv6</strong>.</p>
</li><li><p>When the protocol is <strong>icmp</strong>, IP version should be <strong>IPv4</strong>.</p>
</li></ul>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>ethertype</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>IP version</p>
</li><li><p>The value can be <strong>IPv4</strong> or <strong>IPv6</strong>.</p>
</li><li><p>If you do not set this parameter, <strong>IPv4</strong> is used by default.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>multiport</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>Port or port range</p>
</li><li><p>The value can be a single port (80), a port range (1-30), or inconsecutive ports separated by commas (22,3389,80).</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>action</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>Action of the security group rule.</p>
</li><li><p>The value can be: <strong>allow</strong>, <strong>deny</strong>.</p>
</li><li><p>The default value is <strong>deny</strong>.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>priority</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>Integer</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>Rule priority.</p>
</li><li><p>The value is from <strong>1</strong> to <strong>100</strong>. The value <strong>1</strong> indicates the highest priority.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>remote_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>ID of the remote security group, which allows or denies traffic to and from the security group.</p>
</li><li><p>Value range: ID of an existing security group.</p>
</li><li><p>The parameter value is mutually exclusive with parameters <strong>remote_ip_prefix</strong> and <strong>remote_address_group_id</strong>.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>remote_ip_prefix</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>Remote IP address.</p>
<ul><li><p>If direction is set to <strong>egress</strong>, the parameter specifies the source IP address.</p>
</li><li><p>If direction is set to <strong>ingress</strong>, the parameter specifies the destination IP address.</p>
</li></ul>
</li><li><p>The value is an IP address or a CIDR block.</p>
</li><li><p>Constraints:</p>
<ul><li><p>The parameter value is mutually exclusive with parameters <strong>remote_group_id</strong> and <strong>remote_address_group_id</strong>.</p>
</li></ul>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>remote_address_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>ID of the remote IP address group.</p>
</li><li><p>Value range: ID of an existing IP address group</p>
</li><li><p>The parameter value is mutually exclusive with parameters <strong>remote_ip_prefix</strong> and <strong>remote_group_id</strong>.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>created_at</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>Time when the security group rule is created.</p>
</li><li><p>UTC time in the format of <em>yyyy-MM-ddTHH:mm:ssZ</em>.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>updated_at</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>Time when the security group rule is updated.</p>
</li><li><p>UTC time in the format of <em>yyyy-MM-ddTHH:mm:ssZ</em>.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p>project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><ul><li><p>ID of the project to which the security group rule belongs.</p>
</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Example Requests</h4><p>Create an inbound rule in the security group whose ID is <strong>1c8d9f94-6022-4518-bb98-e0145fcc7b33</strong>.</p>
<pre class="screen">POST https://{Endpoint}/v3/{project_id}/vpc/security-group-rules
{
"security_group_rule" : {
"security_group_id" : "1c8d9f94-6022-4518-bb98-e0145fcc7b33",
"direction" : "ingress",
"protocol" : "tcp",
"description" : "security group rule description",
"action" : "allow",
"priority" : 1,
"multiport" : "33",
"remote_ip_prefix" : "10.10.0.0/16"
}
}</pre>
</div>
<div class="section"><h4 class="sectiontitle">Example Responses</h4><p><strong>Status code: 201</strong></p>
<p>Normal response to the POST operation. For more status codes, see <a href="vpc_api_0002.html">Status Codes</a>.</p>
<ul><li><pre class="screen">{
"request_id" : "1666b2708aaf849337572d6846dce781",
"security_group_rule" : {
"id" : "f626eb24-d8bd-4d26-ae0b-c16bb65730cb",
"project_id" : "060576782980d5762f9ec014dd2f1148",
"security_group_id" : "0552091e-b83a-49dd-88a7-4a5c86fd9ec3",
"direction" : "ingress",
"protocol" : "tcp",
"description" : "security group rule description",
"created_at" : "2020-08-13T07:12:36.000+00:00",
"updated_at" : "2020-08-13T07:12:36.000+00:00",
"ethertype" : "IPv4",
"remote_ip_prefix" : "10.10.0.0/16",
"multiport" : 33,
"action" : "allow",
"priority" : 1,
"remote_group_id" : null,
"remote_address_group_id" : null
}
}</pre>
</li></ul>
</div>
<div class="section"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_apiv3_0016__status_code" frame="border" border="1" rules="all"><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p>Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p>201</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p>Normal response to the POST operation. For more status codes, see <a href="vpc_api_0002.html">Status Codes</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Error Codes</h4><p>See <a href="vpc_api_0003.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="vpc_apiv3_0015.html">Security Group Rule</a></div>
</div>
</div>