doc-exports/docs/rds/api-ref/rds_01_0006.html
Wang , Deng Ke 5208dcae7b RDS API 20221104 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com>
Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
2022-11-10 09:55:48 +00:00

115 lines
10 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="rds_01_0006"></a><a name="rds_01_0006"></a>
<h1 class="topictitle1">Adding a Tag</h1>
<div id="body8662426"><div class="section" id="rds_01_0006__sdb96d603244345c391f4b5ebd12a22fa"><h4 class="sectiontitle">Function</h4><p id="rds_01_0006__en-us_topic_0091754391_p33831530">This API is used to add a tag to a DB instance.</p>
</div>
<div class="section" id="rds_01_0006__sf61442e26fcc4259a131c02dee020a10"><h4 class="sectiontitle">URI</h4><ul id="rds_01_0006__en-us_topic_0091754391_ul55999443"><li id="rds_01_0006__en-us_topic_0091754391_li34232944">URI format<p id="rds_01_0006__en-us_topic_0091754391_p39661040"><a name="rds_01_0006__en-us_topic_0091754391_li34232944"></a><a name="en-us_topic_0091754391_li34232944"></a>PATH: /v1/{project_id}/rds/{instanceId}/tags</p>
<p id="rds_01_0006__a24f3e4a2107e4bba916c8f364a3087a7">Method: POST</p>
</li><li id="rds_01_0006__en-us_topic_0091754391_li21405046">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_01_0006__en-us_topic_0091754391_table58427690" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="rds_01_0006__en-us_topic_0091754391_row1482002"><th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.2.2.2.1.2.4.1.1"><p id="rds_01_0006__en-us_topic_0091754391_p52933326"><strong id="rds_01_0006__en-us_topic_0091754391_b84235270691445">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.2.2.2.1.2.4.1.2"><p id="rds_01_0006__en-us_topic_0091754391_p59740974"><strong id="rds_01_0006__en-us_topic_0091754391_b842352706102346">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="57.99999999999999%" id="mcps1.3.2.2.2.1.2.4.1.3"><p id="rds_01_0006__en-us_topic_0091754391_p7180698"><strong id="rds_01_0006__en-us_topic_0091754391_b842352706163417">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_01_0006__en-us_topic_0091754391_row44765691"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="rds_01_0006__en-us_topic_0091754391_p2142393">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="rds_01_0006__en-us_topic_0091754391_p39316155">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="57.99999999999999%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="rds_01_0006__en-us_topic_0091754391_p30492010">Specifies the project ID of a tenant in a region.</p>
</td>
</tr>
<tr id="rds_01_0006__en-us_topic_0091754391_row5992637"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="rds_01_0006__en-us_topic_0091754391_p15641626">instanceId</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="rds_01_0006__en-us_topic_0091754391_p59012183">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="57.99999999999999%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="rds_01_0006__p7417132564016">Specifies the primary node ID of the DB instance.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="rds_01_0006__en-us_topic_0091754391_ul27898002"><li id="rds_01_0006__l59bbf4caeedd41b38fb78545829b652f">Restrictions<ul id="rds_01_0006__u9e84fc8ca6e0426891fdc87106c07ee3"><li id="rds_01_0006__l4e21c7d0af2745e8b55971854ae0346c">A maximum of 20 tags can be added for each DB instance. The tag key must be unique.</li><li id="rds_01_0006__li11717121313558">If the key in the request body is the same as an existing key in the specified DB instance, the value of the key is overwritten.</li><li id="rds_01_0006__l0f020452533b4bceacb250a86ae352d4">Standby DB instances do not support tag adding.</li></ul>
</li></ul>
</div>
<div class="section" id="rds_01_0006__s09d438844e694f72b12fc288c723116a"><h4 class="sectiontitle">Request</h4><ul id="rds_01_0006__u001e149348604f4090110110817a1112"><li id="rds_01_0006__l9761b2ad053545a7a7185a665b7cfbff">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_01_0006__te7f01ccb355a4f29a1a97bea177cc736" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="rds_01_0006__r1d2e972ffada4dd7be764ebfa5663add"><th align="left" class="cellrowborder" valign="top" width="22%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="rds_01_0006__a40b2b823012a4d6c8da07baa32d6a263"><strong id="rds_01_0006__b1658597578">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="rds_01_0006__a61de8d6c3e1641b5ad4b6acab98c5481"><strong id="rds_01_0006__b268212627">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="rds_01_0006__a61b7a35f766c43abb8fb7264a42b0364"><strong id="rds_01_0006__en-us_topic_0091754391_b842352706164541">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="42%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="rds_01_0006__ae587cc1de1d84c97a12c5031d2b53a53"><strong id="rds_01_0006__b141457549">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_01_0006__ree816e332a0a4172a254e355bbaa7734"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="rds_01_0006__ad71579417ad24b1aa1621e885ff73f38">tag</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="rds_01_0006__a62aeed04cd364a9481c3269d54dda6f5">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="rds_01_0006__af79610cdc59c4d20a1ea874e087c9662">Dictionary data structure. For details, see <a href="#rds_01_0006__teb132a9896b14904b643d3159d0c06eb">Table 3</a>.</p>
</td>
<td class="cellrowborder" valign="top" width="42%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="rds_01_0006__a164aa9b6ed6f4d20a34b354446c9be00">Specifies the tag information.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="rds_01_0006__teb132a9896b14904b643d3159d0c06eb"></a><a name="teb132a9896b14904b643d3159d0c06eb"></a><table cellpadding="4" cellspacing="0" summary="" id="rds_01_0006__teb132a9896b14904b643d3159d0c06eb" frame="border" border="1" rules="all"><caption><b>Table 3 </b>tag field data structure description</caption><thead align="left"><tr id="rds_01_0006__r205f2a4045b24af7bfbe9a7542aa07aa"><th align="left" class="cellrowborder" valign="top" width="22%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="rds_01_0006__ac93bd30b77444614884618eb51b6d66a"><strong id="rds_01_0006__b360994920">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="rds_01_0006__aca36c6e0753c4472a37da4fd1a14d498"><strong id="rds_01_0006__b1003120395">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="rds_01_0006__ad77f9074312f4e0eb280a9f2053986ac"><strong id="rds_01_0006__b1336592741">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="42%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="rds_01_0006__aeabe62f6ada64b35a7cf47c0100b800c"><strong id="rds_01_0006__b1755746050">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_01_0006__r46e744ec5f4f42e1b8fbb38ed61fe49b"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="rds_01_0006__a7ccf99b01cbe4d03ae33e405286a25ea">key</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="rds_01_0006__ab11d8114c8dc45a2b22a63be35799395">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="rds_01_0006__ac7a918d5d8e3418b8836f6d7ccde7146">String</p>
</td>
<td class="cellrowborder" valign="top" width="42%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="rds_01_0006__a88527f11e625412d85ede0d88559c1d9">Specifies the tag key.</p>
<p id="rds_01_0006__a371449e7ea214290915083393b3224f4">Its value cannot be empty and must be 1 to 36 Unicode characters in length. It cannot contain nonprintable ASCII characters (031) and the following special characters: *&lt;&gt;\=</p>
</td>
</tr>
<tr id="rds_01_0006__r4a2647fcd1cd4ffd962c1259e00434a6"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="rds_01_0006__afc9ec9d0e20a45beb6b5ae95ecba77d2">value</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="rds_01_0006__a10261134ed3a4648be213560ea5aefd9">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="rds_01_0006__a9303a484901b4e15a84aed1ed75013a2">String</p>
</td>
<td class="cellrowborder" valign="top" width="42%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="rds_01_0006__adfe36c1c74934a85a6fb050c28a15027">Specifies the tag value.</p>
<p id="rds_01_0006__a3ae0e5212c2a406bb60d9c0add4280d2">Its value can be empty or 1 to 43 Unicode characters in length. It cannot contain nonprintable ASCII characters (031) and the following special characters: *&lt;&gt;\=</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="rds_01_0006__l942697549234470f9e2b41533149c8ab">Request example<pre class="codeblock" id="rds_01_0006__c0cb88c9903e8420394a771510d3cbdca">{
"tag":
{
"key": "ENV",
"value":"DEV"
}
}</pre>
</li></ul>
</div>
<div class="section" id="rds_01_0006__s6499f6b27f174646b4d1b864e8588c72"><h4 class="sectiontitle">Normal Response</h4><pre class="codeblock" id="rds_01_0006__cd018a647874641e6b69ca591949ab6ee">{}</pre>
</div>
<div class="section" id="rds_01_0006__s11e128e8e77a46e6aea356c44f891de4"><h4 class="sectiontitle">Abnormal Response</h4><p id="rds_01_0006__en-us_topic_0091754391_p46896054">For details, see <a href="en-us_topic_0032488197.html">Abnormal Request Results</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rds_01_0005.html">Tag Management</a></div>
</div>
</div>