百度智能云

All Product Document

          Cloud Monitor

          Event Bus Push

          API description

          This API is designed to push specific events to the Event Bus.

          Request structure

          • method:POST
          • Request URL: /v1/event-bus/recv

          Request parameters

          Name Types Description Required or not Parameter location
          eventList List<CloudEvent> Event structure within the Event Bus Yes Body

          CloudEvent

          Name Types Description Required or not Parameter location
          data Map<String, Object> Event content. A JSON object defined by the user or service initiating the event. CloudEvents may include context provided by the event producer at the time of the event, encapsulated in the Data field. This can be empty. No Parameters
          id String Event ID. A unique identifier for an event. The sender must ensure that the combination of source and ID is unique. This can be null; if null, the system will automatically generate it. No Parameters
          source String Event source. The service providing the event, identifying the nature of the event that occurred. Yes Parameters
          specversion String CloudEvents protocol version. This field can be empty. No Parameters
          type String Event type. Describes event types associated with the event source. Yes Parameters
          datacontenttype String Data content format. datacontenttype supports only the application/json format. This can be empty. No Parameters
          subject String Event subject. JSON data containing resource identifiers involved in the event. This can be empty. No Parameters
          time String Event occurrence time, e.g., 2020-11-19T21:04:41Z. The default value references the time when the system receives the event. This can be empty. No Parameters
          resourceType String Cloud product subtype. This field can be null for user-defined events. It can be empty. No Parameters
          level EventLevel Event level. This field can be null for user-defined events. No Parameters
          accountId String Cloud account ID. This can be empty and is retrieved from the request headers by default. No Parameters
          eventBusId String The event bus ID that receives the events. No Parameters
          eventBusName String Event bus name for receiving events. Yes Parameters
          eventSourceAlias String The Chinese alias of the event source. This can be empty. No Parameters
          eventAlias String The Chinese alias of the event type. This can be empty. No Parameters
          eventAliasEn String The English alias for the event type. This field can be left blank. No Parameters
          region String The region of the event. This field can be left blank. No Parameters
          recvTimestamp String The timestamp when the event was received: 2020-11-19T21:04:41+08:00. No Parameters

          Response parameters

          Name Types Description
          events List<CloudEvent> Push event

          Request example

          {
              "eventList": [
                  {
                      // Event details, optional, which can be used for rule matching, etc.
                      "data": "{\"info\":\"System exception occurred\",\"advice\":\"Please contact the administrator\"}",
                      // Event source name, required
                      "source": "App_DEMO",
                      // Event name, required
                      "type": "DEMO_EVENT",
                      // Event ID, optional. A string will be generated randomly by default.
                      "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
                      Event source, optional. Null by default
                      "subject": "qcs::dts:ap-guangzhou:appid12312/uid1250000000:xxx",
                      // Event occurrence time, optional. Defaulting to the time the event is received
                      "time": 1615430559146,
                      // Event occurrence region, optional.
                      "region": "bj"
                  },
                  ...
              ],
              "eventBusId": "eb-xxxxxx"
          }

          Response example

          {
            "events": [
              {
                // Event details
                "data": {
                  "info": "System exception occurred",
                  "advice": "Please contact administrator"
                },
                // Event ID
                "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
                // Event source name
                "source": "source1",
                // Event name
                "type": "DEMO_EVENT",
                // Event source
                "subject": "qcs::dts:ap-guangzhou:appid12312/uid1250000000:xxx",
                // Event occurrence time
                "time": "2023-01-01T00:00:00+0800",
                // Event bus ID
                "eventBusId": "bus1",
                // Event bus name
                "eventBusName": "busName1",
                // Event name
                "eventAlias": "eventAlias1",
                // Event name, English
                "eventAliasEn": "eventAliasEn1",
                // Region
                "region": "region1",
              },
              ...
            ]
          }
          Previous
          Event Alarm History
          Next
          Event Monitor