doc-exports/docs/vpc/api-ref/vpc_sg01_0001.html
gtema 4cfecba474 VPC api from PR#278
Reviewed-by: Kucerak, Kristian <kristian.kucerak@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
2022-10-17 12:39:05 +00:00

323 lines
28 KiB
HTML

<a name="vpc_sg01_0001"></a><a name="vpc_sg01_0001"></a>
<h1 class="topictitle1">Creating a Security Group</h1>
<div id="body20338133"><div class="section" id="vpc_sg01_0001__section1251609489"><h4 class="sectiontitle">Function</h4><p id="vpc_sg01_0001__p546665639489">This API is used to create a security group.</p>
</div>
<div class="section" id="vpc_sg01_0001__section33062409489"><h4 class="sectiontitle">URI</h4><p id="vpc_sg01_0001__p144332489411">POST /v1/{project_id}/security-groups</p>
<div class="p" id="vpc_sg01_0001__p45781958145516"><a href="#vpc_sg01_0001__table483113939489">Table 1</a> describes the parameters.
<div class="tablenoborder"><a name="vpc_sg01_0001__table483113939489"></a><a name="table483113939489"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_sg01_0001__table483113939489" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="vpc_sg01_0001__row411182539489"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.3.2.2.4.1.1"><p id="vpc_sg01_0001__p463378669489">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.3.2.2.4.1.2"><p id="vpc_sg01_0001__p564715189489">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.3.2.2.4.1.3"><p id="vpc_sg01_0001__p724579489">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_sg01_0001__row527882029489"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.3.2.2.4.1.1 "><p id="vpc_sg01_0001__p111312999489">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.3.2.2.4.1.2 "><p id="vpc_sg01_0001__p660990279489">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.3.2.2.4.1.3 "><p id="vpc_sg01_0001__p10487112">Specifies the project ID. </p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="vpc_sg01_0001__section604597999489"><h4 class="sectiontitle">Request Message</h4><ul id="vpc_sg01_0001__ul579224129489"><li id="vpc_sg01_0001__li356728259489">Request parameter
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_sg01_0001__table44974649489" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameter</caption><thead align="left"><tr id="vpc_sg01_0001__row299697129489"><th align="left" class="cellrowborder" valign="top" width="20.412041204120413%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="vpc_sg01_0001__p285205769489">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.45214521452145%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="vpc_sg01_0001__p465402789489">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.311431143114312%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="vpc_sg01_0001__p238240519489">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.824382438243816%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="vpc_sg01_0001__p48352879489">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_sg01_0001__row16369959489"><td class="cellrowborder" valign="top" width="20.412041204120413%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="vpc_sg01_0001__p319354459489">security_group</p>
</td>
<td class="cellrowborder" valign="top" width="21.45214521452145%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="vpc_sg01_0001__p302461269489">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.311431143114312%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="vpc_sg01_0001__p12807519489"><a href="#vpc_sg01_0001__table495783939489">security_group</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="43.824382438243816%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="vpc_sg01_0001__p151006069489">Specifies the security group objects. For details, see <a href="#vpc_sg01_0001__table495783939489">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="vpc_sg01_0001__table495783939489"></a><a name="table495783939489"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_sg01_0001__table495783939489" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Description of <strong>security_group</strong> fields</caption><thead align="left"><tr id="vpc_sg01_0001__row256595299489"><th align="left" class="cellrowborder" valign="top" width="15.310000000000002%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="vpc_sg01_0001__p210585389489">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.73%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="vpc_sg01_0001__p583665309489">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.93%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="vpc_sg01_0001__p382880489489">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52.03%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="vpc_sg01_0001__p120218469489">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_sg01_0001__row289879879489"><td class="cellrowborder" valign="top" width="15.310000000000002%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="vpc_sg01_0001__p422266319489">name</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="vpc_sg01_0001__p392406589489">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.93%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="vpc_sg01_0001__p291833799489">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.03%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><ul id="vpc_sg01_0001__ul152111153467"><li id="vpc_sg01_0001__li4521115134619">Specifies the security group name.</li><li id="vpc_sg01_0001__li11521111564617">The value can contain 1 to 64 characters, including letters, digits, underscores (_), hyphens (-), and periods (.).</li></ul>
</td>
</tr>
<tr id="vpc_sg01_0001__row335873009489"><td class="cellrowborder" valign="top" width="15.310000000000002%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="vpc_sg01_0001__p505959349489">vpc_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="vpc_sg01_0001__p24479189489">No</p>
</td>
<td class="cellrowborder" valign="top" width="15.93%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="vpc_sg01_0001__p518535589489">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.03%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="vpc_sg01_0001__p220374619489">Specifies the resource ID of the VPC to which the security group belongs.</p>
<div class="note" id="vpc_sg01_0001__note4236171919347"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="vpc_sg01_0001__p142368196344">This parameter has been discarded, it is not recommended to use it.</p>
</div></div>
</td>
</tr>
<tr id="vpc_sg01_0001__row105352055143010"><td class="cellrowborder" valign="top" width="15.310000000000002%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="vpc_sg01_0001__p19364757183012">enterprise_project_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="vpc_sg01_0001__p2364125712301">No</p>
</td>
<td class="cellrowborder" valign="top" width="15.93%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="vpc_sg01_0001__p133641357143014">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.03%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><ul id="vpc_sg01_0001__ul5881011144611"><li id="vpc_sg01_0001__li1088611194613">Specifies the enterprise project ID. When creating a security group, associate the enterprise project ID with the security group.</li><li id="vpc_sg01_0001__li11888116469">The value is <strong id="vpc_sg01_0001__b85510189343">0</strong> or a string that contains a maximum of 36 characters in UUID format with hyphens (-). Value <strong id="vpc_sg01_0001__b1686317293341">0</strong> indicates the default enterprise project.</li></ul>
<div class="note" id="vpc_sg01_0001__note19041412125118"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="vpc_sg01_0001__vpc_api01_0001_p182751511487">This parameter is unsupported. Do not use it.</p>
</div></div>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="vpc_sg01_0001__ul88775479489"><li id="vpc_sg01_0001__li636387329489">Example request<pre class="screen" id="vpc_sg01_0001__screen25687801163359">POST https://{Endpoint}/v1/{project_id}/security-groups
{
"security_group": {
"name": "qq",
"vpc_id": "3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85"
"enterprise_project_id": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2"
}
}</pre>
</li></ul>
</div>
<div class="section" id="vpc_sg01_0001__section488521769489"><h4 class="sectiontitle">Response Message</h4><ul id="vpc_sg01_0001__ul165566369489"><li id="vpc_sg01_0001__li589605669489">Response parameter
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_sg01_0001__table187664789489" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response parameter</caption><thead align="left"><tr id="vpc_sg01_0001__row101573199489"><th align="left" class="cellrowborder" valign="top" width="23.26%" id="mcps1.3.4.2.1.1.2.4.1.1"><p id="vpc_sg01_0001__p444890459489">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.09%" id="mcps1.3.4.2.1.1.2.4.1.2"><p id="vpc_sg01_0001__p437522139489">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54.65%" id="mcps1.3.4.2.1.1.2.4.1.3"><p id="vpc_sg01_0001__p578362329489">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_sg01_0001__row449165309489"><td class="cellrowborder" valign="top" width="23.26%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="vpc_sg01_0001__p268266119489">security_group</p>
</td>
<td class="cellrowborder" valign="top" width="22.09%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="vpc_sg01_0001__p630794179489"><a href="#vpc_sg01_0001__table661472489489">security_group</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="54.65%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="vpc_sg01_0001__p349251459489">Specifies the security group objects. For details, see <a href="#vpc_sg01_0001__table661472489489">Table 5</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="vpc_sg01_0001__table661472489489"></a><a name="table661472489489"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_sg01_0001__table661472489489" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Description of <strong id="vpc_sg01_0001__b124836132307">security_group</strong> fields</caption><thead align="left"><tr id="vpc_sg01_0001__row158029169489"><th align="left" class="cellrowborder" valign="top" width="34.52%" id="mcps1.3.4.2.1.2.2.4.1.1"><p id="vpc_sg01_0001__p581966039489">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.45%" id="mcps1.3.4.2.1.2.2.4.1.2"><p id="vpc_sg01_0001__p166624639489">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.03%" id="mcps1.3.4.2.1.2.2.4.1.3"><p id="vpc_sg01_0001__p278965559489">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_sg01_0001__row643785269489"><td class="cellrowborder" valign="top" width="34.52%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="vpc_sg01_0001__p329359299489">name</p>
</td>
<td class="cellrowborder" valign="top" width="21.45%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="vpc_sg01_0001__p230963549489">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.03%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="vpc_sg01_0001__p410063869489">Specifies the security group name.</p>
</td>
</tr>
<tr id="vpc_sg01_0001__row32100149489"><td class="cellrowborder" valign="top" width="34.52%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="vpc_sg01_0001__p522665169489">description</p>
</td>
<td class="cellrowborder" valign="top" width="21.45%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="vpc_sg01_0001__p513285489489">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.03%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="vpc_sg01_0001__p290727679489">Provides supplementary information about the security group.</p>
</td>
</tr>
<tr id="vpc_sg01_0001__row639972559489"><td class="cellrowborder" valign="top" width="34.52%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="vpc_sg01_0001__p634276169489">id</p>
</td>
<td class="cellrowborder" valign="top" width="21.45%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="vpc_sg01_0001__p114487449489">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.03%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="vpc_sg01_0001__p259109349489">Specifies the security group ID, which uniquely identifies the security group.</p>
</td>
</tr>
<tr id="vpc_sg01_0001__row422544629489"><td class="cellrowborder" valign="top" width="34.52%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="vpc_sg01_0001__p590727719489">vpc_id</p>
</td>
<td class="cellrowborder" valign="top" width="21.45%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="vpc_sg01_0001__p10272179489">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.03%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="vpc_sg01_0001__p303149719489">Specifies the resource ID of the VPC to which the security group belongs.</p>
<div class="note" id="vpc_sg01_0001__note1071412434342"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="vpc_sg01_0001__p137151443133411">This parameter has been discarded, it is not recommended to use it.</p>
</div></div>
</td>
</tr>
<tr id="vpc_sg01_0001__row30397199489"><td class="cellrowborder" valign="top" width="34.52%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="vpc_sg01_0001__p252491199489">security_group_rules</p>
</td>
<td class="cellrowborder" valign="top" width="21.45%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="vpc_sg01_0001__p193798449489">Array of <a href="#vpc_sg01_0001__table210704979489">security_group_rule</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="44.03%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="vpc_sg01_0001__p643841019489">Specifies the default security group rules, which ensure that resources in the security group can communicate with one another.</p>
</td>
</tr>
<tr id="vpc_sg01_0001__row104191723103213"><td class="cellrowborder" valign="top" width="34.52%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="vpc_sg01_0001__p19326142511323">enterprise_project_id</p>
</td>
<td class="cellrowborder" valign="top" width="21.45%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="vpc_sg01_0001__p203266259325">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.03%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><ul id="vpc_sg01_0001__ul15517142134714"><li id="vpc_sg01_0001__li051772118474">Specifies the enterprise project ID. When creating a security group, associate the enterprise project ID with the security group.</li><li id="vpc_sg01_0001__li15517102117473">The value is <strong id="vpc_sg01_0001__b11322036153414">0</strong> or a string that contains a maximum of 36 characters in UUID format with hyphens (-). Value <strong id="vpc_sg01_0001__b125551738133416">0</strong> indicates the default enterprise project.</li></ul>
<div class="note" id="vpc_sg01_0001__note428720710014"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="vpc_sg01_0001__vpc_api01_0001_p182751511487_1">This parameter is unsupported. Do not use it.</p>
</div></div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="vpc_sg01_0001__table210704979489"></a><a name="table210704979489"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_sg01_0001__table210704979489" frame="border" border="1" rules="all"><caption><b>Table 6 </b><strong id="vpc_sg01_0001__b897031316622">security_group_rule</strong> objects</caption><thead align="left"><tr id="vpc_sg01_0001__row611024789489"><th align="left" class="cellrowborder" valign="top" width="34.143414341434145%" id="mcps1.3.4.2.1.3.2.4.1.1"><p id="vpc_sg01_0001__p98931099489">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.732073207320735%" id="mcps1.3.4.2.1.3.2.4.1.2"><p id="vpc_sg01_0001__p368367439489">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="45.124512451245124%" id="mcps1.3.4.2.1.3.2.4.1.3"><p id="vpc_sg01_0001__p23523719489">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_sg01_0001__row397690789489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.4.2.1.3.2.4.1.1 "><p id="vpc_sg01_0001__p656951529489">id</p>
</td>
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.4.2.1.3.2.4.1.2 "><p id="vpc_sg01_0001__p307102169489">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.4.2.1.3.2.4.1.3 "><p id="vpc_sg01_0001__p216633359489">Specifies the security group rule ID, which uniquely identifies the security group rule.</p>
</td>
</tr>
<tr id="vpc_sg01_0001__row2447898388"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.4.2.1.3.2.4.1.1 "><p id="vpc_sg01_0001__p432391116381">description</p>
</td>
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.4.2.1.3.2.4.1.2 "><p id="vpc_sg01_0001__p20328111163813">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.4.2.1.3.2.4.1.3 "><ul id="vpc_sg01_0001__ul12329121935111"><li id="vpc_sg01_0001__li93276198510">Provides supplementary information about the security group rule.</li><li id="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_0001__row320377939489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.4.2.1.3.2.4.1.1 "><p id="vpc_sg01_0001__p620577269489">security_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.4.2.1.3.2.4.1.2 "><p id="vpc_sg01_0001__p644725909489">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.4.2.1.3.2.4.1.3 "><p id="vpc_sg01_0001__p260700169489">Specifies the security group rule ID, which uniquely identifies the security group rule.</p>
</td>
</tr>
<tr id="vpc_sg01_0001__row602307149489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.4.2.1.3.2.4.1.1 "><p id="vpc_sg01_0001__p184092199489">direction</p>
</td>
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.4.2.1.3.2.4.1.2 "><p id="vpc_sg01_0001__p499849219489">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.4.2.1.3.2.4.1.3 "><ul id="vpc_sg01_0001__ul8415142317513"><li id="vpc_sg01_0001__li124154235511">Specifies the direction of access control.</li><li id="vpc_sg01_0001__li6916104173512">Possible values are as follows:<ul id="vpc_sg01_0001__ul6968104419355"><li id="vpc_sg01_0001__li2082844743512"><strong id="vpc_sg01_0001__b96381611133314">egress</strong></li><li id="vpc_sg01_0001__li1415123145113"><strong id="vpc_sg01_0001__b9979172133411">ingress</strong></li></ul>
</li></ul>
</td>
</tr>
<tr id="vpc_sg01_0001__row53906049489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.4.2.1.3.2.4.1.1 "><p id="vpc_sg01_0001__p460392719489">ethertype</p>
</td>
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.4.2.1.3.2.4.1.2 "><p id="vpc_sg01_0001__p248464689489">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.4.2.1.3.2.4.1.3 "><ul id="vpc_sg01_0001__ul78261926205119"><li id="vpc_sg01_0001__li178263267515">Specifies the IP protocol version.</li><li id="vpc_sg01_0001__li1882682615114">The value can be <strong id="vpc_sg01_0001__b18421041195618">IPv4</strong> or <strong id="vpc_sg01_0001__b1284244110568">IPv6</strong>.</li></ul>
</td>
</tr>
<tr id="vpc_sg01_0001__row619098859489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.4.2.1.3.2.4.1.1 "><p id="vpc_sg01_0001__p520137079489">protocol</p>
</td>
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.4.2.1.3.2.4.1.2 "><p id="vpc_sg01_0001__p17867349489">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.4.2.1.3.2.4.1.3 "><ul id="vpc_sg01_0001__ul585593011517"><li id="vpc_sg01_0001__li15855430185119">Specifies the protocol type.</li><li id="vpc_sg01_0001__li18254635105816">The value can be <strong id="vpc_sg01_0001__b1459493374214">icmp</strong>, <strong id="vpc_sg01_0001__b115948336427">tcp</strong>, or <strong id="vpc_sg01_0001__b659723354216">udp</strong>.</li><li id="vpc_sg01_0001__li14855183045113">If the parameter is left blank, all protocols are supported.</li></ul>
</td>
</tr>
<tr id="vpc_sg01_0001__row29885099489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.4.2.1.3.2.4.1.1 "><p id="vpc_sg01_0001__p424368709489">port_range_min</p>
</td>
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.4.2.1.3.2.4.1.2 "><p id="vpc_sg01_0001__p167549899489">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.4.2.1.3.2.4.1.3 "><ul id="vpc_sg01_0001__ul1445493595119"><li id="vpc_sg01_0001__li164541435125119">Specifies the start port number.</li><li id="vpc_sg01_0001__li1454635135113">The value ranges from 1 to 65535.</li><li id="vpc_sg01_0001__li1845415357516">The value cannot be greater than the <strong id="vpc_sg01_0001__b842352706195750">port_range_max</strong> value. An empty value indicates all ports. If the protocol is <strong id="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_0001__row330228649489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.4.2.1.3.2.4.1.1 "><p id="vpc_sg01_0001__p239666849489">port_range_max</p>
</td>
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.4.2.1.3.2.4.1.2 "><p id="vpc_sg01_0001__p641378179489">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.4.2.1.3.2.4.1.3 "><ul id="vpc_sg01_0001__ul23372407514"><li id="vpc_sg01_0001__li233744065111">Specifies the end port number.</li><li id="vpc_sg01_0001__li933764019519">The value ranges from 1 to 65535.</li><li id="vpc_sg01_0001__li133371240165111">If the protocol is not <strong id="vpc_sg01_0001__b842352706195730">icmp</strong>, the value cannot be smaller than the <strong id="vpc_sg01_0001__b2089953483">port_range_min</strong> value. An empty value indicates all ports. If the protocol is <strong id="vpc_sg01_0001__b685971771">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_0001__row1745649489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.4.2.1.3.2.4.1.1 "><p id="vpc_sg01_0001__p144166029489">remote_ip_prefix</p>
</td>
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.4.2.1.3.2.4.1.2 "><p id="vpc_sg01_0001__p139601239489">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.4.2.1.3.2.4.1.3 "><ul id="vpc_sg01_0001__ul42481344125119"><li id="vpc_sg01_0001__li1424824420511">Specifies the remote IP address. If the access control direction is set to <strong>egress</strong>, the parameter specifies the source IP address. If the access control direction is set to <strong>ingress</strong>, the parameter specifies the destination IP address.</li><li id="vpc_sg01_0001__li2248184413517">The value can be in the CIDR format or IP addresses.</li><li id="vpc_sg01_0001__li9248644125119">The parameter is exclusive with parameter <strong>remote_group_id</strong>.</li></ul>
</td>
</tr>
<tr id="vpc_sg01_0001__row436879079489"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.4.2.1.3.2.4.1.1 "><p id="vpc_sg01_0001__p420105089489">remote_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.4.2.1.3.2.4.1.2 "><p id="vpc_sg01_0001__p465213149489">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.4.2.1.3.2.4.1.3 "><ul id="vpc_sg01_0001__ul12672447145118"><li id="vpc_sg01_0001__li167216475516">Specifies the ID of the peer security group.</li><li id="vpc_sg01_0001__li20672147185110">The value is exclusive with parameter <strong>remote_ip_prefix</strong>.</li></ul>
</td>
</tr>
<tr id="vpc_sg01_0001__row73928331228"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.4.2.1.3.2.4.1.1 "><p id="vpc_sg01_0001__p1146204615214">remote_address_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.4.2.1.3.2.4.1.2 "><p id="vpc_sg01_0001__p3469461328">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.4.2.1.3.2.4.1.3 "><ul id="vpc_sg01_0001__ul967819571421"><li id="vpc_sg01_0001__li106781571627">Specifies the remote IP address group ID.</li><li id="vpc_sg01_0001__li767815571025">The value is exclusive with parameters <strong id="vpc_sg01_0001__b1185142797">remote_ip_prefix</strong> and <strong id="vpc_sg01_0001__b64611932598">remote_group_id</strong>.</li></ul>
</td>
</tr>
<tr id="vpc_sg01_0001__row66316933510"><td class="cellrowborder" valign="top" width="34.143414341434145%" headers="mcps1.3.4.2.1.3.2.4.1.1 "><p id="vpc_sg01_0001__p66339133513">tenant_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.732073207320735%" headers="mcps1.3.4.2.1.3.2.4.1.2 "><p id="vpc_sg01_0001__p383982443618">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.124512451245124%" headers="mcps1.3.4.2.1.3.2.4.1.3 "><ul id="vpc_sg01_0001__ul5694239163714"><li id="vpc_sg01_0001__li1369413919374">Specifies the ID of the project to which the security group rule belongs.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="vpc_sg01_0001__ul400891789489"><li id="vpc_sg01_0001__li337832489489">Example response<pre class="screen" id="vpc_sg01_0001__screen45844363163425">{
"security_group": {
"id": "16b6e77a-08fa-42c7-aa8b-106c048884e6",
"name": "qq",
"description": "",
"vpc_id": "3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85",
"enterprise_project_id": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2",
"security_group_rules": [
{
"direction": "egress",
"ethertype": "IPv4",
"id": "369e6499-b2cb-4126-972a-97e589692c62",
"description": "",
"security_group_id": "16b6e77a-08fa-42c7-aa8b-106c048884e6"
},
{
"direction": "ingress",
"ethertype": "IPv4",
"id": "0222556c-6556-40ad-8aac-9fd5d3c06171",
"description": "",
"remote_group_id": "16b6e77a-08fa-42c7-aa8b-106c048884e6",
"security_group_id": "16b6e77a-08fa-42c7-aa8b-106c048884e6",
"remote_address_group_id": null
}
]
}
}</pre>
</li></ul>
</div>
<div class="section" id="vpc_sg01_0001__section31981619"><h4 class="sectiontitle">Status Code</h4><p id="vpc_sg01_0001__p18112112662914">See <a href="vpc_api_0002.html">Status Codes</a>.</p>
</div>
<div class="section" id="vpc_sg01_0001__section85821649202813"><h4 class="sectiontitle">Error Code</h4><p id="vpc_sg01_0001__p17281622133910">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>