Modifying the Alarm Status
Function
This API is used to modify the alarm status.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
PUT /v5/{project_id}/cluster-protect/events
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID, which is used to specify the project that an asset belongs to. After the project ID is configured, you can query assets in the project using the project ID. For details about how to obtain it, see Obtaining a Project ID. Constraints N/A Range The value can contain 1 to 256 characters. Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
enterprise_project_id |
No |
String |
Definition Enterprise project ID, which is used to filter assets in different enterprise projects. For details, see Obtaining an Enterprise Project ID. To query assets in all enterprise projects, set this parameter to all_granted_eps. Constraints You need to set this parameter only after the enterprise project function is enabled. Range The value can contain 1 to 256 characters. Default Value 0: default enterprise project. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token, which contains user identity and permissions. The token can be used for identity authentication when an API is called. For details about how to obtain the token, see Obtaining a User Token. Constraints N/A Range The value can contain 1 to 32,768 characters. Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
total_num |
Integer |
Definition Total number. Range Minimum value: 0; maximum value: 10,000 |
|
last_update_time |
Long |
Definition Latest update time. Range The value range is 0 to 9,223,372,036,854,775,807. |
|
data_list |
Array of ClusterEventResponseInfo objects |
Definition Cluster security event list. Range The value can contain 0 to 10,000 ClusterEventResponseInfo objects. |
|
Parameter |
Type |
Description |
|---|---|---|
|
action |
String |
Definition Blocking action. Range The value can contain 1 to 32 characters. |
|
cluster_name |
String |
Definition Cluster name. Range The value can contain 1 to 64 characters. |
|
cluster_id |
String |
Definition Cluster ID. Range The value can contain 1 to 256 characters. |
|
event_name |
String |
Definition Event name. Range The value can contain 1 to 128 characters. |
|
event_class_id |
String |
Definition Unique event ID. Range The value can contain 1 to 128 characters. |
|
event_id |
String |
Definition Event ID. Range The value can contain 1 to 128 characters. |
|
event_type |
Integer |
Definition Event type. Range Minimum value: 1,000; maximum value: 30,000 |
|
event_content |
String |
Definition Event content. Range The value can contain 1 to 128 characters. |
|
handle_status |
String |
Definition Handling status. Range |
|
create_time |
Long |
Definition Creation time. Range The value range is 0 to 9,223,372,036,854,775,807. |
|
update_time |
Long |
Definition Update time. Range The value range is 0 to 9,223,372,036,854,775,807. |
|
project_id |
String |
Definition Project ID. Range The value can contain 1 to 128 characters. |
|
enterprise_project_id |
String |
Definition Enterprise ID. Range The value can contain 1 to 256 characters. |
|
policy_name |
String |
Definition Policy name. Range The value can contain 1 to 128 characters. |
|
policy_id |
String |
Definition Policy ID. Range The value can contain 1 to 128 characters. |
|
resource_info |
Event resource information |
|
Parameter |
Type |
Description |
|---|---|---|
|
enforcement_action |
String |
Definition Action. Range The value can contain 1 to 256 characters. |
|
group |
String |
Definition Group. Range The value can contain 1 to 256 characters. |
|
message |
String |
Definition Information. Range The value can contain 1 to 256 characters. |
|
name |
String |
Definition Name. Range The value can contain 1 to 256 characters. |
|
namespace |
String |
Definition Namespace. Range The value can contain 0 to 256 characters. |
|
version |
String |
Definition Version. Range The value can contain 0 to 128 characters. |
|
kind |
String |
Definition Resource type. Range The value can contain 1 to 64 characters. |
|
resource_name |
String |
Definition Resource name. Range The value can contain 1 to 256 characters. |
Example Requests
This API is used to modify the alarm status.
PUT https://{endpoint}/v5/{project_id}/cluster-protect/events?enterprise_project_id=all_granted_eps
{
"total_num" : 1,
"opr" : "ignore",
"data_list" : [ "daa271e0-9bdb-49cd-9f74-6f1a74686bd1" ]
}
Example Responses
Status code: 200
Request succeeded.
{
"total_num" : 1,
"last_update_time" : 1695094500324,
"data_list" : [ {
"action" : "84b5266c14ae489fa6549827f032dc62",
"cluster_name" : "cce-01",
"cluster_id" : "44753d6c-415e-11ee-834b-0255ac1001b2",
"event_name" : "ExpressionInject",
"event_class_id" : "clusterprotect_1001",
"event_id" : "03368dc5-80ae-482f-8fa8-e62d778bb29f",
"event_type" : 3009,
"event_content" : "{\"enforcementAction\":\"warn\",\"group\":\"\",\"kind\":\"Pod\",\"message\":\"hit label a4, vul image nginx can not startup.\",\"name\":\"deny11\",\"namespace\":\"test-lby\",\"version\":\"v1\"}",
"handle_status" : "unhandled",
"create_time" : 1695094500324,
"update_time" : 1695094500324,
"project_id" : "84b5266c14ae489fa6549827f032dc62",
"enterprise_project_id" : "0",
"policy_name" : "test-warn",
"policy_id" : "4636a2d6-1b8c-44d3-863d-7d881348d32a",
"resource_info" : {
"enforcement_action" : "warn",
"group" : "",
"message" : "hit label a4, vul image swr.cn-north-7.myhuaweicloud.com/scc_cgs_f00418753/nginx:test can not startup.",
"name" : "nginx-test-65d79f9d9f-jmmn4",
"namespace" : "default",
"version" : "v1",
"kind" : "Pod",
"resource_name" : "WINDOWS-COMPILE"
}
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Request succeeded. |
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