Skip to content

Commit 3fcf0b3

Browse files
Google APIscopybara-github
authored andcommitted
feat: Added ClusterView supporting more granular view of continuous backups
feat: Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY feat: Added users API feat: Added fault injection API feat: Added instance update policy feat: Added cluster network config fix: Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA PiperOrigin-RevId: 539728897
1 parent 72da0b1 commit 3fcf0b3

3 files changed

Lines changed: 421 additions & 49 deletions

File tree

google/cloud/alloydb/v1beta/alloydb_v1beta.yaml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,16 @@ authentication:
108108
https://www.googleapis.com/auth/cloud-platform
109109
110110
publishing:
111-
organization: CLOUD
112-
new_issue_uri: 'https://issuetracker.google.com/issues/new?component=1029828'
113-
documentation_uri: 'https://cloud.google.com/alloydb/docs'
114-
api_short_name: 'alloydb'
111+
new_issue_uri: https://issuetracker.google.com/issues/new?component=1194526&template=1689942
112+
documentation_uri: https://cloud.google.com/alloydb/docs
113+
api_short_name: alloydb
115114
github_label: 'api: alloydb'
116-
doc_tag_prefix: 'alloydb'
117-
codeowner_github_teams:
115+
doc_tag_prefix: alloydb
116+
organization: CLOUD
118117
library_settings:
119-
- version: 'google.cloud.alloydb.v1'
118+
- version: google.cloud.alloydb.v1
120119
launch_stage: GA
121-
rest_numeric_enums: false
122120
java_settings:
123-
library_package: ''
124-
service_class_names:
125121
common:
126122
destinations:
127123
- PACKAGE_MANAGER
@@ -153,12 +149,9 @@ publishing:
153149
common:
154150
destinations:
155151
- PACKAGE_MANAGER
156-
- version: 'google.cloud.alloydb.v1beta'
152+
- version: google.cloud.alloydb.v1beta
157153
launch_stage: BETA
158-
rest_numeric_enums: false
159154
java_settings:
160-
library_package: ''
161-
service_class_names:
162155
common:
163156
destinations:
164157
- PACKAGE_MANAGER
@@ -190,12 +183,9 @@ publishing:
190183
common:
191184
destinations:
192185
- PACKAGE_MANAGER
193-
- version: 'google.cloud.alloydb.v1alpha'
186+
- version: google.cloud.alloydb.v1alpha
194187
launch_stage: ALPHA
195-
rest_numeric_enums: false
196188
java_settings:
197-
library_package: ''
198-
service_class_names:
199189
common:
200190
destinations:
201191
- PACKAGE_MANAGER

google/cloud/alloydb/v1beta/resources.proto

Lines changed: 147 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -40,18 +40,6 @@ option (google.api.resource_definition) = {
4040
pattern: "projects/{project}/global/networks/{network}"
4141
};
4242

