-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathpubsub.proto
More file actions
2588 lines (2215 loc) · 111 KB
/
pubsub.proto
File metadata and controls
2588 lines (2215 loc) · 111 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.pubsub.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "google/pubsub/v1/schema.proto";
option csharp_namespace = "Google.Cloud.PubSub.V1";
option go_package = "cloud.google.com/go/pubsub/v2/apiv1/pubsubpb;pubsubpb";
option java_multiple_files = true;
option java_outer_classname = "PubsubProto";
option java_package = "com.google.pubsub.v1";
option php_namespace = "Google\\Cloud\\PubSub\\V1";
option ruby_package = "Google::Cloud::PubSub::V1";
option (google.api.resource_definition) = {
type: "cloudkms.googleapis.com/CryptoKey"
pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
};
option (google.api.resource_definition) = {
type: "analyticshub.googleapis.com/Listing"
pattern: "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
};
// The service that an application uses to manipulate topics, and to send
// messages to a topic.
service Publisher {
option (google.api.default_host) = "pubsub.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/pubsub";
// Creates the given topic with the given name. See the [resource name rules]
// (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
rpc CreateTopic(Topic) returns (Topic) {
option (google.api.http) = {
put: "/v1/{name=projects/*/topics/*}"
body: "*"
};
option (google.api.method_signature) = "name";
}
// Updates an existing topic by updating the fields specified in the update
// mask. Note that certain properties of a topic are not modifiable.
rpc UpdateTopic(UpdateTopicRequest) returns (Topic) {
option (google.api.http) = {
patch: "/v1/{topic.name=projects/*/topics/*}"
body: "*"
};
option (google.api.method_signature) = "topic,update_mask";
}
// Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
// does not exist.
rpc Publish(PublishRequest) returns (PublishResponse) {
option (google.api.http) = {
post: "/v1/{topic=projects/*/topics/*}:publish"
body: "*"
};
option (google.api.method_signature) = "topic,messages";
}
// Gets the configuration of a topic.
rpc GetTopic(GetTopicRequest) returns (Topic) {
option (google.api.http) = {
get: "/v1/{topic=projects/*/topics/*}"
};
option (google.api.method_signature) = "topic";
}
// Lists matching topics.
rpc ListTopics(ListTopicsRequest) returns (ListTopicsResponse) {
option (google.api.http) = {
get: "/v1/{project=projects/*}/topics"
};
option (google.api.method_signature) = "project";
}
// Lists the names of the attached subscriptions on this topic.
rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest)
returns (ListTopicSubscriptionsResponse) {
option (google.api.http) = {
get: "/v1/{topic=projects/*/topics/*}/subscriptions"
};
option (google.api.method_signature) = "topic";
}
// Lists the names of the snapshots on this topic. Snapshots are used in
// [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
// which allow you to manage message acknowledgments in bulk. That is, you can
// set the acknowledgment state of messages in an existing subscription to the
// state captured by a snapshot.
rpc ListTopicSnapshots(ListTopicSnapshotsRequest)
returns (ListTopicSnapshotsResponse) {
option (google.api.http) = {
get: "/v1/{topic=projects/*/topics/*}/snapshots"
};
option (google.api.method_signature) = "topic";
}
// Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
// does not exist. After a topic is deleted, a new topic may be created with
// the same name; this is an entirely new topic with none of the old
// configuration or subscriptions. Existing subscriptions to this topic are
// not deleted, but their `topic` field is set to `_deleted-topic_`.
rpc DeleteTopic(DeleteTopicRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{topic=projects/*/topics/*}"
};
option (google.api.method_signature) = "topic";
}
// Detaches a subscription from this topic. All messages retained in the
// subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
// will return FAILED_PRECONDITION. If the subscription is a push
// subscription, pushes to the endpoint will stop.
rpc DetachSubscription(DetachSubscriptionRequest)
returns (DetachSubscriptionResponse) {
option (google.api.http) = {
post: "/v1/{subscription=projects/*/subscriptions/*}:detach"
};
}
}
// A policy constraining the storage of messages published to the topic.
message MessageStoragePolicy {
// Optional. A list of IDs of Google Cloud regions where messages that are
// published to the topic may be persisted in storage. Messages published by
// publishers running in non-allowed Google Cloud regions (or running outside
// of Google Cloud altogether) are routed for storage in one of the allowed
// regions. An empty list means that no regions are allowed, and is not a
// valid configuration.
repeated string allowed_persistence_regions = 1
[(google.api.field_behavior) = OPTIONAL];
// Optional. If true, `allowed_persistence_regions` is also used to enforce
// in-transit guarantees for messages. That is, Pub/Sub will fail
// Publish operations on this topic and subscribe operations
// on any subscription attached to this topic in any region that is
// not in `allowed_persistence_regions`.
bool enforce_in_transit = 2 [(google.api.field_behavior) = OPTIONAL];
}
// Settings for validating messages published against a schema.
message SchemaSettings {
// Required. The name of the schema that messages published should be
// validated against. Format is `projects/{project}/schemas/{schema}`. The
// value of this field will be `_deleted-schema_` if the schema has been
// deleted.
string schema = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" }
];
// Optional. The encoding of messages validated against `schema`.
Encoding encoding = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. The minimum (inclusive) revision allowed for validating messages.
// If empty or not present, allow any revision to be validated against
// last_revision or any revision created before.
string first_revision_id = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. The maximum (inclusive) revision allowed for validating messages.
// If empty or not present, allow any revision to be validated against
// first_revision or any revision created after.
string last_revision_id = 4 [(google.api.field_behavior) = OPTIONAL];
}
// Settings for an ingestion data source on a topic.
message IngestionDataSourceSettings {
// Ingestion settings for Amazon Kinesis Data Streams.
message AwsKinesis {
// Possible states for ingestion from Amazon Kinesis Data Streams.
enum State {
// Default value. This value is unused.
STATE_UNSPECIFIED = 0;
// Ingestion is active.
ACTIVE = 1;
// Permission denied encountered while consuming data from Kinesis.
// This can happen if:
// - The provided `aws_role_arn` does not exist or does not have the
// appropriate permissions attached.
// - The provided `aws_role_arn` is not set up properly for Identity
// Federation using `gcp_service_account`.
// - The Pub/Sub SA is not granted the
// `iam.serviceAccounts.getOpenIdToken` permission on
// `gcp_service_account`.
KINESIS_PERMISSION_DENIED = 2;
// Permission denied encountered while publishing to the topic. This can
// happen if the Pub/Sub SA has not been granted the [appropriate publish
// permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher)
PUBLISH_PERMISSION_DENIED = 3;
// The Kinesis stream does not exist.
STREAM_NOT_FOUND = 4;
// The Kinesis consumer does not exist.
CONSUMER_NOT_FOUND = 5;
}
// Output only. An output-only field that indicates the state of the Kinesis
// ingestion source.
State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Required. The Kinesis stream ARN to ingest data from.
string stream_arn = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The Kinesis consumer ARN to used for ingestion in Enhanced
// Fan-Out mode. The consumer must be already created and ready to be used.
string consumer_arn = 3 [(google.api.field_behavior) = REQUIRED];
// Required. AWS role ARN to be used for Federated Identity authentication
// with Kinesis. Check the Pub/Sub docs for how to set up this role and the
// required permissions that need to be attached to it.
string aws_role_arn = 4 [(google.api.field_behavior) = REQUIRED];
// Required. The GCP service account to be used for Federated Identity
// authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for
// the provided role). The `aws_role_arn` must be set up with
// `accounts.google.com:sub` equals to this service account number.
string gcp_service_account = 5 [(google.api.field_behavior) = REQUIRED];
}
// Ingestion settings for Cloud Storage.
message CloudStorage {
// Possible states for ingestion from Cloud Storage.
enum State {
// Default value. This value is unused.
STATE_UNSPECIFIED = 0;
// Ingestion is active.
ACTIVE = 1;
// Permission denied encountered while calling the Cloud Storage API. This
// can happen if the Pub/Sub SA has not been granted the
// [appropriate
// permissions](https://cloud.google.com/storage/docs/access-control/iam-permissions):
// - storage.objects.list: to list the objects in a bucket.
// - storage.objects.get: to read the objects in a bucket.
// - storage.buckets.get: to verify the bucket exists.
CLOUD_STORAGE_PERMISSION_DENIED = 2;
// Permission denied encountered while publishing to the topic. This can
// happen if the Pub/Sub SA has not been granted the [appropriate publish
// permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher)
PUBLISH_PERMISSION_DENIED = 3;
// The provided Cloud Storage bucket doesn't exist.
BUCKET_NOT_FOUND = 4;
// The Cloud Storage bucket has too many objects, ingestion will be
// paused.
TOO_MANY_OBJECTS = 5;
}
// Configuration for reading Cloud Storage data in text format. Each line of
// text as specified by the delimiter will be set to the `data` field of a
// Pub/Sub message.
message TextFormat {
// Optional. When unset, '\n' is used.
optional string delimiter = 1 [(google.api.field_behavior) = OPTIONAL];
}
// Configuration for reading Cloud Storage data in Avro binary format. The
// bytes of each object will be set to the `data` field of a Pub/Sub
// message.
message AvroFormat {}
// Configuration for reading Cloud Storage data written via [Cloud Storage
// subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage). The
// data and attributes fields of the originally exported Pub/Sub message
// will be restored when publishing.
message PubSubAvroFormat {}
// Output only. An output-only field that indicates the state of the Cloud
// Storage ingestion source.
State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. Cloud Storage bucket. The bucket name must be without any
// prefix like "gs://". See the [bucket naming requirements]
// (https://cloud.google.com/storage/docs/buckets#naming).
string bucket = 2 [(google.api.field_behavior) = OPTIONAL];
// Defaults to text format.
oneof input_format {
// Optional. Data from Cloud Storage will be interpreted as text.
TextFormat text_format = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. Data from Cloud Storage will be interpreted in Avro format.
AvroFormat avro_format = 4 [(google.api.field_behavior) = OPTIONAL];
// Optional. It will be assumed data from Cloud Storage was written via
// [Cloud Storage
// subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage).
PubSubAvroFormat pubsub_avro_format = 5
[(google.api.field_behavior) = OPTIONAL];
}
// Optional. Only objects with a larger or equal creation timestamp will be
// ingested.
google.protobuf.Timestamp minimum_object_create_time = 6
[(google.api.field_behavior) = OPTIONAL];
// Optional. Glob pattern used to match objects that will be ingested. If
// unset, all objects will be ingested. See the [supported
// patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob).
string match_glob = 9 [(google.api.field_behavior) = OPTIONAL];
}
// Ingestion settings for Azure Event Hubs.
message AzureEventHubs {
// Possible states for managed ingestion from Event Hubs.
enum State {
// Default value. This value is unused.
STATE_UNSPECIFIED = 0;
// Ingestion is active.
ACTIVE = 1;
// Permission denied encountered while consuming data from Event Hubs.
// This can happen when `client_id`, or `tenant_id` are invalid. Or the
// right permissions haven't been granted.
EVENT_HUBS_PERMISSION_DENIED = 2;
// Permission denied encountered while publishing to the topic.
PUBLISH_PERMISSION_DENIED = 3;
// The provided Event Hubs namespace couldn't be found.
NAMESPACE_NOT_FOUND = 4;
// The provided Event Hub couldn't be found.
EVENT_HUB_NOT_FOUND = 5;
// The provided Event Hubs subscription couldn't be found.
SUBSCRIPTION_NOT_FOUND = 6;
// The provided Event Hubs resource group couldn't be found.
RESOURCE_GROUP_NOT_FOUND = 7;
}
// Output only. An output-only field that indicates the state of the Event
// Hubs ingestion source.
State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. Name of the resource group within the azure subscription.
string resource_group = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. The name of the Event Hubs namespace.
string namespace = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. The name of the Event Hub.
string event_hub = 4 [(google.api.field_behavior) = OPTIONAL];
// Optional. The client id of the Azure application that is being used to
// authenticate Pub/Sub.
string client_id = 5 [(google.api.field_behavior) = OPTIONAL];
// Optional. The tenant id of the Azure application that is being used to
// authenticate Pub/Sub.
string tenant_id = 6 [(google.api.field_behavior) = OPTIONAL];
// Optional. The Azure subscription id.
string subscription_id = 7 [(google.api.field_behavior) = OPTIONAL];
// Optional. The GCP service account to be used for Federated Identity
// authentication.
string gcp_service_account = 8 [(google.api.field_behavior) = OPTIONAL];
}
// Ingestion settings for Amazon MSK.
message AwsMsk {
// Possible states for managed ingestion from Amazon MSK.
enum State {
// Default value. This value is unused.
STATE_UNSPECIFIED = 0;
// Ingestion is active.
ACTIVE = 1;
// Permission denied encountered while consuming data from Amazon MSK.
MSK_PERMISSION_DENIED = 2;
// Permission denied encountered while publishing to the topic.
PUBLISH_PERMISSION_DENIED = 3;
// The provided MSK cluster wasn't found.
CLUSTER_NOT_FOUND = 4;
// The provided topic wasn't found.
TOPIC_NOT_FOUND = 5;
}
// Output only. An output-only field that indicates the state of the Amazon
// MSK ingestion source.
State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Required. The Amazon Resource Name (ARN) that uniquely identifies the
// cluster.
string cluster_arn = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The name of the topic in the Amazon MSK cluster that Pub/Sub
// will import from.
string topic = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
];
// Required. AWS role ARN to be used for Federated Identity authentication
// with Amazon MSK. Check the Pub/Sub docs for how to set up this role and
// the required permissions that need to be attached to it.
string aws_role_arn = 4 [(google.api.field_behavior) = REQUIRED];
// Required. The GCP service account to be used for Federated Identity
// authentication with Amazon MSK (via a `AssumeRoleWithWebIdentity` call
// for the provided role). The `aws_role_arn` must be set up with
// `accounts.google.com:sub` equals to this service account number.
string gcp_service_account = 5 [(google.api.field_behavior) = REQUIRED];
}
// Ingestion settings for Confluent Cloud.
message ConfluentCloud {
// Possible states for managed ingestion from Confluent Cloud.
enum State {
// Default value. This value is unused.
STATE_UNSPECIFIED = 0;
// Ingestion is active.
ACTIVE = 1;
// Permission denied encountered while consuming data from Confluent
// Cloud.
CONFLUENT_CLOUD_PERMISSION_DENIED = 2;
// Permission denied encountered while publishing to the topic.
PUBLISH_PERMISSION_DENIED = 3;
// The provided bootstrap server address is unreachable.
UNREACHABLE_BOOTSTRAP_SERVER = 4;
// The provided cluster wasn't found.
CLUSTER_NOT_FOUND = 5;
// The provided topic wasn't found.
TOPIC_NOT_FOUND = 6;
}
// Output only. An output-only field that indicates the state of the
// Confluent Cloud ingestion source.
State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Required. The address of the bootstrap server. The format is url:port.
string bootstrap_server = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The id of the cluster.
string cluster_id = 3 [(google.api.field_behavior) = REQUIRED];
// Required. The name of the topic in the Confluent Cloud cluster that
// Pub/Sub will import from.
string topic = 4 [(google.api.field_behavior) = REQUIRED];
// Required. The id of the identity pool to be used for Federated Identity
// authentication with Confluent Cloud. See
// https://docs.confluent.io/cloud/current/security/authenticate/workload-identities/identity-providers/oauth/identity-pools.html#add-oauth-identity-pools.
string identity_pool_id = 5 [(google.api.field_behavior) = REQUIRED];
// Required. The GCP service account to be used for Federated Identity
// authentication with `identity_pool_id`.
string gcp_service_account = 6 [(google.api.field_behavior) = REQUIRED];
}
// Only one source type can have settings set.
oneof source {
// Optional. Amazon Kinesis Data Streams.
AwsKinesis aws_kinesis = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. Cloud Storage.
CloudStorage cloud_storage = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. Azure Event Hubs.
AzureEventHubs azure_event_hubs = 3
[(google.api.field_behavior) = OPTIONAL];
// Optional. Amazon MSK.
AwsMsk aws_msk = 5 [(google.api.field_behavior) = OPTIONAL];
// Optional. Confluent Cloud.
ConfluentCloud confluent_cloud = 6 [(google.api.field_behavior) = OPTIONAL];
}
// Optional. Platform Logs settings. If unset, no Platform Logs will be
// generated.
PlatformLogsSettings platform_logs_settings = 4
[(google.api.field_behavior) = OPTIONAL];
}
// Settings for Platform Logs produced by Pub/Sub.
message PlatformLogsSettings {
// Severity levels of Platform Logs.
enum Severity {
// Default value. Logs level is unspecified. Logs will be disabled.
SEVERITY_UNSPECIFIED = 0;
// Logs will be disabled.
DISABLED = 1;
// Debug logs and higher-severity logs will be written.
DEBUG = 2;
// Info logs and higher-severity logs will be written.
INFO = 3;
// Warning logs and higher-severity logs will be written.
WARNING = 4;
// Only error logs will be written.
ERROR = 5;
}
// Optional. The minimum severity level of Platform Logs that will be written.
Severity severity = 1 [(google.api.field_behavior) = OPTIONAL];
}
// Payload of the Platform Log entry sent when a failure is encountered while
// ingesting.
message IngestionFailureEvent {
// Specifies the reason why some data may have been left out of
// the desired Pub/Sub message due to the API message limits
// (https://cloud.google.com/pubsub/quotas#resource_limits). For example,
// when the number of attributes is larger than 100, the number of
// attributes is truncated to 100 to respect the limit on the attribute count.
// Other attribute limits are treated similarly. When the size of the desired
// message would've been larger than 10MB, the message won't be published at
// all, and ingestion of the subsequent messages will proceed as normal.
message ApiViolationReason {}
// Set when an Avro file is unsupported or its format is not valid. When this
// occurs, one or more Avro objects won't be ingested.
message AvroFailureReason {}
// Set when a Pub/Sub message fails to get published due to a schema
// validation violation.
message SchemaViolationReason {}
// Set when a Pub/Sub message fails to get published due to a message
// transformation error.
message MessageTransformationFailureReason {}
// Failure when ingesting from a Cloud Storage source.
message CloudStorageFailure {
// Optional. Name of the Cloud Storage bucket used for ingestion.
string bucket = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. Name of the Cloud Storage object which contained the section
// that couldn't be ingested.
string object_name = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. Generation of the Cloud Storage object which contained the
// section that couldn't be ingested.
int64 object_generation = 3 [(google.api.field_behavior) = OPTIONAL];
// Reason why ingestion failed for the specified object.
oneof reason {
// Optional. Failure encountered when parsing an Avro file.
AvroFailureReason avro_failure_reason = 5
[(google.api.field_behavior) = OPTIONAL];
// Optional. The Pub/Sub API limits prevented the desired message from
// being published.
ApiViolationReason api_violation_reason = 6
[(google.api.field_behavior) = OPTIONAL];
// Optional. The Pub/Sub message failed schema validation.
SchemaViolationReason schema_violation_reason = 7
[(google.api.field_behavior) = OPTIONAL];
// Optional. Failure encountered when applying a message transformation to
// the Pub/Sub message.
MessageTransformationFailureReason message_transformation_failure_reason =
8 [(google.api.field_behavior) = OPTIONAL];
}
}
// Failure when ingesting from an Amazon MSK source.
message AwsMskFailureReason {
// Optional. The ARN of the cluster of the topic being ingested from.
string cluster_arn = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. The name of the Kafka topic being ingested from.
string kafka_topic = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. The partition ID of the message that failed to be ingested.
int64 partition_id = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. The offset within the partition of the message that failed to
// be ingested.
int64 offset = 4 [(google.api.field_behavior) = OPTIONAL];
// Reason why ingestion failed for the specified message.
oneof reason {
// Optional. The Pub/Sub API limits prevented the desired message from
// being published.
ApiViolationReason api_violation_reason = 5
[(google.api.field_behavior) = OPTIONAL];
// Optional. The Pub/Sub message failed schema validation.
SchemaViolationReason schema_violation_reason = 6
[(google.api.field_behavior) = OPTIONAL];
// Optional. Failure encountered when applying a message transformation to
// the Pub/Sub message.
MessageTransformationFailureReason message_transformation_failure_reason =
7 [(google.api.field_behavior) = OPTIONAL];
}
}
// Failure when ingesting from an Azure Event Hubs source.
message AzureEventHubsFailureReason {
// Optional. The namespace containing the event hub being ingested from.
string namespace = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. The name of the event hub being ingested from.
string event_hub = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. The partition ID of the message that failed to be ingested.
int64 partition_id = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. The offset within the partition of the message that failed to
// be ingested.
int64 offset = 4 [(google.api.field_behavior) = OPTIONAL];
// Reason why ingestion failed for the specified message.
oneof reason {
// Optional. The Pub/Sub API limits prevented the desired message from
// being published.
ApiViolationReason api_violation_reason = 5
[(google.api.field_behavior) = OPTIONAL];
// Optional. The Pub/Sub message failed schema validation.
SchemaViolationReason schema_violation_reason = 6
[(google.api.field_behavior) = OPTIONAL];
// Optional. Failure encountered when applying a message transformation to
// the Pub/Sub message.
MessageTransformationFailureReason message_transformation_failure_reason =
7 [(google.api.field_behavior) = OPTIONAL];
}
}
// Failure when ingesting from a Confluent Cloud source.
message ConfluentCloudFailureReason {
// Optional. The cluster ID containing the topic being ingested from.
string cluster_id = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. The name of the Kafka topic being ingested from.
string kafka_topic = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. The partition ID of the message that failed to be ingested.
int64 partition_id = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. The offset within the partition of the message that failed to
// be ingested.
int64 offset = 4 [(google.api.field_behavior) = OPTIONAL];
// Reason why ingestion failed for the specified message.
oneof reason {
// Optional. The Pub/Sub API limits prevented the desired message from
// being published.
ApiViolationReason api_violation_reason = 5
[(google.api.field_behavior) = OPTIONAL];
// Optional. The Pub/Sub message failed schema validation.
SchemaViolationReason schema_violation_reason = 6
[(google.api.field_behavior) = OPTIONAL];
// Optional. Failure encountered when applying a message transformation to
// the Pub/Sub message.
MessageTransformationFailureReason message_transformation_failure_reason =
7 [(google.api.field_behavior) = OPTIONAL];
}
}
// Failure when ingesting from an AWS Kinesis source.
message AwsKinesisFailureReason {
// Optional. The stream ARN of the Kinesis stream being ingested from.
string stream_arn = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. The partition key of the message that failed to be ingested.
string partition_key = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. The sequence number of the message that failed to be ingested.
string sequence_number = 3 [(google.api.field_behavior) = OPTIONAL];
// Reason why ingestion failed for the specified message.
oneof reason {
// Optional. The Pub/Sub message failed schema validation.
SchemaViolationReason schema_violation_reason = 4
[(google.api.field_behavior) = OPTIONAL];
// Optional. Failure encountered when applying a message transformation to
// the Pub/Sub message.
MessageTransformationFailureReason message_transformation_failure_reason =
5 [(google.api.field_behavior) = OPTIONAL];
// Optional. The message failed to be published due to an API violation.
// This is only set when the size of the data field of the Kinesis record
// is zero.
ApiViolationReason api_violation_reason = 6
[(google.api.field_behavior) = OPTIONAL];
}
}
// Required. Name of the import topic. Format is:
// projects/{project_name}/topics/{topic_name}.
string topic = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
];
// Required. Error details explaining why ingestion to Pub/Sub has failed.
string error_message = 2 [(google.api.field_behavior) = REQUIRED];
oneof failure {
// Optional. Failure when ingesting from Cloud Storage.
CloudStorageFailure cloud_storage_failure = 3
[(google.api.field_behavior) = OPTIONAL];
// Optional. Failure when ingesting from Amazon MSK.
AwsMskFailureReason aws_msk_failure = 4
[(google.api.field_behavior) = OPTIONAL];
// Optional. Failure when ingesting from Azure Event Hubs.
AzureEventHubsFailureReason azure_event_hubs_failure = 5
[(google.api.field_behavior) = OPTIONAL];
// Optional. Failure when ingesting from Confluent Cloud.
ConfluentCloudFailureReason confluent_cloud_failure = 6
[(google.api.field_behavior) = OPTIONAL];
// Optional. Failure when ingesting from AWS Kinesis.
AwsKinesisFailureReason aws_kinesis_failure = 7
[(google.api.field_behavior) = OPTIONAL];
}
}
// User-defined JavaScript function that can transform or filter a Pub/Sub
// message.
message JavaScriptUDF {
// Required. Name of the JavasScript function that should applied to Pub/Sub
// messages.
string function_name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. JavaScript code that contains a function `function_name` with the
// below signature:
//
// ```
// /**
// * Transforms a Pub/Sub message.
//
// * @return {(Object<string, (string | Object<string, string>)>|null)} - To
// * filter a message, return `null`. To transform a message return a map
// * with the following keys:
// * - (required) 'data' : {string}
// * - (optional) 'attributes' : {Object<string, string>}
// * Returning empty `attributes` will remove all attributes from the
// * message.
// *
// * @param {(Object<string, (string | Object<string, string>)>} Pub/Sub
// * message. Keys:
// * - (required) 'data' : {string}
// * - (required) 'attributes' : {Object<string, string>}
// *
// * @param {Object<string, any>} metadata - Pub/Sub message metadata.
// * Keys:
// * - (optional) 'message_id' : {string}
// * - (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
// * - (optional) 'ordering_key': {string}
// */
//
// function <function_name>(message, metadata) {
// }
// ```
string code = 2 [(google.api.field_behavior) = REQUIRED];
}
// Configuration for making inference requests against Vertex AI models.
message AIInference {
// Configuration for making inferences using arbitrary JSON payloads.
message UnstructuredInference {
// Optional. A parameters object to be included in each inference request.
// The parameters object is combined with the data field of the Pub/Sub
// message to form the inference request.
google.protobuf.Struct parameters = 1
[(google.api.field_behavior) = OPTIONAL];
}
// Required. An endpoint to a Vertex AI model of the form
// `projects/{project}/locations/{location}/endpoints/{endpoint}` or
// `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}`.
// Vertex AI API requests will be sent to this endpoint.
string endpoint = 1 [(google.api.field_behavior) = REQUIRED];
// The format of inference requests made to the endpoint.
oneof inference_mode {
// Optional. Requests and responses can be any arbitrary JSON object.
UnstructuredInference unstructured_inference = 2
[(google.api.field_behavior) = OPTIONAL];
}
// Optional. The service account to use to make prediction requests against
// endpoints. The resource creator or updater that specifies this field must
// have `iam.serviceAccounts.actAs` permission on the service account. If not
// specified, the Pub/Sub [service
// agent](https://cloud.google.com/iam/docs/service-agents),
// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
string service_account_email = 3 [(google.api.field_behavior) = OPTIONAL];
}
// All supported message transforms types.
message MessageTransform {
// The type of transform to apply to messages.
oneof transform {
// Optional. JavaScript User Defined Function. If multiple JavaScriptUDF's
// are specified on a resource, each must have a unique `function_name`.
JavaScriptUDF javascript_udf = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. AI Inference. Specifies the Vertex AI endpoint that inference
// requests built from the Pub/Sub message data and provided parameters will
// be sent to.
AIInference ai_inference = 6 [(google.api.field_behavior) = OPTIONAL];
}
// Optional. This field is deprecated, use the `disabled` field to disable
// transforms.
bool enabled = 3 [deprecated = true, (google.api.field_behavior) = OPTIONAL];
// Optional. If true, the transform is disabled and will not be applied to
// messages. Defaults to `false`.
bool disabled = 4 [(google.api.field_behavior) = OPTIONAL];
}
// A topic resource.
message Topic {
option (google.api.resource) = {
type: "pubsub.googleapis.com/Topic"
pattern: "projects/{project}/topics/{topic}"
pattern: "_deleted-topic_"
plural: "topics"
singular: "topic"
};
// The state of the topic.
enum State {
// Default value. This value is unused.
STATE_UNSPECIFIED = 0;
// The topic does not have any persistent errors.
ACTIVE = 1;
// Ingestion from the data source has encountered a permanent error.
// See the more detailed error state in the corresponding ingestion
// source configuration.
INGESTION_RESOURCE_ERROR = 2;
}
// Required. Identifier. The name of the topic. It must have the format
// `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
// and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
// underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
// signs (`%`). It must be between 3 and 255 characters in length, and it
// must not start with `"goog"`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IDENTIFIER
];
// Optional. See [Creating and managing labels]
// (https://cloud.google.com/pubsub/docs/labels).
map<string, string> labels = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. Policy constraining the set of Google Cloud Platform regions
// where messages published to the topic may be stored. If not present, then
// no constraints are in effect.
MessageStoragePolicy message_storage_policy = 3
[(google.api.field_behavior) = OPTIONAL];
// Optional. The resource name of the Cloud KMS CryptoKey to be used to
// protect access to messages published on this topic.
//
// The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
string kms_key_name = 5 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "cloudkms.googleapis.com/CryptoKey"
}
];
// Optional. Settings for validating messages published against a schema.
SchemaSettings schema_settings = 6 [(google.api.field_behavior) = OPTIONAL];
// Optional. Reserved for future use. This field is set only in responses from
// the server; it is ignored if it is set in any requests.
bool satisfies_pzs = 7 [(google.api.field_behavior) = OPTIONAL];
// Optional. Indicates the minimum duration to retain a message after it is
// published to the topic. If this field is set, messages published to the
// topic in the last `message_retention_duration` are always available to
// subscribers. For instance, it allows any attached subscription to [seek to
// a
// timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
// that is up to `message_retention_duration` in the past. If this field is
// not set, message retention is controlled by settings on individual
// subscriptions. Cannot be more than 31 days or less than 10 minutes.
google.protobuf.Duration message_retention_duration = 8
[(google.api.field_behavior) = OPTIONAL];
// Output only. An output-only field indicating the state of the topic.
State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. Settings for ingestion from a data source into this topic.
IngestionDataSourceSettings ingestion_data_source_settings = 10
[(google.api.field_behavior) = OPTIONAL];
// Optional. Transforms to be applied to messages published to the topic.
// Transforms are applied in the order specified.
repeated MessageTransform message_transforms = 13
[(google.api.field_behavior) = OPTIONAL];
// Optional. Input only. Immutable. Tag keys/values directly bound to this
// resource. For example:
// "123/environment": "production",
// "123/costCenter": "marketing"
// See https://docs.cloud.google.com/pubsub/docs/tags for more information on
// using tags with Pub/Sub resources.
map<string, string> tags = 14 [
(google.api.field_behavior) = INPUT_ONLY,
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OPTIONAL
];
}
// A message that is published by publishers and consumed by subscribers. The
// message must contain either a non-empty data field or at least one attribute.
// Note that client libraries represent this object differently
// depending on the language. See the corresponding [client library
// documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for
// more information. See [quotas and limits]
// (https://cloud.google.com/pubsub/quotas) for more information about message
// limits.
message PubsubMessage {
// Optional. The message data field. If this field is empty, the message must
// contain at least one attribute.
bytes data = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. Attributes for this message. If this field is empty, the message
// must contain non-empty data. This can be used to filter messages on the
// subscription.
map<string, string> attributes = 2 [(google.api.field_behavior) = OPTIONAL];
// ID of this message, assigned by the server when the message is published.
// Guaranteed to be unique within the topic. This value may be read by a
// subscriber that receives a `PubsubMessage` via a `Pull` call or a push
// delivery. It must not be populated by the publisher in a `Publish` call.
string message_id = 3;
// The time at which the message was published, populated by the server when
// it receives the `Publish` call. It must not be populated by the
// publisher in a `Publish` call.
google.protobuf.Timestamp publish_time = 4;
// Optional. If non-empty, identifies related messages for which publish order
// should be respected. If a `Subscription` has `enable_message_ordering` set
// to `true`, messages published with the same non-empty `ordering_key` value
// will be delivered to subscribers in the order in which they are received by
// the Pub/Sub system. All `PubsubMessage`s published in a given
// `PublishRequest` must specify the same `ordering_key` value. For more
// information, see [ordering