forked from docs/doc-exports
Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
250 lines
17 KiB
HTML
250 lines
17 KiB
HTML
<a name="mrs_02_0023"></a><a name="mrs_02_0023"></a>
|
|
|
|
<h1 class="topictitle1">Updating a Data Source</h1>
|
|
<div id="body1484116919792"><div class="section" id="mrs_02_0023__section11410068144834"><h4 class="sectiontitle">Function</h4><p id="mrs_02_0023__p30367694144836">This API is used to update a data source. If the data source does not exist, the system reports an error. This API is compatible with Sahara.</p>
|
|
</div>
|
|
<div class="section" id="mrs_02_0023__section4721807314497"><h4 class="sectiontitle">URI</h4><ul id="mrs_02_0023__uee41980926e4459391aac79c6db117f2"><li id="mrs_02_0023__li53351332194814">Format<p id="mrs_02_0023__p1067115362480"><a name="mrs_02_0023__li53351332194814"></a><a name="li53351332194814"></a>PUT /v1.1/{project_id}/data-sources/{data_source_id}</p>
|
|
</li><li id="mrs_02_0023__li831194172516">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_02_0023__table49499141194754" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameter description</caption><thead align="left"><tr id="mrs_02_0023__row33700024194754"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.2.2.1.2.4.1.1"><p id="mrs_02_0023__p16571835194812">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.2.2.1.2.4.1.2"><p id="mrs_02_0023__p141410194812">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.2.2.1.2.4.1.3"><p id="mrs_02_0023__p11454278194812">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="mrs_02_0023__row6505449415356"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="mrs_02_0023__p3492262515356">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="mrs_02_0023__p1016041415356">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="mrs_02_0023__p1768719515356">Project ID. For details on how to obtain the project ID, see <a href="mrs_02_0011.html">Obtaining a Project ID</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row20659256153330"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="mrs_02_0023__p62787041153330">data_source_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="mrs_02_0023__p52585595153330">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="mrs_02_0023__p31574830153330">Data source ID</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="mrs_02_0023__section31697334144924"><h4 class="sectiontitle">Request</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_02_0023__table1603131015403" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameter description</caption><thead align="left"><tr id="mrs_02_0023__row1607843515403"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.2.5.1.1"><p id="mrs_02_0023__p2728483015403">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.2.2.5.1.2"><p id="mrs_02_0023__p6258762615403">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.2.2.5.1.3"><p id="mrs_02_0023__p45230398152729">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="45%" id="mcps1.3.3.2.2.5.1.4"><p id="mrs_02_0023__p3643294215403">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="mrs_02_0023__row14299430102131"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.2.5.1.1 "><p id="mrs_02_0023__p11744825102315">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.2 "><p id="mrs_02_0023__p11806775102315">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.3 "><p id="mrs_02_0023__p16824758102315">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.3.2.2.5.1.4 "><p id="mrs_02_0023__p20628190102315">Data source name</p>
|
|
<p id="mrs_02_0023__p51435984102315">Contains 1 to 80 characters and consists of letters, digits, hyphens (-), and underscores (_) only.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row46055705102136"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.2.5.1.1 "><p id="mrs_02_0023__p38704048102359">type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.2 "><p id="mrs_02_0023__p48020182102359">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.3 "><p id="mrs_02_0023__p64429504102359">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.3.2.2.5.1.4 "><p id="mrs_02_0023__p51407318102359">Data source type</p>
|
|
<ul id="mrs_02_0023__ul60012686102359"><li id="mrs_02_0023__li3243266102359">hdfs</li><li id="mrs_02_0023__li29189394102359">obs</li><li id="mrs_02_0023__li61377961102359">swift (not supported by the current version)</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row31141531102143"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.2.5.1.1 "><p id="mrs_02_0023__p57562259102339">url</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.2 "><p id="mrs_02_0023__p32031378102339">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.3 "><p id="mrs_02_0023__p44404814102339">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.3.2.2.5.1.4 "><p id="mrs_02_0023__p40020142102339">Data source URL</p>
|
|
<p id="mrs_02_0023__p1953133111171">Contains 1 to 255 characters.</p>
|
|
<ul id="mrs_02_0023__ul24636959102339"><li id="mrs_02_0023__li20406042102339">If the data source type is HDFS, the value is <strong id="mrs_02_0023__b395615292211">/</strong><em id="mrs_02_0023__i1215990992211">Save path of the data source</em>.</li><li id="mrs_02_0023__li42276731102339">If the data source type is OBS, the value is <strong id="mrs_02_0023__b22866623155631">s3</strong><strong id="mrs_02_0023__b32366897155631">a</strong><strong id="mrs_02_0023__b24702452155634">://</strong><em id="mrs_02_0023__i1076191992211">Save path of the data source</em>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row6538721915403"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.2.5.1.1 "><p id="mrs_02_0023__p3925522010269">description</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.2 "><p id="mrs_02_0023__p2555627710269">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.3 "><p id="mrs_02_0023__p5679259510269">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.3.2.2.5.1.4 "><p id="mrs_02_0023__p3679749310269">Data source description</p>
|
|
<p id="mrs_02_0023__p21051431151815">Contains a maximum of 65535 characters.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row6526202815403"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.2.5.1.1 "><p id="mrs_02_0023__p40455002102533">is_protected</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.2 "><p id="mrs_02_0023__p55629730102533">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.3 "><p id="mrs_02_0023__p9714295102533">Bool</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.3.2.2.5.1.4 "><p id="mrs_02_0023__p48660416102533">Whether the data source is protected</p>
|
|
<ul id="mrs_02_0023__ul35290564102533"><li id="mrs_02_0023__li49179622102533">true</li><li id="mrs_02_0023__li39963415102533">false</li></ul>
|
|
<p id="mrs_02_0023__p24126416102533">The current version does not support this function.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row16863865102529"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.2.5.1.1 "><p id="mrs_02_0023__p5635102102533">is_public</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.2 "><p id="mrs_02_0023__p53790114102533">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.3 "><p id="mrs_02_0023__p62032007102533">Bool</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.3.2.2.5.1.4 "><p id="mrs_02_0023__p58536693102533">Whether the data source is public</p>
|
|
<ul id="mrs_02_0023__ul57068190102533"><li id="mrs_02_0023__li43851667102533">true</li><li id="mrs_02_0023__li59120683102533">false</li></ul>
|
|
<p id="mrs_02_0023__p62324105102533">The current version does not support this function.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="mrs_02_0023__section10069032144933"><h4 class="sectiontitle">Response</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_02_0023__table51257841151049" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameter description</caption><thead align="left"><tr id="mrs_02_0023__row8480851151049"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.2.4.1.1"><p id="mrs_02_0023__p15860319151049">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.2.4.1.2"><p id="mrs_02_0023__p40813771151049">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.2.2.4.1.3"><p id="mrs_02_0023__p17581180151049">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="mrs_02_0023__row14789514151049"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.1 "><p id="mrs_02_0023__p28232664151128">description</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.2 "><p id="mrs_02_0023__p32100671151824">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.4.1.3 "><p id="mrs_02_0023__p60375806151049">Data source description</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row6511344151049"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.1 "><p id="mrs_02_0023__p59583657151128">url</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.2 "><p id="mrs_02_0023__p47113545151824">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.4.1.3 "><p id="mrs_02_0023__p38365320151049">Data source URL</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row33112539151141"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.1 "><p id="mrs_02_0023__p64870032151141">tenant_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.2 "><p id="mrs_02_0023__p2060135151824">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.4.1.3 "><p id="mrs_02_0023__p13856035173519">Project ID. For details on how to obtain the project ID, see <a href="mrs_02_0011.html">Obtaining a Project ID</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row22096096151146"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.1 "><p id="mrs_02_0023__p44953331151146">created_at</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.2 "><p id="mrs_02_0023__p26983233151824">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.4.1.3 "><p id="mrs_02_0023__p25869246151146">Data source creation time</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row4456002103134"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.1 "><p id="mrs_02_0023__p25391906103134">updated_at</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.2 "><p id="mrs_02_0023__p32099444103134">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.4.1.3 "><p id="mrs_02_0023__p49918133103134">Data source update time</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row18376161151152"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.1 "><p id="mrs_02_0023__p10483939151640">is_protected</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.2 "><p id="mrs_02_0023__p65650233151640">Bool</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.4.1.3 "><p id="mrs_02_0023__p16068681151640">Whether the data source is protected</p>
|
|
<ul id="mrs_02_0023__ul24233663152954"><li id="mrs_02_0023__li16776383152954">true</li><li id="mrs_02_0023__li16769724152954">false</li></ul>
|
|
<p id="mrs_02_0023__p16709791152954">The current version does not support this function.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row6726034151222"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.1 "><p id="mrs_02_0023__p20438892151640">is_public</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.2 "><p id="mrs_02_0023__p16062920151640">Bool</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.4.1.3 "><p id="mrs_02_0023__p26028163151640">Whether the data source is public</p>
|
|
<ul id="mrs_02_0023__ul23909441152958"><li id="mrs_02_0023__li13858382152958">true</li><li id="mrs_02_0023__li57616581152958">false</li></ul>
|
|
<p id="mrs_02_0023__p48787181152958">The current version does not support this function.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row25334813151227"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.1 "><p id="mrs_02_0023__p38853957151227">type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.2 "><p id="mrs_02_0023__p66202595151828">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.4.1.3 "><p id="mrs_02_0023__p60833455151227">Data source type</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row8652083151249"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.1 "><p id="mrs_02_0023__p29730140151249">id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.2 "><p id="mrs_02_0023__p17113312151828">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.4.1.3 "><p id="mrs_02_0023__p39995064151249">Data source ID</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_02_0023__row12228393151256"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.1 "><p id="mrs_02_0023__p50975775151256">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.2 "><p id="mrs_02_0023__p21869845151828">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.4.1.3 "><p id="mrs_02_0023__p43580859151256">Data source name</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="mrs_02_0023__section205032433315"><h4 class="sectiontitle">Example</h4><ul id="mrs_02_0023__ul840912186339"><li id="mrs_02_0023__li16084111153854">Example request<pre class="screen" id="mrs_02_0023__screen36041483153945">{
|
|
"name": "my-data-source-update",
|
|
"url": "/simple/mapreduce/input",
|
|
"is_protected": false,
|
|
"is_public": false,
|
|
"type": "hdfs",
|
|
"description": "this is the data source template"
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<ul id="mrs_02_0023__ul7522540113319"><li id="mrs_02_0023__li61209710154255">Example response<pre class="screen" id="mrs_02_0023__screen2791385194525">{
|
|
"data_source": {
|
|
"name": "my-data-source-update",
|
|
"type": "hdfs",
|
|
"url": "/simple/mapreduce/input",
|
|
"description": "this is the data source template",
|
|
"created_at": "2017-06-22T08:28:57",
|
|
"updated_at": "2017-06-22T08:30:08",
|
|
"id": "e275a927-fe72-4b8b-a634-e47a11dca181",
|
|
"tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
|
|
"is_public": false,
|
|
"is_protected": false
|
|
}
|
|
}</pre>
|
|
</li></ul>
|
|
<div class="section" id="mrs_02_0023__section13299747144948"><h4 class="sectiontitle">Status Code</h4><p id="mrs_02_0023__p5547365016031"><a href="#mrs_02_0023__table1584477916050">Table 4</a> describes the status code of this API.</p>
|
|
|
|
<div class="tablenoborder"><a name="mrs_02_0023__table1584477916050"></a><a name="table1584477916050"></a><table cellpadding="4" cellspacing="0" summary="" id="mrs_02_0023__table1584477916050" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Status code</caption><thead align="left"><tr id="mrs_02_0023__row1339492016050"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.7.3.2.3.1.1"><p id="mrs_02_0023__p3411176516050">Status Code</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="70%" id="mcps1.3.7.3.2.3.1.2"><p id="mrs_02_0023__p1158961516050">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="mrs_02_0023__row3719767816050"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="mrs_02_0023__p6022194016050">202</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="mrs_02_0023__p4613894216050">The data source has been successfully updated.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="mrs_02_0023__p3132993710328">For the description about error status codes, see <a href="mrs_02_0015.html">Status Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_02_0021.html">Data Source APIs</a></div>
|
|
</div>
|
|
</div>
|
|
|