Class: Google::Apis::DatabasecenterV1beta::DatabaseCenterService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/databasecenter_v1beta/service.rb

Overview

Database Center API

Database Center offers a comprehensive, organization-wide platform for monitoring database fleet health across various products. It simplifies management and reduces risk by automatically aggregating and summarizing key health signals, removing the need for custom dashboards. The platform provides a unified view through its dashboard and API, enabling teams focused on reliability, compliance, security, cost, and administration to quickly identify and address relevant issues within their database fleets.

Examples:

require 'google/apis/databasecenter_v1beta'

Databasecenter = Google::Apis::DatabasecenterV1beta # Alias the module
service = Databasecenter::DatabaseCenterService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://databasecenter.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDatabaseCenterService

Returns a new instance of DatabaseCenterService.



53
54
55
56
57
58
# File 'lib/google/apis/databasecenter_v1beta/service.rb', line 53

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-databasecenter_v1beta',
        client_version: Google::Apis::DatabasecenterV1beta::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



46
47
48
# File 'lib/google/apis/databasecenter_v1beta/service.rb', line 46

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



51
52
53
# File 'lib/google/apis/databasecenter_v1beta/service.rb', line 51

def quota_user
  @quota_user
end

Instance Method Details

#aggregate_fleet(baseline_date_day: nil, baseline_date_month: nil, baseline_date_year: nil, filter: nil, group_by: nil, order_by: nil, page_size: nil, page_token: nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatabasecenterV1beta::AggregateFleetResponse

AggregateFleet provides statistics about the fleet grouped by various fields.

Parameters:

  • baseline_date_day (Fixnum) (defaults to: nil)

    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

  • baseline_date_month (Fixnum) (defaults to: nil)

    Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

  • baseline_date_year (Fixnum) (defaults to: nil)

    Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

  • filter (String) (defaults to: nil)

    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 AND and OR. When AND and OR are 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) (defaults to: nil)

    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) (defaults to: nil)

    Optional. Valid values to order by are: * resource_groups_count * resources_count * and all fields supported by group_by 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 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 (Fixnum) (defaults to: nil)

    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) (defaults to: nil)

    Optional. A page token, received from a previous AggregateFleet call. 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.

  • parent (String) (defaults to: nil)

    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")
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/google/apis/databasecenter_v1beta/service.rb', line 240

