- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- CloudEvent
- CloudEventAttributeValue
- Try it!
messageBuses.publish events to a message bus.
HTTP request
POST https://eventarcpublishing.googleapis.com/v1/{messageBus=projects/*/locations/*/messageBuses/*}:publish
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
message |
Required. The full name of the message bus to publish events to. Format: |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field
|
|
proto |
The Protobuf format of the CloudEvent being published. Specification can be found here: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/protobuf-format.md |
json |
The JSON format of the CloudEvent being published. Specification can be found here: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md |
avro |
The Avro format of the CloudEvent being published. Specification can be found here: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/avro-format.md A base64-encoded string. |
Response body
If successful, the response body is empty.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
CloudEvent
CloudEvent represents a vendor-neutral specification for defining the format of event data.
JSON representation |
---|
{ "id": string, "source": string, "specVersion": string, "type": string, "attributes": { string: { object ( |
Fields | |
---|---|
id |
Required. Identifies the event. Producers MUST ensure that source + id is unique for each distinct event. |
source |
Required. Identifies the context in which an event happened. URI-reference |
spec |
Required. The version of the CloudEvents specification which the event uses. |
type |
Required. This attribute contains a value describing the type of event related to the originating occurrence. |
attributes |
Optional. Used for Optional & Extension Attributes An object containing a list of |
Union field data . The event payload. It should be encoded into a media format which is specified by the 'datacontenttype' attribute (e.g. application/json), and adheres to the dataschema format when those respective attributes are present. data can be only one of the following: |
|
binary |
Optional. Binary data. A base64-encoded string. |
text |
Optional. Text data. |
proto |
Optional. Proto data. An object containing fields of an arbitrary type. An additional field |
CloudEventAttributeValue
The following abstract data types are available for use in attributes.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field attr . The value of the attribute. attr can be only one of the following: |
|
ce |
Boolean value. |
ce |
Integer value. |
ce |
String value. |
ce |
Bytes value. A base64-encoded string. |
ce |
URI value. |
ce |
URI-reference value. |
ce |
Timestamp value. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |