doc-exports/docs/dli/api-ref/dli_02_0191.html
Su, Xiaomeng 57a0d535be dli_api_0910_version_api
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
2023-10-16 22:01:57 +00:00

141 lines
10 KiB
HTML

<a name="dli_02_0191"></a><a name="dli_02_0191"></a>
<h1 class="topictitle1">Binding a Queue</h1>
<div id="body1565767253379"><div class="section" id="dli_02_0191__section13287428103611"><h4 class="sectiontitle">Function</h4><p id="dli_02_0191__p1798441817329">This API is used to bind a queue to a created enhanced datasource connection.</p>
</div>
<div class="section" id="dli_02_0191__section52924285361"><h4 class="sectiontitle">URI</h4><ul id="dli_02_0191__ul1547562815364"><li id="dli_02_0191__li1847520284363">URI format<p id="dli_02_0191__p8475152813362"><a name="dli_02_0191__li1847520284363"></a><a name="li1847520284363"></a>POST /v2.0/{project_id}/datasource/enhanced-connections/{connection_id}/associate-queue</p>
</li><li id="dli_02_0191__li1047502816366">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0191__table18299172853614" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameters</caption><thead align="left"><tr id="dli_02_0191__row947592853614"><th align="left" class="cellrowborder" valign="top" width="17.89178917891789%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="dli_02_0191__p1347513282368">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.77137713771377%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="dli_02_0191__p74757287366">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="11.391139113911391%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="dli_02_0191__p1779481331612">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="56.94569456945695%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="dli_02_0191__p1475182833610">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0191__row16475152833619"><td class="cellrowborder" valign="top" width="17.89178917891789%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="dli_02_0191__p1547552803615">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="13.77137713771377%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="dli_02_0191__p19475828123613">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="11.391139113911391%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="dli_02_0191__p679441311616">String</p>
</td>
<td class="cellrowborder" valign="top" width="56.94569456945695%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="dli_02_0191__p1310472724012">Project ID, which is used for resource isolation. For details about how to obtain its value, see <a href="dli_02_0183.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="dli_02_0191__row1758412516020"><td class="cellrowborder" valign="top" width="17.89178917891789%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="dli_02_0191__p84192317188">connection_id</p>
</td>
<td class="cellrowborder" valign="top" width="13.77137713771377%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="dli_02_0191__p1941914313180">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="11.391139113911391%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="dli_02_0191__p177941213151614">String</p>
</td>
<td class="cellrowborder" valign="top" width="56.94569456945695%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="dli_02_0191__p94197315183">Connection ID. Identifies the UUID of a datasource connection. Set the value to the connection ID returned by <a href="dli_02_0187.html">Creating an Enhanced Datasource Connection</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="dli_02_0191__section1831452873613"><h4 class="sectiontitle">Request</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0191__table965315377819" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="dli_02_0191__row3654123717814"><th align="left" class="cellrowborder" valign="top" width="17.89178917891789%" id="mcps1.3.3.2.2.5.1.1"><p id="dli_02_0191__p1265453712813">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.77137713771377%" id="mcps1.3.3.2.2.5.1.2"><p id="dli_02_0191__p9654237585">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.49124912491249%" id="mcps1.3.3.2.2.5.1.3"><p id="dli_02_0191__p19937461398">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="55.84558455845584%" id="mcps1.3.3.2.2.5.1.4"><p id="dli_02_0191__p265416379818">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0191__row7654203716810"><td class="cellrowborder" valign="top" width="17.89178917891789%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0191__p15107358183">queues</p>
</td>
<td class="cellrowborder" valign="top" width="13.77137713771377%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0191__p8107558589">No</p>
</td>
<td class="cellrowborder" valign="top" width="12.49124912491249%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0191__p14937126595">Array of Strings</p>
</td>
<td class="cellrowborder" valign="top" width="55.84558455845584%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0191__p181078586810">List of queue names that are available for datasource connections.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dli_02_0191__section134515287360"><h4 class="sectiontitle">Response</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0191__table8348112818368" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameters</caption><thead align="left"><tr id="dli_02_0191__row11478132863610"><th align="left" class="cellrowborder" valign="top" width="15.4%" id="mcps1.3.4.2.2.4.1.1"><p id="dli_02_0191__p04782028173616">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.65%" id="mcps1.3.4.2.2.4.1.2"><p id="dli_02_0191__p34781128193612">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="65.95%" id="mcps1.3.4.2.2.4.1.3"><p id="dli_02_0191__p1347917286364">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0191__row18479182813362"><td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.4.2.2.4.1.1 "><p id="dli_02_0191__p392161273513">is_success</p>
</td>
<td class="cellrowborder" valign="top" width="18.65%" headers="mcps1.3.4.2.2.4.1.2 "><p id="dli_02_0191__p18921161219357">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="65.95%" headers="mcps1.3.4.2.2.4.1.3 "><p id="dli_02_0191__p12921712163514">Indicates whether the request is successfully executed. Value <strong id="dli_02_0191__b7556151511110">true</strong> indicates that the request is successfully executed.</p>
</td>
</tr>
<tr id="dli_02_0191__row14946145019340"><td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.4.2.2.4.1.1 "><p id="dli_02_0191__p692141213515">message</p>
</td>
<td class="cellrowborder" valign="top" width="18.65%" headers="mcps1.3.4.2.2.4.1.2 "><p id="dli_02_0191__p6921012133518">String</p>
</td>
<td class="cellrowborder" valign="top" width="65.95%" headers="mcps1.3.4.2.2.4.1.3 "><p id="dli_02_0191__p1921161214351">System prompt. If execution succeeds, the message may be left blank.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dli_02_0191__section1217010661112"><h4 class="sectiontitle">Example Request</h4><p id="dli_02_0191__p177040525413">Bind created enhanced datasource connections to queues <strong id="dli_02_0191__b2350154731512">q1</strong> and <strong id="dli_02_0191__b77045506156">q2</strong>.</p>
<pre class="screen" id="dli_02_0191__screen165944614370">{
"queues": [
"q1",
"q2"
]
}</pre>
</div>
<div class="section" id="dli_02_0191__section910624615450"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="dli_02_0191__screen587751511378">{
"is_success": true,
"message": "associated peer connection for queues: {q1,q2}."
}</pre>
</div>
<div class="section" id="dli_02_0191__sf39cfd445ad24e9e82754fcb0027179d"><h4 class="sectiontitle">Status Codes</h4><p id="dli_02_0191__a04144ca3a08e4576b386c6a98f43a2ae"><a href="#dli_02_0191__tb12870f1c5f24b27abd55ca24264af36">Table 4</a> describes the status code.</p>
<div class="tablenoborder"><a name="dli_02_0191__tb12870f1c5f24b27abd55ca24264af36"></a><a name="tb12870f1c5f24b27abd55ca24264af36"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0191__tb12870f1c5f24b27abd55ca24264af36" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Status codes</caption><thead align="left"><tr id="dli_02_0191__r8d54231f95b14c01a5e55e95f3b2e838"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.7.3.2.3.1.1"><p id="dli_02_0191__ab49d21f312644072a331f43e92baf853">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="70%" id="mcps1.3.7.3.2.3.1.2"><p id="dli_02_0191__aea1d3bd107bb4c499da79a88832d256c">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0191__r211ad4eb571d4d938e5579998723174e"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0191__a3153e07b3a9749adba92599fe6628fbf">200</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0191__p104431642124811">Resource bound succeeded. </p>
</td>
</tr>
<tr id="dli_02_0191__row44937531727"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0191__p184941532219">400</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0191__p2049413539219">Request error.</p>
</td>
</tr>
<tr id="dli_02_0191__row65331212142411"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0191__p5537171216249">500</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0191__p953813124249">Internal service error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dli_02_0191__section13596141025715"><h4 class="sectiontitle">Error Codes</h4><p id="dli_02_0191__p420584425712">If an error occurs when this API is invoked, the system does not return the result similar to the preceding example, but returns the error code and error information. For details, see <a href="dli_02_0056.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_02_0186.html">APIs Related to Enhanced Datasource Connections</a></div>
</div>
</div>