:original_name: UpdateLogConfig.html .. _UpdateLogConfig: Updating Log Configurations =========================== Function -------- This API is used to update log configurations. URI --- PUT /v1/{project_id}/cfw/logs/configuration .. table:: **Table 1** Path Parameters +------------+-----------+--------+----------------------------------------------------------------------------------------------------------------------------------------+ | Parameter | Mandatory | Type | Description | +============+===========+========+========================================================================================================================================+ | project_id | Yes | String | Project ID, which can be obtained by calling an API or from the console. For details, see :ref:`Obtaining a Project ID `. | +------------+-----------+--------+----------------------------------------------------------------------------------------------------------------------------------------+ .. table:: **Table 2** Query Parameters +-----------------------+-----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Parameter | Mandatory | Type | Description | +=======================+===========+========+==============================================================================================================================================================================================================================================================================+ | fw_instance_id | Yes | String | Firewall ID, which can be obtained via :ref:`API ` by referring to :ref:`Obtaining a Firewall ID `. | +-----------------------+-----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | enterprise_project_id | No | String | Enterprise project ID, which is the ID of a project planned based on organizations. You can obtain the enterprise project ID by referring to :ref:`Obtaining an Enterprise Project ID `. If the enterprise project function is not enabled, the value is **0**. | +-----------------------+-----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Request Parameters ------------------ .. table:: **Table 3** Request header parameters +--------------+-----------+--------+---------------------------------------------------------------------------------------------------+ | Parameter | Mandatory | Type | Description | +==============+===========+========+===================================================================================================+ | X-Auth-Token | Yes | String | User token. You can obtain the token by referring to :ref:`Obtaining a User Token `. | +--------------+-----------+--------+---------------------------------------------------------------------------------------------------+ .. table:: **Table 4** Request body parameters +------------------------------+-----------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Parameter | Mandatory | Type | Description | +==============================+===========+=========+============================================================================================================================================================================================================================================================+ | fw_instance_id | Yes | String | Firewall ID, which can be obtained by referring to :ref:`Obtaining a Firewall ID `. | +------------------------------+-----------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | lts_enable | Yes | Integer | Whether to enable LTS: **true** (yes), **false** (no). | +------------------------------+-----------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | lts_log_group_id | Yes | String | Log Tank Service (LTS) log group ID, which can be obtained by calling the API for querying all the log groups of an account in LTS. Find the value in **log_groups.log_group_id** (The period [.] is used to separate different levels of objects). | +------------------------------+-----------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | lts_attack_log_stream_id | No | String | Attack log stream ID, which can be obtained by calling the API for querying all the log streams in a specified log group in LTS. Find the value in **log_streams.log_stream_id** (The period [.] is used to separate different levels of objects). | +------------------------------+-----------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | lts_attack_log_stream_enable | Yes | Integer | Whether to enable the attack log stream: **true** (yes), **false** (no). | +------------------------------+-----------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | lts_access_log_stream_id | No | String | Access control log stream ID, which can be obtained by calling the API for querying all the log streams in a specified log group in LTS. Find the value in **log_streams.log_stream_id** (The period [.] is used to separate different levels of objects). | +------------------------------+-----------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | lts_access_log_stream_enable | Yes | Integer | Whether to enable the access control stream: **true** (yes), **false** (no). | +------------------------------+-----------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | lts_flow_log_stream_id | No | String | Traffic log ID, which can be obtained by calling the API for querying all the log streams in a specified log group in LTS. Find the value in **log_streams.log_stream_id** (The period [.] is used to separate different levels of objects). | +------------------------------+-----------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | lts_flow_log_stream_enable | Yes | Integer | Whether to enable the traffic log function: **true** (yes), **false** (no). | +------------------------------+-----------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Response Parameters ------------------- **Status code: 200** .. table:: **Table 5** Response body parameters +-----------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Parameter | Type | Description | +===========+========+=================================================================================================================================================================+ | data | String | Return value for updating log configurations. The value is the firewall ID, which can be obtained by referring to :ref:`Obtaining a Firewall ID `. | +-----------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ Example Requests ---------------- Update the log configurations of firewall 22c4a5db-504c-471f-8187-5192bc11de0b in project 408972e72dcd4c1a9b033e955802a36b. The LTS log, flow log, access control log, and attack log functions are disabled. .. code-block:: https://{Endpoint}/v1/408972e72dcd4c1a9b033e955802a36b/cfw/logs/configuration?fw_instance_id=22c4a5db-504c-471f-8187-5192bc11de0b&enterprise_project_id=default { "fw_instance_id" : "22c4a5db-504c-471f-8187-5192bc11de0b", "lts_enable" : 0, "lts_log_group_id" : "20282428-a8f9-4e75-8246-165e64cf8ba8", "lts_attack_log_stream_enable" : 0, "lts_access_log_stream_enable" : 0, "lts_flow_log_stream_enable" : 0 } Example Responses ----------------- **Status code: 200** Return value for updating log configurations. .. code-block:: { "data" : "4e113415-7811-4bb3-bf5e-eb835953f7d4" } Status Codes ------------ =========== ============================================= Status Code Description =========== ============================================= 200 Return value for updating log configurations. =========== ============================================= Error Codes ----------- See :ref:`Error Codes `.