Reference documentation and code samples for the Database Center V1BETA API class Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Client.
Client for the DatabaseCenter service.
DatabaseCenter contains methods to query fleet view for database resources.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the DatabaseCenter Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all DatabaseCenter clients ::Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Client.configure do |config| config.timeout = 10.0 end
#aggregate_fleet
def aggregate_fleet(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRow>
def aggregate_fleet(parent: nil, filter: nil, group_by: nil, order_by: nil, page_size: nil, page_token: nil, baseline_date: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRow>AggregateFleet provides statistics about the fleet grouped by various fields.
def aggregate_fleet(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRow>aggregate_fleet via a request object, either of type
AggregateFleetRequest or an equivalent Hash.
- request (::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def aggregate_fleet(parent: nil, filter: nil, group_by: nil, order_by: nil, page_size: nil, page_token: nil, baseline_date: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRow>aggregate_fleet via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) —
Required. Parent can be a project, a folder, or an organization. The search is limited to the resources within the
scope.The allowed values are:
- projects/{PROJECT_ID} (e.g., "projects/foo-bar")
- projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
- folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
- organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
-
filter (::String) — Optional. The expression to filter resources.
Supported fields are:
full_resource_name,resource_type,container,product.type,product.engine,product.version,location,labels,issues, fields of availability_info, data_protection_info, 'resource_name', etc.The expression is a list of zero or more restrictions combined via logical operators
ANDandOR. WhenANDandORare both used in the expression, parentheses must be appropriately used to group the combinations.Example: location="us-east1" Example: container="projects/123" OR container="projects/456" Example: (container="projects/123" OR container="projects/456") AND location="us-east1"
-
group_by (::String) —
Optional. A field that statistics are grouped by. Valid values are any combination of the following:
- container
- product.type
- product.engine
- product.version
- location
- sub_resource_type
- management_type
- tag.key
- tag.value
- tag.source
- tag.inherited
- label.key
- label.value
- label.source
- has_maintenance_schedule
- has_deny_maintenance_schedules Comma separated list.
-
order_by (::String) —
Optional. Valid values to order by are:
- resource_groups_count
- resources_count
- and all fields supported by
group_byThe default order is ascending. Add "DESC" after the field name to indicate descending order. Add "ASC" after the field name to indicate ascending order. It supports ordering using multiple fields. For example: order_by = "resource_groups_count" sorts response in ascending order order_by = "resource_groups_count DESC" sorts response in descending order order_by = "product.type, product.version DESC, location" orders by type in ascending order, version in descending order and location in ascending order
- page_size (::Integer) — Optional. If unspecified, at most 50 items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
-
page_token (::String) — Optional. A page token, received from a previous
AggregateFleetcall. Provide this to retrieve the subsequent page. All other parameters should match the parameters in the call that provided the page token except for page_size which can be different. - baseline_date (::Google::Type::Date, ::Hash) — Optional. The baseline date w.r.t. which the delta counts are calculated. If not set, delta counts are not included in the response and the response indicates the current state of the fleet.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRow>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRow>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/database_center/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRequest.new # Call the aggregate_fleet method. result = client.aggregate_fleet request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRow. p item end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the DatabaseCenter Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#initialize
def initialize() { |config| ... } -> ClientCreate a new DatabaseCenter client object.
- (config) — Configure the DatabaseCenter client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Client.new # Create a client using a custom configuration client = ::Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Client.new do |config| config.timeout = 10.0 end
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#query_database_resource_groups
def query_database_resource_groups(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::DatabaseResourceGroup>
def query_database_resource_groups(parent: nil, filter: nil, signal_type_groups: nil, signal_filters: nil, order_by: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::DatabaseResourceGroup>QueryDatabaseResourceGroups returns paginated results of database groups.
def query_database_resource_groups(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::DatabaseResourceGroup>query_database_resource_groups via a request object, either of type
QueryDatabaseResourceGroupsRequest or an equivalent Hash.
- request (::Google::Cloud::DatabaseCenter::V1beta::QueryDatabaseResourceGroupsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def query_database_resource_groups(parent: nil, filter: nil, signal_type_groups: nil, signal_filters: nil, order_by: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::DatabaseResourceGroup>query_database_resource_groups via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) —
Required. Parent can be a project, a folder, or an organization. The search is limited to the resources within the
scope.The allowed values are:
- projects/{PROJECT_ID} (e.g., "projects/foo-bar")
- projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
- folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
- organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
-
filter (::String) — Optional. The expression to filter resources.
The following fields are filterable:
- full_resource_name
- resource_type
- container
- product.type
- product.engine
- product.version
- location
- labels
- resource_category
- machine_config.cpu_count
- machine_config.memory_size_bytes
- machine_config.shard_count
- resource_name
- tags
- backupdr_config.backupdr_managed
- edition
The expression is a list of zero or more restrictions combined via logical operators
ANDandOR. WhenANDandORare both used in the expression, parentheses must be appropriately used to group the combinations.Example: location="us-east1" Example: container="projects/123" OR container="projects/456" Example: (container="projects/123" OR container="projects/456") AND location="us-east1" Example: full_resource_name=~"test" Example: full_resource_name=~"test.*master"
- signal_type_groups (::Array<::Google::Cloud::DatabaseCenter::V1beta::SignalTypeGroup, ::Hash>) — Optional. Groups of signal types that are requested.
-
signal_filters (::Array<::Google::Cloud::DatabaseCenter::V1beta::SignalFilter, ::Hash>) — Optional. Filters based on signals. The list will be ORed together and then
ANDed with the
filtersfield above. -
order_by (::String) — Optional. A field that specifies the sort order of the results.
The following fields are sortable:
- full_resource_name
- product.type
- product.engine
- product.version
- container
- issue_count
- machine_config.vcpu_count
- machine_config.memory_size_bytes
- machine_config.shard_count
- resource_name
- issue_severity
- signal_type
- location
- resource_type
- instance_type
- edition
- metrics.p99_cpu_utilization
- metrics.p95_cpu_utilization
- metrics.current_storage_used_bytes
- metrics.node_count
- metrics.processing_unit_count
- metrics.current_memory_used_bytes
- metrics.peak_storage_utilization
- metrics.peak_number_connections
- metrics.peak_memory_utilization
The default order is ascending. Add "DESC" after the field name to indicate descending order. Add "ASC" after the field name to indicate ascending order. It only supports a single field at a time.
For example: order_by = "full_resource_name" sorts response in ascending order order_by = "full_resource_name DESC" sorts response in descending order order_by = "issue_count DESC" sorts response in descending order of count of all issues associated with a resource.
More explicitly, order_by = "full_resource_name, product" is not supported.
- page_size (::Integer) — Optional. If unspecified, at most 50 resource groups will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
-
page_token (::String) — Optional. A page token, received from a previous
QueryDatabaseResourceGroupsRequestcall. Provide this to retrieve the subsequent page. All parameters except page_token should match the parameters in the call that provided the page page token.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::DatabaseResourceGroup>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::DatabaseResourceGroup>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/database_center/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DatabaseCenter::V1beta::QueryDatabaseResourceGroupsRequest.new # Call the query_database_resource_groups method. result = client.query_database_resource_groups request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::DatabaseCenter::V1beta::DatabaseResourceGroup. p item end
#query_products
def query_products(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::Product>
def query_products(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::Product>QueryProducts provides a list of all possible products which can be used to filter database resources.
def query_products(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::Product>query_products via a request object, either of type
QueryProductsRequest or an equivalent Hash.
- request (::Google::Cloud::DatabaseCenter::V1beta::QueryProductsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def query_products(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::Product>query_products via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) —
Required. Parent can be a project, a folder, or an organization.
The allowed values are:
- projects/{PROJECT_ID}/locations/{LOCATION} (e.g.,"projects/foo-bar/locations/us-central1")
- projects/{PROJECT_NUMBER}/locations/{LOCATION} (e.g.,"projects/12345678/locations/us-central1")
- folders/{FOLDER_NUMBER}/locations/{LOCATION} (e.g.,"folders/1234567/locations/us-central1")
- organizations/{ORGANIZATION_NUMBER}/locations/{LOCATION} (e.g.,"organizations/123456/locations/us-central1")
- projects/{PROJECT_ID} (e.g., "projects/foo-bar")
- projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
- folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
- organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
- page_size (::Integer) — Optional. If unspecified, at most 50 products will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
-
page_token (::String) — Optional. A page token, received from a previous
ListLocationscall. Provide this to retrieve the subsequent page. All other parameters except page size should match the call that provided the page page token.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::Product>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::Product>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/database_center/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DatabaseCenter::V1beta::QueryProductsRequest.new # Call the query_products method. result = client.query_products request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::DatabaseCenter::V1beta::Product. p item end
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)