Files
doc-exports/docs/cfw/api-ref/ListJob.html
qiaoli 9776db0ee8 First version of the CFW API
Reviewed-by: Gladkov, Maksim <mgladkov@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: qiaoli <qiaoli@huawei.com>
Co-committed-by: qiaoli <qiaoli@huawei.com>
2025-01-21 07:59:01 +00:00

177 lines
13 KiB
HTML

<a name="ListJob"></a><a name="ListJob"></a>
<h1 class="topictitle1">Obtaining the Status of a CFW Task</h1>
<div id="body1708331107508"><div class="section" id="ListJob__section29443413226"><h4 class="sectiontitle">Function</h4><p id="ListJob__p189444411227">This API is used to obtain the status of a CFW task.</p>
</div>
<div class="section" id="ListJob__section179441741102219"><h4 class="sectiontitle">URI</h4><p id="ListJob__p1394554112220">GET /v3/{project_id}/jobs/{job_id}</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListJob__table1694534119228" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="ListJob__row094514102216"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="ListJob__p1694518419223">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="ListJob__p1594504192210">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="ListJob__p109452411223">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="ListJob__p994644112217">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListJob__row69451041192211"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="ListJob__p1994619416224">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="ListJob__p1394613418224">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="ListJob__p1194654114221">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="ListJob__p79465419223">Project ID, which can be obtained by calling an API or from the console. For details, see <a href="cfw_02_0015.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="ListJob__row10945841152217"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="ListJob__p5946341102216">job_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="ListJob__p1946114118224">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="ListJob__p1394744117225">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="ListJob__p3947204115229">Task ID returned when a pay-per-use firewall is created. You can obtain the task ID by calling the <a href="CreateFirewall.html">API for creating a firewall</a>. Its value is obtained from <strong id="ListJob__b1994784112216">job_id</strong> in the return value.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListJob__section18947144116225"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListJob__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="ListJob__row794784122214"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="ListJob__p189471441112216">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="ListJob__p179485410225">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="ListJob__p7948154115224">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="ListJob__p1894894119227">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListJob__row179471841102215"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="ListJob__p794894102220">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="ListJob__p49481141132219">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="ListJob__p7948134113221">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="ListJob__p1694811417228">User token. You can obtain the token by referring to <a href="cfw_02_0029.html">Obtaining a User Token</a>.</p>
</td>
</tr>
<tr id="ListJob__row034595918266"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="ListJob__p16987185572214">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="ListJob__p1453216872313">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="ListJob__p598785514223">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="ListJob__p1821149193417">Content type. It can only be set to application/json.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListJob__section139481141102219"><h4 class="sectiontitle">Response Parameters</h4><p id="ListJob__p694817413224"><strong id="ListJob__b09481741102213">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListJob__response_GetCreateFirewallJobResponse" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response body parameters</caption><thead align="left"><tr id="ListJob__row99499418220"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.1"><p id="ListJob__p13949144152220">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.2"><p id="ListJob__p89491941102210">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.3.2.4.1.3"><p id="ListJob__p1949154102210">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListJob__row1194934102219"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ListJob__p2949194111224">data</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ListJob__p294974182210"><a href="#ListJob__response_GetCreateFirewallJobResponseData">GetCreateFirewallJobResponseData</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ListJob__p1894984152216">Data returned for creating a pay-per-use firewall.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="ListJob__response_GetCreateFirewallJobResponseData"></a><a name="response_GetCreateFirewallJobResponseData"></a><table cellpadding="4" cellspacing="0" summary="" id="ListJob__response_GetCreateFirewallJobResponseData" frame="border" border="1" rules="all"><caption><b>Table 4 </b>GetCreateFirewallJobResponseData</caption><thead align="left"><tr id="ListJob__row1895094117226"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.1"><p id="ListJob__p1095016417224">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.2"><p id="ListJob__p12951124112224">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.4.2.4.1.3"><p id="ListJob__p7951941142217">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListJob__row1950104132212"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListJob__p895194110222">id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListJob__p195112417227">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListJob__p19951741182210">ID of the task for creating a pay-per-use firewall.</p>
</td>
</tr>
<tr id="ListJob__row1895064112214"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListJob__p295154102215">status</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListJob__p10951141182216">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListJob__p59511741172216">Task execution status, which indicates whether a firewall is successfully created.</p>
<p id="ListJob__p89512041162211">Enumeration values:</p>
<ul id="ListJob__ul179511641162214"><li id="ListJob__li18951124112227"><strong id="ListJob__b1495124112215">Running</strong></li><li id="ListJob__li595216418221"><strong id="ListJob__b0952134162211">Success</strong></li><li id="ListJob__li15952114172214"><strong id="ListJob__b9952114112217">Failed</strong></li></ul>
</td>
</tr>
<tr id="ListJob__row13950144111224"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListJob__p20952641192220">begin_time</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListJob__p159524410225">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListJob__p295224142210">Creation time in the "yyyy-mm-ddThh:mm:ssZ" format.</p>
<p id="ListJob__p139527418229"><strong id="ListJob__b129521141182219">T</strong> is the separator between the calendar and the hourly notation of time. <strong id="ListJob__b7952134182213">Z</strong> indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as <strong id="ListJob__b1195254118228">+0800</strong>.</p>
</td>
</tr>
<tr id="ListJob__row19950441122211"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListJob__p9952164110224">end_time</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListJob__p139521541142218">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListJob__p4952541202212">End time in the "yyyy-mm-ddThh:mm:ssZ" format.</p>
<p id="ListJob__p795214117221"><strong id="ListJob__b13952241182219">T</strong> is the separator between the calendar and the hourly notation of time. <strong id="ListJob__b4952841112219">Z</strong> indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as <strong id="ListJob__b149523413228">+0800</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListJob__section149531241202212"><h4 class="sectiontitle">Example Requests</h4><p id="ListJob__p199531941132219">Obtain information about the f588ce71-e26c-400d-8981-f854355f6849 task for creating a pay-per-use firewall in project 09bb24e6fe80d23d2fa2c010b53b418c.</p>
<pre class="screen" id="ListJob__screen11953114118222">https://{Endpoint}/v3/09bb24e6fe80d23d2fa2c010b53b418c/jobs/f588ce71-e26c-400d-8981-f854355f6849</pre>
</div>
<div class="section" id="ListJob__section16953141172212"><h4 class="sectiontitle">Example Responses</h4><p id="ListJob__p11953441162216"><strong id="ListJob__b69533417223">Status code: 200</strong></p>
<p id="ListJob__p995324122220">Return value of the API for obtaining the information about a pay-per-use firewall creation task.</p>
<pre class="screen" id="ListJob__screen1295394110226">{
"data" : {
"begin_time" : 1641370501000,
"end_time" : 1641370515000,
"id" : "f588ce71-e26c-400d-8981-f854355f6849",
"status" : "Success"
}
}</pre>
</div>
<div class="section" id="ListJob__section19162164214227"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListJob__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="ListJob__row8963164112222"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="ListJob__p116224212222">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="ListJob__p51621942192216">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListJob__row896344116220"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListJob__p616217428220">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListJob__p171621142182218">Return value of the API for obtaining the information about a pay-per-use firewall creation task.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListJob__section20162134214223"><h4 class="sectiontitle">Error Codes</h4><p id="ListJob__p01621242102210">See <a href="ErrorCode.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="topic_300000000.html">Firewall Management</a></div>
</div>
</div>