:original_name: CancelCaptureTask.html
.. _CancelCaptureTask:
cancel capture task
===================
Function
--------
cancel capture task
URI
---
POST /v1/{project_id}/capture-task/stop
.. table:: **Table 1** Path Parameters
========== ========= ====== ===========
Parameter Mandatory Type Description
========== ========= ====== ===========
project_id Yes String Project ID
========== ========= ====== ===========
.. table:: **Table 2** Query Parameters
+-----------------------+-----------+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Parameter | Mandatory | Type | Description |
+=======================+===========+========+================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================+
| fw_instance_id | Yes | String | Firewall instance ID, which is automatically generated after a CFW instance is created. You can obtain the ID by calling the API used for querying a firewall instance. For details, see the API Explorer and Help Center FAQ.By default, if fw_instance_Id is not specified, information about the first firewall under the account is returned. If fw_instance_Id is specified, information about the firewall with this fw_instance_Id is returned.If object_Id is specified, information about the firewall with this object_Id is returned by default. If both fw_instance_Id and object_Id are specified, the specified object_Id must belong to the specified firewall. |
+-----------------------+-----------+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| enterprise_project_id | No | String | Enterprise project id, the id generated by the enterprise project after the user supports the enterprise project, which can be obtained by calling the ListFirewallList. |
+-----------------------+-----------+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Request Parameters
------------------
.. table:: **Table 3** Request header parameters
+--------------+-----------+--------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| Parameter | Mandatory | Type | Description |
+==============+===========+========+====================================================================================================================================================+
| X-Auth-Token | No | String | User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token. |
+--------------+-----------+--------+----------------------------------------------------------------------------------------------------------------------------------------------------+
.. table:: **Table 4** Request body parameters
========= ========= ====== =======================
Parameter Mandatory Type Description
========= ========= ====== =======================
task_id No String cancel capture task dto
========= ========= ====== =======================
Response Parameters
-------------------
**Status code: 200**
.. table:: **Table 5** Response body parameters
+-----------+---------------------------------------------------------------+------------------------------+
| Parameter | Type | Description |
+===========+===============================================================+==============================+
| data | :ref:`IdObject ` object | cancel capture task response |
+-----------+---------------------------------------------------------------+------------------------------+
.. _cancelcapturetask__response_idobject:
.. table:: **Table 6** IdObject
========= ====== ===========
Parameter Type Description
========= ====== ===========
id String ID
name String name
========= ====== ===========
Example Requests
----------------
Stop the packet capture task with project ID 09bb24e6fe80d23d2fa2c010b53b418c and firewall ID ebf891cd-2163-48a0-9963-6309f99dd3c4 and task ID 1dcddab3-7d79-4a56-9e67-4aa0962b98ad.
.. code-block::
https://{Endpoint}/v1/09bb24e6fe80d23d2fa2c010b53b418c/capture-task/stop?fw_instance_id=ebf891cd-2163-48a0-9963-6309f99dd3c4&enterprise_project_id=default
{
"task_id" : "1dcddab3-7d79-4a56-9e67-4aa0962b98ad"
}
Example Responses
-----------------
**Status code: 200**
cancle capture task response
.. code-block::
{
"data" : {
"id" : "ebf891cd-2163-48a0-9963-6309f99dd3c4",
"name" : "test"
}
}
Status Codes
------------
=========== ============================
Status Code Description
=========== ============================
200 cancle capture task response
=========== ============================
Error Codes
-----------
See :ref:`Error Codes `.