|
1 |
| -// Copyright 2022 Google LLC |
| 1 | +// Copyright 2023 Google LLC |
2 | 2 | //
|
3 | 3 | // Licensed under the Apache License, Version 2.0 (the "License");
|
4 | 4 | // you may not use this file except in compliance with the License.
|
@@ -647,9 +647,9 @@ service Subscriber {
|
647 | 647 | }
|
648 | 648 | }
|
649 | 649 |
|
650 |
| -// A subscription resource. If none of `push_config` or `bigquery_config` is |
651 |
| -// set, then the subscriber will pull and ack messages using API methods. At |
652 |
| -// most one of these fields may be set. |
| 650 | +// A subscription resource. If none of `push_config`, `bigquery_config`, or |
| 651 | +// `cloud_storage_config` is set, then the subscriber will pull and ack messages |
| 652 | +// using API methods. At most one of these fields may be set. |
653 | 653 | message Subscription {
|
654 | 654 | option (google.api.resource) = {
|
655 | 655 | type: "pubsub.googleapis.com/Subscription"
|
@@ -694,6 +694,10 @@ message Subscription {
|
694 | 694 | // used to configure it.
|
695 | 695 | BigQueryConfig bigquery_config = 18;
|
696 | 696 |
|
| 697 | + // If delivery to Google Cloud Storage is used with this subscription, this |
| 698 | + // field is used to configure it. |
| 699 | + CloudStorageConfig cloud_storage_config = 22; |
| 700 | + |
697 | 701 | // The approximate amount of time (on a best-effort basis) Pub/Sub waits for
|
698 | 702 | // the subscriber to acknowledge receipt before resending the message. In the
|
699 | 703 | // interval after the message is delivered and before it is acknowledged, it
|
@@ -885,9 +889,9 @@ message PushConfig {
|
885 | 889 | message OidcToken {
|
886 | 890 | // [Service account
|
887 | 891 | // email](https://cloud.google.com/iam/docs/service-accounts)
|
888 |
| - // to be used for generating the OIDC token. The caller (for |
889 |
| - // CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must |
890 |
| - // have the iam.serviceAccounts.actAs permission for the service account. |
| 892 | + // used for generating the OIDC token. For more information |
| 893 | + // on setting up authentication, see |
| 894 | + // [Push subscriptions](https://cloud.google.com/pubsub/docs/push). |
891 | 895 | string service_account_email = 1;
|
892 | 896 |
|
893 | 897 | // Audience to be used when generating OIDC token. The audience claim
|
@@ -990,6 +994,75 @@ message BigQueryConfig {
|
990 | 994 | State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
|
991 | 995 | }
|
992 | 996 |
|
| 997 | +// Configuration for a Cloud Storage subscription. |
| 998 | +message CloudStorageConfig { |
| 999 | + // Configuration for writing message data in text format. |
| 1000 | + // Message payloads will be written to files as raw text, separated by a |
| 1001 | + // newline. |
| 1002 | + message TextConfig {} |
| 1003 | + |
| 1004 | + // Configuration for writing message data in Avro format. |
| 1005 | + // Message payloads and metadata will be written to files as an Avro binary. |
| 1006 | + message AvroConfig { |
| 1007 | + // When true, write the subscription name, message_id, publish_time, |
| 1008 | + // attributes, and ordering_key as additional fields in the output. |
| 1009 | + bool write_metadata = 1; |
| 1010 | + } |
| 1011 | + |
| 1012 | + // Possible states for a Cloud Storage subscription. |
| 1013 | + enum State { |
| 1014 | + // Default value. This value is unused. |
| 1015 | + STATE_UNSPECIFIED = 0; |
| 1016 | + |
| 1017 | + // The subscription can actively send messages to Cloud Storage. |
| 1018 | + ACTIVE = 1; |
| 1019 | + |
| 1020 | + // Cannot write to the Cloud Storage bucket because of permission denied |
| 1021 | + // errors. |
| 1022 | + PERMISSION_DENIED = 2; |
| 1023 | + |
| 1024 | + // Cannot write to the Cloud Storage bucket because it does not exist. |
| 1025 | + NOT_FOUND = 3; |
| 1026 | + } |
| 1027 | + |
| 1028 | + // Required. User-provided name for the Cloud Storage bucket. |
| 1029 | + // The bucket must be created by the user. The bucket name must be without |
| 1030 | + // any prefix like "gs://". See the [bucket naming |
| 1031 | + // requirements] (https://cloud.google.com/storage/docs/buckets#naming). |
| 1032 | + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; |
| 1033 | + |
| 1034 | + // User-provided prefix for Cloud Storage filename. See the [object naming |
| 1035 | + // requirements](https://cloud.google.com/storage/docs/objects#naming). |
| 1036 | + string filename_prefix = 2; |
| 1037 | + |
| 1038 | + // User-provided suffix for Cloud Storage filename. See the [object naming |
| 1039 | + // requirements](https://cloud.google.com/storage/docs/objects#naming). |
| 1040 | + string filename_suffix = 3; |
| 1041 | + |
| 1042 | + // Defaults to text format. |
| 1043 | + oneof output_format { |
| 1044 | + // If set, message data will be written to Cloud Storage in text format. |
| 1045 | + TextConfig text_config = 4; |
| 1046 | + |
| 1047 | + // If set, message data will be written to Cloud Storage in Avro format. |
| 1048 | + AvroConfig avro_config = 5; |
| 1049 | + } |
| 1050 | + |
| 1051 | + // The maximum duration that can elapse before a new Cloud Storage file is |
| 1052 | + // created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed |
| 1053 | + // the subscription's acknowledgement deadline. |
| 1054 | + google.protobuf.Duration max_duration = 6; |
| 1055 | + |
| 1056 | + // The maximum bytes that can be written to a Cloud Storage file before a new |
| 1057 | + // file is created. Min 1 KB, max 10 GiB. The max_bytes limit may be exceeded |
| 1058 | + // in cases where messages are larger than the limit. |
| 1059 | + int64 max_bytes = 7; |
| 1060 | + |
| 1061 | + // Output only. An output-only field that indicates whether or not the |
| 1062 | + // subscription can receive messages. |
| 1063 | + State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 1064 | +} |
| 1065 | + |
993 | 1066 | // A message and its corresponding acknowledgment ID.
|
994 | 1067 | message ReceivedMessage {
|
995 | 1068 | // This ID can be used to acknowledge the received message.
|
|
0 commit comments