doc-exports/docs/ecs/api-ref/en-us_topic_0065817692.html
Zaoxu, Li 4edaa4a4cc ECS API 20231016 version
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com>
Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
2024-04-29 11:04:13 +00:00

204 lines
18 KiB
HTML

<a name="EN-US_TOPIC_0065817692"></a><a name="EN-US_TOPIC_0065817692"></a>
<h1 class="topictitle1">Querying Operations on an <span id="text96541822135520">ECS</span></h1>
<div id="body1499652824861"><div class="section" id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_section4103816"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p1999612">This API is used to query all historical operations on an <span id="EN-US_TOPIC_0065817692__text48341438232">ECS</span>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_section36934348"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p17816132418199">GET /v2.1/{project_id}/servers/{server_id}/os-instance-actions?limit={limit}&amp;marker={marker}</p>
<p id="EN-US_TOPIC_0065817692__p171641236152216">GET /v2/{project_id}/servers/{server_id}/os-instance-actions?limit={limit}&amp;marker={marker}</p>
<div class="p" id="EN-US_TOPIC_0065817692__p1669614816504"><a href="#EN-US_TOPIC_0065817692__en-us_topic_0057973177_table32475667">Table 1</a> describes the parameters in the URI.
<div class="tablenoborder"><a name="EN-US_TOPIC_0065817692__en-us_topic_0057973177_table32475667"></a><a name="en-us_topic_0057973177_table32475667"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_table32475667" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row44937496"><th align="left" class="cellrowborder" valign="top" width="22.24%" id="mcps1.3.2.4.2.2.4.1.1"><p id="EN-US_TOPIC_0065817692__p5187119">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.87%" id="mcps1.3.2.4.2.2.4.1.2"><p id="EN-US_TOPIC_0065817692__p17503500">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="55.88999999999999%" id="mcps1.3.2.4.2.2.4.1.3"><p id="EN-US_TOPIC_0065817692__p8497414">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row1664874"><td class="cellrowborder" valign="top" width="22.24%" headers="mcps1.3.2.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p637140">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="21.87%" headers="mcps1.3.2.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p51608407">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="55.88999999999999%" headers="mcps1.3.2.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0065817692__p37593705">Specifies the project ID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row41565035"><td class="cellrowborder" valign="top" width="22.24%" headers="mcps1.3.2.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p11324657">server_id</p>
</td>
<td class="cellrowborder" valign="top" width="21.87%" headers="mcps1.3.2.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p44882061">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="55.88999999999999%" headers="mcps1.3.2.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p11568292">Specifies the <span id="EN-US_TOPIC_0065817692__text1588857161210">ECS</span> ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="note" id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_note41256221212455"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p35761671212455">Pagination query is supported in microversion 2.58 and later. The query results are displayed by the creation time (<strong id="EN-US_TOPIC_0065817692__b23587534154110">created_at</strong>) of the records in descending order. If the creation time is not provided, the results are displayed by object ID in descending order. The number of records displayed on each page is <strong id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_b84235270617342">limit</strong>. If the value of <strong id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_b84235270617420">limit</strong> exceeds the maximum number configured in Nova, the maximum number configured in Nova is returned.</p>
</div></div>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_table25375307161212" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Query parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row19424792161212"><th align="left" class="cellrowborder" valign="top" width="18.19%" id="mcps1.3.3.2.4.1.1"><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p29904339161212">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.549999999999997%" id="mcps1.3.3.2.4.1.2"><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p6332407161212">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="64.25999999999999%" id="mcps1.3.3.2.4.1.3"><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p43162922161212">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row6535831161212"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.3.2.4.1.1 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p41698904161254">limit</p>
</td>
<td class="cellrowborder" valign="top" width="17.549999999999997%" headers="mcps1.3.3.2.4.1.2 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p22168062161254">No</p>
</td>
<td class="cellrowborder" valign="top" width="64.25999999999999%" headers="mcps1.3.3.2.4.1.3 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p50782568161254">Specifies the upper limit on the number of returned results.</p>
<p id="EN-US_TOPIC_0065817692__p8839650326">This parameter is supported in microversion 2.58 and later.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row64491372161218"><td class="cellrowborder" valign="top" width="18.19%" headers="mcps1.3.3.2.4.1.1 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p43508214161254">marker</p>
</td>
<td class="cellrowborder" valign="top" width="17.549999999999997%" headers="mcps1.3.3.2.4.1.2 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p34504442161254">No</p>
</td>
<td class="cellrowborder" valign="top" width="64.25999999999999%" headers="mcps1.3.3.2.4.1.3 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p43396447161254">Specifies the marker that points to the operation. The query starts from the next piece of data indexed by this parameter. The value is <strong id="EN-US_TOPIC_0065817692__b369218216255">request_id</strong>.</p>
<p id="EN-US_TOPIC_0065817692__p12954194193116">This parameter is supported in microversion 2.58 and later.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="EN-US_TOPIC_0065817692__section05103585194"><h4 class="sectiontitle">Request</h4><p id="EN-US_TOPIC_0065817692__p19369110142014">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_section63261583"><h4 class="sectiontitle">Response</h4><p id="EN-US_TOPIC_0065817692__p17399203035117"><a href="#EN-US_TOPIC_0065817692__en-us_topic_0057973153_table55529076">Table 3</a> describes the response parameters.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0065817692__en-us_topic_0057973153_table55529076"></a><a name="en-us_topic_0057973153_table55529076"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065817692__en-us_topic_0057973153_table55529076" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973153_row53394154"><th align="left" class="cellrowborder" valign="top" width="28.79%" id="mcps1.3.5.3.2.4.1.1"><p id="EN-US_TOPIC_0065817692__p32821024102610">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.79%" id="mcps1.3.5.3.2.4.1.2"><p id="EN-US_TOPIC_0065817692__p202822024132618">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="42.42%" id="mcps1.3.5.3.2.4.1.3"><p id="EN-US_TOPIC_0065817692__p10298192442612">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973153_row43894534"><td class="cellrowborder" valign="top" width="28.79%" headers="mcps1.3.5.3.2.4.1.1 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973153_p65796329">instanceActions</p>
</td>
<td class="cellrowborder" valign="top" width="28.79%" headers="mcps1.3.5.3.2.4.1.2 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973153_p27902470">Array of Object</p>
</td>
<td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.3.2.4.1.3 "><p id="EN-US_TOPIC_0065817692__p24702645">Specifies operations performed on the <span id="EN-US_TOPIC_0065817692__text161381629185511">ECS</span>. For details, see <a href="#EN-US_TOPIC_0065817692__en-us_topic_0057973177_table2407422">Table 4</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0065817692__en-us_topic_0057973177_table2407422"></a><a name="en-us_topic_0057973177_table2407422"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_table2407422" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="EN-US_TOPIC_0065817692__b46125273599">instanceActions</strong> field description</caption><thead align="left"><tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row9003795"><th align="left" class="cellrowborder" valign="top" width="13.79%" id="mcps1.3.5.4.2.5.1.1"><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p58218801">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.1%" id="mcps1.3.5.4.2.5.1.2"><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p57014808">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.93%" id="mcps1.3.5.4.2.5.1.3"><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p18102480">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54.17999999999999%" id="mcps1.3.5.4.2.5.1.4"><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p54796720">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row9349312"><td class="cellrowborder" valign="top" width="13.79%" headers="mcps1.3.5.4.2.5.1.1 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p19096817">action</p>
</td>
<td class="cellrowborder" valign="top" width="16.1%" headers="mcps1.3.5.4.2.5.1.2 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p1970644">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.93%" headers="mcps1.3.5.4.2.5.1.3 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p3338346">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.17999999999999%" headers="mcps1.3.5.4.2.5.1.4 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p25404503">Specifies the action.</p>
<p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p490215356174">Options:</p>
<p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p127002371171">create, delete, evacuate, restore, stop, start, reboot, rebuild, revertResize, confirmResize, detach_volume, attach_volume, attach_interface, detach_interface, lock, unlock, resize, migrate, pause, unpause, rescue, unrescue, changePassword, shelve, unshelve, live-migration, live_migration_cancel, live_migration_force_complete, trigger_crash_dump, extend_volume</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row27313937"><td class="cellrowborder" valign="top" width="13.79%" headers="mcps1.3.5.4.2.5.1.1 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p64945259">instance_uuid</p>
</td>
<td class="cellrowborder" valign="top" width="16.1%" headers="mcps1.3.5.4.2.5.1.2 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p31668621">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.93%" headers="mcps1.3.5.4.2.5.1.3 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p26074609">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.17999999999999%" headers="mcps1.3.5.4.2.5.1.4 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p15021476">Specifies the <span id="EN-US_TOPIC_0065817692__text103771059151316">ECS</span> ID in UUID format.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row975562"><td class="cellrowborder" valign="top" width="13.79%" headers="mcps1.3.5.4.2.5.1.1 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p11911720">message</p>
</td>
<td class="cellrowborder" valign="top" width="16.1%" headers="mcps1.3.5.4.2.5.1.2 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p38078364">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.93%" headers="mcps1.3.5.4.2.5.1.3 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p25325238">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.17999999999999%" headers="mcps1.3.5.4.2.5.1.4 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p64448643">Specifies the result status of the operation.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row43166878"><td class="cellrowborder" valign="top" width="13.79%" headers="mcps1.3.5.4.2.5.1.1 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p6856233">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.1%" headers="mcps1.3.5.4.2.5.1.2 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p20807076">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.93%" headers="mcps1.3.5.4.2.5.1.3 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p18483976">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.17999999999999%" headers="mcps1.3.5.4.2.5.1.4 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p7651556">Specifies the project ID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row1755141"><td class="cellrowborder" valign="top" width="13.79%" headers="mcps1.3.5.4.2.5.1.1 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p7948727">request_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.1%" headers="mcps1.3.5.4.2.5.1.2 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p8012684">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.93%" headers="mcps1.3.5.4.2.5.1.3 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p39867137">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.17999999999999%" headers="mcps1.3.5.4.2.5.1.4 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p45047680">Specifies the request ID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row2775936"><td class="cellrowborder" valign="top" width="13.79%" headers="mcps1.3.5.4.2.5.1.1 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p23524259">start_time</p>
</td>
<td class="cellrowborder" valign="top" width="16.1%" headers="mcps1.3.5.4.2.5.1.2 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p59388871">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.93%" headers="mcps1.3.5.4.2.5.1.3 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p26416835">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.17999999999999%" headers="mcps1.3.5.4.2.5.1.4 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p45769240">Specifies the time when the action was started.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_row9269976"><td class="cellrowborder" valign="top" width="13.79%" headers="mcps1.3.5.4.2.5.1.1 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p12670598">user_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.1%" headers="mcps1.3.5.4.2.5.1.2 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p51026317">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.93%" headers="mcps1.3.5.4.2.5.1.3 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p19685557">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.17999999999999%" headers="mcps1.3.5.4.2.5.1.4 "><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_p39490997">Specifies the user ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_section32483342"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0065817692__p102981919201514">Query all historical operations on a specified ECS.</p>
<pre class="screen" id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_screen44654165">GET https://{endpoint}/v2/89655fe61c4c4a08b9f3e7f9095441b8/servers/e723eb40-f56e-40f9-8c8c-caa517fe06ba/os-instance-actions
GET https://{endpoint}/v2.1/89655fe61c4c4a08b9f3e7f9095441b8/servers/e723eb40-f56e-40f9-8c8c-caa517fe06ba/os-instance-actions</pre>
</div>
<div class="section" id="EN-US_TOPIC_0065817692__section10181122219535"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="EN-US_TOPIC_0065817692__screen1818992215538">{
"instanceActions": [
{
"instance_uuid": "e723eb40-f56e-40f9-8c8c-caa517fe06ba",
"user_id": "752be40780484291a9cc7ae50fff3e6d",
"start_time": "2014-12-16T10:58:14.000000",
"request_id": "req-ee56c2b5-d33b-4749-ae83-09281dbbb716",
"action": "resize",
"message": "Error",
"project_id": "89655fe61c4c4a08b9f3e7f9095441b8"
},
{
"instance_uuid": "e723eb40-f56e-40f9-8c8c-caa517fe06ba",
"user_id": "752be40780484291a9cc7ae50fff3e6d",
"start_time": "2014-12-16T10:57:56.000000",
"request_id": "req-23cfd57f-c58a-45cd-86a6-eab3e38f3753",
"action": "resize",
"message": "Error",
"project_id": "89655fe61c4c4a08b9f3e7f9095441b8"
},
]
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_section1642564"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0065817692__en-us_topic_0057973177_en-us_topic_0020212652_p5882489">See <a href="en-us_topic_0022067716.html">Returned Values for General Requests</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0167809633.html">ECS Operation Management</a></div>
</div>
</div>