Obtaining Alarm Events in All Clusters
Function
This API is used to obtain alarm events in all clusters.
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
GET /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. |
|
offset |
Yes |
Integer |
Definition Offset, which specifies the start position of the record to be returned. Constraints N/A Range The value range is 0 to 2,000,000. Default Value N/A |
|
limit |
Yes |
Integer |
Definition Number of records displayed on each page. Constraints N/A Range Value range: 10 to 200 Default Value 10 |
|
cluster_id |
No |
String |
Specifies the cluster ID. |
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
Obtain the alarm events in all clusters.
GET https://{endpoint}/v5/{project_id}/cluster-protect/events?offset=0&limit=200&enterprise_project_id=all_granted_eps
Example Responses
Status code: 200
Request succeeded.
{
"total_num" : 1,
"data_list" : [ {
"project_id" : "84b5266c14ae489fa6549827f032dc62",
"enterprise_project_id" : "0",
"action" : "warn",
"update_time" : 1695094500324,
"event_id" : "03368dc5-80ae-482f-8fa8-e62d778bb29f",
"cluster_id" : "44753d6c-415e-11ee-834b-0255ac1001b2",
"event_class_id" : "clusterprotect_1001",
"event_type" : 3009,
"handle_status" : "unhandled",
"event_content" : "{\"enforcementAction\":\"warn\",\"group\":\"\",\"kind\":\"Pod\",\"message\":\"hit label a4, vul image nginx can not startup.\",\"name\":\"deny11\",\"namespace\":\"test-lby\",\"version\":\"v1\"}",
"policy_id" : "4636a2d6-1b8c-44d3-863d-7d881348d32a",
"policy_name" : "lbytest-warn",
"resource_info" : {
"enforcement_action" : "warn",
"group" : "",
"kind" : "Pod",
"message" : "hit label a4, vul image nginx can not startup.",
"name" : "deny11",
"namespace" : "test-lby",
"version" : "v1"
}
} ]
}
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