|
1 | | -// Copyright 2025 Google LLC |
| 1 | +// Copyright 2026 Google LLC |
2 | 2 | // |
3 | 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | // you may not use this file except in compliance with the License. |
@@ -64,6 +64,15 @@ service DatabaseCenter { |
64 | 64 | body: "*" |
65 | 65 | }; |
66 | 66 | } |
| 67 | + |
| 68 | + // AggregateIssueStats provides database resource issues statistics. |
| 69 | + rpc AggregateIssueStats(AggregateIssueStatsRequest) |
| 70 | + returns (AggregateIssueStatsResponse) { |
| 71 | + option (google.api.http) = { |
| 72 | + post: "/v1beta:aggregateIssueStats" |
| 73 | + body: "*" |
| 74 | + }; |
| 75 | + } |
67 | 76 | } |
68 | 77 |
|
69 | 78 | // The enum value corresponds to 'type' suffix in the resource_type field. |
@@ -405,6 +414,115 @@ message DatabaseResource { |
405 | 414 | [(google.api.field_behavior) = OPTIONAL]; |
406 | 415 | } |
407 | 416 |
|
| 417 | +// AggregateIssueStatsRequest represents the input to the AggregateIssueStats |
| 418 | +// method. |
| 419 | +message AggregateIssueStatsRequest { |
| 420 | + // Required. Parent can be a project, a folder, or an organization. The search |
| 421 | + // is limited to the resources within the `scope`. |
| 422 | + // |
| 423 | + // The allowed values are: |
| 424 | + // |
| 425 | + // * projects/{PROJECT_ID} (e.g., "projects/foo-bar") |
| 426 | + // * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") |
| 427 | + // * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") |
| 428 | + // * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") |
| 429 | + string parent = 1 [(google.api.field_behavior) = REQUIRED]; |
| 430 | + |
| 431 | + // Optional. The expression to filter resources. |
| 432 | + // |
| 433 | + // Supported fields are: `full_resource_name`, `resource_type`, `container`, |
| 434 | + // `product.type`, `product.engine`, `product.version`, `location`, |
| 435 | + // `labels`, `issues`, fields of availability_info, |
| 436 | + // data_protection_info,'resource_name', etc. |
| 437 | + // |
| 438 | + // The expression is a list of zero or more restrictions combined via logical |
| 439 | + // operators `AND` and `OR`. When `AND` and `OR` are both used in the |
| 440 | + // expression, parentheses must be appropriately used to group the |
| 441 | + // combinations. |
| 442 | + // |
| 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" |
| 447 | + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; |
| 448 | + |
| 449 | + // Optional. Lists of signal types that are issues. |
| 450 | + repeated SignalTypeGroup signal_type_groups = 3 |
| 451 | + [(google.api.field_behavior) = OPTIONAL]; |
| 452 | + |
| 453 | + // Optional. The baseline date w.r.t. which the delta counts are calculated. |
| 454 | + // If not set, delta counts are not included in the response and the response |
| 455 | + // indicates the current state of the fleet. |
| 456 | + optional google.type.Date baseline_date = 4 |
| 457 | + [(google.api.field_behavior) = OPTIONAL]; |
| 458 | +} |
| 459 | + |
| 460 | +// The response message containing one of more group of relevant health issues |
| 461 | +// for database resources. |
| 462 | +message AggregateIssueStatsResponse { |
| 463 | + // List of issue group stats where each group contains stats for resources |
| 464 | + // having a particular combination of relevant issues. |
| 465 | + repeated IssueGroupStats issue_group_stats = 1; |
| 466 | + |
| 467 | + // Total count of the resources filtered in based on the user given filter. |
| 468 | + int32 total_resources_count = 2; |
| 469 | + |
| 470 | + // Total count of the resource filtered in based on the user given filter. |
| 471 | + int32 total_resource_groups_count = 3; |
| 472 | + |
| 473 | + // Unordered list. List of unreachable regions from where data could not be |
| 474 | + // retrieved. |
| 475 | + repeated string unreachable = 4 |
| 476 | + [(google.api.field_behavior) = UNORDERED_LIST]; |
| 477 | +} |
| 478 | + |
| 479 | +// IssueGroupStats refers to stats for a particulare combination of relevant |
| 480 | +// health issues of database resources. |
| 481 | +message IssueGroupStats { |
| 482 | + // Database resource level health card name. This will corresponds to one of |
| 483 | + // the requested input group names. |
| 484 | + string display_name = 1; |
| 485 | + |
| 486 | + // Total count of the groups of resources returned by the filter that |
| 487 | + // also have one or more resources for which any of the specified issues |
| 488 | + // are applicable. |
| 489 | + int32 resource_groups_count = 2; |
| 490 | + |
| 491 | + // Total count of resources returned by the filter for which any of the |
| 492 | + // specified issues are applicable. |
| 493 | + int32 resources_count = 3; |
| 494 | + |
| 495 | + // The number of resource groups from the total groups as defined above |
| 496 | + // that are healthy with respect to all of the specified issues. |
| 497 | + int32 healthy_resource_groups_count = 4; |
| 498 | + |
| 499 | + // The number of resources from the total defined above in field |
| 500 | + // total_resources_count that are healthy with respect to all of the specified |
| 501 | + // issues. |
| 502 | + int32 healthy_resources_count = 5; |
| 503 | + |
| 504 | + // List of issues stats containing count of resources having particular issue |
| 505 | + // category. |
| 506 | + repeated IssueStats issue_stats = 6; |
| 507 | +} |
| 508 | + |
| 509 | +// IssueStats holds stats for a particular signal category. |
| 510 | +message IssueStats { |
| 511 | + // Type of signal which is an issue. |
| 512 | + SignalType signal_type = 1; |
| 513 | + |
| 514 | + // Number of resources having issues of a given type. |
| 515 | + int32 resource_count = 2; |
| 516 | + |
| 517 | + // Optional. Delta counts and details of resources for which issue was raised |
| 518 | + // or fixed. |
| 519 | + optional DeltaDetails delta_details = 3 |
| 520 | + [(google.api.field_behavior) = OPTIONAL]; |
| 521 | + |
| 522 | + // Severity of the issue. |
| 523 | + optional IssueSeverity issue_severity = 4; |
| 524 | +} |
| 525 | + |
408 | 526 | // Label is a key value pair applied to a resource. |
409 | 527 | message Label { |
410 | 528 | // The key part of the label. |
|
0 commit comments