百度智能云

All Product Document

          Cloud Monitor

          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

          GET /event-api/v1/bce-event/list HTTP/1.1
          Host: bcm.bj.baidubce.com
          Authorization: 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 List 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

          GET /event-api/v1/bce-event/list?pageNo=1&pageSize=1&startTime=2022-01-01T00:00:00Z&endTime=2022-07-18T00:00:00Z
          Host: bcm.bj.baidubce.com
          Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de

          Response example

          {
              "content": [
                  {
           "accountId": "453bf9588c9e488f9ba2c9841290xxxx",  // Tenant ID to which the event belongs
           "serviceName": "BCE_BCC", // Cloud service name to which the event belongs
           "region": "bj", // Region to which the event belongs
           "resourceType": "Instance", // Resource type of the instance where the event occurred
           "resourceId": "i-SyZeMxxx", // Instance ID where the event occurred
           "eventId": "999bbc21-2061-49e6-bb2a-fd3e6c5xxxxx", // Event ID
           "eventType": "InstanceStateChange", // Event name
           "eventLevel": "NOTICE", // Event level
           "eventAlias": "BCC status change notification", // Event name in Chinese
           "timestamp": "2022-07-15T01:01:00Z", // Event occurrence time
           "content": "{\"info\":\"BCC instance status change\",\"advice\":\"Your BCC instance i-SyZeMxxx status has been updated to running\"}" // Additional event information
                  },
              ],
              "query": null,
              "fields": [],
              "orderBy": [],
              "pageNumber": 1,
              "pageSize": 1,
              "pageElements": 1,
              "last": false,
              "first": true,
              "totalPages": 34,
              "totalElements": 34
          }

          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

          GET /event-api/v1/platform-event/list HTTP/1.1
          Host: bcm.bj.baidubce.com
          Authorization: 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 List 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 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

          GET /event-api/v1/platform-event/list?pageNo=1&pageSize=1&startTime=2022-05-01T00:00:00Z&endTime=2022-07-18T00:00:00Z
          Host: bcm.bj.baidubce.com
          Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de

          Response example

          {
              "content": [
                  {
           "userId": "453bf9588c9e488f9ba2c9841290xxxx", // Tenant ID to which the event belongs. * indicates the event affects all users
           "eventSource": "Platform", // Event source
           "eventName": "RD_NET_ERROR", // Event Name
           "timestamp": "2022-07-17T01:30:29Z", // Event occurrence time
           "eventId": "999bbc21-2061-49e6-bb2a-fd3e6c5xxxxx", // Event ID
           "region": "bj", // Event region
           "az": "[\"zoneB\",\"zoneA\"]", // Availability region affected by the event which may be null.
           "eventLevel": "CRITICAL", // Event level
           "eventAlias": "RD network exception", // Event name in Chinese
           "eventParentAlias": "", // Category to which the event belongs, e.g., "jitter". It can be null.
           "status": "ALARM", // Event status: NULL-no status, ALARM-alarm status, OK-normal status
           "content": "{\"info\":\"platform-0714-005\",\"advice\":\"RD network anomaly, please check\",\"raw\":\"\"}", // Additional event information
           // Range affected by the event
                      "resources": [
                          {
           "service": "BCE_BCC", // Affected cloud product scope
                              "userId": "453bf9588c9e488f9ba2c9841290xxxx",
           "instanceId": "43fs23jfsx9df220sDSf92fxxxxx", // Affected instance ID; "*" indicates inability to locate specific affected instances
           "shortInstanceId": "i-SyZeMxxx", // Short ID of the affected instance, null indicates inability to locate specific affected instances
           "instanceName": "i-SyZeMxxx" // Affected instance name; null indicates inability to locate specific affected instances
                          }
                      ]
                  }
              ],
              "query": null,
              "fields": [],
              "orderBy": [],
              "pageNumber": 1,
              "pageSize": 1,
              "pageElements": 1,
              "last": false,
              "first": true,
              "totalPages": 100,
              "totalElements": 100
          }

          Alarm strategy

          Create Event Alarm Strategy

          API description

          Create Event Alarm Strategy

          Request structure

          POST /event-api/v1/accounts/{accountId}/services/{serviceName}/alarm-policies HTTP/1.1
          Host: bcm.bj.baidubce.com
          Authorization: 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

          {
           "serviceName": "BCE_EDAP",  // Cloud product to which the event strategy belongs
           "name": "test-jobgroup",  // Event strategy name
           // Instance scope of interest for strategy, required
              "resource": {
                  "region": "bj",
                  "type": "instance",
                  "monitorObjectType": "TAG"
                  "resources": [
                       {
                          "identifiers": [
                              {
                                  "name": "tag-key",
                                  "value": "tag-value",
                              }
                          ]
                      }
                  ]
              },
           // Instance scope of interest for user configuration, required
              "eventFilter": {
                  "eventLevel": "*",
                  "eventTypeList": [
                      "*"
                  ]
              },
           // Notification template list, required
              "incidentActions": [
                  "b22b97d6-72b4-4ac1-a86d-25d66375xxxx"
              ],
           "blockStatus": "NORMAL", // The notification status of the strategy, the normal status is "NORMAL", when notifications are shut down, the status is "BLOCKED"
           "accountId": "453bf9588c9e488f9ba2c9841290xxxx" // User ID to which the strategy belongs, required
          }

          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 List 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 List 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
          Previous
          Event Bus Push
          Next
          General Description