Error Reporting V1beta1 API - Class Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client (v0.12.0)

Reference documentation and code samples for the Error Reporting V1beta1 API class Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client.

REST client for the ReportErrorsService service.

An API for reporting error events.

Inherits

  • Object

Methods

.configure

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

Configure the ReportErrorsService 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 ReportErrorsService clients
::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the ReportErrorsService 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

#initialize

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

Create a new ReportErrorsService REST client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client.new do |config|
  config.timeout = 10.0
end

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#report_error_event

def report_error_event(request, options = nil) -> ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse
def report_error_event(project_name: nil, event: nil) -> ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse

Report an individual error event and record the event to a log.

This endpoint accepts either an OAuth token, or an API key for authentication. To use an API key, append it to the URL as the value of a key parameter. For example:

POST https://clouderrorreporting.googleapis.com/v1beta1/\{projectName}/events:report?key=123ABC456

Note: Error Reporting is a service built on Cloud Logging and can analyze log entries when all of the following are true:

  • Customer-managed encryption keys (CMEK) are disabled on the log bucket.
  • The log bucket satisfies one of the following:
    • The log bucket is stored in the same project where the logs originated.
    • The logs were routed to a project, and then that project stored those logs in a log bucket that it owns.
Overloads
def report_error_event(request, options = nil) -> ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse
Pass arguments to report_error_event via a request object, either of type Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventRequest, ::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 report_error_event(project_name: nil, event: nil) -> ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse
Pass arguments to report_error_event 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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/error_reporting/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventRequest.new

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

# The returned object is of type Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse.
p result

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)