Updating an Emergency Policy
Function
This API is used to update an emergency policy. The policy is updated based on the modified attributes. The columns that are not modified will not be updated.
Calling Method
For details, see Calling APIs.
URI
PUT /v1/{project_id}/workspaces/{workspace_id}/soc/policys/{policy_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID, which is used to specify the project that a resource belongs to. You can query the resources of a project by project ID. You can obtain the project ID from the API or console. Obtaining the Project ID Constraints N/A Range N/A Default Value N/A |
|
workspace_id |
Yes |
String |
Definition Workspace ID. Constraints N/A Range N/A Default Value N/A |
|
policy_id |
Yes |
String |
Definition Policy ID. Constraints N/A Range N/A Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. You can obtain it by calling the IAM API for obtaining a user token. The user token is the value of X-Subject-Token in the response header. Obtaining a User Token Constraints N/A Range N/A Default Value N/A |
|
content-type |
Yes |
String |
Definition Content type.
Constraints N/A Range
Default Value N/A |
|
x-secmaster-version |
Yes |
String |
Service version, for example, 25.5.0. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
batch_ids |
Yes |
Array of strings |
ID set of emergency policies. |
|
data_object |
No |
Policy object |
Policy entity information (Other fields must be specified after the data class field is determined.) |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
version |
No |
String |
Version of the policy object. The value of this field must be one of the official release versions determined by Huawei Cloud SSA. |
|
id |
No |
String |
Unique ID of the policy. The value is in UUID format and contains a maximum of 36 characters. |
|
domain_id |
No |
String |
ID of the account (domain_id) to whom the data is delivered and hosted. |
|
domain_name |
No |
String |
Domain name (domain_name) of the destination account for the data delivery. |
|
region_id |
No |
String |
Region ID (region_id) of the destination account for the data delivery. |
|
workspace_id |
No |
String |
ID of the current workspace. |
|
create_time |
No |
String |
Recording time. The format is ISO 8601: YYYY-MM-DDTHH:mm:ss.ms+Time zone. Time zone refers to where the incident occurred. If this parameter cannot be parsed, the default time zone UTC+8 is used. |
|
update_time |
No |
String |
Recording time. The format is ISO 8601: YYYY-MM-DDTHH:mm:ss.ms+Time zone. Time zone refers to where the incident occurred. If this parameter cannot be parsed, the default time zone UTC+8 is used. |
|
creator |
No |
String |
Creator ID. |
|
creator_name |
No |
String |
Creator name. |
|
modifier_id |
No |
String |
Modifier ID. |
|
modifier_name |
No |
String |
Modifier name. |
|
block_target |
No |
String |
IP address of the blocked object. |
|
policy_task_id |
No |
String |
Task ID. |
|
policy_task_name |
No |
String |
Task name. |
|
policy_category |
No |
String |
Type. The value can be WHITE or BLOCK. WHITE: Objects such as IP addresses will be added to the whitelist. BLOCK: The objects such as IP addresses will be added to the blacklist. |
|
type |
No |
String |
Block type. Currently, only source IP addresses are supported. |
|
block_age |
No |
block_age object |
Block aging. |
|
label |
No |
String |
Tag. |
|
description |
No |
String |
Emergency policy description. |
|
defense_policy_list |
No |
Array of ConnectionPolicy objects |
List of policies corresponding to the operation connection. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
is_block_ageing |
No |
Boolean |
Whether to block aging. |
|
block_ageing |
No |
String |
Aging time. The value is a timestamp, in ms. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
defense_id |
No |
String |
Unique ID of the policy. The value is in UUID format and contains a maximum of 36 characters. |
|
defense_update_time |
No |
String |
Recording time. The format is ISO 8601: YYYY-MM-DDTHH:mm:ss.ms+Time zone. Time zone refers to where the incident occurred. If this parameter cannot be parsed, the default time zone UTC+8 is used. |
|
defense_modifier_id |
No |
String |
Modifier ID. |
|
defense_modifier_name |
No |
String |
Modifier name. |
|
defense_block_status |
No |
String |
Block status. |
|
defense_connection_id |
No |
String |
Operation connection ID. |
|
defense_connection_name |
No |
String |
Operation connection name. |
|
target_enterprise_id |
No |
String |
Enterprise project ID. |
|
target_enterprise_name |
No |
String |
Enterprise project name. |
|
defense_policy_name |
No |
String |
Policy name. |
|
defense_type |
No |
String |
Defense layer service. |
|
defense_policy_list |
No |
Array of strings |
Actual IDs of defense layer policies. |
|
defense_connection_region_id |
No |
String |
Region for the defense layer policy. |
|
sync_status |
No |
String |
Defense layer synchronization status. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Error code. |
|
data |
String |
Task ID. |
|
message |
String |
Error message. |
|
request_id |
String |
Request ID. |
|
success |
Boolean |
Request status. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Definition Error code. Range N/A |
|
message |
String |
Definition Error description. Range N/A |
Example Requests
/v1/3bb27e024693436da46b5f5aaf499060/workspaces/42713b38-d753-4365-8b4a-50d179e15747/soc/policys/1f051624-d255-4cd1-a724-f7841f5d8ca1
{
"batch_ids" : [ "50c5feca-a6e8-4f16-9e00-df11568ec17f" ],
"data_object" : {
"defense_policy_list" : [ {
"defense_connection_id" : "1d62c549-c0b9-32b7-9eaf-fdd0c1c7fab5",
"defense_connection_name" : "WAF authentication token.",
"defense_type" : "WAF",
"target_enterprise_id" : "0",
"target_enterprise_name" : "default",
"target_project_id" : "3bb27e024693436da46b5f5aaf499060",
"target_project_name" : "cn-north-7",
"defense_connection_region_id" : "cn-north-7",
"defense_connection_region_name" : "xxxx"
} ],
"block_age" : {
"is_block_ageing" : false,
"block_ageing" : null
},
"labels" : "",
"description" : ""
}
}
Example Responses
Status code: 200
Response body for updating an emergency policy.
{
"code" : "00000000",
"data" : "1f051624-d255-4cd1-a724-f7841f5d8ca1",
"message" : "",
"request_id" : "",
"success" : true
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Response body for updating an emergency policy. |
|
400 |
Response body for an emergency policy update error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot