Skip to content

Commit aa16fda

Browse files
Google APIscopybara-github
authored andcommitted
feat: support for obtaining the public IP address of an Instance
feat: support for getting PSC DNS name from the GetConnectionInfo API feat: add PSC cluster and instance configuration settings to enable/disable PSC and obtain the PSC endpoint name feat: add new API to list the databases in a project and location docs: clarified read pool config is for read pool type instances PiperOrigin-RevId: 610475013
1 parent 0733fdb commit aa16fda

5 files changed

Lines changed: 190 additions & 21 deletions

File tree

google/cloud/alloydb/v1beta/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ proto_library(
2828
"//google/api:annotations_proto",
2929
"//google/api:client_proto",
3030
"//google/api:field_behavior_proto",
31+
"//google/api:field_info_proto",
3132
"//google/api:resource_proto",
3233
"//google/longrunning:operations_proto",
3334
"//google/rpc:status_proto",

google/cloud/alloydb/v1beta/alloydb_v1beta.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,6 @@ documentation:
5656
permission-aware UIs and command-line tools, not for authorization
5757
checking. This operation may "fail open" without warning.
5858
59-
backend:
60-
rules:
61-
- selector: 'google.cloud.alloydb.v1beta.AlloyDBAdmin.*'
62-
deadline: 60.0
63-
- selector: google.cloud.location.Locations.GetLocation
64-
deadline: 60.0
65-
- selector: google.cloud.location.Locations.ListLocations
66-
deadline: 60.0
67-
- selector: 'google.iam.v1.IAMPolicy.*'
68-
deadline: 60.0
69-
- selector: 'google.longrunning.Operations.*'
70-
deadline: 60.0
71-
7259
http:
7360
rules:
7461
- selector: google.cloud.location.Locations.GetLocation

google/cloud/alloydb/v1beta/alloydb_v1beta_grpc_service_config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
{ "service": "google.cloud.alloydb.v1beta.AlloyDBAdmin", "method": "GenerateClientCertificate" },
1212
{ "service": "google.cloud.alloydb.v1beta.AlloyDBAdmin", "method": "GetConnectionInfo" },
1313
{ "service": "google.cloud.alloydb.v1beta.AlloyDBAdmin", "method": "ListUsers" },
14-
{ "service": "google.cloud.alloydb.v1beta.AlloyDBAdmin", "method": "GetUser" }
14+
{ "service": "google.cloud.alloydb.v1beta.AlloyDBAdmin", "method": "GetUser" },
15+
{ "service": "google.cloud.alloydb.v1beta.AlloyDBAdmin", "method": "ListDatabases" }
1516
],
1617
"timeout": "60s",
1718
"retryPolicy": {

google/cloud/alloydb/v1beta/resources.proto

Lines changed: 139 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ syntax = "proto3";
1717
package google.cloud.alloydb.v1beta;
1818

1919
import "google/api/field_behavior.proto";
20+
import "google/api/field_info.proto";
2021
import "google/api/resource.proto";
2122
import "google/protobuf/duration.proto";
2223
import "google/protobuf/timestamp.proto";
@@ -386,14 +387,14 @@ message Cluster {
386387

387388
// Metadata related to network configuration.
388389
message NetworkConfig {
389-
// Required. The resource link for the VPC network in which cluster
390+
// Optional. The resource link for the VPC network in which cluster
390391
// resources are created and from which they are accessible via Private IP.
391392
// The network must belong to the same project as the cluster. It is
392393
// specified in the form:
393394
// "projects/{project_number}/global/networks/{network_id}". This is
394395
// required to create a cluster.
395396
string network = 1 [
396-
(google.api.field_behavior) = REQUIRED,
397+
(google.api.field_behavior) = OPTIONAL,
397398
(google.api.resource_reference) = {
398399
type: "compute.googleapis.com/Network"
399400
}
@@ -404,8 +405,8 @@ message Cluster {
404405
// instance IPs for this cluster will be created in the allocated range. The
405406
// range name must comply with RFC 1035. Specifically, the name must be 1-63
406407
// characters long and match the regular expression
407-
// [a-z]([-a-z0-9]*[a-z0-9])?.
408-
// Field name is intended to be consistent with CloudSQL.
408+
// `[a-z]([-a-z0-9]*[a-z0-9])?`.
409+
// Field name is intended to be consistent with Cloud SQL.
409410
string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL];
410411
}
411412

@@ -606,6 +607,9 @@ message Cluster {
606607

607608
// Output only. Cross Region replication config specific to PRIMARY cluster.
608609
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];
609613
}
610614

611615
// An Instance is a computing unit that an end customer can connect to.
@@ -698,6 +702,79 @@ message Instance {
698702
SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL];
699703
}
700704

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+
701778
// Instance State
702779
enum State {
703780
// The state of the instance is unknown.
@@ -857,13 +934,19 @@ message Instance {
857934
// Configuration for query insights.
858935
QueryInsightsInstanceConfig query_insights_config = 21;
859936

860-
// Read pool specific config.
937+
// Read pool instance configuration.
938+
// This is required if the value of instanceType is READ_POOL.
861939
ReadPoolConfig read_pool_config = 14;
862940

863941
// Output only. The IP address for the Instance.
864942
// This is the connection endpoint for an end-user application.
865943
string ip_address = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
866944

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+
867950
// Output only. Reconciling (https://google.aip.dev/128#reconciliation).
868951
// Set to true if the current state of Instance does not match the user's
869952
// intended state, and the service is actively updating the resource to
@@ -888,6 +971,18 @@ message Instance {
888971
// Optional. Client connection specific configurations
889972
ClientConnectionConfig client_connection_config = 23
890973
[(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];
891986
}
892987

893988
// ConnectionInfo singleton resource.
@@ -908,13 +1003,24 @@ message ConnectionInfo {
9081003
// is set). This is the connection endpoint for an end-user application.
9091004
string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
9101005

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+
9111014
// Output only. The pem-encoded chain that may be used to verify the X.509
9121015
// certificate. Expected to be in issuer-to-root order according to RFC 5246.
9131016
repeated string pem_certificate_chain = 3
9141017
[deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY];
9151018

9161019
// Output only. The unique ID of the Instance.
9171020
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];
9181024
}
9191025

9201026
// Message describing Backup object
@@ -1077,6 +1183,9 @@ message Backup {
10771183
QuantityBasedExpiry expiry_quantity = 20
10781184
[(google.api.field_behavior) = OUTPUT_ONLY];
10791185

1186+
// Output only. Reserved for future use.
1187+
bool satisfies_pzs = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
1188+
10801189
// Output only. The database engine major version of the cluster this backup
10811190
// was created from. Any restored cluster created from this backup will have
10821191
// the same database version.
@@ -1200,3 +1309,28 @@ message User {
12001309
// Optional. Type of this user.
12011310
UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL];
12021311
}
1312+
1313+
// Message describing Database object.
1314+
message 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+
}

google/cloud/alloydb/v1beta/service.proto

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,14 @@ service AlloyDBAdmin {
410410
};
411411
option (google.api.method_signature) = "name";
412412
}
413+
414+
// Lists Databases in a given project and location.
415+
rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) {
416+
option (google.api.http) = {
417+
get: "/v1beta/{parent=projects/*/locations/*/clusters/*}/databases"
418+
};
419+
option (google.api.method_signature) = "parent";
420+
}
413421
}
414422

415423
// Message for requesting list of Clusters
@@ -1348,7 +1356,8 @@ message GenerateClientCertificateRequest {
13481356
// not supported (00000000-0000-0000-0000-000000000000).
13491357
string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
13501358

1351-
// Optional. A pem-encoded X.509 certificate signing request (CSR).
1359+
// Optional. A pem-encoded X.509 certificate signing request (CSR). It is
1360+
// recommended to use public_key instead.
13521361
string pem_csr = 3
13531362
[deprecated = true, (google.api.field_behavior) = OPTIONAL];
13541363

@@ -1372,7 +1381,8 @@ message GenerateClientCertificateRequest {
13721381
// Message returned by a GenerateClientCertificate operation.
13731382
message GenerateClientCertificateResponse {
13741383
// Output only. The pem-encoded, signed X.509 certificate.
1375-
string pem_certificate = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1384+
string pem_certificate = 1
1385+
[deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY];
13761386

13771387
// Output only. The pem-encoded chain that may be used to verify the X.509
13781388
// certificate. Expected to be in issuer-to-root order according to RFC 5246.
@@ -1593,3 +1603,39 @@ message DeleteUserRequest {
15931603
// execute it.
15941604
bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL];
15951605
}
1606+
1607+
// Message for requesting list of Databases.
1608+
message ListDatabasesRequest {
1609+
// Required. Parent value for ListDatabasesRequest.
1610+
string parent = 1 [
1611+
(google.api.field_behavior) = REQUIRED,
1612+
(google.api.resource_reference) = {
1613+
child_type: "alloydb.googleapis.com/Database"
1614+
}
1615+
];
1616+
1617+
// Optional. The maximum number of databases to return. The service may return
1618+
// fewer than this value. If unspecified, an appropriate number of databases
1619+
// will be returned. The max value will be 2000, values above max will be
1620+
// coerced to max.
1621+
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1622+
1623+
// Optional. A page token, received from a previous `ListDatabases` call.
1624+
// This should be provided to retrieve the subsequent page.
1625+
// This field is currently not supported, its value will be ignored if passed.
1626+
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1627+
1628+
// Optional. Filtering results.
1629+
// This field is currently not supported, its value will be ignored if passed.
1630+
string filter = 4 [(google.api.field_behavior) = OPTIONAL];
1631+
}
1632+
1633+
// Message for response to listing Databases.
1634+
message ListDatabasesResponse {
1635+
// The list of databases
1636+
repeated Database databases = 1;
1637+
1638+
// A token identifying the next page of results the server should return.
1639+
// If this field is omitted, there are no subsequent pages.
1640+
string next_page_token = 2;
1641+
}

0 commit comments

Comments
 (0)