Skip to content

Commit 9eea40c

Browse files
Google APIscopybara-github
authored andcommitted
feat: Adding Method QueryIssues of Database Center API v1beta
docs: A comment for field `maintenance_version` in message `.google.cloud.databasecenter.v1beta.MaintenanceInfo` is changed docs: A comment for field `filter` in message `.google.cloud.databasecenter.v1beta.QueryDatabaseResourceGroupsRequest` is changed docs: A comment for field `order_by` in message `.google.cloud.databasecenter.v1beta.QueryDatabaseResourceGroupsRequest` is changed docs: A comment for field `filter` in message `.google.cloud.databasecenter.v1beta.AggregateIssueStatsRequest` is changed docs: A comment for field `filter` in message `.google.cloud.databasecenter.v1beta.AggregateFleetRequest` is changed docs: A comment for field `order_by` in message `.google.cloud.databasecenter.v1beta.AggregateFleetRequest` is changed docs: A comment for message `AggregateFleetResponse` is changed PiperOrigin-RevId: 868397264
1 parent 56bc1b4 commit 9eea40c

File tree

4 files changed

+125
-24
lines changed

4 files changed

+125
-24
lines changed

google/cloud/databasecenter/v1beta/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ load(
338338

339339
csharp_proto_library(
340340
name = "databasecenter_csharp_proto",
341+
extra_opts = [],
341342
deps = [":databasecenter_proto"],
342343
)
343344

google/cloud/databasecenter/v1beta/databasecenter_v1beta_grpc_service_config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
},
1313
{ "service": "google.cloud.databasecenter.v1beta.DatabaseCenterService",
1414
"method": "AggregateIssueStats"
15+
},
16+
{ "service": "google.cloud.databasecenter.v1beta.DatabaseCenterService",
17+
"method": "QueryIssues"
1518
}
1619
],
1720
"timeout": "60s",

google/cloud/databasecenter/v1beta/maintenance.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ message MaintenanceInfo {
9696
repeated ResourceMaintenanceDenySchedule deny_maintenance_schedules = 2
9797
[(google.api.field_behavior) = OPTIONAL];
9898

99-
// Optional. Current Maintenance version of the database resource. Example:
99+
// Output only. Current Maintenance version of the database resource. Example:
100100
// "MYSQL_8_0_41.R20250531.01_15"
101-
string maintenance_version = 3 [(google.api.field_behavior) = OPTIONAL];
101+
string maintenance_version = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
102102
}

google/cloud/databasecenter/v1beta/service.proto

Lines changed: 119 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ service DatabaseCenter {
7373
body: "*"
7474
};
7575
}
76+
77+
// QueryIssues provides a list of issues and recommendations
78+
// that a user has access to and that are within the requested scope.
79+
rpc QueryIssues(QueryIssuesRequest) returns (QueryIssuesResponse) {
80+
option (google.api.http) = {
81+
post: "/v1beta:queryIssues"
82+
body: "*"
83+
};
84+
option (google.api.method_signature) = "parent";
85+
}
7686
}
7787