def aggregate_fleet(baseline_date_day: nil, baseline_date_month: nil, baseline_date_year: nil, filter: nil, group_by: nil, order_by: nil, page_size: nil, page_token: nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta:aggregateFleet', options)
  command.response_representation = Google::Apis::DatabasecenterV1beta::AggregateFleetResponse::Representation
  command.response_class = Google::Apis::DatabasecenterV1beta::AggregateFleetResponse
  command.query['baselineDate.day'] = baseline_date_day unless baseline_date_day.nil?
  command.query['baselineDate.month'] = baseline_date_month unless baseline_date_month.nil?
  command.query['baselineDate.year'] = baseline_date_year unless baseline_date_year.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['groupBy'] = group_by unless group_by.nil?
  command.query['orderBy'] = order_by unless order_by.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#aggregate_folder_query_stats(parent, aggregate_query_stats_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatabasecenterV1beta::AggregateQueryStatsResponse

AggregateQueryStats provides database resource query execution statistics.

Parameters:

  • parent (String)

    Required. Parent can be a project, a folder, or an organization. The search is limited to the resources within the parent. 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")
  • aggregate_query_stats_request_object (Google::Apis::DatabasecenterV1beta::AggregateQueryStatsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



85
86
87
88
89
90
91
92
93
94
95
# File 'lib/google/apis/databasecenter_v1beta/service.rb', line 85

def aggregate_folder_query_stats(parent, aggregate_query_stats_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta/{+parent}:aggregateQueryStats', options)
  command.request_representation = Google::Apis::DatabasecenterV1beta::AggregateQueryStatsRequest::Representation
  command.request_object = aggregate_query_stats_request_object
  command.response_representation = Google::Apis::DatabasecenterV1beta::AggregateQueryStatsResponse::Representation
  command.response_class = Google::Apis::DatabasecenterV1beta::AggregateQueryStatsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#aggregate_issue_stats(aggregate_issue_stats_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatabasecenterV1beta::AggregateIssueStatsResponse

AggregateIssueStats provides database resource issues statistics.

Parameters:

  • aggregate_issue_stats_request_object (Google::Apis::DatabasecenterV1beta::AggregateIssueStatsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



277
278
279
280
281
282
283
284
285
286
# File 'lib/google/apis/databasecenter_v1beta/service.rb', line 277

def aggregate_issue_stats(aggregate_issue_stats_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta:aggregateIssueStats', options)
  command.request_representation = Google::Apis::DatabasecenterV1beta::AggregateIssueStatsRequest::Representation
  command.request_object = aggregate_issue_stats_request_object
  command.response_representation = Google::Apis::DatabasecenterV1beta::AggregateIssueStatsResponse::Representation
  command.response_class = Google::Apis::DatabasecenterV1beta::AggregateIssueStatsResponse
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#aggregate_organization_query_stats(parent, aggregate_query_stats_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatabasecenterV1beta::AggregateQueryStatsResponse

AggregateQueryStats provides database resource query execution statistics.

Parameters:

  • parent (String)

    Required. Parent can be a project, a folder, or an organization. The search is limited to the resources within the parent. 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")
  • aggregate_query_stats_request_object (Google::Apis::DatabasecenterV1beta::AggregateQueryStatsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



122
123
124
125
126
127
128
129
130
131
132
# File 'lib/google/apis/databasecenter_v1beta/service.rb', line 122

def aggregate_organization_query_stats(parent, aggregate_query_stats_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta/{+parent}:aggregateQueryStats', options)
  command.request_representation = Google::Apis::DatabasecenterV1beta::AggregateQueryStatsRequest::Representation
  command.request_object = aggregate_query_stats_request_object
  command.response_representation = Google::Apis::DatabasecenterV1beta::AggregateQueryStatsResponse::Representation
  command.response_class = Google::Apis::DatabasecenterV1beta::AggregateQueryStatsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#aggregate_project_query_stats(parent, aggregate_query_stats_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatabasecenterV1beta::AggregateQueryStatsResponse

AggregateQueryStats provides database resource query execution statistics.

Parameters:

  • parent (String)

    Required. Parent can be a project, a folder, or an organization. The search is limited to the resources within the parent. 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")
  • aggregate_query_stats_request_object (Google::Apis::DatabasecenterV1beta::AggregateQueryStatsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



159
160
161
162
163
164
165
166
167
168
169
# File 'lib/google/apis/databasecenter_v1beta/service.rb', line 159

def aggregate_project_query_stats(parent, aggregate_query_stats_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta/{+parent}:aggregateQueryStats', options)
  command.request_representation = Google::Apis::DatabasecenterV1beta::AggregateQueryStatsRequest::Representation
  command.request_object = aggregate_query_stats_request_object
  command.response_representation = Google::Apis::DatabasecenterV1beta::AggregateQueryStatsResponse::Representation
  command.response_class = Google::Apis::DatabasecenterV1beta::AggregateQueryStatsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#query_database_resource_groups(query_database_resource_groups_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatabasecenterV1beta::QueryDatabaseResourceGroupsResponse

QueryDatabaseResourceGroups returns paginated results of database groups.

Parameters:

  • query_database_resource_groups_request_object (Google::Apis::DatabasecenterV1beta::QueryDatabaseResourceGroupsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



307
308
309
310
311
312
313
314
315
316
# File 'lib/google/apis/databasecenter_v1beta/service.rb', line 307

def query_database_resource_groups(query_database_resource_groups_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta:queryDatabaseResourceGroups', options)
  command.request_representation = Google::Apis::DatabasecenterV1beta::QueryDatabaseResourceGroupsRequest::Representation
  command.request_object = query_database_resource_groups_request_object
  command.response_representation = Google::Apis::DatabasecenterV1beta::QueryDatabaseResourceGroupsResponse::Representation
  command.response_class = Google::Apis::DatabasecenterV1beta::QueryDatabaseResourceGroupsResponse
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#query_issues(query_issues_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatabasecenterV1beta::QueryIssuesResponse

QueryIssues provides a list of issues and recommendations that a user has access to and that are within the requested scope.

Parameters:

  • query_issues_request_object (Google::Apis::DatabasecenterV1beta::QueryIssuesRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



338
339
340
341
342
343
344
345
346
347
# File 'lib/google/apis/databasecenter_v1beta/service.rb', line 338

def query_issues(query_issues_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta:queryIssues', options)
  command.request_representation = Google::Apis::DatabasecenterV1beta::QueryIssuesRequest::Representation
  command.request_object = query_issues_request_object
  command.response_representation = Google::Apis::DatabasecenterV1beta::QueryIssuesResponse::Representation
  command.response_class = Google::Apis::DatabasecenterV1beta::QueryIssuesResponse
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#query_products(page_size: nil, page_token: nil, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatabasecenterV1beta::QueryProductsResponse

QueryProducts provides a list of all possible products which can be used to filter database resources.

Parameters:

  • page_size (Fixnum) (defaults to: nil)

    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) (defaults to: nil)

    Optional. A page token, received from a previous ListLocations call. Provide this to retrieve the subsequent page. All other parameters except page size should match the call that provided the page page token.

  • parent (String) (defaults to: nil)

    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")

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



386
387
388
389
390
391
392
393
394
395
396
# File 'lib/google/apis/databasecenter_v1beta/service.rb', line 386

def query_products(page_size: nil, page_token: nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta:queryProducts', options)
  command.response_representation = Google::Apis::DatabasecenterV1beta::QueryProductsResponse::Representation
  command.response_class = Google::Apis::DatabasecenterV1beta::QueryProductsResponse
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end