Skip to content

Commit b607ece

Browse files
Google APIscopybara-github
authored andcommitted
feat: Adding Method QueryDatabaseResourceGroups of Database Center API v1beta
This release includes: - `DatabaseCenter` service with `QueryDatabaseResourceGroups` method. - `All related enums. PiperOrigin-RevId: 850334121
1 parent 94ccedc commit b607ece

File tree

10 files changed

+1484
-13
lines changed

10 files changed

+1484
-13
lines changed

google/cloud/databasecenter/v1beta/BUILD.bazel

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,25 @@ load("@rules_proto//proto:defs.bzl", "proto_library")
2424
proto_library(
2525
name = "databasecenter_proto",
2626
srcs = [
27+
"machine_config.proto",
28+
"maintenance.proto",
29+
"metric_data.proto",
30+
"operation_error_type.proto",
2731
"product.proto",
2832
"service.proto",
33+
"signals.proto",
34+
"suspension_reason.proto",
2935
],
3036
deps = [
3137
"//google/api:annotations_proto",
3238
"//google/api:client_proto",
3339
"//google/api:field_behavior_proto",
34-
"//google/api:resource_proto",
40+
"//google/type:date_proto",
41+
"//google/type:dayofweek_proto",
42+
"//google/type:timeofday_proto",
43+
"@com_google_protobuf//:duration_proto",
44+
"@com_google_protobuf//:timestamp_proto",
45+
"@com_google_protobuf//:wrappers_proto",
3546
],
3647
)
3748

@@ -96,14 +107,14 @@ java_gapic_test(
96107
# Open Source Packages
97108
java_gapic_assembly_gradle_pkg(
98109
name = "google-cloud-databasecenter-v1beta-java",
110+
include_samples = True,
99111
transport = "grpc+rest",
100112
deps = [
101113
":databasecenter_java_gapic",
102114
":databasecenter_java_grpc",
103115
":databasecenter_java_proto",
104116
":databasecenter_proto",
105117
],
106-
include_samples = True,
107118
)
108119

109120
##############################################################################
@@ -123,6 +134,9 @@ go_grpc_library(
123134
protos = [":databasecenter_proto"],
124135
deps = [
125136
"//google/api:annotations_go_proto",
137+
"//google/type:date_go_proto",
138+
"//google/type:dayofweek_go_proto",
139+
"//google/type:timeofday_go_proto",
126140
],
127141
)
128142

@@ -138,6 +152,7 @@ go_gapic_library(
138152
transport = "grpc+rest",
139153
deps = [
140154
":databasecenter_go_proto",
155+
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
141156
],
142157
)
143158

@@ -146,9 +161,9 @@ go_gapic_assembly_pkg(
146161
name = "gapi-cloud-databasecenter-v1beta-go",
147162
deps = [
148163
":databasecenter_go_gapic",
149-
":databasecenter_go_gapic_srcjar-test.srcjar",
150164
":databasecenter_go_gapic_srcjar-metadata.srcjar",
151165
":databasecenter_go_gapic_srcjar-snippets.srcjar",
166+
":databasecenter_go_gapic_srcjar-test.srcjar",
152167
":databasecenter_go_proto",
153168
],
154169
)
@@ -213,8 +228,8 @@ php_gapic_library(
213228
name = "databasecenter_php_gapic",
214229
srcs = [":databasecenter_proto_with_info"],
215230
grpc_service_config = "databasecenter_v1beta_grpc_service_config.json",
216-
rest_numeric_enums = True,
217231
migration_mode = "NEW_SURFACE_ONLY",
232+
rest_numeric_enums = True,
218233
service_yaml = "databasecenter_v1beta.yaml",
219234
transport = "grpc+rest",
220235
deps = [
@@ -268,8 +283,8 @@ nodejs_gapic_assembly_pkg(
268283
# buildifier: disable=same-origin-load
269284
load(
270285
"@com_google_googleapis_imports//:imports.bzl",
271-
"ruby_gapic_assembly_pkg",
272286
"ruby_cloud_gapic_library",
287+
"ruby_gapic_assembly_pkg",
273288
"ruby_grpc_library",
274289
"ruby_proto_library",
275290
)
@@ -288,9 +303,7 @@ ruby_grpc_library(
288303
ruby_cloud_gapic_library(
289304
name = "databasecenter_ruby_gapic",
290305
srcs = [":databasecenter_proto_with_info"],
291-
extra_protoc_parameters = [
292-
"ruby-cloud-gem-name=google-cloud-database_center-v1beta",
293-
],
306+
extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-database_center-v1beta"],
294307
grpc_service_config = "databasecenter_v1beta_grpc_service_config.json",
295308
rest_numeric_enums = True,
296309
service_yaml = "databasecenter_v1beta.yaml",
@@ -325,7 +338,6 @@ load(
325338

326339
csharp_proto_library(
327340
name = "databasecenter_csharp_proto",
328-
extra_opts = [],
329341
deps = [":databasecenter_proto"],
330342
)
331343

google/cloud/databasecenter/v1beta/databasecenter_v1beta.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ documentation:
2323
2424
authentication:
2525
rules:
26+
- selector: google.cloud.databasecenter.v1beta.DatabaseCenter.QueryDatabaseResourceGroups
27+
oauth:
28+
canonical_scopes: |-
29+
https://www.googleapis.com/auth/cloud-platform
2630
- selector: google.cloud.databasecenter.v1beta.DatabaseCenter.QueryProducts
2731
oauth:
2832
canonical_scopes: |-

google/cloud/databasecenter/v1beta/databasecenter_v1beta_grpc_service_config.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
22
"methodConfig": [{
33
"name": [
4-
{ "service": "google.cloud.databasecenter.v1beta.DatabaseCenterService", "method": "QueryProducts" }
4+
{ "service": "google.cloud.databasecenter.v1beta.DatabaseCenterService",
5+
"method": "QueryProducts"
6+
},
7+
{ "service": "google.cloud.databasecenter.v1beta.DatabaseCenterService",
8+
"method": "QueryDatabaseResourceGroups"
9+
}
510
],
611
"timeout": "60s",
712
"retryPolicy": {
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright 2025 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+
15+
syntax = "proto3";
16+
17+
package google.cloud.databasecenter.v1beta;
18+
19+
import "google/api/field_behavior.proto";
20+
21+
option csharp_namespace = "Google.Cloud.DatabaseCenter.V1Beta";
22+
option go_package = "cloud.google.com/go/databasecenter/apiv1beta/databasecenterpb;databasecenterpb";
23+
option java_multiple_files = true;
24+
option java_outer_classname = "MachineConfigProto";
25+
option java_package = "com.google.cloud.databasecenter.v1beta";
26+
option php_namespace = "Google\\Cloud\\DatabaseCenter\\V1beta";
27+
option ruby_package = "Google::Cloud::DatabaseCenter::V1beta";
28+
29+
// MachineConfig describes the configuration of a machine specific to a Database
30+
// Resource.
31+
// NextID: 5
32+
message MachineConfig {
33+
// Memory size in bytes.
34+
int64 memory_size_bytes = 2;
35+
36+
// Optional. The number of Shards (if applicable).
37+
optional int32 shard_count = 3 [(google.api.field_behavior) = OPTIONAL];
38+
39+
// Optional. The number of vCPUs (if applicable).
40+
optional double vcpu_count = 4 [(google.api.field_behavior) = OPTIONAL];
41+
}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// Copyright 2025 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+
15+
syntax = "proto3";
16+
17+
package google.cloud.databasecenter.v1beta;
18+
19+
import "google/api/field_behavior.proto";
20+
import "google/type/date.proto";
21+
import "google/type/dayofweek.proto";
22+
import "google/type/timeofday.proto";
23+
24+
option csharp_namespace = "Google.Cloud.DatabaseCenter.V1Beta";
25+
option go_package = "cloud.google.com/go/databasecenter/apiv1beta/databasecenterpb;databasecenterpb";
26+
option java_multiple_files = true;
27+
option java_outer_classname = "MaintenanceProto";
28+
option java_package = "com.google.cloud.databasecenter.v1beta";
29+
option php_namespace = "Google\\Cloud\\DatabaseCenter\\V1beta";
30+
option ruby_package = "Google::Cloud::DatabaseCenter::V1beta";
31+
32+
// Phase/Week of the maintenance window. This is to capture order of
33+
// maintenance. For example, for Cloud SQL resources -
34+
// https://cloud.google.com/sql/docs/mysql/maintenance.
35+
// This enum can be extended to support DB Center specific phases for
36+
// recommendation plan generation.
37+
enum Phase {
38+
// Phase is unspecified.
39+
PHASE_UNSPECIFIED = 0;
40+
41+
// Week 1.
42+
PHASE_WEEK1 = 1;
43+
44+
// Week 2.
45+
PHASE_WEEK2 = 2;
46+
47+
// Week 5.
48+
PHASE_WEEK5 = 3;
49+
50+
// Any phase.
51+
PHASE_ANY = 4;
52+
}
53+
54+
// Maintenance window for the database resource. It specifies preferred time
55+
// and day of the week and phase in some cases, when the maintenance can start.
56+
message ResourceMaintenanceSchedule {
57+
// Optional. Preferred time to start the maintenance operation on the
58+
// specified day.
59+
google.type.TimeOfDay start_time = 1 [(google.api.field_behavior) = OPTIONAL];
60+
61+
// Optional. Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY,
62+
// etc.
63+
google.type.DayOfWeek day = 2 [(google.api.field_behavior) = OPTIONAL];
64+
65+
// Optional. Phase of the maintenance window. This is to capture order of
66+
// maintenance. For example, for Cloud SQL resources, this can be used to
67+
// capture if the maintenance window is in Week1, Week2, Week5, etc. Non
68+
// production resources are usually part of early phase.
69+
// For more details, refer to Cloud SQL resources -
70+
// https://cloud.google.com/sql/docs/mysql/maintenance
71+
Phase phase = 3 [(google.api.field_behavior) = OPTIONAL];
72+
}
73+
74+
// Deny maintenance period for the database resource. It specifies the time
75+
// range during which the maintenance cannot start. This is configured by the
76+
// customer.
77+
message ResourceMaintenanceDenySchedule {
78+
// Optional. The start date of the deny maintenance period.
79+
google.type.Date start_date = 1 [(google.api.field_behavior) = OPTIONAL];
80+
81+
// Optional. Deny period end date.
82+
google.type.Date end_date = 2 [(google.api.field_behavior) = OPTIONAL];
83+
84+
// Optional. Time in UTC when the deny period starts on start_date and ends on
85+
// end_date.
86+
google.type.TimeOfDay time = 3 [(google.api.field_behavior) = OPTIONAL];
87+
}
88+
89+
// MaintenanceInfo to capture the maintenance details of database resource.
90+
message MaintenanceInfo {
91+
// Optional. Maintenance window for the database resource.
92+
ResourceMaintenanceSchedule maintenance_schedule = 1
93+
[(google.api.field_behavior) = OPTIONAL];
94+
95+
// Optional. List of Deny maintenance period for the database resource.
96+
repeated ResourceMaintenanceDenySchedule deny_maintenance_schedules = 2
97+
[(google.api.field_behavior) = OPTIONAL];
98+
99+
// Optional. Current Maintenance version of the database resource. Example:
100+
// "MYSQL_8_0_41.R20250531.01_15"
101+
string maintenance_version = 3 [(google.api.field_behavior) = OPTIONAL];
102+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// Copyright 2025 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+
15+
syntax = "proto3";
16+
17+
package google.cloud.databasecenter.v1beta;
18+
19+
import "google/protobuf/timestamp.proto";
20+
21+
option csharp_namespace = "Google.Cloud.DatabaseCenter.V1Beta";
22+
option go_package = "cloud.google.com/go/databasecenter/apiv1beta/databasecenterpb;databasecenterpb";
23+
option java_multiple_files = true;
24+
option java_outer_classname = "MetricDataProto";
25+
option java_package = "com.google.cloud.databasecenter.v1beta";
26+
option php_namespace = "Google\\Cloud\\DatabaseCenter\\V1beta";
27+
option ruby_package = "Google::Cloud::DatabaseCenter::V1beta";
28+
29+
// Metrics represents the metrics for a database resource.
30+
message Metrics {
31+
// P99 CPU utilization observed for the resource. The value is a
32+
// fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).
33+
optional MetricData p99_cpu_utilization = 1;
34+
35+
// P95 CPU utilization observed for the resource. The value is a
36+
// fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).
37+
optional MetricData p95_cpu_utilization = 2;
38+
39+
// Current storage used by the resource in bytes.
40+
optional MetricData current_storage_used_bytes = 3;
41+
42+
// Peak storage utilization observed for the resource. The value is a
43+
// fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).
44+
optional MetricData peak_storage_utilization = 4;
45+
46+
// Peak memory utilization observed for the resource. The value is a
47+
// fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).
48+
optional MetricData peak_memory_utilization = 5;
49+
50+
// Peak number of connections observed for the resource. The value is a
51+
// positive integer.
52+
optional MetricData peak_number_connections = 6;
53+
54+
// Number of nodes in instance for spanner or bigtable.
55+
optional MetricData node_count = 7;
56+
57+
// Number of processing units in spanner.
58+
optional MetricData processing_unit_count = 8;
59+
60+
// Current memory used by the resource in bytes.
61+
optional MetricData current_memory_used_bytes = 9;
62+
}
63+
64+
// MetricData represents the metric data for a database resource.
65+
message MetricData {
66+
// The value associated with the metric.
67+
TypedValue value = 1;
68+
69+
// The time the metric was observed in the metric source service.
70+
google.protobuf.Timestamp observation_time = 2;
71+
}
72+
73+
// TypedValue represents the value of the metric based on data type.
74+
message TypedValue {
75+
// The data type of metric value would be chosen based on the metric type.
76+
oneof value {
77+
// The value of the metric as double.
78+
double double_value = 1;
79+
80+
// The value of the metric as int.
81+
int64 int64_value = 2;
82+
}
83+
}

0 commit comments

Comments
 (0)