doc-exports/docs/dds/api-ref/dds_api_0118.html
Wang , Deng Ke 60010eb9d0 dds api 2.0.38sp24 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>
2023-01-13 08:55:41 +00:00

227 lines
16 KiB
HTML

<a name="dds_api_0118"></a><a name="dds_api_0118"></a>
<h1 class="topictitle1">Obtaining Information About a Task with a Specified ID</h1>
<div id="body0000001129712624"><div class="section" id="dds_api_0118__section1721818456385"><h4 class="sectiontitle">Function</h4><p id="dds_api_0118__p15327171915217">This API is used to obtain information about a task with a specified ID in the task center.</p>
</div>
<div class="section" id="dds_api_0118__section1995103535418"><h4 class="sectiontitle">Constraints</h4><ul id="dds_api_0118__ul66159397195852"><li id="dds_api_0118__li41825295409">Currently, only asynchronous tasks in the task center of DDS Community Edition within one month can be queried.</li><li id="dds_api_0118__li1621424272411">After a job is generated, it takes several seconds to query the job ID.</li><li id="dds_api_0118__li1246511151697">The following asynchronous tasks can be queried: creating an instance (single node, replica set, or cluster), scaling up storage, changing instance class, scaling up a node, restarting a node, performing a primary/standby switchover, changing a private IP address, changing a security group, changing a database port, binding or unbinding an EIP, switching the SSL mode, and changing an AZ, enabling the shard/config IP address, creating a physical backup/snapshot backup, restoration to a new instance using a backup, point-in-time recovery, and database/table-level restoration to a specified time point.</li></ul>
</div>
<div class="section" id="dds_api_0118__section16986417142414"><h4 class="sectiontitle">URI</h4><ul id="dds_api_0118__ul16391217184115"><li id="dds_api_0118__li363951734111">URI format<p id="dds_api_0118__p1363971724110"><a name="dds_api_0118__li363951734111"></a><a name="li363951734111"></a>GET /v3/{project_id}/jobs?id={id}</p>
</li></ul>
</div>
<ul id="dds_api_0118__ul27808384103438"><li id="dds_api_0118__li48916315103438">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0118__table37593651103438" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="dds_api_0118__row58913670103438"><th align="left" class="cellrowborder" valign="top" width="21.43%" id="mcps1.3.4.1.1.2.4.1.1"><p id="dds_api_0118__p7277976103438">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.29%" id="mcps1.3.4.1.1.2.4.1.2"><p id="dds_api_0118__p52645207103438">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="64.28%" id="mcps1.3.4.1.1.2.4.1.3"><p id="dds_api_0118__p36403370103438">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0118__row62991866103438"><td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.4.1.1.2.4.1.1 "><p id="dds_api_0118__p902364145258">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="14.29%" headers="mcps1.3.4.1.1.2.4.1.2 "><p id="dds_api_0118__p5982632145258">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="64.28%" headers="mcps1.3.4.1.1.2.4.1.3 "><p id="dds_api_0118__p14831209145258">Project ID of a tenant in a region.</p>
<p id="dds_api_0118__p19455113121011">For details about how to obtain the project ID, see <a href="dds_projectid.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="dds_api_0118__row64285464517"><td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.4.1.1.2.4.1.1 "><p id="dds_api_0118__p74292461953">id</p>
</td>
<td class="cellrowborder" valign="top" width="14.29%" headers="mcps1.3.4.1.1.2.4.1.2 "><p id="dds_api_0118__p60181840">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="64.28%" headers="mcps1.3.4.1.1.2.4.1.3 "><p id="dds_api_0118__p16429184614514">Task ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<div class="section" id="dds_api_0118__section3074340117316"><h4 class="sectiontitle">Requests</h4><ul id="dds_api_0118__ul161801223133413"><li id="dds_api_0118__li7180162323416">Example request<p id="dds_api_0118__p47251425133415"><a name="dds_api_0118__li7180162323416"></a><a name="li7180162323416"></a>GET https://dds.eu-de.otc.t-systems.com/v3/0549b4a43100d4f32f51c01c2fe4acdb/jobs?id=a9767ede-fe0f-4888-9003-e843a4c90514</p>
</li></ul>
</div>
<div class="section" id="dds_api_0118__section489474814263"><h4 class="sectiontitle">Responses</h4><ul id="dds_api_0118__ul1872869017262"><li id="dds_api_0118__li3434049017262">Normal response
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0118__table12268582117" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="dds_api_0118__row1322618515214"><th align="left" class="cellrowborder" valign="top" width="24.97%" id="mcps1.3.6.2.1.1.2.4.1.1"><p id="dds_api_0118__p937961932115">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="29.94%" id="mcps1.3.6.2.1.1.2.4.1.2"><p id="dds_api_0118__p6379219132116">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="45.09%" id="mcps1.3.6.2.1.1.2.4.1.3"><p id="dds_api_0118__p12379121902117">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0118__row52274542119"><td class="cellrowborder" valign="top" width="24.97%" headers="mcps1.3.6.2.1.1.2.4.1.1 "><p id="dds_api_0118__p22270502110">job</p>
</td>
<td class="cellrowborder" valign="top" width="29.94%" headers="mcps1.3.6.2.1.1.2.4.1.2 "><p id="dds_api_0118__p222712518214">Object</p>
</td>
<td class="cellrowborder" valign="top" width="45.09%" headers="mcps1.3.6.2.1.1.2.4.1.3 "><p id="dds_api_0118__p1122713522111">Task information. For details, see <a href="#dds_api_0118__table54571314103317">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="dds_api_0118__table54571314103317"></a><a name="table54571314103317"></a><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0118__table54571314103317" frame="border" border="1" rules="all"><caption><b>Table 3 </b>job field data structure description</caption><thead align="left"><tr id="dds_api_0118__row3459121463318"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.6.2.1.2.2.4.1.1"><p id="dds_api_0118__p91816414334">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.6.2.1.2.2.4.1.2"><p id="dds_api_0118__p123216414335">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="45%" id="mcps1.3.6.2.1.2.2.4.1.3"><p id="dds_api_0118__p440144113310">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0118__row16459161403314"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.6.2.1.2.2.4.1.1 "><p id="dds_api_0118__p12459414153315">id</p>
</td>
<td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.6.2.1.2.2.4.1.2 "><p id="dds_api_0118__p945941483315">String</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.6.2.1.2.2.4.1.3 "><p id="dds_api_0118__p10459614163315">Task ID</p>
</td>
</tr>
<tr id="dds_api_0118__row2367713135211"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.6.2.1.2.2.4.1.1 "><p id="dds_api_0118__p2036712135529">name</p>
</td>
<td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.6.2.1.2.2.4.1.2 "><p id="dds_api_0118__p1136761311525">String</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.6.2.1.2.2.4.1.3 "><p id="dds_api_0118__p3367141316527">Task name</p>
</td>
</tr>
<tr id="dds_api_0118__row98211748533"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.6.2.1.2.2.4.1.1 "><p id="dds_api_0118__p11821164185319">status</p>
</td>
<td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.6.2.1.2.2.4.1.2 "><p id="dds_api_0118__p178212410537">String</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.6.2.1.2.2.4.1.3 "><p id="dds_api_0118__p20821194165310">Task execution status</p>
<div class="p" id="dds_api_0118__p12167194625317">Valid value:<ul id="dds_api_0118__ul1116724610533"><li id="dds_api_0118__li4183164614535"><strong id="dds_api_0118__b6361038162717">Running</strong>: The task is being executed.</li><li id="dds_api_0118__li6183146185311"><strong id="dds_api_0118__b1845479142810">Completed</strong>: The task is successfully executed.</li><li id="dds_api_0118__li17183746115312"><strong id="dds_api_0118__b2039320133282">Failed</strong>: The task fails to be executed.</li></ul>
</div>
</td>
</tr>
<tr id="dds_api_0118__row8137184445520"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.6.2.1.2.2.4.1.1 "><p id="dds_api_0118__p1137944165511">created</p>
</td>
<td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.6.2.1.2.2.4.1.2 "><p id="dds_api_0118__p10137164414554">String</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.6.2.1.2.2.4.1.3 "><p id="dds_api_0118__p740512805712">Creation time in the "yyyy-mm-ddThh:mm:ssZ" format.</p>
<p id="dds_api_0118__p174057816579"><strong id="dds_api_0118__b16452132062818">T</strong> is the separator between the calendar and the hourly notation of time. <strong id="dds_api_0118__b144677204283">Z</strong> indicates the time zone offset.</p>
</td>
</tr>
<tr id="dds_api_0118__row71317215715"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.6.2.1.2.2.4.1.1 "><p id="dds_api_0118__p61342179">ended</p>
</td>
<td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.6.2.1.2.2.4.1.2 "><p id="dds_api_0118__p131392777">String</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.6.2.1.2.2.4.1.3 "><p id="dds_api_0118__p26452251171">End time in the "yyyy-mm-ddThh:mm:ssZ" format.</p>
<p id="dds_api_0118__p164512251074"><strong id="dds_api_0118__b14624195316287">T</strong> is the separator between the calendar and the hourly notation of time. <strong id="dds_api_0118__b196380533284">Z</strong> indicates the time zone offset.</p>
</td>
</tr>
<tr id="dds_api_0118__row113911711165717"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.6.2.1.2.2.4.1.1 "><p id="dds_api_0118__p183911211105719">progress</p>
</td>
<td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.6.2.1.2.2.4.1.2 "><p id="dds_api_0118__p1839115119578">String</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.6.2.1.2.2.4.1.3 "><p id="dds_api_0118__p739131112579">Task execution progress</p>
<div class="note" id="dds_api_0118__note93961953175813"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="dds_api_0118__p8811111313477">The execution progress (such as <strong id="dds_api_0118__b20165062914">"60%"</strong>, indicating the task execution progress is 60%) is displayed only when the task is being executed. Otherwise, <strong id="dds_api_0118__b835903295">""</strong> is returned.</p>
</div></div>
</td>
</tr>
<tr id="dds_api_0118__row38251071027"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.6.2.1.2.2.4.1.1 "><p id="dds_api_0118__p782547326">instance</p>
</td>
<td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.6.2.1.2.2.4.1.2 "><p id="dds_api_0118__p12825171522">Object</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.6.2.1.2.2.4.1.3 "><p id="dds_api_0118__p148251371722">Instance on which the task is executed.</p>
<p id="dds_api_0118__p176261414190">For details, see <a href="#dds_api_0118__table4062895917262">Table 4</a>.</p>
</td>
</tr>
<tr id="dds_api_0118__row135472431958"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.6.2.1.2.2.4.1.1 "><p id="dds_api_0118__p1954711436518">fail_reason</p>
</td>
<td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.6.2.1.2.2.4.1.2 "><p id="dds_api_0118__p95478437512">String</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.6.2.1.2.2.4.1.3 "><p id="dds_api_0118__p1654711431756">Task failure information.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="dds_api_0118__table4062895917262"></a><a name="table4062895917262"></a><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0118__table4062895917262" frame="border" border="1" rules="all"><caption><b>Table 4 </b>instance field data structure description</caption><thead align="left"><tr id="dds_api_0118__row2045312717262"><th align="left" class="cellrowborder" valign="top" width="23.527647235276476%" id="mcps1.3.6.2.1.3.2.4.1.1"><p id="dds_api_0118__p4609059717262">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="31.36686331366863%" id="mcps1.3.6.2.1.3.2.4.1.2"><p id="dds_api_0118__p4235091617262">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="45.1054894510549%" id="mcps1.3.6.2.1.3.2.4.1.3"><p id="dds_api_0118__p787220417262">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0118__row3366877217262"><td class="cellrowborder" valign="top" width="23.527647235276476%" headers="mcps1.3.6.2.1.3.2.4.1.1 "><p id="dds_api_0118__p4281598817262">id</p>
</td>
<td class="cellrowborder" valign="top" width="31.36686331366863%" headers="mcps1.3.6.2.1.3.2.4.1.2 "><p id="dds_api_0118__p4554301317262">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.1054894510549%" headers="mcps1.3.6.2.1.3.2.4.1.3 "><p id="dds_api_0118__p6510543817262">Instance ID</p>
</td>
</tr>
<tr id="dds_api_0118__row964613217262"><td class="cellrowborder" valign="top" width="23.527647235276476%" headers="mcps1.3.6.2.1.3.2.4.1.1 "><p id="dds_api_0118__p4313926117262">name</p>
</td>
<td class="cellrowborder" valign="top" width="31.36686331366863%" headers="mcps1.3.6.2.1.3.2.4.1.2 "><p id="dds_api_0118__p461925817262">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.1054894510549%" headers="mcps1.3.6.2.1.3.2.4.1.3 "><p id="dds_api_0118__p3861563617262">DB instance name</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="dds_api_0118__note3482053511312"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dds_api_0118__p4494936511312">In the response example, some tasks in the task center are used as examples.</p>
</div></div>
</li></ul>
</div>
<ul id="dds_api_0118__ul123709363214"><li id="dds_api_0118__li24348422172618">Example normal response<p id="dds_api_0118__p0587706161"><a name="dds_api_0118__li24348422172618"></a><a name="li24348422172618"></a>A task is successfully executed.</p>
<pre class="codeblock" id="dds_api_0118__codeblock181412152112">{
"job": {
"id": "f85104b5-4a9c-4e0f-9505-fc5409d8f7ae",
"name": "Create_MongoDB",
"status": "Completed",
"created": "2021-07-12T09:22:04+0000",
"ended": "2021-07-12T10:10:13+0000",
"progress": "",
"instance": {
"id": "d87f5b33049144ec95f0cab0a5f22cfbin02",
"name": "dds-5ff4-sh"
},
"fail_reason": null
}
}</pre>
<p id="dds_api_0118__p175883071614">A task is being executed:</p>
<pre class="codeblock" id="dds_api_0118__codeblock11482144320219">{
"job": {
"id": "9d10bfd1-affb-49c3-b977-298950a8d6fa",
"name": "Create_MongoDB",
"status": "Running",
"created": "2021-07-13T07:28:43+0000",
"ended": "2021-07-13T07:28:53+0000",
"progress": "9%",
"instance": {
"id": "cf538a2dd8ec4b26860b27060902712fin02",
"name": "dds-3a98-wcc"
},
"fail_reason": null
}
}</pre>
<p id="dds_api_0118__p17588130111614">A task fails to be executed:</p>
<pre class="codeblock" id="dds_api_0118__codeblock117557202227">{
"job": {
"id": "a03b1b8a-b756-467c-8a49-38720c3d23ec",
"name": "Restore_MongoDB_Replica",
"status": "Failed",
"created": "2021-07-13T04:55:58+0000",
"ended": "2021-07-13T05:20:04+0000",
"progress": "",
"instance": {
"id": "7beb15d5db9c4742b7c817789244844ein02",
"name": "lenn-v3-restore-4"
},
"fail_reason": "Failed to upgrade the DB Agent."
}
}</pre>
</li></ul>
<div class="section" id="dds_api_0118__section255485081219"><h4 class="sectiontitle">Status Code</h4><p id="dds_api_0118__dds_api_0018_p16131712193312">Status Code:200.</p>
<p id="dds_api_0118__dds_api_0018_p480617135329">For more information, see <a href="dds_status_code.html">Status Code</a>.</p>
</div>
<div class="section" id="dds_api_0118__section95551950141212"><h4 class="sectiontitle">Error Code</h4><p id="dds_api_0118__dds_api_0018_p20466124120334">For more information, see <a href="dds_error_code.html">Error Code</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dds_api_0117.html">Task Management</a></div>
</div>
</div>