Cloud Monitoring Dashboards V1 API - Class Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client (v0.7.0)

Reference documentation and code samples for the Cloud Monitoring Dashboards V1 API class Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.

Client for the DashboardsService service.

Manages Stackdriver dashboards. A dashboard is an arrangement of data display widgets in a specific layout.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the DashboardsService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all DashboardsService clients
::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the DashboardsService 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.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_dashboard

def create_dashboard(request, options = nil) -> ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard
def create_dashboard(parent: nil, dashboard: nil, validate_only: nil) -> ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard

Creates a new custom dashboard. For examples on how you can use this API to create dashboards, see Managing dashboards by API. This method requires the monitoring.dashboards.create permission on the specified project. For more information about permissions, see Cloud Identity and Access Management.

Overloads
def create_dashboard(request, options = nil) -> ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard
Pass arguments to create_dashboard via a request object, either of type CreateDashboardRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Monitoring::Dashboard::V1::CreateDashboardRequest, ::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 create_dashboard(parent: nil, dashboard: nil, validate_only: nil) -> ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard
Pass arguments to create_dashboard 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).
Parameters
  • parent (::String) — Required. The project on which to execute the request. The format is:

    projects/[PROJECT_ID_OR_NUMBER]
    

    The [PROJECT_ID_OR_NUMBER] must match the dashboard resource name.

  • dashboard (::Google::Cloud::Monitoring::Dashboard::V1::Dashboard, ::Hash) — Required. The initial dashboard specification.
  • validate_only (::Boolean) — If set, validate the request and preview the review, but do not actually save it.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/monitoring/dashboard/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::Dashboard::V1::CreateDashboardRequest.new

# Call the create_dashboard method.
result = client.create_dashboard request

# The returned object is of type Google::Cloud::Monitoring::Dashboard::V1::Dashboard.
p result

#delete_dashboard

def delete_dashboard(request, options = nil) -> ::Google::Protobuf::Empty
def delete_dashboard(name: nil) -> ::Google::Protobuf::Empty

Deletes an existing custom dashboard.

This method requires the monitoring.dashboards.delete permission on the specified dashboard. For more information, see Cloud Identity and Access Management.

Overloads
def delete_dashboard(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_dashboard via a request object, either of type Google::Cloud::Monitoring::Dashboard::V1::DeleteDashboardRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Monitoring::Dashboard::V1::DeleteDashboardRequest, ::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 delete_dashboard(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_dashboard 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).
Parameter
  • name (::String) —

    Required. The resource name of the Dashboard. The format is:

    projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]
    
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/monitoring/dashboard/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::Dashboard::V1::DeleteDashboardRequest.new

# Call the delete_dashboard method.
result = client.delete_dashboard request

# The returned object is of type Google::Protobuf::Empty.
p result

#get_dashboard

def get_dashboard(request, options = nil) -> ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard
def get_dashboard(name: nil) -> ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard

Fetches a specific dashboard.

This method requires the monitoring.dashboards.get permission on the specified dashboard. For more information, see Cloud Identity and Access Management.

Overloads
def get_dashboard(request, options = nil) -> ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard
Pass arguments to get_dashboard via a request object, either of type GetDashboardRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Monitoring::Dashboard::V1::GetDashboardRequest, ::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 get_dashboard(name: nil) -> ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard
Pass arguments to get_dashboard 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).
Parameter
  • name (::String) —

    Required. The resource name of the Dashboard. The format is one of:

    • dashboards/[DASHBOARD_ID] (for system dashboards)
    • projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] (for custom dashboards).
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/monitoring/dashboard/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::Dashboard::V1::GetDashboardRequest.new

# Call the get_dashboard method.
result = client.get_dashboard request

# The returned object is of type Google::Cloud::Monitoring::Dashboard::V1::Dashboard.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new DashboardsService client object.

Yields
  • (config) — Configure the DashboardsService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new do |config|
  config.timeout = 10.0
end

#list_dashboards

def list_dashboards(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::Dashboard::V1::Dashboard>
def list_dashboards(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::Dashboard::V1::Dashboard>

Lists the existing dashboards.

This method requires the monitoring.dashboards.list permission on the specified project. For more information, see Cloud Identity and Access Management.

Overloads
def list_dashboards(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::Dashboard::V1::Dashboard>
Pass arguments to list_dashboards via a request object, either of type ListDashboardsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Monitoring::Dashboard::V1::ListDashboardsRequest, ::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 list_dashboards(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::Dashboard::V1::Dashboard>
Pass arguments to list_dashboards 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).
Parameters
  • parent (::String) —

    Required. The scope of the dashboards to list. The format is:

    projects/[PROJECT_ID_OR_NUMBER]
    
  • page_size (::Integer) — A positive number that is the maximum number of results to return. If unspecified, a default of 1000 is used.
  • page_token (::String) — If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/monitoring/dashboard/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::Dashboard::V1::ListDashboardsRequest.new

# Call the list_dashboards method.
result = client.list_dashboards request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard.
  p response
end

#update_dashboard

def update_dashboard(request, options = nil) -> ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard
def update_dashboard(dashboard: nil, validate_only: nil) -> ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard

Replaces an existing custom dashboard with a new definition.

This method requires the monitoring.dashboards.update permission on the specified dashboard. For more information, see Cloud Identity and Access Management.

Overloads
def update_dashboard(request, options = nil) -> ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard
Pass arguments to update_dashboard via a request object, either of type UpdateDashboardRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Monitoring::Dashboard::V1::UpdateDashboardRequest, ::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 update_dashboard(dashboard: nil, validate_only: nil) -> ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard
Pass arguments to update_dashboard 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).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/monitoring/dashboard/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::Dashboard::V1::UpdateDashboardRequest.new

# Call the update_dashboard method.
result = client.update_dashboard request

# The returned object is of type Google::Cloud::Monitoring::Dashboard::V1::Dashboard.
p result