doc-exports/docs/dli/api-ref/dli_02_0187.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

272 lines
19 KiB
HTML

<a name="dli_02_0187"></a><a name="dli_02_0187"></a>
<h1 class="topictitle1">Creating an Enhanced Datasource Connection</h1>
<div id="body1565767253378"><div class="section" id="dli_02_0187__section13287428103611"><h4 class="sectiontitle">Function</h4><p id="dli_02_0187__p184751628133613">This API is used to create an enhanced datasource connection with other services.</p>
</div>
<div class="section" id="dli_02_0187__section52924285361"><h4 class="sectiontitle">URI</h4><ul id="dli_02_0187__ul1547562815364"><li id="dli_02_0187__li1847520284363">URI format<p id="dli_02_0187__p8475152813362"><a name="dli_02_0187__li1847520284363"></a><a name="li1847520284363"></a>POST /v2.0/{project_id}/datasource/enhanced-connections</p>
</li><li id="dli_02_0187__li1047502816366">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0187__table18299172853614" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameter</caption><thead align="left"><tr id="dli_02_0187__row947592853614"><th align="left" class="cellrowborder" valign="top" width="13.459999999999999%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="dli_02_0187__p1347513282368">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.120000000000001%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="dli_02_0187__p74757287366">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.44%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="dli_02_0187__p643725118133">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60.980000000000004%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="dli_02_0187__p1475182833610">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0187__row16475152833619"><td class="cellrowborder" valign="top" width="13.459999999999999%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="dli_02_0187__p1547552803615">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="12.120000000000001%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="dli_02_0187__p19475828123613">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="13.44%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="dli_02_0187__p74381051191312">String</p>
</td>
<td class="cellrowborder" valign="top" width="60.980000000000004%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="dli_02_0187__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>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="dli_02_0187__section1831452873613"><h4 class="sectiontitle">Request</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0187__table19317132814368" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="dli_02_0187__row6476182803617"><th align="left" class="cellrowborder" valign="top" width="16.07%" id="mcps1.3.3.2.2.5.1.1"><p id="dli_02_0187__p7476142811364">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.55%" id="mcps1.3.3.2.2.5.1.2"><p id="dli_02_0187__p16476102818360">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.61%" id="mcps1.3.3.2.2.5.1.3"><p id="dli_02_0187__p147652813365">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="57.769999999999996%" id="mcps1.3.3.2.2.5.1.4"><p id="dli_02_0187__p447622833612">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0187__row4179115221218"><td class="cellrowborder" valign="top" width="16.07%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0187__p1859310416134">name</p>
</td>
<td class="cellrowborder" valign="top" width="9.55%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0187__p1259316417131">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0187__p15935415137">String</p>
</td>
<td class="cellrowborder" valign="top" width="57.769999999999996%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0187__p135938431310">Name of the connection.</p>
<ul id="dli_02_0187__ul12275181465516"><li id="dli_02_0187__li19275191415554">The name can contain only letters, digits, and underscores (_), and cannot be left empty.</li><li id="dli_02_0187__li650641665511">A maximum of 64 characters are allowed.</li></ul>
</td>
</tr>
<tr id="dli_02_0187__row11476132833616"><td class="cellrowborder" valign="top" width="16.07%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0187__p1985012475115">dest_vpc_id</p>
</td>
<td class="cellrowborder" valign="top" width="9.55%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0187__p8849747141118">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0187__p1884834715115">String</p>
</td>
<td class="cellrowborder" valign="top" width="57.769999999999996%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0187__p15848194710119">The ID of the service VPC to be connected. </p>
</td>
</tr>
<tr id="dli_02_0187__row17476828143615"><td class="cellrowborder" valign="top" width="16.07%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0187__p4844447161110">dest_network_id</p>
</td>
<td class="cellrowborder" valign="top" width="9.55%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0187__p14844204719110">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0187__p6842104751111">String</p>
</td>
<td class="cellrowborder" valign="top" width="57.769999999999996%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0187__p138427472111">The subnet ID of the to-be-connected service. </p>
</td>
</tr>
<tr id="dli_02_0187__row1247712814367"><td class="cellrowborder" valign="top" width="16.07%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0187__p498344792918">queues</p>
</td>
<td class="cellrowborder" valign="top" width="9.55%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0187__p1498310477294">No</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0187__p1983547122917">Array of Strings</p>
</td>
<td class="cellrowborder" valign="top" width="57.769999999999996%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0187__p0983047142912">List of queue names that are available for datasource connections.</p>
</td>
</tr>
<tr id="dli_02_0187__row16741853175312"><td class="cellrowborder" valign="top" width="16.07%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0187__p1867495316535">routetable_id</p>
</td>
<td class="cellrowborder" valign="top" width="9.55%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0187__p1067516530539">No</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0187__p96751253165314">String</p>
</td>
<td class="cellrowborder" valign="top" width="57.769999999999996%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0187__p18675105355317">Route table associated with the subnet of the service.</p>
</td>
</tr>
<tr id="dli_02_0187__row162815152014"><td class="cellrowborder" valign="top" width="16.07%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0187__p11282111513119">hosts</p>
</td>
<td class="cellrowborder" valign="top" width="9.55%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0187__p15282191514119">No</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0187__p1828271516112">Array of Objects</p>
</td>
<td class="cellrowborder" valign="top" width="57.769999999999996%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0187__p1228216154115">The user-defined host information. A maximum of 20,000 records are supported. For details, see <a href="#dli_02_0187__table6991727151310">hosts request parameters</a>.</p>
</td>
</tr>
<tr id="dli_02_0187__row1092994216315"><td class="cellrowborder" valign="top" width="16.07%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0187__p19605849173113">tags</p>
</td>
<td class="cellrowborder" valign="top" width="9.55%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0187__p8605194923113">No</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0187__p11605164913118">Array of Objects</p>
</td>
<td class="cellrowborder" valign="top" width="57.769999999999996%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0187__p860644917311">Tags of datasource connections. For details, see <a href="#dli_02_0187__table9391124139">Table 4</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="dli_02_0187__table6991727151310"></a><a name="table6991727151310"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0187__table6991727151310" frame="border" border="1" rules="all"><caption><b>Table 3 </b>hosts request parameters</caption><thead align="left"><tr id="dli_02_0187__row159942715132"><th align="left" class="cellrowborder" valign="top" width="16.07%" id="mcps1.3.3.3.2.5.1.1"><p id="dli_02_0187__p1999162711134">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.55%" id="mcps1.3.3.3.2.5.1.2"><p id="dli_02_0187__p1610014271138">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.61%" id="mcps1.3.3.3.2.5.1.3"><p id="dli_02_0187__p101006279131">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="57.769999999999996%" id="mcps1.3.3.3.2.5.1.4"><p id="dli_02_0187__p1210019278137">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0187__row9100162701310"><td class="cellrowborder" valign="top" width="16.07%" headers="mcps1.3.3.3.2.5.1.1 "><p id="dli_02_0187__p31002272131">name</p>
</td>
<td class="cellrowborder" valign="top" width="9.55%" headers="mcps1.3.3.3.2.5.1.2 "><p id="dli_02_0187__p4100142771318">No</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.3.3.2.5.1.3 "><p id="dli_02_0187__p91001127191314">String</p>
</td>
<td class="cellrowborder" valign="top" width="57.769999999999996%" headers="mcps1.3.3.3.2.5.1.4 "><p id="dli_02_0187__p7100427171315">The user-defined host name. The value can consist of 128 characters, including digits, letters, underscores (_), hyphens (-), and periods (.). It must start with a letter.</p>
</td>
</tr>
<tr id="dli_02_0187__row17100192717138"><td class="cellrowborder" valign="top" width="16.07%" headers="mcps1.3.3.3.2.5.1.1 "><p id="dli_02_0187__p19100182711311">ip</p>
</td>
<td class="cellrowborder" valign="top" width="9.55%" headers="mcps1.3.3.3.2.5.1.2 "><p id="dli_02_0187__p3100327101315">No</p>
</td>
<td class="cellrowborder" valign="top" width="16.61%" headers="mcps1.3.3.3.2.5.1.3 "><p id="dli_02_0187__p10100227101313">String</p>
</td>
<td class="cellrowborder" valign="top" width="57.769999999999996%" headers="mcps1.3.3.3.2.5.1.4 "><p id="dli_02_0187__p181004273132">The IPv4 address of the host.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="dli_02_0187__table9391124139"></a><a name="table9391124139"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0187__table9391124139" frame="border" border="1" rules="all"><caption><b>Table 4 </b>tags parameter</caption><thead align="left"><tr id="dli_02_0187__row1440020130"><th align="left" class="cellrowborder" valign="top" width="14.899999999999999%" id="mcps1.3.3.4.2.5.1.1"><p id="dli_02_0187__p194012219139">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="10.83%" id="mcps1.3.3.4.2.5.1.2"><p id="dli_02_0187__p540724136">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.470000000000002%" id="mcps1.3.3.4.2.5.1.3"><p id="dli_02_0187__p840162161315">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="57.8%" id="mcps1.3.3.4.2.5.1.4"><p id="dli_02_0187__p16401271318">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0187__row194013231317"><td class="cellrowborder" valign="top" width="14.899999999999999%" headers="mcps1.3.3.4.2.5.1.1 "><p id="dli_02_0187__p13401329138">key</p>
</td>
<td class="cellrowborder" valign="top" width="10.83%" headers="mcps1.3.3.4.2.5.1.2 "><p id="dli_02_0187__p940102141313">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.470000000000002%" headers="mcps1.3.3.4.2.5.1.3 "><p id="dli_02_0187__p64019231317">String</p>
</td>
<td class="cellrowborder" valign="top" width="57.8%" headers="mcps1.3.3.4.2.5.1.4 "><p id="dli_02_0187__p5401021139">Tag key.</p>
</td>
</tr>
<tr id="dli_02_0187__row1141142181320"><td class="cellrowborder" valign="top" width="14.899999999999999%" headers="mcps1.3.3.4.2.5.1.1 "><p id="dli_02_0187__p164118215134">value</p>
</td>
<td class="cellrowborder" valign="top" width="10.83%" headers="mcps1.3.3.4.2.5.1.2 "><p id="dli_02_0187__p1141112181317">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.470000000000002%" headers="mcps1.3.3.4.2.5.1.3 "><p id="dli_02_0187__p174114281318">String</p>
</td>
<td class="cellrowborder" valign="top" width="57.8%" headers="mcps1.3.3.4.2.5.1.4 "><p id="dli_02_0187__p16411125137">Tag key.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dli_02_0187__section134515287360"><h4 class="sectiontitle">Response</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0187__table8348112818368" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response parameters</caption><thead align="left"><tr id="dli_02_0187__row11478132863610"><th align="left" class="cellrowborder" valign="top" width="20.7020702070207%" id="mcps1.3.4.2.2.4.1.1"><p id="dli_02_0187__p04782028173616">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.87178717871787%" id="mcps1.3.4.2.2.4.1.2"><p id="dli_02_0187__p34781128193612">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="61.42614261426142%" id="mcps1.3.4.2.2.4.1.3"><p id="dli_02_0187__p1347917286364">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0187__row18479182813362"><td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.3.4.2.2.4.1.1 "><p id="dli_02_0187__en-us_topic_0069077904_p63831923">is_success</p>
</td>
<td class="cellrowborder" valign="top" width="17.87178717871787%" headers="mcps1.3.4.2.2.4.1.2 "><p id="dli_02_0187__en-us_topic_0069077904_p41939966">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="61.42614261426142%" headers="mcps1.3.4.2.2.4.1.3 "><p id="dli_02_0187__p15380173521417">Indicates whether the request is successfully executed. Value <span class="parmvalue" id="dli_02_0187__parmvalue4993877595041"><b>true</b></span> indicates that the request is successfully executed.</p>
</td>
</tr>
<tr id="dli_02_0187__row193581808325"><td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.3.4.2.2.4.1.1 "><p id="dli_02_0187__p16358180103211">message</p>
</td>
<td class="cellrowborder" valign="top" width="17.87178717871787%" headers="mcps1.3.4.2.2.4.1.2 "><p id="dli_02_0187__p1635890103217">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.42614261426142%" headers="mcps1.3.4.2.2.4.1.3 "><p id="dli_02_0187__p535830163217">System prompt. If execution succeeds, the message may be left blank.</p>
</td>
</tr>
<tr id="dli_02_0187__row18100163216132"><td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.3.4.2.2.4.1.1 "><p id="dli_02_0187__p10551134501310">connection_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.87178717871787%" headers="mcps1.3.4.2.2.4.1.2 "><p id="dli_02_0187__p25515459134">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.42614261426142%" headers="mcps1.3.4.2.2.4.1.3 "><p id="dli_02_0187__p05511845181319">Connection ID. Identifies the UUID of a datasource connection.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dli_02_0187__section1217010661112"><h4 class="sectiontitle">Example Request</h4><p id="dli_02_0187__p187795485114">Create an enhanced datasource connection for a queue and configure host information.</p>
<pre class="screen" id="dli_02_0187__screen567617121617">{
"name": "test",
"dest_vpc_id": "22094d8f-c310-4621-913d-4c4d655d8495",
"dest_network_id": "78f2562a-36e4-4b39-95b9-f5aab22e1281",
"queues": [
"q1",
"q2"
],
"hosts": [
{
"ip":"192.168.0.1",
"name":"ecs-97f8-0001"
},
{
"ip":"192.168.0.2",
"name":"ecs-97f8-0002"
}
]
}</pre>
</div>
<div class="section" id="dli_02_0187__section910624615450"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="dli_02_0187__screen17319155911294">{
"is_success": true,
"message": "Create peer connection for queues:{<em id="dli_02_0187__i109581825202612">queue list in the request parameter</em>}",
"connection_id": "2a620c33-5609-40c9-affd-2b6453071b0f"
}</pre>
</div>
<div class="section" id="dli_02_0187__sf39cfd445ad24e9e82754fcb0027179d"><h4 class="sectiontitle">Status Codes</h4><p id="dli_02_0187__a04144ca3a08e4576b386c6a98f43a2ae"><a href="#dli_02_0187__tb12870f1c5f24b27abd55ca24264af36">Table 6</a> describes the status code.</p>
<div class="tablenoborder"><a name="dli_02_0187__tb12870f1c5f24b27abd55ca24264af36"></a><a name="tb12870f1c5f24b27abd55ca24264af36"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0187__tb12870f1c5f24b27abd55ca24264af36" frame="border" border="1" rules="all"><caption><b>Table 6 </b>Status codes</caption><thead align="left"><tr id="dli_02_0187__r8d54231f95b14c01a5e55e95f3b2e838"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.7.3.2.3.1.1"><p id="dli_02_0187__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_0187__aea1d3bd107bb4c499da79a88832d256c">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0187__r211ad4eb571d4d938e5579998723174e"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0187__a3153e07b3a9749adba92599fe6628fbf">201</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0187__p104431642124811">The job is created successfully.</p>
</td>
</tr>
<tr id="dli_02_0187__row44937531727"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0187__p184941532219">400</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0187__p2049413539219">Request error.</p>
</td>
</tr>
<tr id="dli_02_0187__row65331212142411"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0187__p5537171216249">500</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0187__p953813124249">Internal service error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dli_02_0187__section13596141025715"><h4 class="sectiontitle">Error Codes</h4><p id="dli_02_0187__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>