43-
// The supported database engine versions.
44-
enum DatabaseVersion {
45-
// This is an unknown database version.
46-
DATABASE_VERSION_UNSPECIFIED = 0;
47-
48-
// DEPRECATED - The database version is Postgres 13.
49-
POSTGRES_13 = 1 [deprecated = true];
50-
51-
// The database version is Postgres 14.
52-
POSTGRES_14 = 2;
53-
}
54-
5543
// View on Instance. Pass this enum to rpcs that returns an Instance message to
5644
// control which subsets of fields to get.
5745
enum InstanceView {
@@ -68,6 +56,35 @@ enum InstanceView {
6856
INSTANCE_VIEW_FULL = 2;
6957
}
7058

59+
// View on Cluster. Pass this enum to rpcs that returns a cluster message to
60+
// control which subsets of fields to get.
61+
enum ClusterView {
62+
// CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
63+
CLUSTER_VIEW_UNSPECIFIED = 0;
64+
65+
// BASIC server responses include all the relevant cluster details, excluding
66+
// Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific
67+
// fields. The default value.
68+
CLUSTER_VIEW_BASIC = 1;
69+
70+
// CONTINUOUS_BACKUP response returns all the fields from BASIC plus
71+
// the earliest restorable time if continuous backups are enabled.
72+
// May increase latency.
73+
CLUSTER_VIEW_CONTINUOUS_BACKUP = 2;
74+
}
75+
76+
// The supported database engine versions.
77+
enum DatabaseVersion {
78+
// This is an unknown database version.
79+
DATABASE_VERSION_UNSPECIFIED = 0;
80+
81+
// DEPRECATED - The database version is Postgres 13.
82+
POSTGRES_13 = 1 [deprecated = true];
83+
84+
// The database version is Postgres 14.
85+
POSTGRES_14 = 2;
86+
}
87+
7188
// The username/password for a database user. Used for specifying initial
7289
// users at cluster creation time.
7390
message UserPassword {
@@ -141,25 +158,31 @@ message EncryptionInfo {
141158
];
142159
}
143160

144-
// SSL configuration for an AlloyDB Cluster.
161+
// SSL configuration.
145162
message SslConfig {
146163
// SSL mode options.
147164
enum SslMode {
148-
// SSL mode not specified. Defaults to SSL_MODE_ALLOW.
165+
// SSL mode not specified. Defaults to ENCRYPTED_ONLY.
149166
SSL_MODE_UNSPECIFIED = 0;
150167

151168
// SSL connections are optional. CA verification not enforced.
152-
SSL_MODE_ALLOW = 1;
169+
SSL_MODE_ALLOW = 1 [deprecated = true];
153170

154171
// SSL connections are required. CA verification not enforced.
155172
// Clients may use locally self-signed certificates (default psql client
156173
// behavior).
157-
SSL_MODE_REQUIRE = 2;
174+
SSL_MODE_REQUIRE = 2 [deprecated = true];
158175

159176
// SSL connections are required. CA verification enforced.
160177
// Clients must have certificates signed by a Cluster CA, e.g. via
161178
// GenerateClientCertificate.
162-
SSL_MODE_VERIFY_CA = 3;
179+
SSL_MODE_VERIFY_CA = 3 [deprecated = true];
180+
181+
// SSL connections are optional. CA verification not enforced.
182+
ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4;
183+
184+
// SSL connections are required. CA verification not enforced.
185+
ENCRYPTED_ONLY = 5;
163186
}
164187

165188
// Certificate Authority (CA) source for SSL/TLS certificates.
@@ -314,6 +337,11 @@ message ContinuousBackupInfo {
314337
// only field. Ignored if passed into the request.
315338
repeated google.type.DayOfWeek schedule = 3
316339
[(google.api.field_behavior) = OUTPUT_ONLY];
340+
341+
// Output only. The earliest restorable time that can be restored to. Output
342+
// only field.
343+
google.protobuf.Timestamp earliest_restorable_time = 4
344+
[(google.api.field_behavior) = OUTPUT_ONLY];
317345
}
318346

319347
// Message describing a BackupSource.
@@ -353,6 +381,32 @@ message Cluster {
353381
style: DECLARATIVE_FRIENDLY
354382
};
355383

384+
// Metadata related to network configuration.
385+
message NetworkConfig {
386+
// Required. The resource link for the VPC network in which cluster
387+
// resources are created and from which they are accessible via Private IP.
388+
// The network must belong to the same project as the cluster. It is
389+
// specified in the form:
390+
// "projects/{project_number}/global/networks/{network_id}". This is
391+
// required to create a cluster. It can be updated, but it cannot be
392+
// removed.
393+
string network = 1 [
394+
(google.api.field_behavior) = REQUIRED,
395+
(google.api.resource_reference) = {
396+
type: "compute.googleapis.com/Network"
397+
}
398+
];
399+
400+
// Optional. The name of the allocated IP range for the private IP AlloyDB
401+
// cluster. For example: "google-managed-services-default". If set, the
402+
// instance IPs for this cluster will be created in the allocated range. The
403+
// range name must comply with RFC 1035. Specifically, the name must be 1-63
404+
// characters long and match the regular expression
405+
// [a-z]([-a-z0-9]*[a-z0-9])?.
406+
// Field name is intended to be consistent with CloudSQL.
407+
string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL];
408+
}
409+
356410
// Configuration information for the secondary cluster. This should be set
357411
// if and only if the cluster is of type SECONDARY.
358412
message SecondaryConfig {
@@ -481,6 +535,8 @@ message Cluster {
481535
DatabaseVersion database_version = 9
482536
[(google.api.field_behavior) = OUTPUT_ONLY];
483537

538+
NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL];
539+
484540
// Required. The resource link for the VPC network in which cluster resources
485541
// are created and from which they are accessible via Private IP. The network
486542
// must belong to the same project as the cluster. It is specified in the
@@ -519,8 +575,8 @@ message Cluster {
519575
// documentation for the message type.
520576
AutomatedBackupPolicy automated_backup_policy = 17;
521577

522-
// SSL configuration for this AlloyDB Cluster.
523-
SslConfig ssl_config = 18;
578+
// SSL configuration for this AlloyDB cluster.
579+
SslConfig ssl_config = 18 [deprecated = true];
524580

525581
// Optional. The encryption config can be specified to encrypt the data disks
526582
// and other persistent data resources of a cluster with a
@@ -610,6 +666,25 @@ message Instance {
610666
int32 node_count = 1;
611667
}
612668

669+
// Policy to be used while updating the instance.
670+
message UpdatePolicy {
671+
// Specifies the available modes of update.
672+
enum Mode {
673+
// Mode is unknown.
674+
MODE_UNSPECIFIED = 0;
675+
676+
// Least disruptive way to apply the update.
677+
DEFAULT = 1;
678+
679+
// Performs a forced update when applicable. This will be fast but may
680+
// incur a downtime.
681+
FORCE_APPLY = 2;
682+
}
683+
684+
// Mode for updating the instance.
685+
Mode mode = 1;
686+
}
687+
613688
// Instance State
614689
enum State {
615690
// The state of the instance is unknown.
@@ -667,10 +742,11 @@ message Instance {
667742
}
668743

669744
// The Availability type of an instance. Potential values:
745+
//
670746
// - ZONAL: The instance serves data from only one zone. Outages in that
671-
// zone affect instance availability.
747+
// zone affect instance availability.
672748
// - REGIONAL: The instance can serve data from more than one zone in a
673-
// region (it is highly available).
749+
// region (it is highly available).
674750
enum AvailabilityType {
675751
// This is an unknown Availability type.
676752
AVAILABILITY_TYPE_UNSPECIFIED = 0;
@@ -726,8 +802,11 @@ message Instance {
726802
MachineConfig machine_config = 10;
727803

728804
// Availability type of an Instance.
729-
// Defaults to REGIONAL for both primary and read instances.
730-
// Note that primary and read instances can have different availability types.
805+
// If empty, defaults to REGIONAL for primary instances.
806+
// For read pools, availability_type is always UNSPECIFIED. Instances in the
807+
// read pools are evenly distributed across available zones within the region
808+
// (i.e. read pools with more than one node will have a node in at
809+
// least two zones).
731810
AvailabilityType availability_type = 11;
732811

733812
// The Compute Engine zone that the instance should serve from, per
@@ -786,6 +865,12 @@ message Instance {
786865
// This is distinct from labels.
787866
// https://google.aip.dev/128
788867
map<string, string> annotations = 18;
868+
869+
// Update policy that will be applied during instance update.
870+
// This field is not persisted when you update the instance.
871+
// To use a non-default update policy, you must
872+
// specify explicitly specify the value in each update request.
873+
UpdatePolicy update_policy = 22;
789874
}
790875

791876
// ConnectionInfo singleton resource.
@@ -808,7 +893,7 @@ message ConnectionInfo {
808893
// Output only. The pem-encoded chain that may be used to verify the X.509
809894
// certificate. Expected to be in issuer-to-root order according to RFC 5246.
810895
repeated string pem_certificate_chain = 3
811-
[(google.api.field_behavior) = OUTPUT_ONLY];
896+
[deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY];
812897

813898
// Output only. The unique ID of the Instance.
814899
string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -905,7 +990,7 @@ message Backup {
905990
string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
906991

907992
// Required. The full resource name of the backup source cluster
908-
// (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
993+
// (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
909994
string cluster_name = 10 [
910995
(google.api.field_behavior) = REQUIRED,
911996
(google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" }
@@ -1026,3 +1111,39 @@ message SupportedDatabaseFlag {
10261111
// availability SLO's).
10271112
bool requires_db_restart = 6;
10281113
}
1114+
1115+
// Message describing User object.
1116+
message User {
1117+
option (google.api.resource) = {
1118+
type: "alloydb.googleapis.com/User"
1119+
pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}"
1120+
style: DECLARATIVE_FRIENDLY
1121+
};
1122+
1123+
// Enum that details the user type.
1124+
enum UserType {
1125+
// Unspecified user type.
1126+
USER_TYPE_UNSPECIFIED = 0;
1127+
1128+
// The default user type that authenticates via password-based
1129+
// authentication.
1130+
ALLOYDB_BUILT_IN = 1;
1131+
1132+
// Database user that can authenticate via IAM-Based authentication.
1133+
ALLOYDB_IAM_USER = 2;
1134+
}
1135+
1136+
// Output only. Name of the resource in the form of
1137+
// projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
1138+
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1139+
1140+
// Input only. Password for the user.
1141+
string password = 2 [(google.api.field_behavior) = INPUT_ONLY];
1142+
1143+
// Optional. List of database roles this user has.
1144+
// The database role strings are subject to the PostgreSQL naming conventions.
1145+
repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL];
1146+
1147+
// Optional. Type of this user.
1148+
UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL];
1149+
}

0 commit comments

Comments
 (0)