Skip to content

Commit dfce92d

Browse files
Google APIscopybara-github
authored andcommitted
feat: add new fields to Eventarc resources
docs: correct some comments PiperOrigin-RevId: 807339306
1 parent c99b529 commit dfce92d

File tree

8 files changed

+79
-46
lines changed

8 files changed

+79
-46
lines changed

google/cloud/eventarc/v1/channel.proto

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,22 @@ message Channel {
106106
// by the provider to register the channel for publishing.
107107
string activation_token = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
108108

109-
// Resource name of a KMS crypto key (managed by the user) used to
109+
// Optional. Resource name of a KMS crypto key (managed by the user) used to
110110
// encrypt/decrypt their event data.
111111
//
112112
// It must match the pattern
113113
// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
114-
string crypto_key_name = 11 [(google.api.resource_reference) = {
115-
type: "cloudkms.googleapis.com/CryptoKey"
116-
}];
114+
string crypto_key_name = 11 [
115+
(google.api.field_behavior) = OPTIONAL,
116+
(google.api.resource_reference) = {
117+
type: "cloudkms.googleapis.com/CryptoKey"
118+
}
119+
];
117120

118121
// Output only. Whether or not this Channel satisfies the requirements of
119122
// physical zone separation
120123
bool satisfies_pzs = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
124+
125+
// Optional. Resource labels.
126+
map<string, string> labels = 13 [(google.api.field_behavior) = OPTIONAL];
121127
}

google/cloud/eventarc/v1/channel_connection.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,7 @@ message ChannelConnection {
7070
// during the creation of ChannelConnection to bind the channel with the
7171
// provider project. This field will not be stored in the provider resource.
7272
string activation_token = 8 [(google.api.field_behavior) = INPUT_ONLY];
73+
74+
// Optional. Resource labels.
75+
map<string, string> labels = 9 [(google.api.field_behavior) = OPTIONAL];
7376
}

