Skip to content

Commit 23ec7b6

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add BigtableConfig type
PiperOrigin-RevId: 878685355
1 parent 572d5d5 commit 23ec7b6

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

google/pubsub/v1/pubsub.proto

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,6 +1475,10 @@ message Subscription {
14751475
CloudStorageConfig cloud_storage_config = 22
14761476
[(google.api.field_behavior) = OPTIONAL];
14771477

1478+
// Optional. If delivery to Bigtable is used with this subscription, this
1479+
// field is used to configure it.
1480+
BigtableConfig bigtable_config = 27 [(google.api.field_behavior) = OPTIONAL];
1481+
14781482
// Optional. The approximate amount of time (on a best-effort basis) Pub/Sub
14791483
// waits for the subscriber to acknowledge receipt before resending the
14801484
// message. In the interval after the message is delivered and before it is
@@ -1853,6 +1857,84 @@ message BigQueryConfig {
18531857
string service_account_email = 7 [(google.api.field_behavior) = OPTIONAL];
18541858
}
18551859

1860+
// Configuration for a Bigtable subscription. The Pub/Sub message will be
1861+
// written to a Bigtable row as follows:
1862+
// - row key: subscription name and message ID delimited by #.
1863+
// - columns: message bytes written to a single column family "data" with an
1864+
// empty-string column qualifier.
1865+
// - cell timestamp: the message publish timestamp.
1866+
message BigtableConfig {
1867+
// Possible states for a Bigtable subscription.
1868+
// Note: more states could be added in the future. Please code accordingly.
1869+
enum State {
1870+
// Default value. This value is unused.
1871+
STATE_UNSPECIFIED = 0;
1872+
1873+
// The subscription can actively send messages to Bigtable.
1874+
ACTIVE = 1;
1875+
1876+
// Cannot write to Bigtable because the instance, table, or app profile
1877+
// does not exist.
1878+
NOT_FOUND = 2;
1879+
1880+
// Cannot write to Bigtable because the app profile is not configured for
1881+
// single-cluster routing.
1882+
APP_PROFILE_MISCONFIGURED = 3;
1883+
1884+
// Cannot write to Bigtable because of permission denied errors.
1885+
// This can happen if:
1886+
// - The Pub/Sub service agent has not been granted the
1887+
// [appropriate Bigtable IAM permission
1888+
// bigtable.tables.mutateRows]({$universe.dns_names.final_documentation_domain}/bigtable/docs/access-control#permissions)
1889+
// - The bigtable.googleapis.com API is not enabled for the project
1890+
// ([instructions]({$universe.dns_names.final_documentation_domain}/service-usage/docs/enable-disable))
1891+
PERMISSION_DENIED = 4;
1892+
1893+
// Cannot write to Bigtable because of a missing column family ("data") or
1894+
// if there is no structured row key for the subscription name + message ID.
1895+
SCHEMA_MISMATCH = 5;
1896+
1897+
// Cannot write to the destination because enforce_in_transit is set to true
1898+
// and the destination locations are not in the allowed regions.
1899+
IN_TRANSIT_LOCATION_RESTRICTION = 6;
1900+
1901+
// Cannot write to Bigtable because the table is not in the same location as
1902+
// where Vertex AI models used in `message_transform`s are deployed.
1903+
VERTEX_AI_LOCATION_RESTRICTION = 7;
1904+
}
1905+
1906+
// Optional. The unique name of the table to write messages to.
1907+
//
1908+
// Values are of the form
1909+
// `projects/<project>/instances/<instance>/tables/<table>`.
1910+
string table = 1 [(google.api.field_behavior) = OPTIONAL];
1911+
1912+
// Optional. The app profile to use for the Bigtable writes. If not specified,
1913+
// the "default" application profile will be used. The app profile must use
1914+
// single-cluster routing.
1915+
string app_profile_id = 2 [(google.api.field_behavior) = OPTIONAL];
1916+
1917+
// Optional. The service account to use to write to Bigtable. The subscription
1918+
// creator or updater that specifies this field must have
1919+
// `iam.serviceAccounts.actAs` permission on the service account. If not
1920+
// specified, the Pub/Sub [service
1921+
// agent](https://cloud.google.com/iam/docs/service-agents),
1922+
// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
1923+
string service_account_email = 3 [(google.api.field_behavior) = OPTIONAL];
1924+
1925+
// Optional. When true, write the subscription name, message_id, publish_time,
1926+
// attributes, and ordering_key to additional columns in the table under the
1927+
// pubsub_metadata column family. The subscription name, message_id, and
1928+
// publish_time fields are put in their own columns while all other message
1929+
// properties (other than data) are written to a JSON object in the attributes
1930+
// column.
1931+
bool write_metadata = 5 [(google.api.field_behavior) = OPTIONAL];
1932+
1933+
// Output only. An output-only field that indicates whether or not the
1934+
// subscription can receive messages.
1935+
State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
1936+
}
1937+
18561938
// Configuration for a Cloud Storage subscription.
18571939
message CloudStorageConfig {
18581940
// Configuration for writing message data in text format.

0 commit comments

Comments
 (0)