7888
// The enum value corresponds to 'type' suffix in the resource_type field.
@@ -224,12 +234,12 @@ message QueryDatabaseResourceGroupsRequest {
224234
// expression, parentheses must be appropriately used to group the
225235
// combinations.
226236
//
227-
// Example: location="us-east1"
228-
// Example: container="projects/123" OR container="projects/456"
229-
// Example: (container="projects/123" OR
230-
// container="projects/456") AND location="us-east1"
231-
// Example: full_resource_name=~"test"
232-
// Example: full_resource_name=~"test.*master"
237+
// Example: `location="us-east1"`
238+
// Example: `container="projects/123" OR container="projects/456"`
239+
// Example: `(container="projects/123" OR
240+
// container="projects/456") AND location="us-east1"`
241+
// Example: `full_resource_name=~"test"`
242+
// Example: `full_resource_name=~"test.*master"`
233243
string filter = 2 [(google.api.field_behavior) = OPTIONAL];
234244

235245
// Optional. Groups of signal types that are requested.
@@ -275,12 +285,13 @@ message QueryDatabaseResourceGroupsRequest {
275285
// order. It only supports a single field at a time.
276286
//
277287
// For example:
278-
// order_by = "full_resource_name" sorts response in ascending order
279-
// order_by = "full_resource_name DESC" sorts response in descending order
280-
// order_by = "issue_count DESC" sorts response in descending order of
288+
// `order_by = "full_resource_name"` sorts response in ascending order
289+
// `order_by = "full_resource_name DESC"` sorts response in descending order
290+
// `order_by = "issue_count DESC"` sorts response in descending order of
281291
// count of all issues associated with a resource.
282292
//
283-
// More explicitly, order_by = "full_resource_name, product" is not supported.
293+
// More explicitly, `order_by = "full_resource_name, product"` is not
294+
// supported.
284295
string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
285296

286297
// Optional. If unspecified, at most 50 resource groups will be returned.
@@ -440,10 +451,10 @@ message AggregateIssueStatsRequest {
440451
// expression, parentheses must be appropriately used to group the
441452
// combinations.
442453
//
443-
// Example: location="us-east1"
444-
// Example: container="projects/123" OR container="projects/456"
445-
// Example: (container="projects/123" OR
446-
// container="projects/456") AND location="us-east1"
454+
// Example: `location="us-east1"`
455+
// Example: `container="projects/123" OR container="projects/456"`
456+
// Example: `(container="projects/123" OR
457+
// container="projects/456") AND location="us-east1"`
447458
string filter = 2 [(google.api.field_behavior) = OPTIONAL];
448459

449460
// Optional. Lists of signal types that are issues.
@@ -562,10 +573,10 @@ message AggregateFleetRequest {
562573
// expression, parentheses must be appropriately used to group the
563574
// combinations.
564575
//
565-
// Example: location="us-east1"
566-
// Example: container="projects/123" OR container="projects/456"
567-
// Example: (container="projects/123" OR
568-
// container="projects/456") AND location="us-east1"
576+
// Example: `location="us-east1"`
577+
// Example: `container="projects/123" OR container="projects/456"`
578+
// Example: `(container="projects/123" OR
579+
// container="projects/456") AND location="us-east1"`
569580
string filter = 2 [(google.api.field_behavior) = OPTIONAL];
570581

571582
// Optional. A field that statistics are grouped by.
@@ -597,9 +608,10 @@ message AggregateFleetRequest {
597608
// descending order. Add "ASC" after the field name to indicate ascending
598609
// order. It supports ordering using multiple fields.
599610
// For example:
600-
// order_by = "resource_groups_count" sorts response in ascending order
601-
// order_by = "resource_groups_count DESC" sorts response in descending order
602-
// order_by = "product.type, product.version DESC, location" orders by type
611+
// `order_by = "resource_groups_count"` sorts response in ascending order
612+
// `order_by = "resource_groups_count DESC"` sorts response in descending
613+
// order
614+
// `order_by = "product.type, product.version DESC, location"` orders by type
603615
// in ascending order, version in descending order and location in ascending
604616
// order
605617
string order_by = 4 [(google.api.field_behavior) = OPTIONAL];
@@ -621,7 +633,8 @@ message AggregateFleetRequest {
621633
[(google.api.field_behavior) = OPTIONAL];
622634
}
623635

624-
// The response message to aggregate a fleet by some group by fields.
636+
// The response message to aggregate a fleet by some group by
637+
// fields.
625638
message AggregateFleetResponse {
626639
// Represents a row grouped by the fields in the input.
627640
repeated AggregateFleetRow rows = 1;
@@ -737,6 +750,90 @@ message BackupDRConfig {
737750
optional bool backupdr_managed = 1;
738751
}
739752

753+
// QueryIssuesRequest is the request to get a list of issues.
754+
message QueryIssuesRequest {
755+
// Required. Parent can be a project, a folder, or an organization. The list
756+
// is limited to the one attached to resources within the `scope` that a user
757+
// has access to.
758+
//
759+
// The allowed values are:
760+
//
761+
// * projects/{PROJECT_ID} (e.g., "projects/foo-bar")
762+
// * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
763+
// * folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
764+
// * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
765+
string parent = 1 [(google.api.field_behavior) = REQUIRED];
766+
767+
// Optional.
768+
// Supported fields are:
769+
// 'product',
770+
// `location`,
771+
// `issue_severity`,
772+
// 'tags',
773+
// 'labels',
774+
string filter = 2 [(google.api.field_behavior) = OPTIONAL];
775+
776+
// Optional. Filters based on signal and product. The filter list will be ORed
777+
// across pairs and ANDed within a signal and products pair.
778+
repeated SignalProductsFilters signal_products_filters = 3
779+
[(google.api.field_behavior) = OPTIONAL];
780+
781+
// Optional. Following fields are sortable:
782+
// SignalType
783+
// Product
784+
// Location
785+
// IssueSeverity
786+
//
787+
// The default order is ascending. Add "DESC" after the field name to indicate
788+
// descending order. Add "ASC" after the field name to indicate ascending
789+
// order. It only supports a single field at a time.
790+
string order_by = 4 [(google.api.field_behavior) = OPTIONAL];
791+
792+
// Optional. If unspecified, at most 50 issues will be returned.
793+
// The maximum value is 1000; values above 1000 will be coerced to 1000.
794+
int32 page_size = 5 [(google.api.field_behavior) = OPTIONAL];
795+
796+
// Optional. A page token, received from a previous `QueryIssues` call.
797+
// Provide this to retrieve the subsequent page.
798+
// All parameters except page size should match the parameters used in the
799+
// call that provided the page token.
800+
string page_token = 6 [(google.api.field_behavior) = OPTIONAL];
801+
}
802+
803+
// SignalProductsFilters represents a signal and list of supported products.
804+
message SignalProductsFilters {
805+
// Optional. The type of signal.
806+
SignalType signal_type = 1 [(google.api.field_behavior) = OPTIONAL];
807+
808+
// Optional. Product type of the resource. The version of the product will be
809+
// ignored in filtering.
810+
repeated Product products = 2 [(google.api.field_behavior) = OPTIONAL];
811+
}
812+
813+
// QueryIssuesResponse is the response containing a list of issues.
814+
message QueryIssuesResponse {
815+
// List of issues and resource details.
816+
repeated DatabaseResourceIssue resource_issues = 1;
817+
818+
// A token that can be sent as `page_token` to retrieve the next page.
819+
// If this field is omitted, there are no subsequent pages.
820+
string next_page_token = 2;
821+
822+
// Unordered list. List of unreachable regions from where data could not be
823+
// retrieved.
824+
repeated string unreachable = 3
825+
[(google.api.field_behavior) = UNORDERED_LIST];
826+
}
827+
828+
// DatabaseResource and Issue associated with it.
829+
message DatabaseResourceIssue {
830+
// Signal associated with the issue.
831+
Signal signal = 1;
832+
833+
// Resource associated with the issue.
834+
DatabaseResource resource = 2;
835+
}
836+
740837
// Tag is a key value pair attached to a resource.
741838
message Tag {
742839
string key = 1;

0 commit comments

Comments
 (0)