google/cloud/eventarc/v1/enrollment.proto

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ message Enrollment {
7474
// applies to.
7575
string cel_match = 9 [(google.api.field_behavior) = REQUIRED];
7676

77-
// Required. Resource name of the message bus identifying the source of the
78-
// messages. It matches the form
77+
// Required. Immutable. Resource name of the message bus identifying the
78+
// source of the messages. It matches the form
7979
// projects/{project}/locations/{location}/messageBuses/{messageBus}.
8080
string message_bus = 10 [
8181
(google.api.field_behavior) = REQUIRED,
82+
(google.api.field_behavior) = IMMUTABLE,
8283
(google.api.resource_reference) = {
8384
type: "eventarc.googleapis.com/MessageBus"
8485
}

google/cloud/eventarc/v1/eventarc.proto

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ service Eventarc {
224224
};
225225
}
226226

227-
// Get a GoogleChannelConfig
227+
// Get a GoogleChannelConfig.
228+
// The name of the GoogleChannelConfig in the response is ALWAYS coded with
229+
// projectID.
228230
rpc GetGoogleChannelConfig(GetGoogleChannelConfigRequest)
229231
returns (GoogleChannelConfig) {
230232
option (google.api.http) = {
@@ -878,7 +880,7 @@ message GetMessageBusRequest {
878880

879881
// The request message for the ListMessageBuses method.
880882
message ListMessageBusesRequest {
881-
// Required. The parent collection to list triggers on.
883+
// Required. The parent collection to list message buses on.
882884
string parent = 1 [
883885
(google.api.field_behavior) = REQUIRED,
884886
(google.api.resource_reference) = {
@@ -972,7 +974,7 @@ message CreateMessageBusRequest {
972974
MessageBus message_bus = 2 [(google.api.field_behavior) = REQUIRED];
973975

974976
// Required. The user-provided ID to be assigned to the MessageBus. It should
975-
// match the format (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$)
977+
// match the format `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
976978
string message_bus_id = 3 [(google.api.field_behavior) = REQUIRED];
977979

978980
// Optional. If set, validate the request and preview the review, but do not
@@ -1094,7 +1096,7 @@ message CreateEnrollmentRequest {
10941096
Enrollment enrollment = 2 [(google.api.field_behavior) = REQUIRED];
10951097

10961098
// Required. The user-provided ID to be assigned to the Enrollment. It should
1097-
// match the format (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
1099+
// match the format `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
10981100
string enrollment_id = 3 [(google.api.field_behavior) = REQUIRED];
10991101

11001102
// Optional. If set, validate the request and preview the review, but do not
@@ -1215,7 +1217,8 @@ message CreatePipelineRequest {
12151217
// Required. The pipeline to create.
12161218
Pipeline pipeline = 2 [(google.api.field_behavior) = REQUIRED];
12171219

1218-
// Required. The user-provided ID to be assigned to the Pipeline.
1220+
// Required. The user-provided ID to be assigned to the Pipeline. It should
1221+
// match the format `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
12191222
string pipeline_id = 3 [(google.api.field_behavior) = REQUIRED];
12201223

12211224
// Optional. If set, validate the request and preview the review, but do not
@@ -1338,7 +1341,7 @@ message CreateGoogleApiSourceRequest {
13381341
[(google.api.field_behavior) = REQUIRED];
13391342

13401343
// Required. The user-provided ID to be assigned to the GoogleApiSource. It
1341-
// should match the format (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
1344+
// should match the format `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
13421345
string google_api_source_id = 3 [(google.api.field_behavior) = REQUIRED];
13431346

13441347
// Optional. If set, validate the request and preview the review, but do not

google/cloud/eventarc/v1/eventarc_v1.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ http:
6363
- get: '/v1/{resource=projects/*/locations/*/messageBuses/*}:getIamPolicy'
6464
- get: '/v1/{resource=projects/*/locations/*/enrollments/*}:getIamPolicy'
6565
- get: '/v1/{resource=projects/*/locations/*/pipelines/*}:getIamPolicy'
66+
- get: '/v1/{resource=projects/*/locations/*/kafkaSources/*}:getIamPolicy'
6667
- get: '/v1/{resource=projects/*/locations/*/googleApiSources/*}:getIamPolicy'
6768
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
6869
post: '/v1/{resource=projects/*/locations/*/triggers/*}:setIamPolicy'
@@ -78,6 +79,8 @@ http:
7879
body: '*'
7980
- post: '/v1/{resource=projects/*/locations/*/pipelines/*}:setIamPolicy'
8081
body: '*'
82+
- post: '/v1/{resource=projects/*/locations/*/kafkaSources/*}:setIamPolicy'
83+
body: '*'
8184
- post: '/v1/{resource=projects/*/locations/*/googleApiSources/*}:setIamPolicy'
8285
body: '*'
8386
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
@@ -94,6 +97,8 @@ http:
9497
body: '*'
9598
- post: '/v1/{resource=projects/*/locations/*/pipelines/*}:testIamPermissions'
9699
body: '*'
100+
- post: '/v1/{resource=projects/*/locations/*/kafkaSources/*}:testIamPermissions'
101+
body: '*'
97102
- post: '/v1/{resource=projects/*/locations/*/googleApiSources/*}:testIamPermissions'
98103
body: '*'
99104
- selector: google.longrunning.Operations.CancelOperation

google/cloud/eventarc/v1/google_channel_config.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ message GoogleChannelConfig {
4141
option (google.api.resource) = {
4242
type: "eventarc.googleapis.com/GoogleChannelConfig"
4343
pattern: "projects/{project}/locations/{location}/googleChannelConfig"
44+
plural: "googleChannelConfigs"
4445
singular: "googleChannelConfig"
4546
};
4647

4748
// Required. The resource name of the config. Must be in the format of,
4849
// `projects/{project}/locations/{location}/googleChannelConfig`.
50+
// In API responses, the config name always includes the projectID, regardless
51+
// of whether the projectID or projectNumber was provided.
4952
string name = 1 [(google.api.field_behavior) = REQUIRED];
5053

5154
// Output only. The last-modified time.
@@ -63,4 +66,7 @@ message GoogleChannelConfig {
6366
type: "cloudkms.googleapis.com/CryptoKey"
6467
}
6568
];
69+
70+
// Optional. Resource labels.
71+
map<string, string> labels = 8 [(google.api.field_behavior) = OPTIONAL];
6672
}

google/cloud/eventarc/v1/pipeline.proto

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ message Pipeline {
9595

9696
// Represents a HTTP endpoint destination.
9797
message HttpEndpoint {
98-
// Required. The URI of the HTTP enpdoint.
98+
// Required. The URI of the HTTP endpoint.
9999
//
100100
// The value must be a RFC2396 URI string.
101101
// Examples: `https://svc.us-central1.p.local:8080/route`.
@@ -107,10 +107,11 @@ message Pipeline {
107107
//
108108
// If a binding expression is not specified here, the message
109109
// is treated as a CloudEvent and is mapped to the HTTP request according
110-
// to the CloudEvent HTTP Protocol Binding Binary Content Mode. In this
111-
// representation, all fields except the `data` and `datacontenttype`
112-
// field on the message are mapped to HTTP request headers with a prefix
113-
// of `ce-`.
110+
// to the CloudEvent HTTP Protocol Binding Binary Content Mode
111+
// (https://github.com/cloudevents/spec/blob/main/cloudevents/bindings/http-protocol-binding.md#31-binary-content-mode).
112+
// In this representation, all fields except the `data` and
113+
// `datacontenttype` field on the message are mapped to HTTP request
114+
// headers with a prefix of `ce-`.
114115
//
115116
// To construct the HTTP request payload and the value of the content-type
116117
// HTTP header, the payload format is defined as follows:
@@ -140,7 +141,7 @@ message Pipeline {
140141
// - If a map named `headers` exists on the result of the expression,
141142
// then its key/value pairs are directly mapped to the HTTP request
142143
// headers. The headers values are constructed from the corresponding
143-
// value types canonical representation. If the `headers` field doesnt
144+
// value type's canonical representation. If the `headers` field doesn't
144145
// exist then the resulting HTTP request will be the headers of the
145146
// CloudEvent HTTP Binding Binary Content Mode representation of the final
146147
// message. Note: If the specified binding expression, has updated the
@@ -182,6 +183,11 @@ message Pipeline {
182183
// "body": "new-body"
183184
// }
184185
// ```
186+
// - The default binding for the message payload can be accessed using the
187+
// `body` variable. It conatins a string representation of the message
188+
// payload in the format specified by the `output_payload_format` field.
189+
// If the `input_payload_format` field is not set, the `body`
190+
// variable contains the same message payload bytes that were published.
185191
//
186192
// Additionally, the following CEL extension functions are provided for
187193
// use in this CEL expression:
@@ -239,33 +245,28 @@ message Pipeline {
239245
// - toMap:
240246
// [map1, map2, ...].toMap() -> map
241247
// - Converts a CEL list of CEL maps to a single CEL map
242-
// - toDestinationPayloadFormat():
243-
// message.data.toDestinationPayloadFormat() -> string or bytes
244-
// - Converts the message data to the destination payload format
245-
// specified in Pipeline.Destination.output_payload_format
246-
// - This function is meant to be applied to the message.data field.
247-
// - If the destination payload format is not set, the function will
248-
// return the message data unchanged.
249248
// - toCloudEventJsonWithPayloadFormat:
250249
// message.toCloudEventJsonWithPayloadFormat() -> map
251250
// - Converts a message to the corresponding structure of JSON
252-
// format for CloudEvents
253-
// - This function applies toDestinationPayloadFormat() to the
254-
// message data. It also sets the corresponding datacontenttype of
251+
// format for CloudEvents.
252+
// - It converts `data` to destination payload format
253+
// specified in `output_payload_format`. If `output_payload_format` is
254+
// not set, the data will remain unchanged.
255+
// - It also sets the corresponding datacontenttype of
255256
// the CloudEvent, as indicated by
256-
// Pipeline.Destination.output_payload_format. If no
257-
// output_payload_format is set it will use the existing
258-
// datacontenttype on the CloudEvent if present, else leave
259-
// datacontenttype absent.
257+
// `output_payload_format`. If no
258+
// `output_payload_format` is set it will use the value of the
259+
// "datacontenttype" attribute on the CloudEvent if present, else
260+
// remove "datacontenttype" attribute.
260261
// - This function expects that the content of the message will
261-
// adhere to the standard CloudEvent format. If it doesnt then this
262+
// adhere to the standard CloudEvent format. If it doesn't then this
262263
// function will fail.
263264
// - The result is a CEL map that corresponds to the JSON
264265
// representation of the CloudEvent. To convert that data to a JSON
265266
// string it can be chained with the toJsonString function.
266267
//
267268
// The Pipeline expects that the message it receives adheres to the
268-
// standard CloudEvent format. If it doesnt then the outgoing message
269+
// standard CloudEvent format. If it doesn't then the outgoing message
269270
// request may fail with a persistent error.
270271
string message_binding_template = 3
271272
[(google.api.field_behavior) = OPTIONAL];
@@ -274,14 +275,14 @@ message Pipeline {
274275
// Represents a config used to authenticate message requests.
275276
message AuthenticationConfig {
276277
// Represents a config used to authenticate with a Google OIDC token using
277-
// a GCP service account. Use this authentication method to invoke your
278-
// Cloud Run and Cloud Functions destinations or HTTP endpoints that
279-
// support Google OIDC.
278+
// a Google Cloud service account. Use this authentication method to
279+
// invoke your Cloud Run and Cloud Functions destinations or HTTP
280+
// endpoints that support Google OIDC.
280281
message OidcToken {
281282
// Required. Service account email used to generate the OIDC Token.
282283
// The principal who calls this API must have
283284
// iam.serviceAccounts.actAs permission in the service account. See
284-
// https://cloud.google.com/iam/docs/understanding-service-accounts?hl=en#sa_common
285+
// https://cloud.google.com/iam/docs/understanding-service-accounts
285286
// for more information. Eventarc service agents must have
286287
// roles/roles/iam.serviceAccountTokenCreator role to allow the
287288
// Pipeline to create OpenID tokens for authenticated requests.
@@ -307,7 +308,7 @@ message Pipeline {
307308
// token](https://developers.google.com/identity/protocols/OAuth2).
308309
// The principal who calls this API must have
309310
// iam.serviceAccounts.actAs permission in the service account. See
310-
// https://cloud.google.com/iam/docs/understanding-service-accounts?hl=en#sa_common
311+
// https://cloud.google.com/iam/docs/understanding-service-accounts
311312
// for more information. Eventarc service agents must have
312313
// roles/roles/iam.serviceAccountTokenCreator role to allow Pipeline
313314
// to create OAuth2 tokens for authenticated requests.
@@ -327,7 +328,7 @@ message Pipeline {
327328
// The type of authentication method.
328329
oneof authentication_method_descriptor {
329330
// Optional. This authenticate method will apply Google OIDC tokens
330-
// signed by a GCP service account to the requests.
331+
// signed by a Google Cloud service account to the requests.
331332
OidcToken google_oidc = 1 [(google.api.field_behavior) = OPTIONAL];
332333

333334
// Optional. If specified, an [OAuth
@@ -389,9 +390,9 @@ message Pipeline {
389390

390391
// Optional. An authentication config used to authenticate message requests,
391392
// such that destinations can verify the source. For example, this can be
392-
// used with private GCP destinations that require GCP credentials to access
393-
// like Cloud Run. This field is optional and should be set only by users
394-
// interested in authenticated push
393+
// used with private Google Cloud destinations that require Google Cloud
394+
// credentials for access like Cloud Run. This field is optional and should
395+
// be set only by users interested in authenticated push.
395396
AuthenticationConfig authentication_config = 5
396397
[(google.api.field_behavior) = OPTIONAL];
397398

@@ -478,7 +479,7 @@ message Pipeline {
478479
// datacontenttype on the CloudEvent if present, else leave
479480
// datacontenttype absent.
480481
// - This function expects that the content of the message will
481-
// adhere to the standard CloudEvent format. If it doesnt then this
482+
// adhere to the standard CloudEvent format. If it doesn't then this
482483
// function will fail.
483484
// - The result is a CEL map that corresponds to the JSON
484485
// representation of the CloudEvent. To convert that data to a JSON
@@ -600,5 +601,9 @@ message Pipeline {
600601
// Output only. This checksum is computed by the server based on the value of
601602
// other fields, and might be sent only on create requests to ensure that the
602603
// client has an up-to-date value before proceeding.
603-
string etag = 99;
604+
string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY];
605+
606+
// Output only. Whether or not this Pipeline satisfies the requirements of
607+
// physical zone separation
608+
bool satisfies_pzs = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
604609
}

google/cloud/eventarc/v1/trigger.proto

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ option (google.api.resource_definition) = {
4646
type: "compute.googleapis.com/NetworkAttachment"
4747
pattern: "projects/{project}/regions/{region}/networkAttachments/{networkattachment}"
4848
};
49+
option (google.api.resource_definition) = {
50+
type: "integrations.googleapis.com/Integration"
51+
pattern: "projects/{project}/locations/{location}/integrations/{integration}"
52+
};
4953

5054
// A representation of the trigger resource.
5155
message Trigger {
@@ -282,7 +286,7 @@ message Pubsub {
282286

283287
// Represents a HTTP endpoint destination.
284288
message HttpEndpoint {
285-
// Required. The URI of the HTTP enpdoint.
289+
// Required. The URI of the HTTP endpoint.
286290
//
287291
// The value must be a RFC2396 URI string.
288292
// Examples: `http://10.10.10.8:80/route`,

0 commit comments

Comments
 (0)