xref: /aosp_15_r20/external/googleapis/google/cloud/alloydb/v1alpha/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.v1alpha;
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.V1Alpha";
29option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb";
30option java_multiple_files = true;
31option java_outer_classname = "ResourcesProto";
32option java_package = "com.google.cloud.alloydb.v1alpha";
33option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha";
34option ruby_package = "Google::Cloud::AlloyDB::V1alpha";
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  // PscConfig contains PSC related configuration at a cluster level.
432  message PscConfig {
433    // Optional. Create an instance that allows connections from Private Service
434    // Connect endpoints to the instance.
435    bool psc_enabled = 1 [(google.api.field_behavior) = OPTIONAL];
436  }
437
438  // Cluster State
439  enum State {
440    // The state of the cluster is unknown.
441    STATE_UNSPECIFIED = 0;
442
443    // The cluster is active and running.
444    READY = 1;
445
446    // The cluster is stopped. All instances in the cluster are stopped.
447    // Customers can start a stopped cluster at any point and all their
448    // instances will come back to life with same names and IP resources. In
449    // this state, customer pays for storage.
450    // Associated backups could also be present in a stopped cluster.
451    STOPPED = 2;
452
453    // The cluster is empty and has no associated resources.
454    // All instances, associated storage and backups have been deleted.
455    EMPTY = 3;
456
457    // The cluster is being created.
458    CREATING = 4;
459
460    // The cluster is being deleted.
461    DELETING = 5;
462
463    // The creation of the cluster failed.
464    FAILED = 6;
465
466    // The cluster is bootstrapping with data from some other source.
467    // Direct mutations to the cluster (e.g. adding read pool) are not allowed.
468    BOOTSTRAPPING = 7;
469
470    // The cluster is under maintenance. AlloyDB regularly performs maintenance
471    // and upgrades on customer clusters. Updates on the cluster are
472    // not allowed while the cluster is in this state.
473    MAINTENANCE = 8;
474
475    // The cluster is being promoted.
476    PROMOTING = 9;
477  }
478
479  // Type of Cluster
480  enum ClusterType {
481    // The type of the cluster is unknown.
482    CLUSTER_TYPE_UNSPECIFIED = 0;
483
484    // Primary cluster that support read and write operations.
485    PRIMARY = 1;
486
487    // Secondary cluster that is replicating from another region.
488    // This only supports read.
489    SECONDARY = 2;
490  }
491
492  // In case of an imported cluster, this field contains information about the
493  // source this cluster was imported from.
494  oneof source {
495    // Output only. Cluster created from backup.
496    BackupSource backup_source = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
497
498    // Output only. Cluster created via DMS migration.
499    MigrationSource migration_source = 16
500        [(google.api.field_behavior) = OUTPUT_ONLY];
501  }
502
503  // Output only. The name of the cluster resource with the format:
504  //  * projects/{project}/locations/{region}/clusters/{cluster_id}
505  // where the cluster ID segment should satisfy the regex expression
506  // `[a-z0-9-]+`. For more details see https://google.aip.dev/122.
507  // The prefix of the cluster resource name is the name of the parent resource:
508  //  * projects/{project}/locations/{region}
509  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
510
511  // User-settable and human-readable display name for the Cluster.
512  string display_name = 2;
513
514  // Output only. The system-generated UID of the resource. The UID is assigned
515  // when the resource is created, and it is retained until it is deleted.
516  string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
517
518  // Output only. Create time stamp
519  google.protobuf.Timestamp create_time = 4
520      [(google.api.field_behavior) = OUTPUT_ONLY];
521
522  // Output only. Update time stamp
523  google.protobuf.Timestamp update_time = 5
524      [(google.api.field_behavior) = OUTPUT_ONLY];
525
526  // Output only. Delete time stamp
527  google.protobuf.Timestamp delete_time = 6
528      [(google.api.field_behavior) = OUTPUT_ONLY];
529
530  // Labels as key value pairs
531  map<string, string> labels = 7;
532
533  // Output only. The current serving state of the cluster.
534  State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
535
536  // Output only. The type of the cluster. This is an output-only field and it's
537  // populated at the Cluster creation time or the Cluster promotion
538  // time. The cluster type is determined by which RPC was used to create
539  // the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
540  ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
541
542  // Optional. The database engine major version. This is an optional field and
543  // it is populated at the Cluster creation time. If a database version is not
544  // supplied at cluster creation time, then a default database version will
545  // be used.
546  DatabaseVersion database_version = 9 [(google.api.field_behavior) = OPTIONAL];
547
548  NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL];
549
550  // Required. The resource link for the VPC network in which cluster resources
551  // are created and from which they are accessible via Private IP. The network
552  // must belong to the same project as the cluster. It is specified in the
553  // form: "projects/{project}/global/networks/{network_id}". This is required
554  // to create a cluster. Deprecated, use network_config.network instead.
555  string network = 10 [
556    deprecated = true,
557    (google.api.field_behavior) = REQUIRED,
558    (google.api.resource_reference) = { type: "compute.googleapis.com/Network" }
559  ];
560
561  // For Resource freshness validation (https://google.aip.dev/154)
562  string etag = 11;
563
564  // Annotations to allow client tools to store small amount of arbitrary data.
565  // This is distinct from labels.
566  // https://google.aip.dev/128
567  map<string, string> annotations = 12;
568
569  // Output only. Reconciling (https://google.aip.dev/128#reconciliation).
570  // Set to true if the current state of Cluster does not match the user's
571  // intended state, and the service is actively updating the resource to
572  // reconcile them. This can happen due to user-triggered updates or
573  // system actions like failover or maintenance.
574  bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
575
576  // Input only. Initial user to setup during cluster creation. Required.
577  // If used in `RestoreCluster` this is ignored.
578  UserPassword initial_user = 14 [(google.api.field_behavior) = INPUT_ONLY];
579
580  // The automated backup policy for this cluster.
581  //
582  // If no policy is provided then the default policy will be used. If backups
583  // are supported for the cluster, the default policy takes one backup a day,
584  // has a backup window of 1 hour, and retains backups for 14 days.
585  // For more information on the defaults, consult the
586  // documentation for the message type.
587  AutomatedBackupPolicy automated_backup_policy = 17;
588
589  // SSL configuration for this AlloyDB cluster.
590  SslConfig ssl_config = 18 [deprecated = true];
591
592  // Optional. The encryption config can be specified to encrypt the data disks
593  // and other persistent data resources of a cluster with a
594  // customer-managed encryption key (CMEK). When this field is not
595  // specified, the cluster will then use default encryption scheme to
596  // protect the user data.
597  EncryptionConfig encryption_config = 19
598      [(google.api.field_behavior) = OPTIONAL];
599
600  // Output only. The encryption information for the cluster.
601  EncryptionInfo encryption_info = 20
602      [(google.api.field_behavior) = OUTPUT_ONLY];
603
604  // Optional. Continuous backup configuration for this cluster.
605  ContinuousBackupConfig continuous_backup_config = 27
606      [(google.api.field_behavior) = OPTIONAL];
607
608  // Output only. Continuous backup properties for this cluster.
609  ContinuousBackupInfo continuous_backup_info = 28
610      [(google.api.field_behavior) = OUTPUT_ONLY];
611
612  // Cross Region replication config specific to SECONDARY cluster.
613  SecondaryConfig secondary_config = 22;
614
615  // Output only. Cross Region replication config specific to PRIMARY cluster.
616  PrimaryConfig primary_config = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
617
618  // Output only. Reserved for future use.
619  bool satisfies_pzi = 33 [(google.api.field_behavior) = OUTPUT_ONLY];
620
621  // Output only. Reserved for future use.
622  bool satisfies_pzs = 30 [(google.api.field_behavior) = OUTPUT_ONLY];
623
624  // Optional. The configuration for Private Service Connect (PSC) for the
625  // cluster.
626  PscConfig psc_config = 31 [(google.api.field_behavior) = OPTIONAL];
627}
628
629// An Instance is a computing unit that an end customer can connect to.
630// It's the main unit of computing resources in AlloyDB.
631message Instance {
632  option (google.api.resource) = {
633    type: "alloydb.googleapis.com/Instance"
634    pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}"
635    style: DECLARATIVE_FRIENDLY
636  };
637
638  // MachineConfig describes the configuration of a machine.
639  message MachineConfig {
640    // The number of CPU's in the VM instance.
641    int32 cpu_count = 1;
642  }
643
644  // Details of a single node in the instance.
645  // Nodes in an AlloyDB instance are ephemereal, they can change during
646  // update, failover, autohealing and resize operations.
647  message Node {
648    // The Compute Engine zone of the VM e.g. "us-central1-b".
649    string zone_id = 1;
650
651    // The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".
652    string id = 2;
653
654    // The private IP address of the VM e.g. "10.57.0.34".
655    string ip = 3;
656
657    // Determined by state of the compute VM and postgres-service health.
658    // Compute VM state can have values listed in
659    // https://cloud.google.com/compute/docs/instances/instance-life-cycle and
660    // postgres-service health can have values: HEALTHY and UNHEALTHY.
661    string state = 4;
662  }
663
664  // QueryInsights Instance specific configuration.
665  message QueryInsightsInstanceConfig {
666    // Record application tags for an instance.
667    // This flag is turned "on" by default.
668    optional bool record_application_tags = 2;
669
670    // Record client address for an instance. Client address is PII information.
671    // This flag is turned "on" by default.
672    optional bool record_client_address = 3;
673
674    // Query string length. The default value is 1024.
675    // Any integer between 256 and 4500 is considered valid.
676    uint32 query_string_length = 4;
677
678    // Number of query execution plans captured by Insights per minute
679    // for all queries combined. The default value is 5.
680    // Any integer between 0 and 20 is considered valid.
681    optional uint32 query_plans_per_minute = 5;
682  }
683
684  // Configuration for a read pool instance.
685  message ReadPoolConfig {
686    // Read capacity, i.e. number of nodes in a read pool instance.
687    int32 node_count = 1;
688  }
689
690  // Policy to be used while updating the instance.
691  message UpdatePolicy {
692    // Specifies the available modes of update.
693    enum Mode {
694      // Mode is unknown.
695      MODE_UNSPECIFIED = 0;
696
697      // Least disruptive way to apply the update.
698      DEFAULT = 1;
699
700      // Performs a forced update when applicable. This will be fast but may
701      // incur a downtime.
702      FORCE_APPLY = 2;
703    }
704
705    // Mode for updating the instance.
706    Mode mode = 1;
707  }
708
709  // Client connection configuration
710  message ClientConnectionConfig {
711    // Optional. Configuration to enforce connectors only (ex: AuthProxy)
712    // connections to the database.
713    bool require_connectors = 1 [(google.api.field_behavior) = OPTIONAL];
714
715    // Optional. SSL config option for this instance.
716    SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL];
717  }
718
719  // Configuration for setting up a PSC interface. This information needs to be
720  // provided by the customer.
721  // PSC interfaces will be created and added to VMs via SLM (adding a network
722  // interface will require recreating the VM). For HA instances this will be
723  // done via LDTM.
724  message PscInterfaceConfig {
725    // A list of endpoints in the consumer VPC the interface might initiate
726    // outbound connections to. This list has to be provided when the PSC
727    // interface is created.
728    repeated string consumer_endpoint_ips = 1;
729
730    // The NetworkAttachment resource created in the consumer VPC to which the
731    // PSC interface will be linked, in the form of:
732    // "projects/${CONSUMER_PROJECT}/regions/${REGION}/networkAttachments/${NETWORK_ATTACHMENT_NAME}".
733    // NetworkAttachment has to be provided when the PSC interface is created.
734    string network_attachment = 2;
735  }
736
737  // PscInstanceConfig contains PSC related configuration at an
738  // instance level.
739  message PscInstanceConfig {
740    // Output only. The service attachment created when Private
741    // Service Connect (PSC) is enabled for the instance.
742    // The name of the resource will be in the format of
743    // projects/<alloydb-tenant-project-number>/regions/<region-name>/serviceAttachments/<service-attachment-name>
744    string service_attachment_link = 1
745        [(google.api.field_behavior) = OUTPUT_ONLY];
746
747    // Optional. List of consumer projects that are allowed to create
748    // PSC endpoints to service-attachments to this instance.
749    repeated string allowed_consumer_projects = 2
750        [(google.api.field_behavior) = OPTIONAL];
751
752    // Optional. List of consumer networks that are allowed to create
753    // PSC endpoints to service-attachments to this instance.
754    repeated string allowed_consumer_networks = 3
755        [(google.api.field_behavior) = OPTIONAL];
756
757    // Optional. Configurations for setting up PSC interfaces attached to the
758    // instance which are used for outbound connectivity. Only primary instances
759    // can have PSC interface attached. All the VMs created for the primary
760    // instance will share the same configurations. Currently we only support 0
761    // or 1 PSC interface.
762    repeated PscInterfaceConfig psc_interface_configs = 4
763        [(google.api.field_behavior) = OPTIONAL];
764
765    // Optional. List of service attachments that this instance has created
766    // endpoints to connect with. Currently, only a single outgoing service
767    // attachment is supported per instance.
768    repeated string outgoing_service_attachment_links = 5
769        [(google.api.field_behavior) = OPTIONAL];
770
771    // Optional. Whether PSC connectivity is enabled for this instance.
772    // This is populated by referencing the value from the parent cluster.
773    bool psc_enabled = 6 [(google.api.field_behavior) = OPTIONAL];
774  }
775
776  // Metadata related to instance level network configuration.
777  message InstanceNetworkConfig {
778    // AuthorizedNetwork contains metadata for an authorized network.
779    message AuthorizedNetwork {
780      // CIDR range for one authorzied network of the instance.
781      string cidr_range = 1 [(google.api.field_info).format = IPV4];
782    }
783
784    // Optional. A list of external network authorized to access this instance.
785    repeated AuthorizedNetwork authorized_external_networks = 1
786        [(google.api.field_behavior) = OPTIONAL];
787
788    // Optional. Enabling public ip for the instance.
789    bool enable_public_ip = 2 [(google.api.field_behavior) = OPTIONAL];
790  }
791
792  // Instance State
793  enum State {
794    // The state of the instance is unknown.
795    STATE_UNSPECIFIED = 0;
796
797    // The instance is active and running.
798    READY = 1;
799
800    // The instance is stopped. Instance name and IP resources are preserved.
801    STOPPED = 2;
802
803    // The instance is being created.
804    CREATING = 3;
805
806    // The instance is being deleted.
807    DELETING = 4;
808
809    // The instance is down for maintenance.
810    MAINTENANCE = 5;
811
812    // The creation of the instance failed or a fatal error occurred during
813    // an operation on the instance.
814    // Note: Instances in this state would tried to be auto-repaired. And
815    // Customers should be able to restart, update or delete these instances.
816    FAILED = 6;
817
818    // Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that
819    // index unused in case that state also needs to exposed via consumer apis
820    // in future.
821    // The instance has been configured to sync data from some other source.
822    BOOTSTRAPPING = 8;
823
824    // The instance is being promoted.
825    PROMOTING = 9;
826  }
827
828  // Type of an Instance
829  enum InstanceType {
830    // The type of the instance is unknown.
831    INSTANCE_TYPE_UNSPECIFIED = 0;
832
833    // PRIMARY instances support read and write operations.
834    PRIMARY = 1;
835
836    // READ POOL instances support read operations only. Each read pool instance
837    // consists of one or more homogeneous nodes.
838    //  * Read pool of size 1 can only have zonal availability.
839    //  * Read pools with node count of 2 or more can have regional
840    //    availability (nodes are present in 2 or more zones in a region).
841    READ_POOL = 2;
842
843    // SECONDARY instances support read operations only. SECONDARY instance
844    // is a cross-region read replica
845    SECONDARY = 3;
846  }
847
848  // The Availability type of an instance. Potential values:
849  //
850  // - ZONAL: The instance serves data from only one zone. Outages in that
851  //     zone affect instance availability.
852  // - REGIONAL: The instance can serve data from more than one zone in a
853  //     region (it is highly available).
854  enum AvailabilityType {
855    // This is an unknown Availability type.
856    AVAILABILITY_TYPE_UNSPECIFIED = 0;
857
858    // Zonal available instance.
859    ZONAL = 1;
860
861    // Regional (or Highly) available instance.
862    REGIONAL = 2;
863  }
864
865  // Output only. The name of the instance resource with the format:
866  //  * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}
867  // where the cluster and instance ID segments should satisfy the regex
868  // expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
869  // lowercase letters, numbers, and dashes, starting with a letter, and ending
870  // with a letter or number. For more details see https://google.aip.dev/122.
871  // The prefix of the instance resource name is the name of the parent
872  // resource:
873  //  * projects/{project}/locations/{region}/clusters/{cluster_id}
874  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
875
876  // User-settable and human-readable display name for the Instance.
877  string display_name = 2;
878
879  // Output only. The system-generated UID of the resource. The UID is assigned
880  // when the resource is created, and it is retained until it is deleted.
881  string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
882
883  // Output only. Create time stamp
884  google.protobuf.Timestamp create_time = 4
885      [(google.api.field_behavior) = OUTPUT_ONLY];
886
887  // Output only. Update time stamp
888  google.protobuf.Timestamp update_time = 5
889      [(google.api.field_behavior) = OUTPUT_ONLY];
890
891  // Output only. Delete time stamp
892  google.protobuf.Timestamp delete_time = 6
893      [(google.api.field_behavior) = OUTPUT_ONLY];
894
895  // Labels as key value pairs
896  map<string, string> labels = 7;
897
898  // Output only. The current serving state of the instance.
899  State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
900
901  // Required. The type of the instance. Specified at creation time.
902  InstanceType instance_type = 9 [(google.api.field_behavior) = REQUIRED];
903
904  // Configurations for the machines that host the underlying
905  // database engine.
906  MachineConfig machine_config = 10;
907
908  // Availability type of an Instance.
909  // If empty, defaults to REGIONAL for primary instances.
910  // For read pools, availability_type is always UNSPECIFIED. Instances in the
911  // read pools are evenly distributed across available zones within the region
912  // (i.e. read pools with more than one node will have a node in at
913  // least two zones).
914  AvailabilityType availability_type = 11;
915
916  // The Compute Engine zone that the instance should serve from, per
917  // https://cloud.google.com/compute/docs/regions-zones
918  // This can ONLY be specified for ZONAL instances.
919  // If present for a REGIONAL instance, an error will be thrown.
920  // If this is absent for a ZONAL instance, instance is created in a random
921  // zone with available capacity.
922  string gce_zone = 12;
923
924  // Database flags. Set at instance level.
925  //  * They are copied from primary instance on read instance creation.
926  //  * Read instances can set new or override existing flags that are relevant
927  //    for reads, e.g. for enabling columnar cache on a read instance. Flags
928  //    set on read instance may or may not be present on primary.
929  //
930  //
931  // This is a list of "key": "value" pairs.
932  // "key": The name of the flag. These flags are passed at instance setup time,
933  // so include both server options and system variables for Postgres. Flags are
934  // specified with underscores, not hyphens.
935  // "value": The value of the flag. Booleans are set to **on** for true
936  // and **off** for false. This field must be omitted if the flag
937  // doesn't take a value.
938  map<string, string> database_flags = 13;
939
940  // Output only. This is set for the read-write VM of the PRIMARY instance
941  // only.
942  Node writable_node = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
943
944  // Output only. List of available read-only VMs in this instance, including
945  // the standby for a PRIMARY instance.
946  repeated Node nodes = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
947
948  // Configuration for query insights.
949  QueryInsightsInstanceConfig query_insights_config = 21;
950
951  // Read pool instance configuration.
952  // This is required if the value of instanceType is READ_POOL.
953  ReadPoolConfig read_pool_config = 14;
954
955  // Output only. The IP address for the Instance.
956  // This is the connection endpoint for an end-user application.
957  string ip_address = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
958
959  // Output only. The public IP addresses for the Instance. This is available
960  // ONLY when enable_public_ip is set. This is the connection endpoint for an
961  // end-user application.
962  string public_ip_address = 27 [(google.api.field_behavior) = OUTPUT_ONLY];
963
964  // Output only. Reconciling (https://google.aip.dev/128#reconciliation).
965  // Set to true if the current state of Instance does not match the user's
966  // intended state, and the service is actively updating the resource to
967  // reconcile them. This can happen due to user-triggered updates or
968  // system actions like failover or maintenance.
969  bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
970
971  // For Resource freshness validation (https://google.aip.dev/154)
972  string etag = 17;
973
974  // Annotations to allow client tools to store small amount of arbitrary data.
975  // This is distinct from labels.
976  // https://google.aip.dev/128
977  map<string, string> annotations = 18;
978
979  // Update policy that will be applied during instance update.
980  // This field is not persisted when you update the instance.
981  // To use a non-default update policy, you must
982  // specify explicitly specify the value in each update request.
983  UpdatePolicy update_policy = 22;
984
985  // Optional. Client connection specific configurations
986  ClientConnectionConfig client_connection_config = 23
987      [(google.api.field_behavior) = OPTIONAL];
988
989  // Output only. Reserved for future use.
990  bool satisfies_pzi = 30 [(google.api.field_behavior) = OUTPUT_ONLY];
991
992  // Output only. Reserved for future use.
993  bool satisfies_pzs = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
994
995  // Optional. The configuration for Private Service Connect (PSC) for the
996  // instance.
997  PscInstanceConfig psc_instance_config = 28
998      [(google.api.field_behavior) = OPTIONAL];
999
1000  // Optional. Instance level network configuration.
1001  InstanceNetworkConfig network_config = 29
1002      [(google.api.field_behavior) = OPTIONAL];
1003}
1004
1005// ConnectionInfo singleton resource.
1006// https://google.aip.dev/156
1007message ConnectionInfo {
1008  option (google.api.resource) = {
1009    type: "alloydb.googleapis.com/ConnectionInfo"
1010    pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo"
1011  };
1012
1013  // The name of the ConnectionInfo singleton resource, e.g.:
1014  // projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo
1015  // This field currently has no semantic meaning.
1016  string name = 1;
1017
1018  // Output only. The private network IP address for the Instance. This is the
1019  // default IP for the instance and is always created (even if enable_public_ip
1020  // is set). This is the connection endpoint for an end-user application.
1021  string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
1022
1023  // Output only. The public IP addresses for the Instance. This is available
1024  // ONLY when enable_public_ip is set. This is the connection endpoint for an
1025  // end-user application.
1026  string public_ip_address = 5 [
1027    (google.api.field_info).format = IPV4,
1028    (google.api.field_behavior) = OUTPUT_ONLY
1029  ];
1030
1031  // Output only. The pem-encoded chain that may be used to verify the X.509
1032  // certificate. Expected to be in issuer-to-root order according to RFC 5246.
1033  repeated string pem_certificate_chain = 3
1034      [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY];
1035
1036  // Output only. The unique ID of the Instance.
1037  string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
1038
1039  // Output only. The DNS name to use with PSC for the Instance.
1040  string psc_dns_name = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
1041}
1042
1043// Message describing Backup object
1044message Backup {
1045  option (google.api.resource) = {
1046    type: "alloydb.googleapis.com/Backup"
1047    pattern: "projects/{project}/locations/{location}/backups/{backup}"
1048    style: DECLARATIVE_FRIENDLY
1049  };
1050
1051  // A backup's position in a quantity-based retention queue, of backups with
1052  // the same source cluster and type, with length, retention, specified by the
1053  // backup's retention policy.
1054  // Once the position is greater than the retention, the backup is eligible to
1055  // be garbage collected.
1056  //
1057  // Example: 5 backups from the same source cluster and type with a
1058  // quantity-based retention of 3 and denoted by backup_id (position,
1059  // retention).
1060  //
1061  // Safe: backup_5 (1, 3), backup_4, (2, 3), backup_3 (3, 3).
1062  // Awaiting garbage collection: backup_2 (4, 3), backup_1 (5, 3)
1063  message QuantityBasedExpiry {
1064    // Output only. The backup's position among its backups with the same source
1065    // cluster and type, by descending chronological order create time(i.e.
1066    // newest first).
1067    int32 retention_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1068
1069    // Output only. The length of the quantity-based queue, specified by the
1070    // backup's retention policy.
1071    int32 total_retention_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
1072  }
1073
1074  // Backup State
1075  enum State {
1076    // The state of the backup is unknown.
1077    STATE_UNSPECIFIED = 0;
1078
1079    // The backup is ready.
1080    READY = 1;
1081
1082    // The backup is creating.
1083    CREATING = 2;
1084
1085    // The backup failed.
1086    FAILED = 3;
1087
1088    // The backup is being deleted.
1089    DELETING = 4;
1090  }
1091
1092  // Backup Type
1093  enum Type {
1094    // Backup Type is unknown.
1095    TYPE_UNSPECIFIED = 0;
1096
1097    // ON_DEMAND backups that were triggered by the customer (e.g., not
1098    // AUTOMATED).
1099    ON_DEMAND = 1;
1100
1101    // AUTOMATED backups triggered by the automated backups scheduler pursuant
1102    // to an automated backup policy.
1103    AUTOMATED = 2;
1104
1105    // CONTINUOUS backups triggered by the automated backups scheduler
1106    // due to a continuous backup policy.
1107    CONTINUOUS = 3;
1108  }
1109
1110  // Output only. The name of the backup resource with the format:
1111  //  * projects/{project}/locations/{region}/backups/{backup_id}
1112  // where the cluster and backup ID segments should satisfy the regex
1113  // expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of
1114  // lowercase letters, numbers, and dashes, starting with a letter, and ending
1115  // with a letter or number. For more details see https://google.aip.dev/122.
1116  // The prefix of the backup resource name is the name of the parent
1117  // resource:
1118  //  * projects/{project}/locations/{region}
1119  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1120
1121  // User-settable and human-readable display name for the Backup.
1122  string display_name = 2;
1123
1124  // Output only. The system-generated UID of the resource. The UID is assigned
1125  // when the resource is created, and it is retained until it is deleted.
1126  string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
1127
1128  // Output only. Create time stamp
1129  google.protobuf.Timestamp create_time = 4
1130      [(google.api.field_behavior) = OUTPUT_ONLY];
1131
1132  // Output only. Update time stamp
1133  google.protobuf.Timestamp update_time = 5
1134      [(google.api.field_behavior) = OUTPUT_ONLY];
1135
1136  // Output only. Delete time stamp
1137  google.protobuf.Timestamp delete_time = 15
1138      [(google.api.field_behavior) = OUTPUT_ONLY];
1139
1140  // Labels as key value pairs
1141  map<string, string> labels = 6;
1142
1143  // Output only. The current state of the backup.
1144  State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
1145
1146  // The backup type, which suggests the trigger for the backup.
1147  Type type = 8;
1148
1149  // User-provided description of the backup.
1150  string description = 9;
1151
1152  // Output only. The system-generated UID of the cluster which was used to
1153  // create this resource.
1154  string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
1155
1156  // Required. The full resource name of the backup source cluster
1157  // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
1158  string cluster_name = 10 [
1159    (google.api.field_behavior) = REQUIRED,
1160    (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" }
1161  ];
1162
1163  // Output only. Reconciling (https://google.aip.dev/128#reconciliation), if
1164  // true, indicates that the service is actively updating the resource. This
1165  // can happen due to user-triggered updates or system actions like failover or
1166  // maintenance.
1167  bool reconciling = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
1168
1169  // Optional. The encryption config can be specified to encrypt the
1170  // backup with a customer-managed encryption key (CMEK). When this field is
1171  // not specified, the backup will then use default encryption scheme to
1172  // protect the user data.
1173  EncryptionConfig encryption_config = 12
1174      [(google.api.field_behavior) = OPTIONAL];
1175
1176  // Output only. The encryption information for the backup.
1177  EncryptionInfo encryption_info = 13
1178      [(google.api.field_behavior) = OUTPUT_ONLY];
1179
1180  // For Resource freshness validation (https://google.aip.dev/154)
1181  string etag = 14;
1182
1183  // Annotations to allow client tools to store small amount of arbitrary data.
1184  // This is distinct from labels.
1185  // https://google.aip.dev/128
1186  map<string, string> annotations = 16;
1187
1188  // Output only. The size of the backup in bytes.
1189  int64 size_bytes = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
1190
1191  // Output only. The time at which after the backup is eligible to be garbage
1192  // collected. It is the duration specified by the backup's retention policy,
1193  // added to the backup's create_time.
1194  google.protobuf.Timestamp expiry_time = 19
1195      [(google.api.field_behavior) = OUTPUT_ONLY];
1196
1197  // Output only. The QuantityBasedExpiry of the backup, specified by the
1198  // backup's retention policy. Once the expiry quantity is over retention, the
1199  // backup is eligible to be garbage collected.
1200  QuantityBasedExpiry expiry_quantity = 20
1201      [(google.api.field_behavior) = OUTPUT_ONLY];
1202
1203  // Output only. Reserved for future use.
1204  bool satisfies_pzi = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
1205
1206  // Output only. Reserved for future use.
1207  bool satisfies_pzs = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
1208
1209  // Output only. The database engine major version of the cluster this backup
1210  // was created from. Any restored cluster created from this backup will have
1211  // the same database version.
1212  DatabaseVersion database_version = 22
1213      [(google.api.field_behavior) = OUTPUT_ONLY];
1214}
1215
1216// SupportedDatabaseFlag gives general information about a database flag,
1217// like type and allowed values. This is a static value that is defined
1218// on the server side, and it cannot be modified by callers.
1219// To set the Database flags on a particular Instance, a caller should modify
1220// the Instance.database_flags field.
1221message SupportedDatabaseFlag {
1222  option (google.api.resource) = {
1223    type: "alloydb.googleapis.com/SupportedDatabaseFlag"
1224    pattern: "projects/{project}/locations/{location}/flags/{flag}"
1225  };
1226
1227  // Restrictions on STRING type values
1228  message StringRestrictions {
1229    // The list of allowed values, if bounded. This field will be empty
1230    // if there is a unbounded number of allowed values.
1231    repeated string allowed_values = 1;
1232  }
1233
1234  // Restrictions on INTEGER type values.
1235  message IntegerRestrictions {
1236    // The minimum value that can be specified, if applicable.
1237    google.protobuf.Int64Value min_value = 1;
1238
1239    // The maximum value that can be specified, if applicable.
1240    google.protobuf.Int64Value max_value = 2;
1241  }
1242
1243  // ValueType describes the semantic type of the value that the flag accepts.
1244  // Regardless of the ValueType, the Instance.database_flags field accepts the
1245  // stringified version of the value, i.e. "20" or "3.14".
1246  enum ValueType {
1247    // This is an unknown flag type.
1248    VALUE_TYPE_UNSPECIFIED = 0;
1249
1250    // String type flag.
1251    STRING = 1;
1252
1253    // Integer type flag.
1254    INTEGER = 2;
1255
1256    // Float type flag.
1257    FLOAT = 3;
1258
1259    // Denotes that the flag does not accept any values.
1260    NONE = 4;
1261  }
1262
1263  // The restrictions on the flag value per type.
1264  oneof restrictions {
1265    // Restriction on STRING type value.
1266    StringRestrictions string_restrictions = 7;
1267
1268    // Restriction on INTEGER type value.
1269    IntegerRestrictions integer_restrictions = 8;
1270  }
1271
1272  // The name of the flag resource, following Google Cloud conventions, e.g.:
1273  //  * projects/{project}/locations/{location}/flags/{flag}
1274  // This field currently has no semantic meaning.
1275  string name = 1;
1276
1277  // The name of the database flag, e.g. "max_allowed_packets".
1278  // The is a possibly key for the Instance.database_flags map field.
1279  string flag_name = 2;
1280
1281  ValueType value_type = 3;
1282
1283  // Whether the database flag accepts multiple values. If true,
1284  // a comma-separated list of stringified values may be specified.
1285  bool accepts_multiple_values = 4;
1286
1287  // Major database engine versions for which this flag is supported.
1288  repeated DatabaseVersion supported_db_versions = 5;
1289
1290  // Whether setting or updating this flag on an Instance requires a database
1291  // restart. If a flag that requires database restart is set, the backend
1292  // will automatically restart the database (making sure to satisfy any
1293  // availability SLO's).
1294  bool requires_db_restart = 6;
1295}
1296
1297// Message describing User object.
1298message User {
1299  option (google.api.resource) = {
1300    type: "alloydb.googleapis.com/User"
1301    pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}"
1302    style: DECLARATIVE_FRIENDLY
1303  };
1304
1305  // Enum that details the user type.
1306  enum UserType {
1307    // Unspecified user type.
1308    USER_TYPE_UNSPECIFIED = 0;
1309
1310    // The default user type that authenticates via password-based
1311    // authentication.
1312    ALLOYDB_BUILT_IN = 1;
1313
1314    // Database user that can authenticate via IAM-Based authentication.
1315    ALLOYDB_IAM_USER = 2;
1316  }
1317
1318  // Output only. Name of the resource in the form of
1319  // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
1320  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1321
1322  // Input only. Password for the user.
1323  string password = 2 [(google.api.field_behavior) = INPUT_ONLY];
1324
1325  // Optional. List of database roles this user has.
1326  // The database role strings are subject to the PostgreSQL naming conventions.
1327  repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL];
1328
1329  // Optional. Type of this user.
1330  UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL];
1331}
1332
1333// Message describing Database object.
1334message Database {
1335  option (google.api.resource) = {
1336    type: "alloydb.googleapis.com/Database"
1337    pattern: "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}"
1338    plural: "databases"
1339    singular: "database"
1340    style: DECLARATIVE_FRIENDLY
1341  };
1342
1343  // Identifier. Name of the resource in the form of
1344  // projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}.
1345  string name = 1 [(google.api.field_behavior) = IDENTIFIER];
1346
1347  // Optional. Charset for the database.
1348  // This field can contain any PostgreSQL supported charset name.
1349  // Example values include "UTF8", "SQL_ASCII", etc.
1350  string charset = 2 [(google.api.field_behavior) = OPTIONAL];
1351
1352  // Optional. Collation for the database.
1353  // Name of the custom or native collation for postgres.
1354  // Example values include "C", "POSIX", etc
1355  string collation = 3 [(google.api.field_behavior) = OPTIONAL];
1356}
1357