forked from docs/doc-exports
Reviewed-by: Sarda, Priya <prsarda@noreply.gitea.eco.tsi-dev.otc-service.com> Co-authored-by: Qin Ying, Fan <fanqinying@huawei.com> Co-committed-by: Qin Ying, Fan <fanqinying@huawei.com>
309 lines
30 KiB
HTML
309 lines
30 KiB
HTML
<a name="vpc_sg01_0005"></a><a name="vpc_sg01_0005"></a>
|
|
|
|
<h1 class="topictitle1">Creating a Security Group Rule</h1>
|
|
<div id="body1512612629587"><div class="section" id="vpc_sg01_0005__section4195542395259"><h4 class="sectiontitle">Function</h4><p id="vpc_sg01_0005__p6584443995259">This API is used to create a security group rule.</p>
|
|
</div>
|
|
<div class="section" id="vpc_sg01_0005__section5844660495259"><h4 class="sectiontitle">URI</h4><p id="vpc_sg01_0005__p71617310511">POST /v1/{project_id}/security-group-rules</p>
|
|
</div>
|
|
<div class="section" id="vpc_sg01_0005__section3936161695259"><h4 class="sectiontitle">Request Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_sg01_0005__table64406641102826" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameter</caption><thead align="left"><tr id="vpc_sg01_0005__row57921141102826"><th align="left" class="cellrowborder" valign="top" width="25.729999999999997%" id="mcps1.3.3.2.2.5.1.1"><p id="vpc_sg01_0005__p61100872102826"><strong id="vpc_sg01_0005__b842352706195711_1">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="14.979999999999999%" id="mcps1.3.3.2.2.5.1.2"><p id="vpc_sg01_0005__p50223579102826"><strong id="vpc_sg01_0005__b842352706145619_1">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20.3%" id="mcps1.3.3.2.2.5.1.3"><p id="vpc_sg01_0005__p12571728103332"><strong id="vpc_sg01_0005__b842352706145623_1">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="38.99%" id="mcps1.3.3.2.2.5.1.4"><p id="vpc_sg01_0005__p41578070102826"><strong id="vpc_sg01_0005__b372029376201138_1">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="vpc_sg01_0005__row12380514102826"><td class="cellrowborder" valign="top" width="25.729999999999997%" headers="mcps1.3.3.2.2.5.1.1 "><p id="vpc_sg01_0005__p63297574102826">security_group_rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.979999999999999%" headers="mcps1.3.3.2.2.5.1.2 "><p id="vpc_sg01_0005__p26829899102826">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.3%" headers="mcps1.3.3.2.2.5.1.3 "><p id="vpc_sg01_0005__p11677013103332"><a href="#vpc_sg01_0005__table40497645103533">security_group_rule</a> object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.99%" headers="mcps1.3.3.2.2.5.1.4 "><p id="vpc_sg01_0005__p25738233102826">Specifies the security group rule objects. For details, see <a href="#vpc_sg01_0005__table40497645103533">Table 2</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="vpc_sg01_0005__table40497645103533"></a><a name="table40497645103533"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_sg01_0005__table40497645103533" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Description of the <strong id="vpc_sg01_0005__b172251411414">security_group_rule</strong> field</caption><thead align="left"><tr id="vpc_sg01_0005__row53169346103533"><th align="left" class="cellrowborder" valign="top" width="25.729999999999997%" id="mcps1.3.3.3.2.5.1.1"><p id="vpc_sg01_0005__p11749806103533"><strong id="vpc_sg01_0005__b842352706195711_3">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="14.979999999999999%" id="mcps1.3.3.3.2.5.1.2"><p id="vpc_sg01_0005__p12210197103533"><strong id="vpc_sg01_0005__b842352706145619_3">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20.3%" id="mcps1.3.3.3.2.5.1.3"><p id="vpc_sg01_0005__p49501921103533"><strong id="vpc_sg01_0005__b842352706145623_3">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="38.99%" id="mcps1.3.3.3.2.5.1.4"><p id="vpc_sg01_0005__p50232698103533"><strong id="vpc_sg01_0005__b372029376201138_3">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="vpc_sg01_0005__row42316743103533"><td class="cellrowborder" valign="top" width="25.729999999999997%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_sg01_0005__p5104177103533">security_group_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.979999999999999%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_sg01_0005__p10785183103533">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.3%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_sg01_0005__p1184634103533">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.99%" headers="mcps1.3.3.3.2.5.1.4 "><p id="vpc_sg01_0005__p28846505103533">Specifies the security group ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__row837164644616"><td class="cellrowborder" valign="top" width="25.729999999999997%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_sg01_0005__p432391116381">description</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.979999999999999%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_sg01_0005__p20328111163813">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.3%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_sg01_0005__p193371011103810">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.99%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_sg01_0005__ul1225611189157"><li id="vpc_sg01_0005__li13256151871511">Provides supplementary information about the security group rule.</li><li id="vpc_sg01_0005__li525621831517">The value can contain no more than 255 characters, including letters and digits.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__row21341412103542"><td class="cellrowborder" valign="top" width="25.729999999999997%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_sg01_0005__p57854982103542">direction</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.979999999999999%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_sg01_0005__p55741936103542">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.3%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_sg01_0005__p18802950103542">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.99%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_sg01_0005__ul1268116179462"><li id="vpc_sg01_0005__li15292202518218">Access control direction specified in a security group rule.</li><li id="vpc_sg01_0005__li6916104173512">The value can be:<ul id="vpc_sg01_0005__ul6968104419355"><li id="vpc_sg01_0005__li2082844743512"><strong id="vpc_sg01_0005__b15904714116">egress</strong></li><li id="vpc_sg01_0005__li1415123145113"><strong id="vpc_sg01_0005__b195461181119">ingress</strong></li></ul>
|
|
</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__row4645343310375"><td class="cellrowborder" valign="top" width="25.729999999999997%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_sg01_0005__p1542771910375">ethertype</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.979999999999999%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_sg01_0005__p4168576010375">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.3%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_sg01_0005__p2110340510375">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.99%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_sg01_0005__ul117531010191518"><li id="vpc_sg01_0005__li11753110191516">Specifies the IP protocol version.</li><li id="vpc_sg01_0005__li575317107159">The value can be <strong id="vpc_sg01_0005__b9479132065713">IPv4</strong> or <strong id="vpc_sg01_0005__b748013209574">IPv6</strong>.</li><li id="vpc_sg01_0005__li1775311011159">If you do not set this parameter, <strong id="vpc_sg01_0005__b842352706111846">IPv4</strong> is used by default.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__row978280010378"><td class="cellrowborder" valign="top" width="25.729999999999997%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_sg01_0005__p2093634110378">protocol</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.979999999999999%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_sg01_0005__p1812206110378">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.3%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_sg01_0005__p5860085010378">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.99%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_sg01_0005__ul8194236156"><li id="vpc_sg01_0005__li1219415331520">Specifies the protocol type.</li><li id="vpc_sg01_0005__li419411314157">The value can be <strong id="vpc_sg01_0005__b1615864720619">icmp</strong>, <strong id="vpc_sg01_0005__b106741349769">tcp</strong>, <strong id="vpc_sg01_0005__b5312125220619">udp</strong>, or an IP protocol number (0 to 255, for example, 47 for GRE)</li><li id="vpc_sg01_0005__li171941436153">If the parameter is left blank, all protocols are supported. </li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__row18668800103711"><td class="cellrowborder" valign="top" width="25.729999999999997%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_sg01_0005__p33801475103711">port_range_min</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.979999999999999%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_sg01_0005__p53564969103711">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.3%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_sg01_0005__p43795239103711">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.99%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_sg01_0005__ul8924125811144"><li id="vpc_sg01_0005__li13924115811146">Specifies the start port number.</li><li id="vpc_sg01_0005__li109242058101419">The value ranges from 1 to 65535.</li><li id="vpc_sg01_0005__li199242058161416">The value cannot be greater than the <strong id="vpc_sg01_0005__b842352706195750_1">port_range_max</strong> value. An empty value indicates all ports. If the protocol is <strong id="vpc_sg01_0005__b842352706195910_1">icmp</strong>, the value range is shown in <a href="vpc_api_0009.html">ICMP-Port Range Relationship Table</a>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__row13883795103937"><td class="cellrowborder" valign="top" width="25.729999999999997%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_sg01_0005__p57845296103937">port_range_max</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.979999999999999%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_sg01_0005__p54957377103937">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.3%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_sg01_0005__p22362584103937">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.99%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_sg01_0005__ul39421154151419"><li id="vpc_sg01_0005__li8941195412140">Specifies the end port number.</li><li id="vpc_sg01_0005__li1194145417141">The value ranges from 1 to 65535.</li><li id="vpc_sg01_0005__li594211547146">If the protocol is not <strong id="vpc_sg01_0005__b842352706195730">icmp</strong>, the value cannot be smaller than the <strong id="vpc_sg01_0005__b842352706195750_3">port_range_min</strong> value. An empty value indicates all ports. If the protocol is <strong id="vpc_sg01_0005__b842352706195910_3">icmp</strong>, the value range is shown in <a href="vpc_api_0009.html">ICMP-Port Range Relationship Table</a>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__row6541391310401"><td class="cellrowborder" valign="top" width="25.729999999999997%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_sg01_0005__p5185430910401">remote_ip_prefix</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.979999999999999%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_sg01_0005__p3944952510401">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.3%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_sg01_0005__p4129497410401">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.99%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_sg01_0005__ul14397351121414"><li id="vpc_sg01_0005__li7396105120141">Specifies the remote IP address. If the access control direction is set to <strong id="vpc_sg01_0005__b1252918224236">egress</strong>, the parameter specifies the source IP address. If the access control direction is set to <strong id="vpc_sg01_0005__b11529102252317">ingress</strong>, the parameter specifies the destination IP address.</li><li id="vpc_sg01_0005__li7396155114148">The value can be in the CIDR format or IP addresses.</li><li id="vpc_sg01_0005__li2039745118146">The parameter is mutually exclusive with parameter <strong id="vpc_sg01_0005__b10538123012342">remote_group_id</strong>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__row58771576104026"><td class="cellrowborder" valign="top" width="25.729999999999997%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_sg01_0005__p59182141104026">remote_group_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.979999999999999%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_sg01_0005__p29024106104026">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.3%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_sg01_0005__p2142367104026">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.99%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_sg01_0005__ul3180184851416"><li id="vpc_sg01_0005__li10180448131411">Specifies the ID of the peer security group.</li><li id="vpc_sg01_0005__li31809484146">This parameter is mutually exclusive with parameter <strong id="vpc_sg01_0005__b11351617103513">remote_ip_prefix</strong>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__row134031950290"><td class="cellrowborder" valign="top" width="25.729999999999997%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_sg01_0005__p1146204615214">remote_address_group_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.979999999999999%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_sg01_0005__p11784181217611">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.3%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_sg01_0005__p3469461328">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.99%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_sg01_0005__ul967819571421"><li id="vpc_sg01_0005__vpc_sg01_0003_li106781571627">Specifies the remote IP address group ID. You can log in to the management console and view the ID on the IP address group page.</li><li id="vpc_sg01_0005__vpc_sg01_0003_li767815571025">This parameter is mutually exclusive with parameters <strong id="vpc_sg01_0005__b123041425141111">remote_ip_prefix</strong> and <strong id="vpc_sg01_0005__b930519252110">remote_group_id</strong>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="vpc_sg01_0005__section182631730192116"><h4 class="sectiontitle">Example Request</h4><ul id="vpc_sg01_0005__ul184681633132116"><li id="vpc_sg01_0005__li19468733202115">Create an inbound rule in the security group whose ID is a7734e61-b545-452d-a3cd-0189cbd9747a.<pre class="screen" id="vpc_sg01_0005__screen25687801163359">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"
|
|
}
|
|
}</pre>
|
|
<pre class="screen" id="vpc_sg01_0005__screen135603363448">POST https://{Endpoint}/v1/{project_id}/security-group-rules
|
|
|
|
{
|
|
"security_group_rule": {
|
|
"direction": "ingress",
|
|
"port_range_min": "80",
|
|
"ethertype": "IPv6",
|
|
"port_range_max": "90",
|
|
"protocol": "tcp",
|
|
"security_group_id": "a7734e61-b545-452d-a3cd-0189cbd9747a"
|
|
}
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="vpc_sg01_0005__section3532656695259"><h4 class="sectiontitle">Response Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_sg01_0005__table187664789489" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameter</caption><thead align="left"><tr id="vpc_sg01_0005__row101573199489"><th align="left" class="cellrowborder" valign="top" width="23.09%" id="mcps1.3.5.2.2.4.1.1"><p id="vpc_sg01_0005__p444890459489"><strong id="vpc_sg01_0005__b842352706195711_5">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="22.14%" id="mcps1.3.5.2.2.4.1.2"><p id="vpc_sg01_0005__p437522139489"><strong id="vpc_sg01_0005__b842352706145623_5">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="54.769999999999996%" id="mcps1.3.5.2.2.4.1.3"><p id="vpc_sg01_0005__p578362329489"><strong id="vpc_sg01_0005__b372029376201138_5">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="vpc_sg01_0005__row449165309489"><td class="cellrowborder" valign="top" width="23.09%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_sg01_0005__p268266119489">security_group_rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.14%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_sg01_0005__p630794179489"><a href="#vpc_sg01_0005__table488727239520">security_group_rule</a> object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.769999999999996%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_sg01_0005__p349251459489">Specifies the security group rule objects. For details, see <a href="#vpc_sg01_0005__table488727239520">Table 4</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="vpc_sg01_0005__table488727239520"></a><a name="table488727239520"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_sg01_0005__table488727239520" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="vpc_sg01_0005__vpc_sg01_0001_b897031316622">security_group_rule</strong> objects</caption><thead align="left"><tr id="vpc_sg01_0005__vpc_sg01_0001_row611024789489"><th align="left" class="cellrowborder" valign="top" width="34.143414341434145%" id="mcps1.3.5.3.2.4.1.1"><p id="vpc_sg01_0005__vpc_sg01_0001_p98931099489">Name</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20.732073207320735%" id="mcps1.3.5.3.2.4.1.2"><p id="vpc_sg01_0005__vpc_sg01_0001_p368367439489">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="45.124512451245124%" id="mcps1.3.5.3.2.4.1.3"><p id="vpc_sg01_0005__vpc_sg01_0001_p23523719489">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="vpc_sg01_0005__vpc_sg01_0001_row397690789489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg01_0005__vpc_sg01_0001_p656951529489">id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg01_0005__vpc_sg01_0001_p307102169489">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg01_0005__vpc_sg01_0001_p216633359489">Specifies the security group rule ID, which uniquely identifies the security group rule.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__vpc_sg01_0001_row2447898388"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg01_0005__vpc_sg01_0001_p432391116381">description</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg01_0005__vpc_sg01_0001_p20328111163813">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_sg01_0005__vpc_sg01_0001_ul12329121935111"><li id="vpc_sg01_0005__vpc_sg01_0001_li93276198510">Provides supplementary information about the security group rule.</li><li id="vpc_sg01_0005__vpc_sg01_0001_li5329141955114">The value can contain no more than 255 characters, including letters and digits.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__vpc_sg01_0001_row320377939489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg01_0005__vpc_sg01_0001_p620577269489">security_group_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg01_0005__vpc_sg01_0001_p644725909489">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg01_0005__vpc_sg01_0001_p260700169489">Specifies the security group rule ID, which uniquely identifies the security group rule.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__vpc_sg01_0001_row602307149489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg01_0005__vpc_sg01_0001_p184092199489">direction</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg01_0005__vpc_sg01_0001_p499849219489">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_sg01_0005__vpc_sg01_0001_ul8415142317513"><li id="vpc_sg01_0005__vpc_sg01_0001_li124154235511">Specifies the direction of access control.</li><li id="vpc_sg01_0005__vpc_sg01_0001_li6916104173512">Possible values are as follows:<ul id="vpc_sg01_0005__vpc_sg01_0001_ul6968104419355"><li id="vpc_sg01_0005__vpc_sg01_0001_li2082844743512"><strong id="vpc_sg01_0005__vpc_sg01_0001_b96381611133314">egress</strong></li><li id="vpc_sg01_0005__vpc_sg01_0001_li1415123145113"><strong id="vpc_sg01_0005__vpc_sg01_0001_b9979172133411">ingress</strong></li></ul>
|
|
</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__vpc_sg01_0001_row53906049489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg01_0005__vpc_sg01_0001_p460392719489">ethertype</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg01_0005__vpc_sg01_0001_p248464689489">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_sg01_0005__vpc_sg01_0001_ul78261926205119"><li id="vpc_sg01_0005__vpc_sg01_0001_li178263267515">Specifies the IP protocol version.</li><li id="vpc_sg01_0005__vpc_sg01_0001_li1882682615114">The value can be <strong id="vpc_sg01_0005__vpc_sg01_0001_b18421041195618">IPv4</strong> or <strong id="vpc_sg01_0005__vpc_sg01_0001_b1284244110568">IPv6</strong>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__vpc_sg01_0001_row619098859489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg01_0005__vpc_sg01_0001_p520137079489">protocol</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg01_0005__vpc_sg01_0001_p17867349489">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_sg01_0005__vpc_sg01_0001_ul585593011517"><li id="vpc_sg01_0005__vpc_sg01_0001_li15855430185119">Specifies the protocol type.</li><li id="vpc_sg01_0005__vpc_sg01_0001_li18254635105816">The value can be <strong id="vpc_sg01_0005__vpc_sg01_0001_b1576775584012">icmp</strong>, <strong id="vpc_sg01_0005__vpc_sg01_0001_b20767455104015">tcp</strong>, <strong id="vpc_sg01_0005__vpc_sg01_0001_b1876714558408">udp</strong>, or an IP protocol number (0 to 255, for example, 47 for GRE)</li><li id="vpc_sg01_0005__vpc_sg01_0001_li14855183045113">If the parameter is left blank, all protocols are supported.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__vpc_sg01_0001_row29885099489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg01_0005__vpc_sg01_0001_p424368709489">port_range_min</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg01_0005__vpc_sg01_0001_p167549899489">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_sg01_0005__vpc_sg01_0001_ul1445493595119"><li id="vpc_sg01_0005__vpc_sg01_0001_li164541435125119">Specifies the start port number.</li><li id="vpc_sg01_0005__vpc_sg01_0001_li1454635135113">The value ranges from 1 to 65535.</li><li id="vpc_sg01_0005__vpc_sg01_0001_li1845415357516">The value cannot be greater than the <strong id="vpc_sg01_0005__vpc_sg01_0001_b842352706195750">port_range_max</strong> value. An empty value indicates all ports. If the protocol is <strong id="vpc_sg01_0005__vpc_sg01_0001_b842352706195910">icmp</strong>, the value range is shown in <a href="vpc_api_0009.html">ICMP-Port Range Relationship Table</a>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__vpc_sg01_0001_row330228649489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg01_0005__vpc_sg01_0001_p239666849489">port_range_max</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg01_0005__vpc_sg01_0001_p641378179489">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_sg01_0005__vpc_sg01_0001_ul23372407514"><li id="vpc_sg01_0005__vpc_sg01_0001_li233744065111">Specifies the end port number.</li><li id="vpc_sg01_0005__vpc_sg01_0001_li933764019519">The value ranges from 1 to 65535.</li><li id="vpc_sg01_0005__vpc_sg01_0001_li133371240165111">If the protocol is not <strong id="vpc_sg01_0005__vpc_sg01_0001_b842352706195730">icmp</strong>, the value cannot be smaller than the <strong id="vpc_sg01_0005__vpc_sg01_0001_b873792704">port_range_min</strong> value. An empty value indicates all ports. If the protocol is <strong id="vpc_sg01_0005__vpc_sg01_0001_b2077102465">icmp</strong>, the value range is shown in <a href="vpc_api_0009.html">ICMP-Port Range Relationship Table</a>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__vpc_sg01_0001_row1745649489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg01_0005__vpc_sg01_0001_p144166029489">remote_ip_prefix</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg01_0005__vpc_sg01_0001_p139601239489">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_sg01_0005__vpc_sg01_0001_ul42481344125119"><li id="vpc_sg01_0005__vpc_sg01_0001_li1424824420511">Specifies the remote IP address. If the access control direction is set to <strong id="vpc_sg01_0005__vpc_sg01_0001_b168443017227">egress</strong>, the parameter specifies the source IP address. If the access control direction is set to <strong id="vpc_sg01_0005__vpc_sg01_0001_b138411307223">ingress</strong>, the parameter specifies the destination IP address.</li><li id="vpc_sg01_0005__vpc_sg01_0001_li2248184413517">The value can be in the CIDR format or IP addresses.</li><li id="vpc_sg01_0005__vpc_sg01_0001_li9248644125119">The parameter is mutually exclusive with parameter <strong id="vpc_sg01_0005__vpc_sg01_0001_b286230152212">remote_group_id</strong>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__vpc_sg01_0001_row436879079489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg01_0005__vpc_sg01_0001_p420105089489">remote_group_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg01_0005__vpc_sg01_0001_p465213149489">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_sg01_0005__vpc_sg01_0001_ul12672447145118"><li id="vpc_sg01_0005__vpc_sg01_0001_li167216475516">Specifies the ID of the peer security group.</li><li id="vpc_sg01_0005__vpc_sg01_0001_li20672147185110">The value is mutually exclusive with parameter <strong id="vpc_sg01_0005__vpc_sg01_0001_b28793017228">remote_ip_prefix</strong>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__vpc_sg01_0001_row73928331228"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg01_0005__vpc_sg01_0001_p1146204615214">remote_address_group_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg01_0005__vpc_sg01_0001_p3469461328">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_sg01_0005__vpc_sg01_0001_ul967819571421"><li id="vpc_sg01_0005__vpc_sg01_0001_li106781571627">Specifies the remote IP address group ID.</li><li id="vpc_sg01_0005__vpc_sg01_0001_li767815571025">The value is mutually exclusive with parameters <strong id="vpc_sg01_0005__vpc_sg01_0001_b1185142797">remote_ip_prefix</strong> and <strong id="vpc_sg01_0005__vpc_sg01_0001_b64611932598">remote_group_id</strong>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_sg01_0005__vpc_sg01_0001_row66316933510"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg01_0005__vpc_sg01_0001_p66339133513">tenant_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg01_0005__vpc_sg01_0001_p383982443618">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_sg01_0005__vpc_sg01_0001_ul5694239163714"><li id="vpc_sg01_0005__vpc_sg01_0001_li1369413919374">Specifies the ID of the project to which the security group rule belongs.</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="vpc_sg01_0005__section1519695415213"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="vpc_sg01_0005__screen32294494104812">{
|
|
"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
|
|
}
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="vpc_sg01_0005__section31981619"><h4 class="sectiontitle">Status Code</h4><p id="vpc_sg01_0005__p18112112662914">See <a href="vpc_api_0002.html">Status Codes</a>.</p>
|
|
</div>
|
|
<div class="section" id="vpc_sg01_0005__section85821649202813"><h4 class="sectiontitle">Error Code</h4><p id="vpc_sg01_0005__p7233105282813">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_sg01_0000.html">Security Group</a></div>
|
|
</div>
|
|
</div>
|
|
|