doc-exports/docs/tms/api-ref/en-us_topic_0056765936.html
Wei, Hongmin b99f77d8d1 TMS API 0721 Version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Wei, Hongmin <weihongmin1@huawei.com>
Co-committed-by: Wei, Hongmin <weihongmin1@huawei.com>
2023-08-01 07:10:13 +00:00

195 lines
20 KiB
HTML

<a name="en-us_topic_0056765936"></a><a name="en-us_topic_0056765936"></a>
<h1 class="topictitle1">Querying Predefined Tags</h1>
<div id="body8662426"><div class="section" id="en-us_topic_0056765936__sa351fa754ccd4966b11b591f3010c79a"><h4 class="sectiontitle">Function</h4><p id="en-us_topic_0056765936__en-us_topic_0056765543_p11315292">This API is used to query predefined tags.</p>
</div>
<div class="section" id="en-us_topic_0056765936__se9dc9e77f7904f9ab9c69706ad333f19"><h4 class="sectiontitle">URI</h4><p id="en-us_topic_0056765936__en-us_topic_0056765543_p17230008">GET /v1.0/predefine_tags</p>
</div>
<div class="section" id="en-us_topic_0056765936__s5b699a216bdd435b9a5e6f40c0f13404"><h4 class="sectiontitle">Request</h4><ul id="en-us_topic_0056765936__en-us_topic_0056765543_ul44407631"><li id="en-us_topic_0056765936__en-us_topic_0056765543_li64124362">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0056765936__en-us_topic_0056765543_table40248354" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters in the request</caption><thead align="left"><tr id="en-us_topic_0056765936__en-us_topic_0056765543_row24110047"><th align="left" class="cellrowborder" valign="top" width="15.89%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="en-us_topic_0056765936__en-us_topic_0056765543_p6756797"><strong id="en-us_topic_0056765936__b5323790920856">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.3%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="en-us_topic_0056765936__en-us_topic_0056765543_p10429724"><strong id="en-us_topic_0056765936__b1730337920856">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.38%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="en-us_topic_0056765936__en-us_topic_0056765543_p39501348"><strong id="en-us_topic_0056765936__b5939649820856">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.43%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="en-us_topic_0056765936__en-us_topic_0056765543_p45492604"><strong id="en-us_topic_0056765936__b4638706620856">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0056765936__en-us_topic_0056765543_row61022284"><td class="cellrowborder" valign="top" width="15.89%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p43857981">key</p>
</td>
<td class="cellrowborder" valign="top" width="16.3%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p62835574">No</p>
</td>
<td class="cellrowborder" valign="top" width="16.38%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p56516768">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.43%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="en-us_topic_0056765936__p4719145472213">Specifies the key.</p>
<p id="en-us_topic_0056765936__en-us_topic_0056765543_p14455523">Supports fuzzy search and is case insensitive. If this parameter value contains non-URL-safe characters, it must be URL encoded.</p>
</td>
</tr>
<tr id="en-us_topic_0056765936__en-us_topic_0056765543_row62990845"><td class="cellrowborder" valign="top" width="15.89%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p1984791">value</p>
</td>
<td class="cellrowborder" valign="top" width="16.3%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p26550365">No</p>
</td>
<td class="cellrowborder" valign="top" width="16.38%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p3095993">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.43%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="en-us_topic_0056765936__p5841031235">Specifies the value.</p>
<p id="en-us_topic_0056765936__en-us_topic_0056765543_p49448848">Supports fuzzy search and is case insensitive. If this parameter value contains non-URL-safe characters, it must be URL encoded.</p>
</td>
</tr>
<tr id="en-us_topic_0056765936__en-us_topic_0056765543_row42386454"><td class="cellrowborder" valign="top" width="15.89%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p10750772">limit</p>
</td>
<td class="cellrowborder" valign="top" width="16.3%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p65506178">No</p>
</td>
<td class="cellrowborder" valign="top" width="16.38%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p4400168">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="51.43%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="en-us_topic_0056765936__p90800982096">Specifies the number of query records.</p>
<p id="en-us_topic_0056765936__en-us_topic_0056765543_p20869327">The value ranges from <strong id="en-us_topic_0056765936__b84235270611458">1</strong> to <strong id="en-us_topic_0056765936__b8423527061151">1000</strong>. If no value is specified, the value is <strong id="en-us_topic_0056765936__b8423527061155">10</strong> by default. If the value is set to <strong id="en-us_topic_0056765936__b84235270611512">0</strong>, the number of query records is not limited.</p>
</td>
</tr>
<tr id="en-us_topic_0056765936__en-us_topic_0056765543_row53606218"><td class="cellrowborder" valign="top" width="15.89%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p47136405">marker</p>
</td>
<td class="cellrowborder" valign="top" width="16.3%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p59952436">No</p>
</td>
<td class="cellrowborder" valign="top" width="16.38%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p24309136">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.43%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="en-us_topic_0056765936__p718100820917">Specifies the paging location identifier (index).</p>
<p id="en-us_topic_0056765936__p3142903120935">The query starts from the next piece of data indexed by this parameter.</p>
<div class="note" id="en-us_topic_0056765936__note1181112820945"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="en-us_topic_0056765936__p1236117409159">When querying the data on the first page, you do not need to specify this parameter. When querying the data on subsequent pages, set this parameter to the value in the response body returned by querying data of the previous page. When the returned <strong id="en-us_topic_0056765936__b63194200110">tags</strong> is an empty list, the last page has been queried.</p>
</div></div>
</td>
</tr>
<tr id="en-us_topic_0056765936__row6411200918469"><td class="cellrowborder" valign="top" width="15.89%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="en-us_topic_0056765936__p44855268184630">order_field</p>
</td>
<td class="cellrowborder" valign="top" width="16.3%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="en-us_topic_0056765936__p44396523184643">No</p>
</td>
<td class="cellrowborder" valign="top" width="16.38%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="en-us_topic_0056765936__p48098095184648">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.43%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="en-us_topic_0056765936__p4423127210758">Specifies the field for sorting.</p>
<p id="en-us_topic_0056765936__p5625456010755">The parameter value is case sensitive and can be <strong id="en-us_topic_0056765936__b842352706154035">update_time</strong>, <strong id="en-us_topic_0056765936__b842352706154038">key</strong>, or <strong id="en-us_topic_0056765936__b842352706154042">value</strong>.</p>
<p id="en-us_topic_0056765936__p61309029151611">Its default value is <strong id="en-us_topic_0056765936__b67084326151611">update_time</strong>.</p>
<p id="en-us_topic_0056765936__p50024018222837">You can choose only one of the three values and based on the value of <strong id="en-us_topic_0056765936__b842352706144716">order_method</strong> to sort the remaining two default fields.</p>
<p id="en-us_topic_0056765936__p6032547810755">For example:</p>
<ul id="en-us_topic_0056765936__ul4769660110812"><li id="en-us_topic_0056765936__li5287192010812">If <strong id="en-us_topic_0056765936__b842352706145014">order_field</strong> is set to <strong id="en-us_topic_0056765936__b842352706145022">update_time</strong>, both <strong id="en-us_topic_0056765936__b842352706145046">key</strong> and <strong id="en-us_topic_0056765936__b842352706145049">value</strong> are sorted in the ascending order.</li><li id="en-us_topic_0056765936__li695065410812">If <strong id="en-us_topic_0056765936__b118265127514518">order_field</strong> is set to <strong id="en-us_topic_0056765936__b8457024314518">key</strong>, <strong id="en-us_topic_0056765936__b842352706145220">update_time</strong> is sorted in the descending order, and <strong id="en-us_topic_0056765936__b842352706145227">value</strong> is sorted in the ascending order.</li><li id="en-us_topic_0056765936__li5849709310812">If <strong id="en-us_topic_0056765936__b110479522">order_field</strong> is set to <strong id="en-us_topic_0056765936__b81028253">value</strong>, <strong id="en-us_topic_0056765936__b84235270614533">update_time</strong> is sorted in the descending order, and <strong id="en-us_topic_0056765936__b84235270614537">key</strong> is sorted in the ascending order.</li><li id="en-us_topic_0056765936__li3455001510812">If <strong id="en-us_topic_0056765936__b988046015922">order_field</strong> is not specified, its default value <strong id="en-us_topic_0056765936__b66377750151114">update_time</strong> is taken. In this case, <strong id="en-us_topic_0056765936__b6211983515922">key</strong> and <strong id="en-us_topic_0056765936__b2220761115922">value</strong> are sorted in the ascending order.</li></ul>
</td>
</tr>
<tr id="en-us_topic_0056765936__row2229804318465"><td class="cellrowborder" valign="top" width="15.89%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="en-us_topic_0056765936__p31639816184658">order_method</p>
</td>
<td class="cellrowborder" valign="top" width="16.3%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="en-us_topic_0056765936__p13692318465">No</p>
</td>
<td class="cellrowborder" valign="top" width="16.38%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="en-us_topic_0056765936__p40935226184651">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.43%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="en-us_topic_0056765936__p5246838910935">Specifies the sorting method of the <strong id="en-us_topic_0056765936__b479923793315">order_field</strong> field.</p>
<p id="en-us_topic_0056765936__p93153345115">The method can be (case sensitive):</p>
<ul id="en-us_topic_0056765936__ul1952353612116"><li id="en-us_topic_0056765936__li19612638710"><strong id="en-us_topic_0056765936__b5185193514248">asc</strong>: ascending order</li><li id="en-us_topic_0056765936__li1523436715"><strong id="en-us_topic_0056765936__b732944042416">desc</strong>: descending order</li></ul>
<p id="en-us_topic_0056765936__p183581356918">Only one of the preceding sorting methods can be selected.</p>
<p id="en-us_topic_0056765936__p2169536710933">If this parameter is not specified, the default value is <strong id="en-us_topic_0056765936__b191910498235">desc</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0056765936__en-us_topic_0056765543_ul41580444"><li id="en-us_topic_0056765936__en-us_topic_0056765543_li38679683">Example request<pre class="codeblock" id="en-us_topic_0056765936__codeblock1289722023215"><strong id="en-us_topic_0056765936__b58251843105611">GET https://{</strong><em id="en-us_topic_0056765936__i1459314845617">TMS endpoint</em><strong id="en-us_topic_0056765936__b0977195315618">}/v1.0/predefine_tags?key=ENV&amp;value=DEV&amp;limit=10&amp;marker=9&amp;order_field=key&amp;order_method=asc</strong></pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0056765936__s3e892fc1908b44cc928a547dea06b281"><h4 class="sectiontitle">Response</h4><ul id="en-us_topic_0056765936__en-us_topic_0056765543_ul11766267"><li id="en-us_topic_0056765936__en-us_topic_0056765543_li38787544">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0056765936__en-us_topic_0056765543_table13543581" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameters in the response</caption><thead align="left"><tr id="en-us_topic_0056765936__en-us_topic_0056765543_row54764719"><th align="left" class="cellrowborder" valign="top" width="24.147585241475852%" id="mcps1.3.4.2.1.1.2.4.1.1"><p id="en-us_topic_0056765936__en-us_topic_0056765543_p6757235"><strong id="en-us_topic_0056765936__b8581806201024">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="37.92620737926208%" id="mcps1.3.4.2.1.1.2.4.1.2"><p id="en-us_topic_0056765936__en-us_topic_0056765543_p10465156"><strong id="en-us_topic_0056765936__b24037706201024">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="37.92620737926208%" id="mcps1.3.4.2.1.1.2.4.1.3"><p id="en-us_topic_0056765936__en-us_topic_0056765543_p42371273"><strong id="en-us_topic_0056765936__b897203201024">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0056765936__en-us_topic_0056765543_row9521066"><td class="cellrowborder" valign="top" width="24.147585241475852%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p33008913">tags</p>
</td>
<td class="cellrowborder" valign="top" width="37.92620737926208%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="en-us_topic_0056765936__p51676625185015">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="37.92620737926208%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p11174282">Specifies the tags.</p>
<p id="en-us_topic_0056765936__p193646415165">For details, see <a href="#en-us_topic_0056765936__en-us_topic_0056765543_table36783718">Table 3</a>.</p>
</td>
</tr>
<tr id="en-us_topic_0056765936__en-us_topic_0056765543_row33459681"><td class="cellrowborder" valign="top" width="24.147585241475852%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p25879650">total_count</p>
</td>
<td class="cellrowborder" valign="top" width="37.92620737926208%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p15876907">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="37.92620737926208%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p10961125">Specifies the total number of tags that meet the filtering criteria, which is not affected by pagination.</p>
</td>
</tr>
<tr id="en-us_topic_0056765936__en-us_topic_0056765543_row31541268"><td class="cellrowborder" valign="top" width="24.147585241475852%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p4705914">marker</p>
</td>
<td class="cellrowborder" valign="top" width="37.92620737926208%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p45634724">String</p>
</td>
<td class="cellrowborder" valign="top" width="37.92620737926208%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="en-us_topic_0056765936__p39030128201034">Specifies the paging location identifier.</p>
<p id="en-us_topic_0056765936__en-us_topic_0056765543_p5425146">It indicates the location of the last query record.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="en-us_topic_0056765936__en-us_topic_0056765543_li48826322"><strong id="en-us_topic_0056765936__b842352706143643">tags</strong> field description
<div class="tablenoborder"><a name="en-us_topic_0056765936__en-us_topic_0056765543_table36783718"></a><a name="en-us_topic_0056765543_table36783718"></a><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0056765936__en-us_topic_0056765543_table36783718" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameter description</caption><thead align="left"><tr id="en-us_topic_0056765936__en-us_topic_0056765543_row33607346"><th align="left" class="cellrowborder" valign="top" width="23.799999999999997%" id="mcps1.3.4.2.2.2.2.4.1.1"><p id="en-us_topic_0056765936__en-us_topic_0056765543_p37840511"><strong id="en-us_topic_0056765936__b15845101465213">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.09%" id="mcps1.3.4.2.2.2.2.4.1.2"><p id="en-us_topic_0056765936__en-us_topic_0056765543_p45182569"><strong id="en-us_topic_0056765936__b2101190025">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="48.11%" id="mcps1.3.4.2.2.2.2.4.1.3"><p id="en-us_topic_0056765936__en-us_topic_0056765543_p35909463"><strong id="en-us_topic_0056765936__b527216793">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0056765936__en-us_topic_0056765543_row22985394"><td class="cellrowborder" valign="top" width="23.799999999999997%" headers="mcps1.3.4.2.2.2.2.4.1.1 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p49877601">key</p>
</td>
<td class="cellrowborder" valign="top" width="28.09%" headers="mcps1.3.4.2.2.2.2.4.1.2 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p13553869">String</p>
</td>
<td class="cellrowborder" valign="top" width="48.11%" headers="mcps1.3.4.2.2.2.2.4.1.3 "><p id="en-us_topic_0056765936__p108587120631">Specifies the key.</p>
<p id="en-us_topic_0056765936__p16424462153146">It cannot be left blank and can contain a maximum of 36 Unicode characters. Only digits, letters, hyphens (-), and underscores (_) are allowed.</p>
</td>
</tr>
<tr id="en-us_topic_0056765936__en-us_topic_0056765543_row15767494"><td class="cellrowborder" valign="top" width="23.799999999999997%" headers="mcps1.3.4.2.2.2.2.4.1.1 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p2098632">value</p>
</td>
<td class="cellrowborder" valign="top" width="28.09%" headers="mcps1.3.4.2.2.2.2.4.1.2 "><p id="en-us_topic_0056765936__en-us_topic_0056765543_p35771490">String</p>
</td>
<td class="cellrowborder" valign="top" width="48.11%" headers="mcps1.3.4.2.2.2.2.4.1.3 "><p id="en-us_topic_0056765936__p2486891184110">Specifies the value.</p>
<p id="en-us_topic_0056765936__p10159585153243">Each value contains a maximum of 43 Unicode characters and can be an empty string. Only digits, letters, hyphens (-), and underscores (_) are allowed.</p>
</td>
</tr>
<tr id="en-us_topic_0056765936__row13791973185143"><td class="cellrowborder" valign="top" width="23.799999999999997%" headers="mcps1.3.4.2.2.2.2.4.1.1 "><p id="en-us_topic_0056765936__p20931513185145">update_time</p>
</td>
<td class="cellrowborder" valign="top" width="28.09%" headers="mcps1.3.4.2.2.2.2.4.1.2 "><p id="en-us_topic_0056765936__p4585322185157">String</p>
</td>
<td class="cellrowborder" valign="top" width="48.11%" headers="mcps1.3.4.2.2.2.2.4.1.3 "><p id="en-us_topic_0056765936__p1338498018524">Specifies the update time, which must be the UTC time, for example, <strong id="en-us_topic_0056765936__b1596523515713">2016-12-09T00:00:00Z</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0056765936__ul60573598105438"><li id="en-us_topic_0056765936__li8291477105438">Example response<pre class="screen" id="en-us_topic_0056765936__screen6608432318552">{
"marker": "12",
"total_count": 13,
"tags": [
{
"key": "ENV1",
"value": "DEV1",
"update_time": "2017-04-12T14:22:34Z"
},
{
"key": "ENV2",
"value": "DEV2",
"update_time": "2017-04-12T14:22:34Z"
}
]
}</pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0056765936__section17789101582315"><h4 class="sectiontitle">Status Codes</h4><p id="en-us_topic_0056765936__p145228330242">See <a href="en-us_topic_0130578970.html">Status Codes</a>.</p>
</div>
<div class="section" id="en-us_topic_0056765936__section18604165622519"><h4 class="sectiontitle">Error Codes</h4><p id="en-us_topic_0056765936__p177044331253">See <a href="en-us_topic_0057939857.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0133313258.html">Predefined Tag Operations</a></div>
</div>
</div>