CloudEvents(cloudevents.io)는 이벤트 데이터를 일반적인 방식으로 설명할 수 있는 사양입니다. 이 사양은 CNCF(Cloud Native Computing Foundation)에 속하며 CNCF의 서버리스 작업 그룹별로 구성됩니다.
Eventarc는 HTTP 요청을 통해 CloudEvents 형식으로 이벤트 수신자에 이벤트를 전달합니다. 예를 들어 Workflows 서비스와 같은 대상은 이벤트를 CloudEvents 사양에 따라 JSON 객체로 변환하고 이벤트를 워크플로 실행에 워크플로 런타임 인수로 전달합니다.
런타임 인수는 Cloud 감사 로그 이벤트를 자세히 설명하는 JSON 객체입니다. 이 문서에서 일반적인 이벤트 예시를 참조하세요.
JSON 객체에서 resourceName, serviceName, methodName 값을 찾을 수 있습니다. 자세한 내용은 Cloud 감사 로그의 이벤트 필터 확인을 참조하세요.
google.cloud.audit.log.v1.written 유형의 이벤트 형식은 다음과 같습니다.
이 저장소에는 다음과 같은 항목이 포함되어 있어 프로그래밍 언어로 CloudEvents 데이터를 이해하고 사용하는 데 도움이 됩니다.
CloudEvents 데이터 페이로드용 Google 프로토콜 버퍼
생성된 JSON 스키마
공개 JSON 스키마 카탈로그
클라이언트 라이브러리 링크도 포함됩니다.
일반 이벤트
프로토콜 버퍼(또는 protobuf)는 Eventarc에서 생성되는 이벤트 내의 데이터를 나타냅니다. CloudEvents의 프로토콜 버퍼는 머신 판독 가능 스키마로 제공되며, 데이터 유형의 라이브러리를 생성하고 이벤트를 더 쉽게 소비할 수 있게 해줍니다.
모든 특정 CloudEvent 유형에는 2개의 protobuf 메시지가 관련되어 있습니다.
하나는 확장 속성을 포함하여 전체 CloudEvent를 나타내는 봉투 메시지입니다(예: AuditLogWrittenEvent).
data 메시지입니다(예: LogEntryData 또는 StorageObjectData).
여러 CloudEvent 유형에서 동일한 데이터 메시지를 사용할 수 있습니다. 예를 들어 Cloud Storage 객체와 연결된 모든 이벤트는 StorageObjectData를 데이터 메시지로 사용합니다. 각 봉투 메시지는 proto 주석을 통해 연결된 CloudEvent 유형을 지정합니다.
자세한 내용은 protobuf 메시지와 CloudEvent 유형 사이의 관계를 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-05-30(UTC)"],[[["\u003cp\u003eCloudEvents is a CNCF specification for describing event data in a common format, delivered to event receivers via HTTP requests.\u003c/p\u003e\n"],["\u003cp\u003eEventarc formats events to the JSON Event Format for CloudEvents version 1.0.1, including attributes like \u003ccode\u003edata\u003c/code\u003e, \u003ccode\u003edatacontenttype\u003c/code\u003e, \u003ccode\u003eid\u003c/code\u003e, \u003ccode\u003esource\u003c/code\u003e, \u003ccode\u003especversion\u003c/code\u003e, \u003ccode\u003etype\u003c/code\u003e, and \u003ccode\u003etime\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEventarc handles events from Cloud Audit Logs, Cloud Storage, and Pub/Sub, with each event type having a specific JSON format and structure, including envelope and data messages.\u003c/p\u003e\n"],["\u003cp\u003eThe structure of HTTP bodies for all events and related resources like Google Protocol Buffers, JSON schemas, and client libraries are available on the CloudEvents GitHub repository.\u003c/p\u003e\n"],["\u003cp\u003eProtocol Buffers (protobufs) represent the data within events, and there is an envelope message and a data message for each event type, simplifying data handling and consumption.\u003c/p\u003e\n"]]],[],null,["# CloudEvents - JSON event format\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. The destination target---for example, the\nWorkflows service---converts the event to a JSON object (following the\nCloudEvents specification) and passes the event into the\nworkflow execution as a workflow runtime argument.\n\nJSON payload format\n-------------------\n\nThe destination service receives events from event routers and formats\nthe events to the\n[JSON Event Format for CloudEvents version 1.0.1](https://github.com/cloudevents/spec/blob/v1.0.1/json-format.md#json-event-format-for-cloudevents---version-101)\nwith the following CloudEvents attributes:\n\nDepending on the event type, the payload format is as follows: \n\n### Cloud Audit Logs\n\nThe runtime argument is a JSON object detailing the Cloud Audit Logs\nevent. In this document, see the [Common events example](/eventarc/docs/cloudevents-json#common-events).\nIn the JSON object, you can find the `resourceName`, `serviceName`,\nand `methodName` values. For more information, see\n[Determine event filters for Cloud Audit Logs](/eventarc/docs/determining-filters-cal).\n\nEvents of type `google.cloud.audit.log.v1.written` have the following format: \n\n```json\n{\n \"data\":{ EVENT_DATA },\n \"datacontenttype\": \"application/json; charset=utf-8\",\n \"id\": \"\u003cvar translate=\"no\"\u003eMESSAGE_ID\u003c/var\u003e\",\n \"source\": \"//cloudaudit.googleapis.com/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/logs/data_access\",\n \"specversion\": \"1.0\",\n \"type\": \"google.cloud.audit.log.v1.written\",\n \"time\": \"\u003cvar translate=\"no\"\u003eEVENT_GENERATION_TIME\u003c/var\u003e\",\n \"dataschema\": \"https://googleapis.github.io/google-cloudevents/jsonschema/google/events/cloud/audit/v1/LogEntryData.json\",\n \"methodName\": \"jobservice.jobcompleted\",\n \"resourceName\": \"projects/my-project/jobs/bqjob_r3ac45813612fa2d6_0000017d591922c9_1\",\n \"serviceName\": \"bigquery.googleapis.com\",\n \"subject\": \"bigquery.googleapis.com/projects/my-project/jobs/bqjob_r3ac45813612fa2d6_0000017d591922c9_1\"\n}\n```\n\n- \u003cvar translate=\"no\"\u003eEVENT_DATA\u003c/var\u003e: the decoded message content in JSON format. For more information, in this document, see [Common events](#common-events).\n- \u003cvar translate=\"no\"\u003eMESSAGE_ID\u003c/var\u003e, \u003cvar translate=\"no\"\u003eEVENT_GENERATION_TIME\u003c/var\u003e: system-generated.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your Google Cloud project ID.\n- `dataschema`, `methodName`, `resourceName`, `serviceName`, `subject`: attributes specific to the event type.\n\n### Cloud Storage\n\nThe runtime arguments are changes to Cloud Storage. In the `data` field\nyou can find the change in the Cloud Storage bucket. In this\ndocument, see the\n[Common events example](/eventarc/docs/cloudevents-json#common-events).\n\nEvents of type `google.cloud.storage.object.v1.finalized` have the following\nformat: \n\n```json\n{\n \"data\":{ EVENT_DATA },\n \"datacontenttype\": \"application/json\",\n \"id\": \"\u003cvar translate=\"no\"\u003eMESSAGE_ID\u003c/var\u003e\",\n \"source\": \"//storage.googleapis.com/projects/_/buckets/\u003cvar translate=\"no\"\u003eBUCKET_NAME\u003c/var\u003e\",\n \"specversion\": \"1.0\",\n \"type\": \"google.cloud.storage.object.v1.finalized\",\n \"time\": \"\u003cvar translate=\"no\"\u003eEVENT_GENERATION_TIME\u003c/var\u003e\",\n \"subject\": \"objects/my-file.txt\"\n}\n```\n\n- \u003cvar translate=\"no\"\u003eEVENT_DATA\u003c/var\u003e: the decoded message content in JSON format. For more information, in this document, see [Common events](#common-events).\n- \u003cvar translate=\"no\"\u003eMESSAGE_ID\u003c/var\u003e, \u003cvar translate=\"no\"\u003eEVENT_GENERATION_TIME\u003c/var\u003e: system-generated.\n- \u003cvar translate=\"no\"\u003eBUCKET_NAME\u003c/var\u003e: the name of the Cloud Storage bucket that gets updated.\n- `subject`: attribute specific to the event type.\n\n### Pub/Sub\n\nThe runtime argument is a Pub/Sub push message. In the `data`\nfield you can find the message as a Base64-encoded string. In this document,\nsee the\n[Common events example](/eventarc/docs/cloudevents-json#common-events).\n\nEvents of type `google.cloud.pubsub.topic.v1.messagePublished` have the\nfollowing format: \n\n```json\n{\n \"data\":{ EVENT_DATA },\n \"datacontenttype\": \"application/json; charset=utf-8\",\n \"id\": \"\u003cvar translate=\"no\"\u003eMESSAGE_ID\u003c/var\u003e\",\n \"source\": \"//pubsub.googleapis.com/\u003cvar translate=\"no\"\u003eTOPIC_NAME\u003c/var\u003e\",\n \"specversion\": \"1.0\",\n \"type\": \"google.cloud.pubsub.topic.v1.messagePublished\",\n \"time\": \"\u003cvar translate=\"no\"\u003eEVENT_GENERATION_TIME\u003c/var\u003e\"\n}\n```\n\n- \u003cvar translate=\"no\"\u003eEVENT_DATA\u003c/var\u003e: the decoded message content in JSON format. For more information, in this document, see [Common events](#common-events).\n- \u003cvar translate=\"no\"\u003eMESSAGE_ID\u003c/var\u003e, \u003cvar translate=\"no\"\u003eEVENT_GENERATION_TIME\u003c/var\u003e: system-generated.\n- \u003cvar translate=\"no\"\u003eTOPIC_NAME\u003c/var\u003e: the Pub/Sub topic name to which the event was published to.\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"]]