Files
doc-exports/docs/css/api-ref/ChangeSecurityGroup.html
zhengxiu 8f6b8d3664 css api 25.6.0 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: zhengxiu <zhengxiu@huawei.com>
Co-committed-by: zhengxiu <zhengxiu@huawei.com>
2025-11-25 11:21:12 +00:00

139 lines
11 KiB
HTML

<a name="ChangeSecurityGroup"></a><a name="ChangeSecurityGroup"></a>
<h1 class="topictitle1">Changing the Security Group</h1>
<div id="body1708331107508"><div class="section" id="ChangeSecurityGroup__section1781973841616"><h4 class="sectiontitle">Function</h4><p id="ChangeSecurityGroup__p48201138151612">This API is used to change the security group after a cluster is created.</p>
<div class="note" id="ChangeSecurityGroup__note18820133871618"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="ChangeSecurityGroup__p58201038131614">Before changing the security group, ensure that port 9200 has been enabled. Incorrect security group configuration may cause service access failures. Exercise caution when performing this operation.</p>
</div></div>
</div>
<div class="section" id="ChangeSecurityGroup__section1182003891615"><h4 class="sectiontitle">Calling Method</h4><p id="ChangeSecurityGroup__p168201838161612">For details, see <a href="css_03_0077.html">Calling APIs</a>.</p>
</div>
<div class="section" id="ChangeSecurityGroup__section128215388163"><h4 class="sectiontitle">URI</h4><p id="ChangeSecurityGroup__p28217385162">POST /v1.0/{project_id}/clusters/{cluster_id}/sg/change</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ChangeSecurityGroup__table19821123801614" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="ChangeSecurityGroup__row0821738181613"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="ChangeSecurityGroup__p3822193811612">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="ChangeSecurityGroup__p282215384166">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="ChangeSecurityGroup__p138221638161613">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="ChangeSecurityGroup__p13822193814162">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ChangeSecurityGroup__row282193816167"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="ChangeSecurityGroup__p1582223817162">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="ChangeSecurityGroup__p48225385168">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="ChangeSecurityGroup__p1982223818168">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="ChangeSecurityGroup__p882383811166"><strong id="ChangeSecurityGroup__b138231138181618">Definition</strong>:</p>
<p id="ChangeSecurityGroup__p28236383166">Project ID. For details about how to obtain the project ID and name, see <a href="css_03_0071.html">Obtaining the Project ID and Name</a>.</p>
<p id="ChangeSecurityGroup__p48231038151610"><strong id="ChangeSecurityGroup__b138233383168">Constraints</strong>:</p>
<p id="ChangeSecurityGroup__p10823103812169">N/A</p>
<p id="ChangeSecurityGroup__p138231038111616"><strong id="ChangeSecurityGroup__b582314387163">Value range</strong>:</p>
<p id="ChangeSecurityGroup__p138231938201611">Project ID of the account.</p>
<p id="ChangeSecurityGroup__p382393819164"><strong id="ChangeSecurityGroup__b582363881610">Default value</strong>:</p>
<p id="ChangeSecurityGroup__p8823938131614">N/A</p>
</td>
</tr>
<tr id="ChangeSecurityGroup__row1821338101619"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="ChangeSecurityGroup__p128241238131618">cluster_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="ChangeSecurityGroup__p12824163818167">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="ChangeSecurityGroup__p208249386165">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="ChangeSecurityGroup__p1182414388162"><strong id="ChangeSecurityGroup__b1882414386163">Definition</strong>:</p>
<p id="ChangeSecurityGroup__p17824238191615">ID of the cluster that you want to change the security group. For details about how to obtain the cluster ID, see <a href="css_03_0101.html">Obtaining the Cluster ID</a>.</p>
<p id="ChangeSecurityGroup__p382413871620"><strong id="ChangeSecurityGroup__b13824143810162">Constraints</strong>:</p>
<p id="ChangeSecurityGroup__p15824173819166">N/A</p>
<p id="ChangeSecurityGroup__p4824143811161"><strong id="ChangeSecurityGroup__b18251938171612">Value range</strong>:</p>
<p id="ChangeSecurityGroup__p1825203812165">Cluster ID.</p>
<p id="ChangeSecurityGroup__p4825133851614"><strong id="ChangeSecurityGroup__b182563821616">Default value</strong>:</p>
<p id="ChangeSecurityGroup__p1382583812166">N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ChangeSecurityGroup__section208255386163"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ChangeSecurityGroup__request_ChangeSecurityGroupReq" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request body parameters</caption><thead align="left"><tr id="ChangeSecurityGroup__row1882553881614"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.1"><p id="ChangeSecurityGroup__p1882693841613">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.2"><p id="ChangeSecurityGroup__p11826838101614">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.3"><p id="ChangeSecurityGroup__p482613385160">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.4.2.2.5.1.4"><p id="ChangeSecurityGroup__p5826938111618">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ChangeSecurityGroup__row148257382167"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="ChangeSecurityGroup__p38263383165">security_group_ids</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="ChangeSecurityGroup__p11826238131615">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="ChangeSecurityGroup__p13826113815167">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="ChangeSecurityGroup__p11827163818169"><strong id="ChangeSecurityGroup__b1782713388165">Definition</strong>:</p>
<p id="ChangeSecurityGroup__p482733831611">Security group ID.</p>
<p id="ChangeSecurityGroup__p382733891617"><strong id="ChangeSecurityGroup__b382723811162">Constraints</strong>:</p>
<p id="ChangeSecurityGroup__p282723818166">N/A</p>
<p id="ChangeSecurityGroup__p1982763818165"><strong id="ChangeSecurityGroup__b482733810168">Value range</strong>:</p>
<p id="ChangeSecurityGroup__p1827173851620">N/A</p>
<p id="ChangeSecurityGroup__p10827163816162"><strong id="ChangeSecurityGroup__b18827103881619">Default value</strong>:</p>
<p id="ChangeSecurityGroup__p38275381165">N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ChangeSecurityGroup__section15827193861615"><h4 class="sectiontitle">Response Parameters</h4><p id="ChangeSecurityGroup__p15828173811160"><strong id="ChangeSecurityGroup__b882843831616">Status code: 200</strong></p>
<p id="ChangeSecurityGroup__p482893831618">Request succeeded.</p>
<p id="ChangeSecurityGroup__p13828143816161">None</p>
</div>
<div class="section" id="ChangeSecurityGroup__section13828123831611"><h4 class="sectiontitle">Example Requests</h4><p id="ChangeSecurityGroup__p6828163819164">Change the security group that the current cluster belongs to.</p>
<pre class="screen" id="ChangeSecurityGroup__screen108281238131612">POST https://{Endpoint}/v1.0/{project_id}/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/sg/change
{
"security_group_ids" : "b1038649-1f77-4ae9-b64d-9af56e422652"
}</pre>
</div>
<div class="section" id="ChangeSecurityGroup__section118290387168"><h4 class="sectiontitle">Example Responses</h4><p id="ChangeSecurityGroup__p882953812165">None</p>
</div>
<div class="section" id="ChangeSecurityGroup__section995993811163"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ChangeSecurityGroup__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="ChangeSecurityGroup__row128441538161617"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.8.2.1.3.1.1"><p id="ChangeSecurityGroup__p095953811610">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.8.2.1.3.1.2"><p id="ChangeSecurityGroup__p1995923851613">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ChangeSecurityGroup__row15844183871613"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="ChangeSecurityGroup__p139601338141617">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="ChangeSecurityGroup__p119606381162">Request succeeded.</p>
</td>
</tr>
<tr id="ChangeSecurityGroup__row1084416385162"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="ChangeSecurityGroup__p096053821614">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="ChangeSecurityGroup__p29603381163">Invalid request.</p>
<p id="ChangeSecurityGroup__p20960183816167">The client should not repeat the request without modifications.</p>
</td>
</tr>
<tr id="ChangeSecurityGroup__row118441938121618"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="ChangeSecurityGroup__p4960153812168">403</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="ChangeSecurityGroup__p199601538191615">Request rejected.</p>
<p id="ChangeSecurityGroup__p17960123811614">The server has received the request and understood it, but refused to respond to it. The client should not repeat the request without modifications.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ChangeSecurityGroup__section69602038121617"><h4 class="sectiontitle">Error Codes</h4><p id="ChangeSecurityGroup__p1896012382161">See <a href="css_03_0076.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="cluster_management.html">Cluster Management</a></div>
</div>
</div>