Event Monitor
Query cloud product events
API description
Retrieve the Cloud Product Event List associated with users.
Permission description
The Access Key and request signature mechanism are uniformly adopted for all API security authentication. Access Key consists of an Access Key ID and a Secret Access Key, both of which are strings. For each HTTP request, use the algorithm described below to generate a authentication string. Submit the certification string in the Authorization header. The server verifies the correctness of the authentication string based on the generation algorithm. The certification string format is bce-auth-v{version}/{accessKeyId}/{timestamp}/{expirationPeriodInSeconds}/{signedHeaders}/{signature}.
- The version is a positive integer.
- The timestamp refers to the UTC time when the signature is created.
- The expirationPeriodInSeconds specifies the duration during which the signature remains valid.
- SignedHeaders includes the list of headers involved in the signature algorithm. The headers are separated by semicolons (e.g., host;x-bce-date) and arranged in lexicographical order. (This API signature involves only the host and x-bce-date headers.)
- The signature is a 256-bit signature represented as a 64-character lowercase hexadecimal digest.
When Baidu AI Cloud receives a user's request, the system uses the same SK and certification mechanism to generate a certification string. This string is then compared with the one included in the user's request. If the two match, the system confirms the user has the required permissions and proceeds with the operation. If they differ, the system cancels the operation and returns an error code.
For detailed information on the authentication mechanism, please refer to [Authentication](Reference/Authentication mechanism/Introduction.md).
Request structure
1GET /event-api/v1/bce-event/list HTTP/1.1
2Host: bcm.bj.baidubce.com
3Authorization: authorization string
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| pageNo | int | Yes | Query | Pagination page number |
| pageSize | int | Yes | Query | Page size |
| startTime | String | Yes | Query | Event occurrence time filter condition, in UTC format, e.g., 2019-01-01T00:00:00Z |
| endTime | String | Yes | Query | Event end time filter condition, in UTC format, e.g., 2019-01-01T00:00:00Z |
| accountId | String | Yes | Query | User ID |
| ascending | bool | No | Query | Whether sort by event occurrence time in ascending order; defaulting to desc (false) |
| scope | String | No | Query | Cloud service name to which the event belongs |
| region | String | No | Query | Event region filter condition |
| eventLevel | String | No | Query | Event level filter conditions: CRITICAL, MAJOR, WARNING, NOTICE |
| eventName | String | No | Query | Exact search by event name |
| eventAlias | String | No | Query | Fuzzy search by event alias |
| resourceType | String | No | Query | Product subtype to which the event-affected instance belongs, such as BCC subtype: Instance |
| resourceId | String | No | Query | Instance ID of the event instance, e.g., BCC instance: i-SyZeMxxx |
| eventId | String | No | Query | A unique identifier for an event, such as 999bbc21-2061-49e6-bb2a-fd3e6c5xxxxx. |
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| pageNumber | int | Pagination page number |
| pageSize | int | Page size |
| pageElements | int | Count of results returned per page |
| last | boolean | Whether it is the last page |
| first | boolean | Whether it is the first page |
| totalPages | int | Total number of pages |
| totalElements | int | Total count of results |
| content | Response result |
CloudEventData
| Parameter name | Types | Description |
|---|---|---|
| accountId | String | Tenant ID to which the event belongs |
| serviceName | String | Cloud service name to which the event belongs |
| region | String | Region name where the event belongs, defaulting to global |
| resourceType | String | Instance type to which the event belongs, used to distinguish different types of cloud resource objects, defaulting to instance |
| resourceId | String | Instance ID to which the event belongs |
| eventId | String | The Event ID is used to uniquely identify an event. |
| eventType | String | Event type |
| eventLevel | EventLevel | Event level, [NOTICE/WARNING/MAJOR/CRITICAL] |
| eventAlias | String | Event alias |
| timestamp | String | Timestamp of event, in UTC format |
| content | String | Event content |
Request example
1GET /event-api/v1/bce-event/list?pageNo=1&pageSize=1&startTime=2022-01-01T00:00:00Z&endTime=2022-07-18T00:00:00Z
2Host: bcm.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
Response example
1{
2 "content": [
3 {
4 "accountId": "453bf9588c9e488f9ba2c9841290xxxx", // Tenant ID to which the event belongs
5 "serviceName": "BCE_BCC", // Cloud service name to which the event belongs
6 "region": "bj", // Region to which the event belongs
7 "resourceType": "Instance", // Resource type of the instance where the event occurred
8 "resourceId": "i-SyZeMxxx", // Instance ID where the event occurred
9 "eventId": "999bbc21-2061-49e6-bb2a-fd3e6c5xxxxx", // Event ID
10 "eventType": "InstanceStateChange", // Event name
11 "eventLevel": "NOTICE", // Event level
12 "eventAlias": "BCC status change notification", // Event name in Chinese
13 "timestamp": "2022-07-15T01:01:00Z", // Event occurrence time
14 "content": "{\"info\":\"BCC instance status change\",\"advice\":\"Your BCC instance i-SyZeMxxx status has been updated to running\"}" // Additional event information
15 },
16 ],
17 "query": null,
18 "fields": [],
19 "orderBy": [],
20 "pageNumber": 1,
21 "pageSize": 1,
22 "pageElements": 1,
23 "last": false,
24 "first": true,
25 "totalPages": 34,
26 "totalElements": 34
27}
Query platform-related events
API description
Retrieve the Platform-related Event List associated with users.
Permission description
The Access Key and request signature mechanism are uniformly adopted for all API security authentication. Access Key consists of an Access Key ID and a Secret Access Key, both of which are strings. For each HTTP request, use the algorithm described below to generate a authentication string. Submit the certification string in the Authorization header. The server verifies the correctness of the authentication string based on the generation algorithm. The certification string format is bce-auth-v{version}/{accessKeyId}/{timestamp}/{expirationPeriodInSeconds}/{signedHeaders}/{signature}.
- The version is a positive integer.
- The timestamp refers to the UTC time when the signature is created.
- The expirationPeriodInSeconds specifies the duration during which the signature remains valid.
- SignedHeaders includes the list of headers involved in the signature algorithm. The headers are separated by semicolons (e.g., host;x-bce-date) and arranged in lexicographical order. (This API signature involves only the host and x-bce-date headers.)
- The signature is a 256-bit signature represented as a 64-character lowercase hexadecimal digest.
When Baidu AI Cloud receives a user's request, the system uses the same SK and certification mechanism to generate a certification string. This string is then compared with the one included in the user's request. If the two match, the system confirms the user has the required permissions and proceeds with the operation. If they differ, the system cancels the operation and returns an error code.
For detailed information on the authentication mechanism, please refer to [Authentication](Reference/Authentication mechanism/Introduction.md).
Request structure
1GET /event-api/v1/platform-event/list HTTP/1.1
2Host: bcm.bj.baidubce.com
3Authorization: authorization string
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| pageNo | int | Yes | Query | Pagination page number |
| pageSize | int | Yes | Query | Page size |
| startTime | String | Yes | Query | Event occurrence time filter condition, in UTC format, e.g., 2019-01-01T00:00:00Z |
| endTime | String | Yes | Query | Event end time filter condition, in UTC format, e.g., 2019-01-01T00:00:00Z |
| accountId | String | Yes | Query | User ID |
| ascending | bool | No | Query | Whether sort by event occurrence time in ascending order; defaulting to desc (false) |
| region | String | No | Query | Event region filter condition |
| eventLevel | String | No | Query | Event level filter conditions: CRITICAL, MAJOR, WARNING, NOTICE |
| eventName | String | No | Query | Exact search by event name |
| eventAlias | String | No | Query | Fuzzy search by event alias |
| eventId | String | No | Query | A unique identifier for an event, such as 999bbc21-2061-49e6-bb2a-fd3e6c5xxxxx. |
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| pageNumber | int | Pagination page number |
| pageSize | int | Page size |
| pageElements | int | Count of results returned per page |
| last | boolean | Whether it is the last page |
| first | boolean | Whether it is the first page |
| totalPages | int | Total number of pages |
| totalElements | int | Total count of results |
| content | Response result |
PlatformEventDataResponse
| Parameter name | Types | Description |
|---|---|---|
| userId | String | User ID |
| eventSource | String | Event source |
| eventName | String | Event name |
| timestamp | String | Timestamp of event, in UTC format |
| eventId | String | The Event ID is used to uniquely identify an event. |
| region | String | Region name to which the event belongs |
| az | String | Availability region where the event belongs |
| eventLevel | EventLevel | Event level, [NOTICE/WARNING/MAJOR/CRITICAL] |
| eventAlias | String | Event alias |
| eventParentAlias | String | Parent type event name |
| content | String | Event content |
| resources | List of affected resources, optional |
PlatformResource
| Parameter name | Types | Description |
|---|---|---|
| service | String | Service name |
| userId | String | User ID |
| instanceId | String | Instance ID |
| shortInstanceId | String | Short instance ID |
| instanceName | String | Instance name |
Request example
1GET /event-api/v1/platform-event/list?pageNo=1&pageSize=1&startTime=2022-05-01T00:00:00Z&endTime=2022-07-18T00:00:00Z
2Host: bcm.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
Response example
1{
2 "content": [
3 {
4 "userId": "453bf9588c9e488f9ba2c9841290xxxx", // Tenant ID to which the event belongs. * indicates the event affects all users
5 "eventSource": "Platform", // Event source
6 "eventName": "RD_NET_ERROR", // Event Name
7 "timestamp": "2022-07-17T01:30:29Z", // Event occurrence time
8 "eventId": "999bbc21-2061-49e6-bb2a-fd3e6c5xxxxx", // Event ID
9 "region": "bj", // Event region
10 "az": "[\"zoneB\",\"zoneA\"]", // Availability region affected by the event which may be null.
11 "eventLevel": "CRITICAL", // Event level
12 "eventAlias": "RD network exception", // Event name in Chinese
13 "eventParentAlias": "", // Category to which the event belongs, e.g., "jitter". It can be null.
14 "status": "ALARM", // Event status: NULL-no status, ALARM-alarm status, OK-normal status
15 "content": "{\"info\":\"platform-0714-005\",\"advice\":\"RD network anomaly, please check\",\"raw\":\"\"}", // Additional event information
16 // Range affected by the event
17 "resources": [
18 {
19 "service": "BCE_BCC", // Affected cloud product scope
20 "userId": "453bf9588c9e488f9ba2c9841290xxxx",
21 "instanceId": "43fs23jfsx9df220sDSf92fxxxxx", // Affected instance ID; "*" indicates inability to locate specific affected instances
22 "shortInstanceId": "i-SyZeMxxx", // Short ID of the affected instance, null indicates inability to locate specific affected instances
23 "instanceName": "i-SyZeMxxx" // Affected instance name; null indicates inability to locate specific affected instances
24 }
25 ]
26 }
27 ],
28 "query": null,
29 "fields": [],
30 "orderBy": [],
31 "pageNumber": 1,
32 "pageSize": 1,
33 "pageElements": 1,
34 "last": false,
35 "first": true,
36 "totalPages": 100,
37 "totalElements": 100
38}
Alarm strategy
Create Event Alarm Strategy
API description
Create Event Alarm Strategy
Request structure
1POST /event-api/v1/accounts/{accountId}/services/{serviceName}/alarm-policies HTTP/1.1
2Host: bcm.bj.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| serviceName | String | Yes | Path | Cloud product to which the event belongs |
| accountId | String | Yes | Path | User ID |
| alarmConfig | EventAlarmConfig | Yes | Body | Event strategy configuration |
Response headers
There are no special headers required beyond the common headers.
Response parameters
No parameters
Request example
1{
2 "serviceName": "BCE_EDAP", // Cloud product to which the event strategy belongs
3 "name": "test-jobgroup", // Event strategy name
4 // Instance scope of interest for strategy, required
5 "resource": {
6 "region": "bj",
7 "type": "instance",
8 "monitorObjectType": "TAG"
9 "resources": [
10 {
11 "identifiers": [
12 {
13 "name": "tag-key",
14 "value": "tag-value",
15 }
16 ]
17 }
18 ]
19 },
20 // Instance scope of interest for user configuration, required
21 "eventFilter": {
22 "eventLevel": "*",
23 "eventTypeList": [
24 "*"
25 ]
26 },
27 // Notification template list, required
28 "incidentActions": [
29 "b22b97d6-72b4-4ac1-a86d-25d66375xxxx"
30 ],
31 "blockStatus": "NORMAL", // The notification status of the strategy, the normal status is "NORMAL", when notifications are shut down, the status is "BLOCKED"
32 "accountId": "453bf9588c9e488f9ba2c9841290xxxx" // User ID to which the strategy belongs, required
33}
Appendix
EventAlarmConfig
| Name | Types | Description |
|---|---|---|
| serviceName | String | Cloud product to which the strategy belongs, required |
| accountId | String | User ID to which the strategy belongs, required |
| name | String | The strategy name is user-defined and must be unique for each user under the same cloud product. This field is required. |
| resource | EventResourceFilter | Instance scope of interest for strategy, required |
| eventFilter | EventFilter | Instance scope of interest for user configuration, required |
| incidentActions | Notification template list, required | |
| blockStatus | String | The notification status of the strategy, the normal status is "NORMAL", when notifications are shut down, the status is "BLOCKED" |
EventResourceFilter
| Name | Types | Description |
|---|---|---|
| region | String | Instance region information, required |
| type | String | The sub-product type of the cloud product is required, with a default value of "Instance". |
| monitorObjectType | MonitorObjectType | Cloud product to which the strategy belongs, required |
| resources | List<EventResource> | Specific instance information of interest for strategy, ignored when monitorObjectType is ALL |
EventFilter
| Name | Types | Description |
|---|---|---|
| eventLevel | EventLevel | Event level of interest, required |
| eventTypeList | The event type for user configuration can include multiple options. To select all, use "*". |
EventResource
| Name | Types | Description |
|---|---|---|
| identifiers | Map<String,String> | User-configured instance or tag details. For instance: instanceId:i-vs3s24i; for tags: tag-k-1:tag-v-1. |
MonitorObjectType
| Value | Description |
|---|---|
| ALL | All instances |
| TAG | Effective for specified tags |
| INSTANCE | Effective for specified instances |
EventLevel
| Value | Description |
|---|---|
| * | All |
| NOTICE | Notification |
| WARNING | Warning |
| MAJOR | Warning |
| CRITICAL | Failure |
