@@ -24,6 +24,7 @@ import "google/cloud/databasecenter/v1beta/maintenance.proto"; |
24 | 24 | import "google/cloud/databasecenter/v1beta/metric_data.proto"; |
25 | 25 | import "google/cloud/databasecenter/v1beta/product.proto"; |
26 | 26 | import "google/cloud/databasecenter/v1beta/signals.proto"; |
| 27 | +import "google/type/date.proto"; |
27 | 28 |
|
28 | 29 | option csharp_namespace = "Google.Cloud.DatabaseCenter.V1Beta"; |
29 | 30 | option go_package = "cloud.google.com/go/databasecenter/apiv1beta/databasecenterpb;databasecenterpb"; |
@@ -47,6 +48,14 @@ service DatabaseCenter { |
47 | 48 | }; |
48 | 49 | } |
49 | 50 |
|
| 51 | + // AggregateFleet provides statistics about the fleet grouped by various |
| 52 | + // fields. |
| 53 | + rpc AggregateFleet(AggregateFleetRequest) returns (AggregateFleetResponse) { |
| 54 | + option (google.api.http) = { |
| 55 | + get: "/v1beta:aggregateFleet" |
| 56 | + }; |
| 57 | + } |
| 58 | + |
50 | 59 | // QueryDatabaseResourceGroups returns paginated results of database groups. |
51 | 60 | rpc QueryDatabaseResourceGroups(QueryDatabaseResourceGroupsRequest) |
52 | 61 | returns (QueryDatabaseResourceGroupsResponse) { |
@@ -109,6 +118,18 @@ enum SubResourceType { |
109 | 118 | SUB_RESOURCE_TYPE_OTHER = 4; |
110 | 119 | } |
111 | 120 |
|
| 121 | +// The management type of the resource. |
| 122 | +enum ManagementType { |
| 123 | + // Unspecified. |
| 124 | + MANAGEMENT_TYPE_UNSPECIFIED = 0; |
| 125 | + |
| 126 | + // Google-managed resource. |
| 127 | + MANAGEMENT_TYPE_GCP_MANAGED = 1; |
| 128 | + |
| 129 | + // Self-managed resource. |
| 130 | + MANAGEMENT_TYPE_SELF_MANAGED = 2; |
| 131 | +} |
| 132 | + |
112 | 133 | // QueryProductsRequest is the request to get a list of products. |
113 | 134 | message QueryProductsRequest { |
114 | 135 | // Required. Parent can be a project, a folder, or an organization. |
@@ -397,6 +418,200 @@ message Label { |
397 | 418 | string source = 3; |
398 | 419 | } |
399 | 420 |
|
| 421 | +// The request message to aggregate fleet which are grouped by a field. |
| 422 | +message AggregateFleetRequest { |
| 423 | + // Required. Parent can be a project, a folder, or an organization. The search |
| 424 | + // is limited to the resources within the `scope`. |
| 425 | + // |
| 426 | + // The allowed values are: |
| 427 | + // |
| 428 | + // * projects/{PROJECT_ID} (e.g., "projects/foo-bar") |
| 429 | + // * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") |
| 430 | + // * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") |
| 431 | + // * organizations/{ORGANIZATION_NUMBER} (e.g., |
| 432 | + // "organizations/123456") |
| 433 | + string parent = 1 [(google.api.field_behavior) = REQUIRED]; |
| 434 | + |
| 435 | + // Optional. The expression to filter resources. |
| 436 | + // |
| 437 | + // Supported fields are: `full_resource_name`, `resource_type`, `container`, |
| 438 | + // `product.type`, `product.engine`, `product.version`, `location`, |
| 439 | + // `labels`, `issues`, fields of availability_info, data_protection_info, |
| 440 | + // 'resource_name', etc. |
| 441 | + // |
| 442 | + // The expression is a list of zero or more restrictions combined via logical |
| 443 | + // operators `AND` and `OR`. When `AND` and `OR` are both used in the |
| 444 | + // expression, parentheses must be appropriately used to group the |
| 445 | + // combinations. |
| 446 | + // |
| 447 | + // Example: location="us-east1" |
| 448 | + // Example: container="projects/123" OR container="projects/456" |
| 449 | + // Example: (container="projects/123" OR |
| 450 | + // container="projects/456") AND location="us-east1" |
| 451 | + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; |
| 452 | + |
| 453 | + // Optional. A field that statistics are grouped by. |
| 454 | + // Valid values are any combination of the following: |
| 455 | + // * container |
| 456 | + // * product.type |
| 457 | + // * product.engine |
| 458 | + // * product.version |
| 459 | + // * location |
| 460 | + // * sub_resource_type |
| 461 | + // * management_type |
| 462 | + // * tag.key |
| 463 | + // * tag.value |
| 464 | + // * tag.source |
| 465 | + // * tag.inherited |
| 466 | + // * label.key |
| 467 | + // * label.value |
| 468 | + // * label.source |
| 469 | + // * has_maintenance_schedule |
| 470 | + // * has_deny_maintenance_schedules |
| 471 | + // Comma separated list. |
| 472 | + string group_by = 3 [(google.api.field_behavior) = OPTIONAL]; |
| 473 | + |
| 474 | + // Optional. Valid values to order by are: |
| 475 | + // * resource_groups_count |
| 476 | + // * resources_count |
| 477 | + // * and all fields supported by `group_by` |
| 478 | + // The default order is ascending. Add "DESC" after the field name to indicate |
| 479 | + // descending order. Add "ASC" after the field name to indicate ascending |
| 480 | + // order. It supports ordering using multiple fields. |
| 481 | + // For example: |
| 482 | + // order_by = "resource_groups_count" sorts response in ascending order |
| 483 | + // order_by = "resource_groups_count DESC" sorts response in descending order |
| 484 | + // order_by = "product.type, product.version DESC, location" orders by type |
| 485 | + // in ascending order, version in descending order and location in ascending |
| 486 | + // order |
| 487 | + string order_by = 4 [(google.api.field_behavior) = OPTIONAL]; |
| 488 | + |
| 489 | + // Optional. If unspecified, at most 50 items will be returned. |
| 490 | + // The maximum value is 1000; values above 1000 will be coerced to 1000. |
| 491 | + int32 page_size = 5 [(google.api.field_behavior) = OPTIONAL]; |
| 492 | + |
| 493 | + // Optional. A page token, received from a previous `AggregateFleet` call. |
| 494 | + // Provide this to retrieve the subsequent page. |
| 495 | + // All other parameters should match the parameters in the call that provided |
| 496 | + // the page token except for page_size which can be different. |
| 497 | + string page_token = 6 [(google.api.field_behavior) = OPTIONAL]; |
| 498 | + |
| 499 | + // Optional. The baseline date w.r.t. which the delta counts are calculated. |
| 500 | + // If not set, delta counts are not included in the response and the response |
| 501 | + // indicates the current state of the fleet. |
| 502 | + optional google.type.Date baseline_date = 7 |
| 503 | + [(google.api.field_behavior) = OPTIONAL]; |
| 504 | +} |
| 505 | + |
| 506 | +// The response message to aggregate a fleet by some group by fields. |
| 507 | +message AggregateFleetResponse { |
| 508 | + // Represents a row grouped by the fields in the input. |
| 509 | + repeated AggregateFleetRow rows = 1; |
| 510 | + |
| 511 | + // Count of all resource groups in the fleet. This includes counts from all |
| 512 | + // pages. |
| 513 | + int32 resource_groups_total_count = 2; |
| 514 | + |
| 515 | + // Count of all resources in the fleet. This includes counts from all pages. |
| 516 | + int32 resource_total_count = 3; |
| 517 | + |
| 518 | + // A token that can be sent as `page_token` to retrieve the next page. |
| 519 | + // If this field is omitted, there are no subsequent pages. |
| 520 | + string next_page_token = 4; |
| 521 | + |
| 522 | + // Unordered list. List of unreachable regions from where data could not be |
| 523 | + // retrieved. |
| 524 | + repeated string unreachable = 5 |
| 525 | + [(google.api.field_behavior) = UNORDERED_LIST]; |
| 526 | +} |
| 527 | + |
| 528 | +// Individual row grouped by a particular dimension. |
| 529 | +message AggregateFleetRow { |
| 530 | + // Group by dimension. |
| 531 | + repeated Dimension dimension = 1; |
| 532 | + |
| 533 | + // Number of resource groups that have a particular dimension. |
| 534 | + int32 resource_groups_count = 2; |
| 535 | + |
| 536 | + // Number of resources that have a particular dimension. |
| 537 | + int32 resources_count = 3; |
| 538 | + |
| 539 | + // Optional. Delta counts and details of resources which were added to/deleted |
| 540 | + // from fleet. |
| 541 | + optional DeltaDetails delta_details = 4 |
| 542 | + [(google.api.field_behavior) = OPTIONAL]; |
| 543 | +} |
| 544 | + |
| 545 | +// Dimension used to aggregate the fleet. |
| 546 | +message Dimension { |
| 547 | + // Followings are the dimensions to be used to aggregate the fleet. |
| 548 | + oneof dimension { |
| 549 | + // Specifies where the resource is created. For GCP, it is the full name of |
| 550 | + // the project. |
| 551 | + string container = 2; |
| 552 | + |
| 553 | + // Type to identify a product |
| 554 | + ProductType product_type = 3; |
| 555 | + |
| 556 | + // Engine refers to underlying database binary running in an instance. |
| 557 | + Engine product_engine = 4; |
| 558 | + |
| 559 | + // Version of the underlying database engine |
| 560 | + string product_version = 5; |
| 561 | + |
| 562 | + // The location of the resources. It supports returning only regional |
| 563 | + // locations in GCP. |
| 564 | + string location = 6; |
| 565 | + |
| 566 | + // The type of resource defined according to the pattern: |
| 567 | + // {Service Name}/{Type}. Ex: |
| 568 | + // sqladmin.googleapis.com/Instance |
| 569 | + // alloydb.googleapis.com/Cluster |
| 570 | + // alloydb.googleapis.com/Instance |
| 571 | + // spanner.googleapis.com/Instance |
| 572 | + string resource_type = 7; |
| 573 | + |
| 574 | + // Subtype of the resource specified at creation time. |
| 575 | + SubResourceType sub_resource_type = 8; |
| 576 | + |
| 577 | + // The category of the resource. |
| 578 | + ResourceCategory resource_category = 9; |
| 579 | + |
| 580 | + // The management type of the resource. |
| 581 | + ManagementType management_type = 10; |
| 582 | + |
| 583 | + // The edition of the resource. |
| 584 | + Edition edition = 11; |
| 585 | + |
| 586 | + // Tag key of the resource. |
| 587 | + string tag_key = 12; |
| 588 | + |
| 589 | + // Tag value of the resource. |
| 590 | + string tag_value = 13; |
| 591 | + |
| 592 | + // Tag source of the resource. |
| 593 | + string tag_source = 14; |
| 594 | + |
| 595 | + // Tag inheritance value of the resource. |
| 596 | + bool tag_inherited = 15; |
| 597 | + |
| 598 | + // Label key of the resource. |
| 599 | + string label_key = 16; |
| 600 | + |
| 601 | + // Label value of the resource. |
| 602 | + string label_value = 17; |
| 603 | + |
| 604 | + // Label source of the resource. |
| 605 | + string label_source = 18; |
| 606 | + |
| 607 | + // Whether the resource has a maintenance schedule. |
| 608 | + bool has_maintenance_schedule = 19; |
| 609 | + |
| 610 | + // Whether the resource has deny maintenance schedules. |
| 611 | + bool has_deny_maintenance_schedules = 20; |
| 612 | + } |
| 613 | +} |
| 614 | + |
400 | 615 | // BackupDRConfig to capture the backup and disaster recovery details of |
401 | 616 | // database resource. |
402 | 617 | message BackupDRConfig { |
@@ -428,3 +643,33 @@ message Tag { |
428 | 643 | // value is directly attached to the resource. |
429 | 644 | bool inherited = 4; |
430 | 645 | } |
| 646 | + |
| 647 | +// Capture the resource details for resources that are included in the delta |
| 648 | +// counts. |
| 649 | +message ResourceDetails { |
| 650 | + // Full resource name of the resource. |
| 651 | + string full_resource_name = 1; |
| 652 | + |
| 653 | + // Specifies where the resource is created. For GCP, it is the full name of |
| 654 | + // the project. |
| 655 | + string container = 2; |
| 656 | + |
| 657 | + // Product type of the resource. |
| 658 | + Product product = 3; |
| 659 | + |
| 660 | + // Location of the resource. |
| 661 | + string location = 4; |
| 662 | +} |
| 663 | + |
| 664 | +// Captures the details of items that have increased or decreased in some bucket |
| 665 | +// when compared to some point in history. |
| 666 | +// It is currently used to capture the delta of resources that have been added |
| 667 | +// or removed in the fleet as well as to capture the resources that have a |
| 668 | +// change in Issue/Signal status. |
| 669 | +message DeltaDetails { |
| 670 | + // Details of resources that have increased. |
| 671 | + repeated ResourceDetails increased_resources = 1; |
| 672 | + |
| 673 | + // Details of resources that have decreased. |
| 674 | + repeated ResourceDetails decreased_resources = 2; |
| 675 | +} |