Method: Google::Cloud::Monitoring::V3::UptimeCheckService::Client#delete_uptime_check_config

Defined in:
lib/google/cloud/monitoring/v3/uptime_check_service/client.rb

#delete_uptime_check_config(request, options = nil) ⇒ ::Google::Protobuf::Empty #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.

Examples:

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

Overloads:

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

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.

[View source]

613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
# File 'lib/google/cloud/monitoring/v3/uptime_check_service/client.rb', line 613

def delete_uptime_check_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::DeleteUptimeCheckConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_uptime_check_config..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_uptime_check_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_uptime_check_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @uptime_check_service_stub.call_rpc :delete_uptime_check_config, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end