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.
- (config) — Configure the Client client.
- config (Client::Configuration)
# 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#initialize
def initialize() { |config| ... } -> Client
Create a new ReportErrorsService REST client object.
- (config) — Configure the ReportErrorsService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# 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
#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.
def report_error_event(request, options = nil) -> ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse
report_error_event
via a request object, either of type
Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventRequest or an equivalent Hash.
- 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
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).
-
project_name (::String) — Required. The resource name of the Google Cloud Platform project. Written
as
projects/{projectId}
, where{projectId}
is the Google Cloud Platform project ID.Example: //
projects/my-project-123
. - event (::Google::Cloud::ErrorReporting::V1beta1::ReportedErrorEvent, ::Hash) — Required. The error event to be reported.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
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
- (String)