Cloud Monitoring V3 API - Class Google::Cloud::Monitoring::V3::UptimeCheckService::Client (v0.10.0)

Reference documentation and code samples for the Cloud Monitoring V3 API class Google::Cloud::Monitoring::V3::UptimeCheckService::Client.

Client for the UptimeCheckService service.

The UptimeCheckService API is used to manage (list, create, delete, edit) Uptime check configurations in the Stackdriver Monitoring product. An Uptime check is a piece of configuration that determines which resources and services to monitor for availability. These configurations can also be configured interactively by navigating to the Cloud Console, selecting the appropriate project, clicking on "Monitoring" on the left-hand side to navigate to Stackdriver, and then clicking on "Uptime".

Inherits

  • Object

Methods

.configure

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

Configure the UptimeCheckService 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 UptimeCheckService clients
::Google::Cloud::Monitoring::V3::UptimeCheckService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the UptimeCheckService 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_uptime_check_config

def create_uptime_check_config(request, options = nil) -> ::Google::Cloud::Monitoring::V3::UptimeCheckConfig
def create_uptime_check_config(parent: nil, uptime_check_config: nil) -> ::Google::Cloud::Monitoring::V3::UptimeCheckConfig

Creates a new Uptime check configuration.

Overloads
def create_uptime_check_config(request, options = nil) -> ::Google::Cloud::Monitoring::V3::UptimeCheckConfig
Pass arguments to create_uptime_check_config via a request object, either of type CreateUptimeCheckConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Monitoring::V3::CreateUptimeCheckConfigRequest, ::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_uptime_check_config(parent: nil, uptime_check_config: nil) -> ::Google::Cloud::Monitoring::V3::UptimeCheckConfig
Pass arguments to create_uptime_check_config 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/v3"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::CreateUptimeCheckConfigRequest.new

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

# The returned object is of type Google::Cloud::Monitoring::V3::UptimeCheckConfig.
p result

#delete_uptime_check_config

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

Deletes an Uptime check configuration. Note that this method will fail if the Uptime check configuration is referenced by an alert policy or other dependent configs that would be rendered invalid by the deletion.

Overloads
def delete_uptime_check_config(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_uptime_check_config via a request object, either of type DeleteUptimeCheckConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Monitoring::V3::DeleteUptimeCheckConfigRequest, ::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_uptime_check_config(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_uptime_check_config 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 Uptime check configuration to delete. The format is:

    projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_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/v3"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::DeleteUptimeCheckConfigRequest.new

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

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

#get_uptime_check_config

def get_uptime_check_config(request, options = nil) -> ::Google::Cloud::Monitoring::V3::UptimeCheckConfig
def get_uptime_check_config(name: nil) -> ::Google::Cloud::Monitoring::V3::UptimeCheckConfig

Gets a single Uptime check configuration.

Overloads
def get_uptime_check_config(request, options = nil) -> ::Google::Cloud::Monitoring::V3::UptimeCheckConfig
Pass arguments to get_uptime_check_config via a request object, either of type GetUptimeCheckConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Monitoring::V3::GetUptimeCheckConfigRequest, ::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_uptime_check_config(name: nil) -> ::Google::Cloud::Monitoring::V3::UptimeCheckConfig
Pass arguments to get_uptime_check_config 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 Uptime check configuration to retrieve. The format is:

    projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_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/v3"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::GetUptimeCheckConfigRequest.new

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

# The returned object is of type Google::Cloud::Monitoring::V3::UptimeCheckConfig.
p result

#initialize

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

Create a new UptimeCheckService client object.

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

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

#list_uptime_check_configs

def list_uptime_check_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::UptimeCheckConfig>
def list_uptime_check_configs(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::UptimeCheckConfig>

Lists the existing valid Uptime check configurations for the project (leaving out any invalid configurations).

Overloads
def list_uptime_check_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::UptimeCheckConfig>
Pass arguments to list_uptime_check_configs via a request object, either of type ListUptimeCheckConfigsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Monitoring::V3::ListUptimeCheckConfigsRequest, ::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_uptime_check_configs(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::UptimeCheckConfig>
Pass arguments to list_uptime_check_configs 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 whose Uptime check configurations are listed. The format is:

    projects/[PROJECT_ID_OR_NUMBER]
    
  • page_size (::Integer) — The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is <=0, the server will decide the number of results to be returned.
  • 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 more 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/v3"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::ListUptimeCheckConfigsRequest.new

# Call the list_uptime_check_configs method.
result = client.list_uptime_check_configs 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::V3::UptimeCheckConfig.
  p response
end

#list_uptime_check_ips

def list_uptime_check_ips(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::UptimeCheckIp>
def list_uptime_check_ips(page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::UptimeCheckIp>

Returns the list of IP addresses that checkers run from

Overloads
def list_uptime_check_ips(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::UptimeCheckIp>
Pass arguments to list_uptime_check_ips via a request object, either of type ListUptimeCheckIpsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Monitoring::V3::ListUptimeCheckIpsRequest, ::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_uptime_check_ips(page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::UptimeCheckIp>
Pass arguments to list_uptime_check_ips 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
  • page_size (::Integer) — The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is <=0, the server will decide the number of results to be returned. NOTE: this field is not yet implemented
  • 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 more results from the previous method call. NOTE: this field is not yet implemented
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/v3"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::ListUptimeCheckIpsRequest.new

# Call the list_uptime_check_ips method.
result = client.list_uptime_check_ips 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::V3::UptimeCheckIp.
  p response
end

#update_uptime_check_config

def update_uptime_check_config(request, options = nil) -> ::Google::Cloud::Monitoring::V3::UptimeCheckConfig
def update_uptime_check_config(update_mask: nil, uptime_check_config: nil) -> ::Google::Cloud::Monitoring::V3::UptimeCheckConfig

Updates an Uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via updateMask. Returns the updated configuration.

Overloads
def update_uptime_check_config(request, options = nil) -> ::Google::Cloud::Monitoring::V3::UptimeCheckConfig
Pass arguments to update_uptime_check_config via a request object, either of type Google::Cloud::Monitoring::V3::UpdateUptimeCheckConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Monitoring::V3::UpdateUptimeCheckConfigRequest, ::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_uptime_check_config(update_mask: nil, uptime_check_config: nil) -> ::Google::Cloud::Monitoring::V3::UptimeCheckConfig
Pass arguments to update_uptime_check_config 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
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. If present, only the listed fields in the current Uptime check configuration are updated with values from the new configuration. If this field is empty, then the current configuration is completely replaced with the new configuration.
  • uptime_check_config (::Google::Cloud::Monitoring::V3::UptimeCheckConfig, ::Hash) — Required. If an updateMask has been specified, this field gives the values for the set of fields mentioned in the updateMask. If an updateMask has not been given, this Uptime check configuration replaces the current configuration. If a field is mentioned in updateMask but the corresonding field is omitted in this partial Uptime check configuration, it has the effect of deleting/clearing the field from the configuration on the server.

    The following fields can be updated: display_name, http_check, tcp_check, timeout, content_matchers, and selected_regions.

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/v3"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::UpdateUptimeCheckConfigRequest.new

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

# The returned object is of type Google::Cloud::Monitoring::V3::UptimeCheckConfig.
p result