doc-exports/docs/vpc/api-ref/vpc_sg02_0007.html
Qin Ying, Fan 310d2d9eb1 VPC API 20230106 version
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>
2024-02-06 08:38:37 +00:00

186 lines
14 KiB
HTML

<a name="vpc_sg02_0007"></a><a name="vpc_sg02_0007"></a>
<h1 class="topictitle1">Querying a Security Group Rule</h1>
<div id="body1495612692297"><div class="section" id="vpc_sg02_0007__section241393816235"><h4 class="sectiontitle">Function</h4><p id="vpc_sg02_0007__p2060874016235">This API is used to query details about a specific security group rule.</p>
</div>
<div class="section" id="vpc_sg02_0007__section4708630216235"><h4 class="sectiontitle">URI</h4><p id="vpc_sg02_0007__p643821717132">GET /v2.0/security-group-rules/{security_group_rule_id}</p>
</div>
<div class="section" id="vpc_sg02_0007__section1121883416235"><h4 class="sectiontitle">Request Parameters</h4><p id="vpc_sg02_0007__p4298115816235">None</p>
</div>
<div class="section" id="vpc_sg02_0007__section12634438103413"><h4 class="sectiontitle">Example Request</h4><pre class="screen" id="vpc_sg02_0007__screen6186124813412">GET https://{Endpoint}/v2.0/security-group-rules/1755bc80-cf3a-4f57-8ae9-d9796482ddc0</pre>
</div>
<div class="section" id="vpc_sg02_0007__section2503267016235"><h4 class="sectiontitle">Response Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_sg02_0007__table265337716235" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Response parameter</caption><thead align="left"><tr id="vpc_sg02_0007__row4122992216235"><th align="left" class="cellrowborder" valign="top" width="34.14658534146586%" id="mcps1.3.5.2.2.4.1.1"><p id="vpc_sg02_0007__p6294639916235">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.628537146285373%" id="mcps1.3.5.2.2.4.1.2"><p id="vpc_sg02_0007__p6682514016235">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.22487751224878%" id="mcps1.3.5.2.2.4.1.3"><p id="vpc_sg02_0007__p1721315516235">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_sg02_0007__row1324978916235"><td class="cellrowborder" valign="top" width="34.14658534146586%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_sg02_0007__p510999716235">security_group_rule</p>
</td>
<td class="cellrowborder" valign="top" width="14.628537146285373%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_sg02_0007__p1974626116235"><a href="#vpc_sg02_0007__table655457801607">security_group_rule </a>object</p>
</td>
<td class="cellrowborder" valign="top" width="51.22487751224878%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_sg02_0007__p4059418616235">Specifies the security group rule. For details, see <a href="#vpc_sg02_0007__table655457801607">Table 2</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="vpc_sg02_0007__table655457801607"></a><a name="table655457801607"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_sg02_0007__table655457801607" frame="border" border="1" rules="all"><caption><b>Table 2 </b><strong id="vpc_sg02_0007__b17783335172511">Security Group Rule</strong> objects</caption><thead align="left"><tr id="vpc_sg02_0007__row54478641607"><th align="left" class="cellrowborder" valign="top" width="26.669999999999998%" id="mcps1.3.5.3.2.4.1.1"><p id="vpc_sg02_0007__p389969021607"><strong id="vpc_sg02_0007__b887703715258">Attribute</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.330000000000002%" id="mcps1.3.5.3.2.4.1.2"><p id="vpc_sg02_0007__p36789391607"><strong id="vpc_sg02_0007__b17831123913257">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.3.2.4.1.3"><p id="vpc_sg02_0007__p433861031607"><strong id="vpc_sg02_0007__b16938114072519">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_sg02_0007__row134774871607"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p269083981607">id</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p630670281607">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p334792201607">Specifies the security group rule ID.</p>
<p id="vpc_sg02_0007__p529374054010">This parameter is not mandatory when you query security group rules.</p>
</td>
</tr>
<tr id="vpc_sg02_0007__row250554771607"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p254411021607">description</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p505368621607">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p480145951607">Provides supplementary information about the security group rule.</p>
</td>
</tr>
<tr id="vpc_sg02_0007__row569401671607"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p115724181607">security_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p615991711607">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p587796621607">Specifies the ID of the belonged security group.</p>
</td>
</tr>
<tr id="vpc_sg02_0007__row654332091607"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p113008931607">remote_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p170542961607">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p141218971607">Specifies the peer ID of the belonged security group.</p>
</td>
</tr>
<tr id="vpc_sg02_0007__row9932071607"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p657989401607">direction</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p507988391607">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p570991491607">Specifies the direction of the traffic for which the security group rule takes effect.</p>
</td>
</tr>
<tr id="vpc_sg02_0007__row97529031607"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p478834691607">remote_ip_prefix</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p622759951607">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p146708701607">Specifies the peer IP address segment.</p>
</td>
</tr>
<tr id="vpc_sg02_0007__row315033981607"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p163656291607">protocol</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p628340441607">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p99902671607">Specifies the protocol type or the IP protocol number.</p>
</td>
</tr>
<tr id="vpc_sg02_0007__row551583771607"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p97886331607">port_range_max</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p343603851607">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p188144701607">Specifies the maximum port number. When ICMP is used, the value is the ICMP code.</p>
</td>
</tr>
<tr id="vpc_sg02_0007__row456604071607"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p630384091607">port_range_min</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p337362901607">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p258562691607">Specifies the minimum port number. If the ICMP protocol is used, this parameter indicates the ICMP type.</p>
<p id="vpc_sg02_0007__p5690808615417">When the TCP or UDP protocol is used, both <strong id="vpc_sg02_0007__b395012147582">port_range_max</strong> and <strong id="vpc_sg02_0007__b99515141582">port_range_min</strong> must be specified, and the <strong id="vpc_sg02_0007__b1895241425813">port_range_max</strong> value must be greater than the <strong id="vpc_sg02_0007__b79530147587">port_range_min</strong> value.</p>
<p id="vpc_sg02_0007__p4241072615417">When the ICMP protocol is used, if you specify the ICMP code (<strong id="vpc_sg02_0007__b5775141635817">port_range_max</strong>), you must also specify the ICMP type (<strong id="vpc_sg02_0007__b1477641617584">port_range_min</strong>).</p>
</td>
</tr>
<tr id="vpc_sg02_0007__row360773491607"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p364292801607">ethertype</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p339523071607">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p34728681607">Specifies the network type.</p>
<p id="vpc_sg02_0007__p568898621607">IPv4 and IPv6 are supported.</p>
</td>
</tr>
<tr id="vpc_sg02_0007__row532124261607"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p593368391607">tenant_id</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p130282191607">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p10487112">Specifies the project ID. </p>
</td>
</tr>
<tr id="vpc_sg02_0007__row226972613121"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p114291339201219">remote_address_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p6429183913122">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_sg02_0007__ul4848131071616"><li id="vpc_sg02_0007__vpc_sg01_0001_li106781571627">Specifies the remote IP address group ID.</li><li id="vpc_sg02_0007__vpc_sg01_0001_li767815571025">The value is mutually exclusive with parameters <strong id="vpc_sg02_0007__vpc_sg01_0001_b1185142797">remote_ip_prefix</strong> and <strong id="vpc_sg02_0007__vpc_sg01_0001_b64611932598">remote_group_id</strong>.</li></ul>
</td>
</tr>
<tr id="vpc_sg02_0007__row11992111863317"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p169261732143314">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p69311132153317">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p142999113115">Specifies the project ID. </p>
</td>
</tr>
<tr id="vpc_sg02_0007__row10903153923318"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p6634195714335">created_at</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p12638157153319">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p1364635713332">Specifies the time (UTC) when the security group rule is created.</p>
<p id="vpc_sg02_0007__p65980291419">Format: <em id="vpc_sg02_0007__i1731734865817">yyyy-MM-ddTHH:mm:ss</em></p>
</td>
</tr>
<tr id="vpc_sg02_0007__row1797311427338"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_sg02_0007__p1725445103416">updated_at</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_sg02_0007__p192601514345">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_sg02_0007__p1127018513343">Specifies the time (UTC) when the security group rule is updated.</p>
<p id="vpc_sg02_0007__p457613546135">Format: <em id="vpc_sg02_0007__i19709155625820">yyyy-MM-ddTHH:mm:ss</em></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="vpc_sg02_0007__section2374028316235"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="vpc_sg02_0007__screen5169105910345">{
"security_group_rule": {
"remote_group_id": null,
"direction": "egress",
"remote_ip_prefix": null,
"protocol": null,
"tenant_id": "6fbe9263116a4b68818cf1edce16bc4f",
"port_range_max": null,
"security_group_id": "723bc02c-d7f7-49b5-b6ff-d08320f315e2",
"port_range_min": null,
"ethertype": "IPv4",
"description": null,
"id": "1755bc80-cf3a-4f57-8ae9-d9796482ddc0",
"project_id": "6fbe9263116a4b68818cf1edce16bc4f",
"created_at": "2018-09-20T02:15:34",
"updated_at": "2018-09-20T02:15:34",
"remote_address_group_id": null
}
}</pre>
</div>
<div class="section" id="vpc_sg02_0007__section10470352390"><h4 class="sectiontitle">Status Code</h4><p id="vpc_sg02_0007__p18112112662914">See <a href="vpc_api_0002.html">Status Codes</a>.</p>
</div>
<div class="section" id="vpc_sg02_0007__section85821649202813"><h4 class="sectiontitle">Error Code</h4><p id="vpc_sg02_0007__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_sg02_0000.html">Security Group</a></div>
</div>
</div>