xref: /aosp_15_r20/external/googleapis/google/cloud/alloydb/v1beta/resources.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.alloydb.v1beta;
18
19import "google/api/field_behavior.proto";
20import "google/api/field_info.proto";
21import "google/api/resource.proto";
22import "google/protobuf/duration.proto";
23import "google/protobuf/timestamp.proto";
24import "google/protobuf/wrappers.proto";
25import "google/type/dayofweek.proto";
26import "google/type/timeofday.proto";
27
28option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta";
29option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb";
30option java_multiple_files = true;
31option java_outer_classname = "ResourcesProto";
32option java_package = "com.google.cloud.alloydb.v1beta";
33option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta";
34option ruby_package = "Google::Cloud::AlloyDB::V1beta";
35option (google.api.resource_definition) = {
36  type: "cloudkms.googleapis.com/CryptoKeyVersion"
37  pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}"
38};
39option (google.api.resource_definition) = {
40  type: "compute.googleapis.com/Network"
41  pattern: "projects/{project}/global/networks/{network}"
42};
43
44// View on Instance. Pass this enum to rpcs that returns an Instance message to
45// control which subsets of fields to get.
46enum InstanceView {
47  // INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
48  INSTANCE_VIEW_UNSPECIFIED = 0;
49
50  // BASIC server responses for a primary or read instance include all the
51  // relevant instance details, excluding the details of each node in the
52  // instance. The default value.
53  INSTANCE_VIEW_BASIC = 1;
54
55  // FULL response is equivalent to BASIC for primary instance (for now).
56  // For read pool instance, this includes details of each node in the pool.
57  INSTANCE_VIEW_FULL = 2;
58}
59
60// View on Cluster. Pass this enum to rpcs that returns a cluster message to
61// control which subsets of fields to get.
62enum ClusterView {
63  // CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
64  CLUSTER_VIEW_UNSPECIFIED = 0;
65
66  // BASIC server responses include all the relevant cluster details, excluding
67  // Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific
68  // fields. The default value.
69  CLUSTER_VIEW_BASIC = 1;
70
71  // CONTINUOUS_BACKUP response returns all the fields from BASIC plus
72  // the earliest restorable time if continuous backups are enabled.
73  // May increase latency.
74  CLUSTER_VIEW_CONTINUOUS_BACKUP = 2;
75}
76
77// The supported database engine versions.
78enum DatabaseVersion {
79  // This is an unknown database version.
80  DATABASE_VERSION_UNSPECIFIED = 0;
81
82  // DEPRECATED - The database version is Postgres 13.
83  POSTGRES_13 = 1 [deprecated = true];
84
85  // The database version is Postgres 14.
86  POSTGRES_14 = 2;
87
88  // The database version is Postgres 15.
89  POSTGRES_15 = 3;
90}
91
92// The username/password for a database user. Used for specifying initial
93// users at cluster creation time.
94message UserPassword {
95  // The database username.
96  string user = 1;
97
98  // The initial password for the user.
99  string password = 2;
100}
101
102// Subset of the source instance configuration that is available when reading
103// the cluster resource.
104message MigrationSource {
105  // Denote the type of migration source that created this cluster.
106  enum MigrationSourceType {
107    // Migration source is unknown.
108    MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0;
109
110    // DMS source means the cluster was created via DMS migration job.
111    DMS = 1;
112  }
113
114  // Output only. The host and port of the on-premises instance in host:port
115  // format
116  string host_port = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
117
118  // Output only. Place holder for the external source identifier(e.g DMS job
119  // name) that created the cluster.
120  string reference_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
121
122  // Output only. Type of migration source.
123  MigrationSourceType source_type = 3
124      [(google.api.field_behavior) = OUTPUT_ONLY];
125}
126
127// EncryptionConfig describes the encryption config of a cluster or a backup
128// that is encrypted with a CMEK (customer-managed encryption key).
129message EncryptionConfig {
130  // The fully-qualified resource name of the KMS key.
131  // Each Cloud KMS key is regionalized and has the following format:
132  // projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
133  string kms_key_name = 1;
134}
135
136// EncryptionInfo describes the encryption information of a cluster or a backup.
137message EncryptionInfo {
138  // Possible encryption types.
139  enum Type {
140    // Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION.
141    TYPE_UNSPECIFIED = 0;
142
143    // The data is encrypted at rest with a key that is fully managed by Google.
144    // No key version will be populated. This is the default state.
145    GOOGLE_DEFAULT_ENCRYPTION = 1;
146
147    // The data is encrypted at rest with a key that is managed by the customer.
148    // KMS key versions will be populated.
149    CUSTOMER_MANAGED_ENCRYPTION = 2;
150  }
151
152  // Output only. Type of encryption.
153  Type encryption_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
154
155  // Output only. Cloud KMS key versions that are being used to protect the
156  // database or the backup.
157  repeated string kms_key_versions = 2 [
158    (google.api.field_behavior) = OUTPUT_ONLY,
159    (google.api.resource_reference) = {
160      type: "cloudkms.googleapis.com/CryptoKeyVersion"
161    }
162  ];
163}
164
165// SSL configuration.
166message SslConfig {
167  // SSL mode options.
168  enum SslMode {
169    // SSL mode not specified. Defaults to ENCRYPTED_ONLY.
170    SSL_MODE_UNSPECIFIED = 0;
171
172    // SSL connections are optional. CA verification not enforced.
173    SSL_MODE_ALLOW = 1 [deprecated = true];
174
175    // SSL connections are required. CA verification not enforced.
176    // Clients may use locally self-signed certificates (default psql client
177    // behavior).
178    SSL_MODE_REQUIRE = 2 [deprecated = true];
179
180    // SSL connections are required. CA verification enforced.
181    // Clients must have certificates signed by a Cluster CA, e.g. via
182    // GenerateClientCertificate.
183    SSL_MODE_VERIFY_CA = 3 [deprecated = true];
184
185    // SSL connections are optional. CA verification not enforced.
186    ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4;
187
188    // SSL connections are required. CA verification not enforced.
189    ENCRYPTED_ONLY = 5;
190  }
191
192  // Certificate Authority (CA) source for SSL/TLS certificates.
193  enum CaSource {
194    // Certificate Authority (CA) source not specified. Defaults to
195    // CA_SOURCE_MANAGED.
196    CA_SOURCE_UNSPECIFIED = 0;
197
198    // Certificate Authority (CA) managed by the AlloyDB Cluster.
199    CA_SOURCE_MANAGED = 1;
200  }
201
202  // Optional. SSL mode. Specifies client-server SSL/TLS connection behavior.
203  SslMode ssl_mode = 1 [(google.api.field_behavior) = OPTIONAL];
204
205  // Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is
206  // supported currently, and is the default value.
207  CaSource ca_source = 2 [(google.api.field_behavior) = OPTIONAL];
208}
209
210// Message describing the user-specified automated backup policy.
211//
212// All fields in the automated backup policy are optional. Defaults for each
213// field are provided if they are not set.
214message AutomatedBackupPolicy {
215  // A weekly schedule starts a backup at prescribed start times within a
216  // day, for the specified days of the week.
217  //
218  // The weekly schedule message is flexible and can be used to create many
219  // types of schedules. For example, to have a daily backup that starts at
220  // 22:00, configure the `start_times` field to have one element "22:00" and
221  // the `days_of_week` field to have all seven days of the week.
222  message WeeklySchedule {
223    // The times during the day to start a backup. The start times are assumed
224    // to be in UTC and to be an exact hour (e.g., 04:00:00).
225    //
226    // If no start times are provided, a single fixed start time is chosen
227    // arbitrarily.
228    repeated google.type.TimeOfDay start_times = 1;
229
230    // The days of the week to perform a backup.
231    //
232    // If this field is left empty, the default of every day of the week is
233    // used.
234    repeated google.type.DayOfWeek days_of_week = 2;
235  }
236
237  // A time based retention policy specifies that all backups within a certain
238  // time period should be retained.
239  message TimeBasedRetention {
240    // The retention period.
241    google.protobuf.Duration retention_period = 1;
242  }
243
244  // A quantity based policy specifies that a certain number of the most recent
245  // successful backups should be retained.
246  message QuantityBasedRetention {
247    // The number of backups to retain.
248    int32 count = 1;
249  }
250
251  // The schedule for this automated backup policy.
252  //
253  // A schedule specifies times at which to start a backup. If a backup
254  // window is also provided, the backup is guaranteed to be started and
255  // completed within the start time plus the backup window. If the backup is
256  // not completed within the backup window it is marked as failed.
257  //
258  // If not set, the schedule defaults to a weekly schedule with one backup
259  // per day and a start time chosen arbitrarily.
260  oneof schedule {
261    // Weekly schedule for the Backup.
262    WeeklySchedule weekly_schedule = 2;
263  }
264
265  // The retention policy for automated backups.
266  //
267  // The retention policy for a backup is fixed at the time the backup is
268  // created. Changes to this field only apply to new backups taken with the
269  // policy; the retentions of existing backups remain unchanged.
270  //
271  // If no retention policy is set, a default of 14 days is used.
272  oneof retention {
273    // Time-based Backup retention policy.
274    TimeBasedRetention time_based_retention = 4;
275
276    // Quantity-based Backup retention policy to retain recent backups.
277    QuantityBasedRetention quantity_based_retention = 5;
278  }
279
280  // Whether automated automated backups are enabled. If not set, defaults to
281  // true.
282  optional bool enabled = 1;
283
284  // The length of the time window during which a backup can be
285  // taken. If a backup does not succeed within this time window, it will be
286  // canceled and considered failed.
287  //
288  // The backup window must be at least 5 minutes long. There is no upper bound
289  // on the window. If not set, it defaults to 1 hour.
290  google.protobuf.Duration backup_window = 3;
291
292  // Optional. The encryption config can be specified to encrypt the
293  // backups with a customer-managed encryption key (CMEK). When this field is
294  // not specified, the backup will then use default encryption scheme to
295  // protect the user data.
296  EncryptionConfig encryption_config = 8
297      [(google.api.field_behavior) = OPTIONAL];
298
299  // The location where the backup will be stored. Currently, the only supported
300  // option is to store the backup in the same region as the cluster.
301  //
302  // If empty, defaults to the region of the cluster.
303  string location = 6;
304
305  // Labels to apply to backups created using this configuration.
306  map<string, string> labels = 7;
307}
308
309// ContinuousBackupConfig describes the continuous backups recovery
310// configurations of a cluster.
311message ContinuousBackupConfig {
312  // Whether ContinuousBackup is enabled.
313  optional bool enabled = 1;
314
315  // The number of days that are eligible to restore from using PITR. To support
316  // the entire recovery window, backups and logs are retained for one day more
317  // than the recovery window. If not set, defaults to 14 days.
318  int32 recovery_window_days = 4;
319
320  // The encryption config can be specified to encrypt the
321  // backups with a customer-managed encryption key (CMEK). When this field is
322  // not specified, the backup will then use default encryption scheme to
323  // protect the user data.
324  EncryptionConfig encryption_config = 3;
325}
326
327// ContinuousBackupInfo describes the continuous backup properties of a
328// cluster.
329message ContinuousBackupInfo {
330  // Output only. The encryption information for the WALs and backups required
331  // for ContinuousBackup.
332  EncryptionInfo encryption_info = 1
333      [(google.api.field_behavior) = OUTPUT_ONLY];
334
335  // Output only. When ContinuousBackup was most recently enabled. Set to null
336  // if ContinuousBackup is not enabled.
337  google.protobuf.Timestamp enabled_time = 2
338      [(google.api.field_behavior) = OUTPUT_ONLY];
339
340  // Output only. Days of the week on which a continuous backup is taken. Output
341  // only field. Ignored if passed into the request.
342  repeated google.type.DayOfWeek schedule = 3
343      [(google.api.field_behavior) = OUTPUT_ONLY];
344
345  // Output only. The earliest restorable time that can be restored to. Output
346  // only field.
347  google.protobuf.Timestamp earliest_restorable_time = 4
348      [(google.api.field_behavior) = OUTPUT_ONLY];
349}
350
351// Message describing a BackupSource.
352message BackupSource {
353  // Output only. The system-generated UID of the backup which was used to
354  // create this resource. The UID is generated when the backup is created, and
355  // it is retained until the backup is deleted.
356  string backup_uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
357
358  // Required. The name of the backup resource with the format:
359  //  * projects/{project}/locations/{region}/backups/{backup_id}
360  string backup_name = 1 [
361    (google.api.field_behavior) = REQUIRED,
362    (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" }
363  ];
364}
365
366// Message describing a ContinuousBackupSource.
367message ContinuousBackupSource {
368  // Required. The source cluster from which to restore. This cluster must have
369  // continuous backup enabled for this operation to succeed. For the required
370  // format, see the comment on the Cluster.name field.
371  string cluster = 1 [(google.api.field_behavior) = REQUIRED];
372
373  // Required. The point in time to restore to.
374  google.protobuf.Timestamp point_in_time = 2
375      [(google.api.field_behavior) = REQUIRED];
376}
377
378// A cluster is a collection of regional AlloyDB resources. It can include a
379// primary instance and one or more read pool instances.
380// All cluster resources share a storage layer, which scales as needed.
381message Cluster {
382  option (google.api.resource) = {
383    type: "alloydb.googleapis.com/Cluster"
384    pattern: "projects/{project}/locations/{location}/clusters/{cluster}"
385    style: DECLARATIVE_FRIENDLY
386  };
387
388  // Metadata related to network configuration.
389  message NetworkConfig {
390    // Optional. The resource link for the VPC network in which cluster
391    // resources are created and from which they are accessible via Private IP.
392    // The network must belong to the same project as the cluster. It is
393    // specified in the form:
394    // "projects/{project_number}/global/networks/{network_id}". This is
395    // required to create a cluster.
396    string network = 1 [
397      (google.api.field_behavior) = OPTIONAL,
398      (google.api.resource_reference) = {
399        type: "compute.googleapis.com/Network"
400      }
401    ];
402
403    // Optional. Name of the allocated IP range for the private IP AlloyDB
404    // cluster, for example: "google-managed-services-default". If set, the
405    // instance IPs for this cluster will be created in the allocated range. The
406    // range name must comply with RFC 1035. Specifically, the name must be 1-63
407    // characters long and match the regular expression
408    // `[a-z]([-a-z0-9]*[a-z0-9])?`.
409    // Field name is intended to be consistent with Cloud SQL.
410    string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL];
411  }
412
413  // Configuration information for the secondary cluster. This should be set
414  // if and only if the cluster is of type SECONDARY.
415  message SecondaryConfig {
416    // The name of the primary cluster name with the format:
417    // * projects/{project}/locations/{region}/clusters/{cluster_id}
418    string primary_cluster_name = 1;
419  }
420
421  // Configuration for the primary cluster. It has the list of clusters that are
422  // replicating from this cluster. This should be set if and only if the
423  // cluster is of type PRIMARY.
424  message PrimaryConfig {
425    // Output only. Names of the clusters that are replicating from this
426    // cluster.
427    repeated string secondary_cluster_names = 1
428        [(google.api.field_behavior) = OUTPUT_ONLY];
429  }
430
431  // Cluster State
432  enum State {
433    // The state of the cluster is unknown.
434    STATE_UNSPECIFIED = 0;
435
436    // The cluster is active and running.
437    READY = 1;
438
439    // The cluster is stopped. All instances in the cluster are stopped.
440    // Customers can start a stopped cluster at any point and all their
441    // instances will come back to life with same names and IP resources. In
442    // this state, customer pays for storage.
443    // Associated backups could also be present in a stopped cluster.
444    STOPPED = 2;
445
446    // The cluster is empty and has no associated resources.
447    // All instances, associated storage and backups have been deleted.
448    EMPTY = 3;
449
450    // The cluster is being created.
451    CREATING = 4;
452
453    // The cluster is being deleted.
454    DELETING = 5;
455
456    // The creation of the cluster failed.
457    FAILED = 6;
458
459    // The cluster is bootstrapping with data from some other source.
460    // Direct mutations to the cluster (e.g. adding read pool) are not allowed.
461    BOOTSTRAPPING = 7;
462
463    // The cluster is under maintenance. AlloyDB regularly performs maintenance
464    // and upgrades on customer clusters. Updates on the cluster are
465    // not allowed while the cluster is in this state.
466    MAINTENANCE = 8;
467
468    // The cluster is being promoted.
469    PROMOTING = 9;
470  }
471
472  // Type of Cluster
473  enum ClusterType {
474    // The type of the cluster is unknown.
475    CLUSTER_TYPE_UNSPECIFIED = 0;
476
477    // Primary cluster that support read and write operations.
478    PRIMARY = 1;
479
480    // Secondary cluster that is replicating from another region.
481    // This only supports read.
482    SECONDARY = 2;
483  }
484
485  // In case of an imported cluster, this field contains information about the
486  // source this cluster was imported from.
487  oneof source {
488    // Output only. Cluster created from backup.
489    BackupSource backup_source = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
490
491    // Output only. Cluster created via DMS migration.
492    MigrationSource migration_source = 16
493        [(google.api.field_behavior) = OUTPUT_ONLY];
494  }
495
496  // Output only. The name of the cluster resource with the format:
497  //  * projects/{project}/locations/{region}/clusters/{cluster_id}
498  // where the cluster ID segment should satisfy the regex expression
499  // `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
500  // The prefix of the cluster resource name is the name of the parent resource:
501  //  * projects/{project}/locations/{region}
502  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
503
504  // User-settable and human-readable display name for the Cluster.
505  string display_name = 2;
506
507  // Output only. The system-generated UID of the resource. The UID is assigned
508  // when the resource is created, and it is retained until it is deleted.
509  string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
510
511  // Output only. Create time stamp
512  google.protobuf.Timestamp create_time = 4
513      [(google.api.field_behavior) = OUTPUT_ONLY];
514
515  // Output only. Update time stamp
516  google.protobuf.Timestamp update_time = 5
517      [(google.api.field_behavior) = OUTPUT_ONLY];
518
519  // Output only. Delete time stamp
520  google.protobuf.Timestamp delete_time = 6
521      [(google.api.field_behavior) = OUTPUT_ONLY];
522
523  // Labels as key value pairs
524  map<string, string> labels = 7;
525
526  // Output only. The current serving state of the cluster.
527  State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
528
529  // Output only. The type of the cluster. This is an output-only field and it's
530  // populated at the Cluster creation time or the Cluster promotion
531  // time. The cluster type is determined by which RPC was used to create
532  // the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
533  ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
534
535  // Optional. The database engine major version. This is an optional field and
536  // it is populated at the Cluster creation time. If a database version is not
537  // supplied at cluster creation time, then a default database version will
538  // be used.
539  DatabaseVersion database_version = 9 [(google.api.field_behavior) = OPTIONAL];
540
541  NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL];
542
543  // Required. The resource link for the VPC network in which cluster resources
544  // are created and from which they are accessible via Private IP. The network
545  // must belong to the same project as the cluster. It is specified in the
546  // form: "projects/{project}/global/networks/{network_id}". This is required
547  // to create a cluster. Deprecated, use network_config.network instead.
548  string network = 10 [
549    deprecated = true,
550    (google.api.field_behavior) = REQUIRED,
551    (google.api.resource_reference) = { type: "compute.googleapis.com/Network" }
552  ];
553
554  // For Resource freshness validation (https://google.aip.dev/154)
555  string etag = 11;
556
557  // Annotations to allow client tools to store small amount of arbitrary data.
558  // This is distinct from labels.
559  // https://google.aip.dev/128
560  map<string, string> annotations = 12;
561
562  // Output only. Reconciling (https://google.aip.dev/128#reconciliation).
563  // Set to true if the current state of Cluster does not match the user's
564  // intended state, and the service is actively updating the resource to
565  // reconcile them. This can happen due to user-triggered updates or
566  // system actions like failover or maintenance.
567  bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
568
569  // Input only. Initial user to setup during cluster creation. Required.
570  // If used in `RestoreCluster` this is ignored.
571  UserPassword initial_user = 14 [(google.api.field_behavior) = INPUT_ONLY];
572
573  // The automated backup policy for this cluster.
574  //
575  // If no policy is provided then the default policy will be used. If backups
576  // are supported for the cluster, the default policy takes one backup a day,
577  // has a backup window of 1 hour, and retains backups for 14 days.
578  // For more information on the defaults, consult the
579  // documentation for the message type.
580  AutomatedBackupPolicy automated_backup_policy = 17;
581
582  // SSL configuration for this AlloyDB cluster.
583  SslConfig ssl_config = 18 [deprecated = true];
584
585  // Optional. The encryption config can be specified to encrypt the data disks
586  // and other persistent data resources of a cluster with a
587  // customer-managed encryption key (CMEK). When this field is not
588  // specified, the cluster will then use default encryption scheme to
589  // protect the user data.
590  EncryptionConfig encryption_config = 19
591      [(google.api.field_behavior) = OPTIONAL];
592
593  // Output only. The encryption information for the cluster.
594  EncryptionInfo encryption_info = 20
595      [(google.api.field_behavior) = OUTPUT_ONLY];
596
597  // Optional. Continuous backup configuration for this cluster.
598  ContinuousBackupConfig continuous_backup_config = 27
599      [(google.api.field_behavior) = OPTIONAL];
600
601  // Output only. Continuous backup properties for this cluster.
602  ContinuousBackupInfo continuous_backup_info = 28
603      [(google.api.field_behavior) = OUTPUT_ONLY];
604
605  // Cross Region replication config specific to SECONDARY cluster.
606  SecondaryConfig secondary_config = 22;
607
608  // Output only. Cross Region replication config specific to PRIMARY cluster.
609  PrimaryConfig primary_config = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
610
611  // Output only. Reserved for future use.
612  bool satisfies_pzs = 30 [(google.api.field_behavior) = OUTPUT_ONLY];
613}
614
615// An Instance is a computing unit that an end customer can connect to.
616// It's the main unit of computing resources in AlloyDB.
617message Instance {
618  option (google.api.resource) = {
619    type: "alloydb.googleapis.com/Instance"
620    pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}"
621    style: DECLARATIVE_FRIENDLY
622  };
623
624  // MachineConfig describes the configuration of a machine.
625  message MachineConfig {
626    // The number of CPU's in the VM instance.
627    int32 cpu_count = 1;
628  }
629
630  // Details of a single node in the instance.
631  // Nodes in an AlloyDB instance are ephemereal, they can change during
632  // update, failover, autohealing and resize operations.
633  message Node {
634    // The Compute Engine zone of the VM e.g. "us-central1-b".
635    string zone_id = 1;
636
637    // The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
638    string id = 2;
639
640    // The private IP address of the VM e.g. "10.57.0.34".
641    string ip = 3;
642
643    // Determined by state of the compute VM and postgres-service health.
644    // Compute VM state can have values listed in
645    // https://cloud.google.com/compute/docs/instances/instance-life-cycle and
646    // postgres-service health can have values: HEALTHY and UNHEALTHY.
647    string state = 4;
648  }
649
650  // QueryInsights Instance specific configuration.
651  message QueryInsightsInstanceConfig {
652    // Record application tags for an instance.
653    // This flag is turned "on" by default.
654    optional bool record_application_tags = 2;
655
656    // Record client address for an instance. Client address is PII information.
657    // This flag is turned "on" by default.
658    optional bool record_client_address = 3;
659
660    // Query string length. The default value is 1024.
661    // Any integer between 256 and 4500 is considered valid.
662    uint32 query_string_length = 4;
663
664    // Number of query execution plans captured by Insights per minute
665    // for all queries combined. The default value is 5.
666    // Any integer between 0 and 20 is considered valid.
667    optional uint32 query_plans_per_minute = 5;
668  }
669
670  // Configuration for a read pool instance.
671  message ReadPoolConfig {
672    // Read capacity, i.e. number of nodes in a read pool instance.
673    int32 node_count = 1;
674  }
675
676  // Policy to be used while updating the instance.
677  message UpdatePolicy {
678    // Specifies the available modes of update.
679    enum Mode {
680      // Mode is unknown.
681      MODE_UNSPECIFIED = 0;
682
683      // Least disruptive way to apply the update.
684      DEFAULT = 1;
685
686      // Performs a forced update when applicable. This will be fast but may
687      // incur a downtime.
688      FORCE_APPLY = 2;
689    }
690
691    // Mode for updating the instance.
692    Mode mode = 1;
693  }
694
695  // Client connection configuration
696  message ClientConnectionConfig {
697    // Optional. Configuration to enforce connectors only (ex: AuthProxy)
698    // connections to the database.
699    bool require_connectors = 1 [(google.api.field_behavior) = OPTIONAL];
700
701    // Optional. SSL config option for this instance.
702    SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL];
703  }
704
705  // Configuration for setting up a PSC interface. This information needs to be
706  // provided by the customer.
707  // PSC interfaces will be created and added to VMs via SLM (adding a network
708  // interface will require recreating the VM). For HA instances this will be
709  // done via LDTM.
710  message PscInterfaceConfig {
711    // A list of endpoints in the consumer VPC the interface might initiate
712    // outbound connections to. This list has to be provided when the PSC
713    // interface is created.
714    repeated string consumer_endpoint_ips = 1;
715
716    // The NetworkAttachment resource created in the consumer VPC to which the
717    // PSC interface will be linked, in the form of:
718    // `projects/${CONSUMER_PROJECT}/regions/${REGION}/networkAttachments/${NETWORK_ATTACHMENT_NAME}`.
719    // NetworkAttachment has to be provided when the PSC interface is created.
720    string network_attachment = 2;
721  }
722
723  // PscInstanceConfig contains PSC related configuration at an
724  // instance level.
725  message PscInstanceConfig {
726    // Output only. The service attachment created when Private
727    // Service Connect (PSC) is enabled for the instance.
728    // The name of the resource will be in the format of
729    // `projects/<alloydb-tenant-project-number>/regions/<region-name>/serviceAttachments/<service-attachment-name>`
730    string service_attachment_link = 1
731        [(google.api.field_behavior) = OUTPUT_ONLY];
732
733    // Optional. List of consumer projects that are allowed to create
734    // PSC endpoints to service-attachments to this instance.
735    repeated string allowed_consumer_projects = 2
736        [(google.api.field_behavior) = OPTIONAL];
737
738    // Optional. List of consumer networks that are allowed to create
739    // PSC endpoints to service-attachments to this instance.
740    repeated string allowed_consumer_networks = 3
741        [(google.api.field_behavior) = OPTIONAL];
742
743    // Optional. Configurations for setting up PSC interfaces attached to the
744    // instance which are used for outbound connectivity. Only primary instances
745    // can have PSC interface attached. All the VMs created for the primary
746    // instance will share the same configurations. Currently we only support 0
747    // or 1 PSC interface.
748    repeated PscInterfaceConfig psc_interface_configs = 4
749        [(google.api.field_behavior) = OPTIONAL];
750
751    // Optional. List of service attachments that this instance has created
752    // endpoints to connect with. Currently, only a single outgoing service
753    // attachment is supported per instance.
754    repeated string outgoing_service_attachment_links = 5
755        [(google.api.field_behavior) = OPTIONAL];
756
757    // Optional. Whether PSC connectivity is enabled for this instance.
758    // This is populated by referencing the value from the parent cluster.
759    bool psc_enabled = 6 [(google.api.field_behavior) = OPTIONAL];
760  }
761
762  // Metadata related to instance level network configuration.
763  message InstanceNetworkConfig {
764    // AuthorizedNetwork contains metadata for an authorized network.
765    message AuthorizedNetwork {
766      // CIDR range for one authorzied network of the instance.
767      string cidr_range = 1 [(google.api.field_info).format = IPV4];
768    }
769
770    // Optional. A list of external network authorized to access this instance.
771    repeated AuthorizedNetwork authorized_external_networks = 1
772        [(google.api.field_behavior) = OPTIONAL];
773
774    // Optional. Enabling public ip for the instance.
775    bool enable_public_ip = 2 [(google.api.field_behavior) = OPTIONAL];
776  }
777
778  // Instance State
779  enum State {
780    // The state of the instance is unknown.
781    STATE_UNSPECIFIED = 0;
782
783    // The instance is active and running.
784    READY = 1;
785
786    // The instance is stopped. Instance name and IP resources are preserved.
787    STOPPED = 2;
788
789    // The instance is being created.
790    CREATING = 3;
791
792    // The instance is being deleted.
793    DELETING = 4;
794
795    // The instance is down for maintenance.
796    MAINTENANCE = 5;
797
798    // The creation of the instance failed or a fatal error occurred during
799    // an operation on the instance.
800    // Note: Instances in this state would tried to be auto-repaired. And
801    // Customers should be able to restart, update or delete these instances.
802    FAILED = 6;
803
804    // Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that
805    // index unused in case that state also needs to exposed via consumer apis
806    // in future.
807    // The instance has been configured to sync data from some other source.
808    BOOTSTRAPPING = 8;
809
810    // The instance is being promoted.
811    PROMOTING = 9;
812  }
813
814  // Type of an Instance
815  enum InstanceType {
816    // The type of the instance is unknown.
817    INSTANCE_TYPE_UNSPECIFIED = 0;
818
819    // PRIMARY instances support read and write operations.
820    PRIMARY = 1;
821
822    // READ POOL instances support read operations only. Each read pool instance
823    // consists of one or more homogeneous nodes.
824    //  * Read pool of size 1 can only have zonal availability.
825    //  * Read pools with node count of 2 or more can have regional
826    //    availability (nodes are present in 2 or more zones in a region).
827    READ_POOL = 2;
828
829    // SECONDARY instances support read operations only. SECONDARY instance
830    // is a cross-region read replica
831    SECONDARY = 3;
832  }
833
834  // The Availability type of an instance. Potential values:
835  //
836  // - ZONAL: The instance serves data from only one zone. Outages in that
837  //     zone affect instance availability.
838  // - REGIONAL: The instance can serve data from more than one zone in a
839  //     region (it is highly available).
840  enum AvailabilityType {
841    // This is an unknown Availability type.
842    AVAILABILITY_TYPE_UNSPECIFIED = 0;
843
844    // Zonal available instance.
845    ZONAL = 1;
846
847    // Regional (or Highly) available instance.
848    REGIONAL = 2;
849  }
850
851  // Output only. The name of the instance resource with the format:
852  //  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
853  // where the cluster and instance ID segments should satisfy the regex
854  // expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
855  // lowercase letters, numbers, and dashes, starting with a letter, and ending
856  // with a letter or number. For more details see https://google.aip.dev/122.
857  // The prefix of the instance resource name is the name of the parent
858  // resource:
859  //  * projects/{project}/locations/{region}/clusters/{cluster_id}
860  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
861
862  // User-settable and human-readable display name for the Instance.
863  string display_name = 2;
864
865  // Output only. The system-generated UID of the resource. The UID is assigned
866  // when the resource is created, and it is retained until it is deleted.
867  string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
868
869  // Output only. Create time stamp
870  google.protobuf.Timestamp create_time = 4
871      [(google.api.field_behavior) = OUTPUT_ONLY];
872
873  // Output only. Update time stamp
874  google.protobuf.Timestamp update_time = 5
875      [(google.api.field_behavior) = OUTPUT_ONLY];
876
877  // Output only. Delete time stamp
878  google.protobuf.Timestamp delete_time = 6
879      [(google.api.field_behavior) = OUTPUT_ONLY];
880
881  // Labels as key value pairs
882  map<string, string> labels = 7;
883
884  // Output only. The current serving state of the instance.
885  State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
886
887  // Required. The type of the instance. Specified at creation time.
888  InstanceType instance_type = 9 [(google.api.field_behavior) = REQUIRED];
889
890  // Configurations for the machines that host the underlying
891  // database engine.
892  MachineConfig machine_config = 10;
893
894  // Availability type of an Instance.
895  // If empty, defaults to REGIONAL for primary instances.
896  // For read pools, availability_type is always UNSPECIFIED. Instances in the
897  // read pools are evenly distributed across available zones within the region
898  // (i.e. read pools with more than one node will have a node in at
899  // least two zones).
900  AvailabilityType availability_type = 11;
901
902  // The Compute Engine zone that the instance should serve from, per
903  // https://cloud.google.com/compute/docs/regions-zones
904  // This can ONLY be specified for ZONAL instances.
905  // If present for a REGIONAL instance, an error will be thrown.
906  // If this is absent for a ZONAL instance, instance is created in a random
907  // zone with available capacity.
908  string gce_zone = 12;
909
910  // Database flags. Set at instance level.
911  //  * They are copied from primary instance on read instance creation.
912  //  * Read instances can set new or override existing flags that are relevant
913  //    for reads, e.g. for enabling columnar cache on a read instance. Flags
914  //    set on read instance may or may not be present on primary.
915  //
916  //
917  // This is a list of "key": "value" pairs.
918  // "key": The name of the flag. These flags are passed at instance setup time,
919  // so include both server options and system variables for Postgres. Flags are
920  // specified with underscores, not hyphens.
921  // "value": The value of the flag. Booleans are set to **on** for true
922  // and **off** for false. This field must be omitted if the flag
923  // doesn't take a value.
924  map<string, string> database_flags = 13;
925
926  // Output only. This is set for the read-write VM of the PRIMARY instance
927  // only.
928  Node writable_node = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
929
930  // Output only. List of available read-only VMs in this instance, including
931  // the standby for a PRIMARY instance.
932  repeated Node nodes = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
933
934  // Configuration for query insights.
935  QueryInsightsInstanceConfig query_insights_config = 21;
936
937  // Read pool instance configuration.
938  // This is required if the value of instanceType is READ_POOL.
939  ReadPoolConfig read_pool_config = 14;
940
941  // Output only. The IP address for the Instance.
942  // This is the connection endpoint for an end-user application.
943  string ip_address = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
944
945  // Output only. The public IP addresses for the Instance. This is available
946  // ONLY when enable_public_ip is set. This is the connection endpoint for an
947  // end-user application.
948  string public_ip_address = 27 [(google.api.field_behavior) = OUTPUT_ONLY];
949
950  // Output only. Reconciling (https://google.aip.dev/128#reconciliation).
951  // Set to true if the current state of Instance does not match the user's
952  // intended state, and the service is actively updating the resource to
953  // reconcile them. This can happen due to user-triggered updates or
954  // system actions like failover or maintenance.
955  bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
956
957  // For Resource freshness validation (https://google.aip.dev/154)
958  string etag = 17;
959
960  // Annotations to allow client tools to store small amount of arbitrary data.
961  // This is distinct from labels.
962  // https://google.aip.dev/128
963  map<string, string> annotations = 18;
964
965  // Update policy that will be applied during instance update.
966  // This field is not persisted when you update the instance.
967  // To use a non-default update policy, you must
968  // specify explicitly specify the value in each update request.
969  UpdatePolicy update_policy = 22;
970
971  // Optional. Client connection specific configurations
972  ClientConnectionConfig client_connection_config = 23
973      [(google.api.field_behavior) = OPTIONAL];
974
975  // Output only. Reserved for future use.
976  bool satisfies_pzs = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
977
978  // Optional. The configuration for Private Service Connect (PSC) for the
979  // instance.
980  PscInstanceConfig psc_instance_config = 28
981      [(google.api.field_behavior) = OPTIONAL];
982
983  // Optional. Instance level network configuration.
984  InstanceNetworkConfig network_config = 29
985      [(google.api.field_behavior) = OPTIONAL];
986}
987
988// ConnectionInfo singleton resource.
989// https://google.aip.dev/156
990message ConnectionInfo {
991  option (google.api.resource) = {
992    type: "alloydb.googleapis.com/ConnectionInfo"
993    pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo"
994  };
995
996  // The name of the ConnectionInfo singleton resource, e.g.:
997  // projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
998  // This field currently has no semantic meaning.
999  string name = 1;
1000
1001  // Output only. The private network IP address for the Instance. This is the
1002  // default IP for the instance and is always created (even if enable_public_ip
1003  // is set). This is the connection endpoint for an end-user application.
1004  string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
1005
1006  // Output only. The public IP addresses for the Instance. This is available
1007  // ONLY when enable_public_ip is set. This is the connection endpoint for an
1008  // end-user application.
1009  string public_ip_address = 5 [
1010    (google.api.field_info).format = IPV4,
1011    (google.api.field_behavior) = OUTPUT_ONLY
1012  ];
1013
1014  // Output only. The pem-encoded chain that may be used to verify the X.509
1015  // certificate. Expected to be in issuer-to-root order according to RFC 5246.
1016  repeated string pem_certificate_chain = 3
1017      [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY];
1018
1019  // Output only. The unique ID of the Instance.
1020  string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
1021
1022  // Output only. The DNS name to use with PSC for the Instance.
1023  string psc_dns_name = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
1024}
1025
1026// Message describing Backup object
1027message Backup {
1028  option (google.api.resource) = {
1029    type: "alloydb.googleapis.com/Backup"
1030    pattern: "projects/{project}/locations/{location}/backups/{backup}"
1031    style: DECLARATIVE_FRIENDLY
1032  };
1033
1034  // A backup's position in a quantity-based retention queue, of backups with
1035  // the same source cluster and type, with length, retention, specified by the
1036  // backup's retention policy.
1037  // Once the position is greater than the retention, the backup is eligible to
1038  // be garbage collected.
1039  //
1040  // Example: 5 backups from the same source cluster and type with a
1041  // quantity-based retention of 3 and denoted by backup_id (position,
1042  // retention).
1043  //
1044  // Safe: backup_5 (1, 3), backup_4, (2, 3), backup_3 (3, 3).
1045  // Awaiting garbage collection: backup_2 (4, 3), backup_1 (5, 3)
1046  message QuantityBasedExpiry {
1047    // Output only. The backup's position among its backups with the same source
1048    // cluster and type, by descending chronological order create time(i.e.
1049    // newest first).
1050    int32 retention_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1051
1052    // Output only. The length of the quantity-based queue, specified by the
1053    // backup's retention policy.
1054    int32 total_retention_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
1055  }
1056
1057  // Backup State
1058  enum State {
1059    // The state of the backup is unknown.
1060    STATE_UNSPECIFIED = 0;
1061
1062    // The backup is ready.
1063    READY = 1;
1064
1065    // The backup is creating.
1066    CREATING = 2;
1067
1068    // The backup failed.
1069    FAILED = 3;
1070
1071    // The backup is being deleted.
1072    DELETING = 4;
1073  }
1074
1075  // Backup Type
1076  enum Type {
1077    // Backup Type is unknown.
1078    TYPE_UNSPECIFIED = 0;
1079
1080    // ON_DEMAND backups that were triggered by the customer (e.g., not
1081    // AUTOMATED).
1082    ON_DEMAND = 1;
1083
1084    // AUTOMATED backups triggered by the automated backups scheduler pursuant
1085    // to an automated backup policy.
1086    AUTOMATED = 2;
1087
1088    // CONTINUOUS backups triggered by the automated backups scheduler
1089    // due to a continuous backup policy.
1090    CONTINUOUS = 3;
1091  }
1092
1093  // Output only. The name of the backup resource with the format:
1094  //  * projects/{project}/locations/{region}/backups/{backup_id}
1095  // where the cluster and backup ID segments should satisfy the regex
1096  // expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
1097  // lowercase letters, numbers, and dashes, starting with a letter, and ending
1098  // with a letter or number. For more details see https://google.aip.dev/122.
1099  // The prefix of the backup resource name is the name of the parent
1100  // resource:
1101  //  * projects/{project}/locations/{region}
1102  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1103
1104  // User-settable and human-readable display name for the Backup.
1105  string display_name = 2;
1106
1107  // Output only. The system-generated UID of the resource. The UID is assigned
1108  // when the resource is created, and it is retained until it is deleted.
1109  string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
1110
1111  // Output only. Create time stamp
1112  google.protobuf.Timestamp create_time = 4
1113      [(google.api.field_behavior) = OUTPUT_ONLY];
1114
1115  // Output only. Update time stamp
1116  google.protobuf.Timestamp update_time = 5
1117      [(google.api.field_behavior) = OUTPUT_ONLY];
1118
1119  // Output only. Delete time stamp
1120  google.protobuf.Timestamp delete_time = 15
1121      [(google.api.field_behavior) = OUTPUT_ONLY];
1122
1123  // Labels as key value pairs
1124  map<string, string> labels = 6;
1125
1126  // Output only. The current state of the backup.
1127  State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
1128
1129  // The backup type, which suggests the trigger for the backup.
1130  Type type = 8;
1131
1132  // User-provided description of the backup.
1133  string description = 9;
1134
1135  // Output only. The system-generated UID of the cluster which was used to
1136  // create this resource.
1137  string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
1138
1139  // Required. The full resource name of the backup source cluster
1140  // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
1141  string cluster_name = 10 [
1142    (google.api.field_behavior) = REQUIRED,
1143    (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" }
1144  ];
1145
1146  // Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
1147  // true, indicates that the service is actively updating the resource. This
1148  // can happen due to user-triggered updates or system actions like failover or
1149  // maintenance.
1150  bool reconciling = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
1151
1152  // Optional. The encryption config can be specified to encrypt the
1153  // backup with a customer-managed encryption key (CMEK). When this field is
1154  // not specified, the backup will then use default encryption scheme to
1155  // protect the user data.
1156  EncryptionConfig encryption_config = 12
1157      [(google.api.field_behavior) = OPTIONAL];
1158
1159  // Output only. The encryption information for the backup.
1160  EncryptionInfo encryption_info = 13
1161      [(google.api.field_behavior) = OUTPUT_ONLY];
1162
1163  // For Resource freshness validation (https://google.aip.dev/154)
1164  string etag = 14;
1165
1166  // Annotations to allow client tools to store small amount of arbitrary data.
1167  // This is distinct from labels.
1168  // https://google.aip.dev/128
1169  map<string, string> annotations = 16;
1170
1171  // Output only. The size of the backup in bytes.
1172  int64 size_bytes = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
1173
1174  // Output only. The time at which after the backup is eligible to be garbage
1175  // collected. It is the duration specified by the backup's retention policy,
1176  // added to the backup's create_time.
1177  google.protobuf.Timestamp expiry_time = 19
1178      [(google.api.field_behavior) = OUTPUT_ONLY];
1179
1180  // Output only. The QuantityBasedExpiry of the backup, specified by the
1181  // backup's retention policy. Once the expiry quantity is over retention, the
1182  // backup is eligible to be garbage collected.
1183  QuantityBasedExpiry expiry_quantity = 20
1184      [(google.api.field_behavior) = OUTPUT_ONLY];
1185
1186  // Output only. Reserved for future use.
1187  bool satisfies_pzs = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
1188
1189  // Output only. The database engine major version of the cluster this backup
1190  // was created from. Any restored cluster created from this backup will have
1191  // the same database version.
1192  DatabaseVersion database_version = 22
1193      [(google.api.field_behavior) = OUTPUT_ONLY];
1194}
1195
1196// SupportedDatabaseFlag gives general information about a database flag,
1197// like type and allowed values. This is a static value that is defined
1198// on the server side, and it cannot be modified by callers.
1199// To set the Database flags on a particular Instance, a caller should modify
1200// the Instance.database_flags field.
1201message SupportedDatabaseFlag {
1202  option (google.api.resource) = {
1203    type: "alloydb.googleapis.com/SupportedDatabaseFlag"
1204    pattern: "projects/{project}/locations/{location}/flags/{flag}"
1205  };
1206
1207  // Restrictions on STRING type values
1208  message StringRestrictions {
1209    // The list of allowed values, if bounded. This field will be empty
1210    // if there is a unbounded number of allowed values.
1211    repeated string allowed_values = 1;
1212  }
1213
1214  // Restrictions on INTEGER type values.
1215  message IntegerRestrictions {
1216    // The minimum value that can be specified, if applicable.
1217    google.protobuf.Int64Value min_value = 1;
1218
1219    // The maximum value that can be specified, if applicable.
1220    google.protobuf.Int64Value max_value = 2;
1221  }
1222
1223  // ValueType describes the semantic type of the value that the flag accepts.
1224  // Regardless of the ValueType, the Instance.database_flags field accepts the
1225  // stringified version of the value, i.e. "20" or "3.14".
1226  enum ValueType {
1227    // This is an unknown flag type.
1228    VALUE_TYPE_UNSPECIFIED = 0;
1229
1230    // String type flag.
1231    STRING = 1;
1232
1233    // Integer type flag.
1234    INTEGER = 2;
1235
1236    // Float type flag.
1237    FLOAT = 3;
1238
1239    // Denotes that the flag does not accept any values.
1240    NONE = 4;
1241  }
1242
1243  // The restrictions on the flag value per type.
1244  oneof restrictions {
1245    // Restriction on STRING type value.
1246    StringRestrictions string_restrictions = 7;
1247
1248    // Restriction on INTEGER type value.
1249    IntegerRestrictions integer_restrictions = 8;
1250  }
1251
1252  // The name of the flag resource, following Google Cloud conventions, e.g.:
1253  //  * projects/{project}/locations/{location}/flags/{flag}
1254  // This field currently has no semantic meaning.
1255  string name = 1;
1256
1257  // The name of the database flag, e.g. "max_allowed_packets".
1258  // The is a possibly key for the Instance.database_flags map field.
1259  string flag_name = 2;
1260
1261  ValueType value_type = 3;
1262
1263  // Whether the database flag accepts multiple values. If true,
1264  // a comma-separated list of stringified values may be specified.
1265  bool accepts_multiple_values = 4;
1266
1267  // Major database engine versions for which this flag is supported.
1268  repeated DatabaseVersion supported_db_versions = 5;
1269
1270  // Whether setting or updating this flag on an Instance requires a database
1271  // restart. If a flag that requires database restart is set, the backend
1272  // will automatically restart the database (making sure to satisfy any
1273  // availability SLO's).
1274  bool requires_db_restart = 6;
1275}
1276
1277// Message describing User object.
1278message User {
1279  option (google.api.resource) = {
1280    type: "alloydb.googleapis.com/User"
1281    pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}"
1282    style: DECLARATIVE_FRIENDLY
1283  };
1284
1285  // Enum that details the user type.
1286  enum UserType {
1287    // Unspecified user type.
1288    USER_TYPE_UNSPECIFIED = 0;
1289
1290    // The default user type that authenticates via password-based
1291    // authentication.
1292    ALLOYDB_BUILT_IN = 1;
1293
1294    // Database user that can authenticate via IAM-Based authentication.
1295    ALLOYDB_IAM_USER = 2;
1296  }
1297
1298  // Output only. Name of the resource in the form of
1299  // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
1300  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1301
1302  // Input only. Password for the user.
1303  string password = 2 [(google.api.field_behavior) = INPUT_ONLY];
1304
1305  // Optional. List of database roles this user has.
1306  // The database role strings are subject to the PostgreSQL naming conventions.
1307  repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL];
1308
1309  // Optional. Type of this user.
1310  UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL];
1311}
1312
1313// Message describing Database object.
1314message Database {
1315  option (google.api.resource) = {
1316    type: "alloydb.googleapis.com/Database"
1317    pattern: "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}"
1318    plural: "databases"
1319    singular: "database"
1320    style: DECLARATIVE_FRIENDLY
1321  };
1322
1323  // Identifier. Name of the resource in the form of
1324  // `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`.
1325  string name = 1 [(google.api.field_behavior) = IDENTIFIER];
1326
1327  // Optional. Charset for the database.
1328  // This field can contain any PostgreSQL supported charset name.
1329  // Example values include "UTF8", "SQL_ASCII", etc.
1330  string charset = 2 [(google.api.field_behavior) = OPTIONAL];
1331
1332  // Optional. Collation for the database.
1333  // Name of the custom or native collation for postgres.
1334  // Example values include "C", "POSIX", etc
1335  string collation = 3 [(google.api.field_behavior) = OPTIONAL];
1336}
1337