[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003eCloudEvents is a CNCF specification for describing event data, and Eventarc delivers events in this format via HTTP requests.\u003c/p\u003e\n"],["\u003cp\u003eHTTP requests for events contain specific headers such as \u003ccode\u003ece-id\u003c/code\u003e, \u003ccode\u003ece-source\u003c/code\u003e, \u003ccode\u003ece-specversion\u003c/code\u003e, \u003ccode\u003ece-type\u003c/code\u003e, and \u003ccode\u003ece-time\u003c/code\u003e, along with a JSON body payload.\u003c/p\u003e\n"],["\u003cp\u003eCloud Audit Logs events use \u003ccode\u003egoogle.cloud.audit.log.v1.written\u003c/code\u003e as their event type and include details in a JSON body with \u003ccode\u003eprotoPayload\u003c/code\u003e containing values like \u003ccode\u003eresourceName\u003c/code\u003e, \u003ccode\u003eserviceName\u003c/code\u003e, and \u003ccode\u003emethodName\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003ePub/Sub events use \u003ccode\u003egoogle.cloud.pubsub.topic.v1.messagePublished\u003c/code\u003e as their event type, with the body payload containing a Base64-encoded string in the \u003ccode\u003edata\u003c/code\u003e field.\u003c/p\u003e\n"],["\u003cp\u003eProtocol Buffers provide machine-readable schemas for CloudEvents, with each event type having an envelope message (e.g., \u003ccode\u003eAuditLogWrittenEvent\u003c/code\u003e) and a data message (e.g., \u003ccode\u003eLogEntryData\u003c/code\u003e).\u003c/p\u003e\n"]]],[],null,["# CloudEvents format - HTTP protocol binding\n\n[Advanced](/eventarc/advanced/docs/overview) [Standard](/eventarc/standard/docs/overview)\n\nCloudEvents ([cloudevents.io](http://cloudevents.io)) is a specification for\ndescribing event data in a common way. The specification is under the Cloud\nNative Computing Foundation (CNCF) and is organized by the CNCF's Serverless\nWorking Group.\n\nEventarc delivers events to the event receiver in the CloudEvents\nformat through an HTTP request.\n| **Note:** As the Eventarc product evolves, we might apply [backwards-compatible](/apis/design/compatibility) changes, like adding optional filtering attributes, output-only attributes, or optional fields to the event payload.\n\n\nHTTP request headers\n--------------------\n\nTarget services receive events from event routers as HTTP POST\nrequests formatted to the CloudEvents version 1.0\n[HTTP protocol binding specification](https://github.com/cloudevents/spec/blob/v1.0/http-protocol-binding.md). Each HTTP request contains event-specific\nheaders and a body, and is sent to the root URL path (`/`) of the service.\n\nIn addition to other HTTP headers, all events have the following CloudEvents\nHTTP headers:\n\n\u003cbr /\u003e\n\nHTTP payload format\n-------------------\n\n### Cloud Audit Logs\n\nEvents of type `google.cloud.audit.log.v1.written` have the following format:\n\n#### Headers\n\n```\nce-specversion: 1.0\nce-type: google.cloud.audit.log.v1.written\nce-source: //SERVICE_NAME/projects/PROJECT_ID\nce-id: MESSAGE_ID\nce-time: PUBLISH_TIME\nContent-Type: application/json; charset=utf-8\nContent-Length: CONTENT_LENGTH\n```\n\n- \u003cvar translate=\"no\"\u003eSERVICE_NAME\u003c/var\u003e: the Google API URI for the service issuing the event; for example, `bigquery.googleapis.com` for events from BigQuery.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your Google Cloud project ID.\n- \u003cvar translate=\"no\"\u003eMESSAGE_ID\u003c/var\u003e, \u003cvar translate=\"no\"\u003ePUBLISH_TIME\u003c/var\u003e, \u003cvar translate=\"no\"\u003eCONTENT_LENGTH\u003c/var\u003e: system-generated.\n\n#### Body\n\nThe payload is a JSON object detailing the Cloud Audit Logs event. In\n`protoPayload` you can find the `resourceName`, `serviceName`, and `methodName`\nvalues. For more information, see\n[Determine event filters for Cloud Audit Logs](/eventarc/docs/determining-filters-cal).\n\n### Pub/Sub\n\nEvents of type `google.cloud.pubsub.topic.v1.messagePublished` have the following\nformat:\n\n#### Headers\n\n```\nce-specversion: 1.0\nce-type: google.cloud.pubsub.topic.v1.messagePublished\nce-source: //pubsub.googleapis.com/TOPIC\nce-id: MESSAGE_ID\nce-time: PUBLISH_TIME\nContent-Type: application/json; charset=utf-8\nContent-Length: CONTENT_LENGTH\n```\n\n- \u003cvar translate=\"no\"\u003eTOPIC\u003c/var\u003e: the Pub/Sub topic the event was published to.\n- \u003cvar translate=\"no\"\u003eMESSAGE_ID\u003c/var\u003e, \u003cvar translate=\"no\"\u003ePUBLISH_TIME\u003c/var\u003e, \u003cvar translate=\"no\"\u003eCONTENT_LENGTH\u003c/var\u003e: system-generated.\n\n#### Body\n\nThe payload is a Pub/Sub push message. In the `data` field you\ncan find the message as a Base64-encoded string. See the\n[example](/eventarc/docs/cloudevents#pubsub_1) in this document.\n\n\nOpen source repository\n----------------------\n\nThe structure of the HTTP body for all events are available on the\n[CloudEvents GitHub repository](https://github.com/googleapis/google-cloudevents).\n\n\nThe repository contains the following to help you understand and use CloudEvents\ndata in your programming language:\n\n- Google Protocol Buffers for CloudEvents data payloads\n- Generated JSON schemas\n- A public JSON schema catalog\n\n\nLinks to client libraries are also included.\n\n\u003cbr /\u003e\n\n\nCommon events\n-------------\n\nProtocol Buffers (or protobufs) represent the data within events that are\ngenerated by Eventarc. Protocol Buffers for CloudEvents are\nprovided as machine-readable schemas, allowing libraries of data types to be\ncreated and making it easier to consume events.\n\n\nThere are two protobuf messages that are relevant for any given CloudEvent type:\n\n- The *envelope* message that represents the complete CloudEvent, including any extension attributes; for example, `AuditLogWrittenEvent`.\n- The *data* message; for example, `LogEntryData` or `StorageObjectData`.\n\nMany CloudEvent types can use the same data message. For example, every event associated with a Cloud Storage object uses `StorageObjectData` as the data message. Each envelope message specifies the CloudEvent type that it is associated with through a proto annotation. For more information, see [Relationship between protobuf messages and CloudEvent types](https://github.com/googleapis/google-cloudevents/blob/main/proto/README.md#relationship-between-protobuf-messages-and-cloudevent-types).\n\n\nThe following tables detail the components of some common events:\n\n### Cloud Audit Logs\n\n### Cloud Storage\n\n### Firestore\n\n### Pub/Sub\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\n[Learn more about event routes](/eventarc/standard/docs/run/event-routing-options)."]]