Reference documentation and code samples for the Cloud Error Reporting V1beta1 API class Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client.
Client for the ErrorStatsService service.
An API for retrieving and managing error statistics as well as data for individual events.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the ErrorStatsService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all ErrorStatsService clients ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the ErrorStatsService 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)
#delete_events
def delete_events(request, options = nil) -> ::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse
def delete_events(project_name: nil) -> ::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse
Deletes all error events of a given project.
def delete_events(request, options = nil) -> ::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse
delete_events
via a request object, either of type
DeleteEventsRequest or an equivalent Hash.
- request (::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsRequest, ::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_events(project_name: nil) -> ::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse
delete_events
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
.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC 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::ErrorStatsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::ErrorReporting::V1beta1::DeleteEventsRequest.new # Call the delete_events method. result = client.delete_events request # The returned object is of type Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new ErrorStatsService client object.
- (config) — Configure the ErrorStatsService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client.new do |config| config.timeout = 10.0 end
#list_events
def list_events(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorEvent>
def list_events(project_name: nil, group_id: nil, service_filter: nil, time_range: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorEvent>
Lists the specified events.
def list_events(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorEvent>
list_events
via a request object, either of type
ListEventsRequest or an equivalent Hash.
- request (::Google::Cloud::ErrorReporting::V1beta1::ListEventsRequest, ::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_events(project_name: nil, group_id: nil, service_filter: nil, time_range: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorEvent>
list_events
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
. - group_id (::String) — Required. The group for which events shall be returned.
- service_filter (::Google::Cloud::ErrorReporting::V1beta1::ServiceContextFilter, ::Hash) — Optional. List only ErrorGroups which belong to a service context that matches the filter. Data for all service contexts is returned if this field is not specified.
- time_range (::Google::Cloud::ErrorReporting::V1beta1::QueryTimeRange, ::Hash) — Optional. List only data for the given time range. If not set a default time range is used. The field time_range_begin in the response will specify the beginning of this time range.
- page_size (::Integer) — Optional. The maximum number of results to return per response.
-
page_token (::String) — Optional. A
next_page_token
provided by a previous response.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorEvent>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorEvent>)
- (::Google::Cloud::Error) — if the RPC 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::ErrorStatsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::ErrorReporting::V1beta1::ListEventsRequest.new # Call the list_events method. result = client.list_events 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::ErrorReporting::V1beta1::ErrorEvent. p response end
#list_group_stats
def list_group_stats(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupStats>
def list_group_stats(project_name: nil, group_id: nil, service_filter: nil, time_range: nil, timed_count_duration: nil, alignment: nil, alignment_time: nil, order: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupStats>
Lists the specified groups.
def list_group_stats(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupStats>
list_group_stats
via a request object, either of type
ListGroupStatsRequest or an equivalent Hash.
- request (::Google::Cloud::ErrorReporting::V1beta1::ListGroupStatsRequest, ::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_group_stats(project_name: nil, group_id: nil, service_filter: nil, time_range: nil, timed_count_duration: nil, alignment: nil, alignment_time: nil, order: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupStats>
list_group_stats
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}
orprojects/{projectNumber}
, where{projectID}
and{projectNumber}
can be found in the Google Cloud Console.Examples:
projects/my-project-123
,projects/5551234
. -
group_id (::Array<::String>) — Optional. List all
ErrorGroupStats
with these IDs. -
service_filter (::Google::Cloud::ErrorReporting::V1beta1::ServiceContextFilter, ::Hash) — Optional. List only
ErrorGroupStats
which belong to a service context that matches the filter. Data for all service contexts is returned if this field is not specified. -
time_range (::Google::Cloud::ErrorReporting::V1beta1::QueryTimeRange, ::Hash) — Optional. List data for the given time range.
If not set, a default time range is used. The field
time_range_begin
in the response will specify the beginning of this time range. OnlyErrorGroupStats
with a non-zero count in the given time range are returned, unless the request contains an explicitgroup_id
list. If agroup_id
list is given, alsoErrorGroupStats
with zero occurrences are returned. -
timed_count_duration (::Google::Protobuf::Duration, ::Hash) — Optional. The preferred duration for a single returned
TimedCount
. If not set, no timed counts are returned. -
alignment (::Google::Cloud::ErrorReporting::V1beta1::TimedCountAlignment) — Optional. The alignment of the timed counts to be returned.
Default is
ALIGNMENT_EQUAL_AT_END
. - alignment_time (::Google::Protobuf::Timestamp, ::Hash) — Optional. Time where the timed counts shall be aligned if rounded alignment is chosen. Default is 00:00 UTC.
-
order (::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupOrder) — Optional. The sort order in which the results are returned.
Default is
COUNT_DESC
. - page_size (::Integer) — Optional. The maximum number of results to return per response. Default is 20.
-
page_token (::String) — Optional. A
next_page_token
provided by a previous response. To view additional results, pass this token along with the identical query parameters as the first request.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupStats>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupStats>)
- (::Google::Cloud::Error) — if the RPC 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::ErrorStatsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::ErrorReporting::V1beta1::ListGroupStatsRequest.new # Call the list_group_stats method. result = client.list_group_stats 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::ErrorReporting::V1beta1::ErrorGroupStats. p response end