Skip to content

Commit bd3a3d1

Browse files
author
Song Wang
committed
Update to be the same as api-client-staging for errorreporting API
1 parent 11e7def commit bd3a3d1

21 files changed

Lines changed: 108 additions & 122 deletions
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Stackdriver Clouderrorreporting API for Ruby
2+
=================================================
3+
4+
google-cloud-error_reporting uses [Google API extensions][google-gax] to provide an
5+
easy-to-use client library for the [Stackdriver Clouderrorreporting API][] (v1beta1) defined in the [googleapis][] git repository
6+
7+
8+
[googleapis]: https://github.com/googleapis/googleapis/tree/master/google/google/devtools/clouderrorreporting/v1beta1
9+
[google-gax]: https://github.com/googleapis/gax-ruby
10+
[Stackdriver Clouderrorreporting API]: https://developers.google.com/apis-explorer/#p/clouderrorreporting/v1beta1/
11+
12+
Getting started
13+
---------------
14+
15+
google-cloud-error_reporting will allow you to connect to the [Stackdriver Clouderrorreporting API][] and access all its methods.
16+
17+
In order to achieve so you need to set up authentication as well as install the library locally.
18+
19+
20+
Setup Authentication
21+
--------------------
22+
23+
To authenticate all your API calls, first install and setup the [Google Cloud SDK][].
24+
Once done, you can then run the following command in your terminal:
25+
26+
$ gcloud beta auth application-default login
27+
28+
or
29+
30+
$ gcloud auth login
31+
32+
Please see [[gcloud beta auth application-default login][] document for the difference between these commands.
33+
34+
[Google Cloud SDK]: https://cloud.google.com/sdk/
35+
[gcloud beta auth application-default login]: https://cloud.google.com/sdk/gcloud/reference/beta/auth/application-default/login
36+
37+
38+
Installation
39+
-------------------
40+
41+
Install this library using gem:
42+
43+
$ [sudo] gem install google-cloud-error_reporting
44+
45+
At this point you are all set to continue.

google-cloud-errorreporting/google-cloud-clouderrorreporting-v1beta1.gemspec renamed to google-cloud-error_reporting/google-cloud-error_reporting.gemspec

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# encoding: utf-8
33

44
Gem::Specification.new do |s|
5-
s.name = 'google-cloud-clouderrorreporting-v1beta1'
5+
s.name = 'google-cloud-error_reporting'
66
s.version = '0.6.8'
77

88
s.authors = ['Google Inc']
@@ -16,13 +16,12 @@ Gem::Specification.new do |s|
1616
s.platform = Gem::Platform::RUBY
1717
s.require_paths = ['lib']
1818
s.required_ruby_version = '>= 2.0.0'
19-
s.requirements << 'libgrpc ~> 0.9.0 needs to be installed'
20-
s.summary = 'google-cloud-clouderrorreporting-v1beta1 is the official library for Stackdriver Error Reporting API'
19+
s.summary = 'Google client library for the Stackdriver Clouderrorreporting service'
2120

22-
s.add_dependency 'google-gax', '~> 0.4.4'
21+
s.add_dependency 'google-gax', '~> 0.5.1'
2322
s.add_dependency 'grpc', '~> 1.0'
2423
s.add_dependency 'googleauth', '~> 0.5.1'
25-
s.add_dependency 'googleapis-common-protos', '~> 1.2.0'
24+
s.add_dependency 'googleapis-common-protos', '~> 1.3.1'
2625

2726
s.add_development_dependency 'bundler', '~> 1.9'
2827
s.add_development_dependency 'rake', '~> 10.4'
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
# Copyright 2016 Google Inc. All rights reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
17+
require "google/cloud/error_reporting/v1beta1/error_group_service_api"
18+
require "google/cloud/error_reporting/v1beta1/error_stats_service_api"
19+
require "google/cloud/error_reporting/v1beta1/report_errors_service_api"

google-cloud-errorreporting/lib/google/cloud/errorreporting/v1beta1/error_group_service_api.rb renamed to google-cloud-error_reporting/lib/google/cloud/error_reporting/v1beta1/error_group_service_api.rb

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929

3030
module Google
3131
module Cloud
32-
module Errorreporting
32+
module ErrorReporting
3333
module V1beta1
3434
# Service for retrieving and updating individual error groups.
3535
#
36-
# @!attribute [r] stub
36+
# @!attribute [r] error_group_service_stub
3737
# @return [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroupService::Stub]
3838
class ErrorGroupServiceApi
39-
attr_reader :stub
39+
attr_reader :error_group_service_stub
4040

4141
# The default address of the service.
4242
SERVICE_ADDRESS = "clouderrorreporting.googleapis.com".freeze
@@ -121,7 +121,8 @@ def initialize \
121121
require "google/devtools/clouderrorreporting/v1beta1/error_group_service_services_pb"
122122

123123
google_api_client = "#{app_name}/#{app_version} " \
124-
"#{CODE_GEN_NAME_VERSION} ruby/#{RUBY_VERSION}".freeze
124+
"#{CODE_GEN_NAME_VERSION} gax/#{Google::Gax::VERSION} " \
125+
"ruby/#{RUBY_VERSION}".freeze
125126
headers = { :"x-goog-api-client" => google_api_client }
126127
client_config_file = Pathname.new(__dir__).join(
127128
"error_group_service_client_config.json"
@@ -137,7 +138,7 @@ def initialize \
137138
kwargs: headers
138139
)
139140
end
140-
@stub = Google::Gax::Grpc.create_stub(
141+
@error_group_service_stub = Google::Gax::Grpc.create_stub(
141142
service_path,
142143
port,
143144
chan_creds: chan_creds,
@@ -147,11 +148,11 @@ def initialize \
147148
)
148149

149150
@get_group = Google::Gax.create_api_call(
150-
@stub.method(:get_group),
151+
@error_group_service_stub.method(:get_group),
151152
defaults["get_group"]
152153
)
153154
@update_group = Google::Gax.create_api_call(
154-
@stub.method(:update_group),
155+
@error_group_service_stub.method(:update_group),
155156
defaults["update_group"]
156157
)
157158
end
@@ -175,9 +176,9 @@ def initialize \
175176
# @return [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup]
176177
# @raise [Google::Gax::GaxError] if the RPC is aborted.
177178
# @example
178-
# require "google/cloud/errorreporting/v1beta1/error_group_service_api"
179+
# require "google/cloud/error_reporting/v1beta1/error_group_service_api"
179180
#
180-
# ErrorGroupServiceApi = Google::Cloud::Errorreporting::V1beta1::ErrorGroupServiceApi
181+
# ErrorGroupServiceApi = Google::Cloud::ErrorReporting::V1beta1::ErrorGroupServiceApi
181182
#
182183
# error_group_service_api = ErrorGroupServiceApi.new
183184
# formatted_group_name = ErrorGroupServiceApi.group_path("[PROJECT]", "[GROUP]")
@@ -203,10 +204,10 @@ def get_group \
203204
# @return [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup]
204205
# @raise [Google::Gax::GaxError] if the RPC is aborted.
205206
# @example
206-
# require "google/cloud/errorreporting/v1beta1/error_group_service_api"
207+
# require "google/cloud/error_reporting/v1beta1/error_group_service_api"
207208
#
208209
# ErrorGroup = Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup
209-
# ErrorGroupServiceApi = Google::Cloud::Errorreporting::V1beta1::ErrorGroupServiceApi
210+
# ErrorGroupServiceApi = Google::Cloud::ErrorReporting::V1beta1::ErrorGroupServiceApi
210211
#
211212
# error_group_service_api = ErrorGroupServiceApi.new
212213
# group = ErrorGroup.new

google-cloud-errorreporting/lib/google/cloud/errorreporting/v1beta1/error_group_service_client_config.json renamed to google-cloud-error_reporting/lib/google/cloud/error_reporting/v1beta1/error_group_service_client_config.json

File renamed without changes.

google-cloud-errorreporting/lib/google/cloud/errorreporting/v1beta1/error_stats_service_api.rb renamed to google-cloud-error_reporting/lib/google/cloud/error_reporting/v1beta1/error_stats_service_api.rb

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929

3030
module Google
3131
module Cloud
32-
module Errorreporting
32+
module ErrorReporting
3333
module V1beta1
3434
# An API for retrieving and managing error statistics as well as data for
3535
# individual events.
3636
#
37-
# @!attribute [r] stub
37+
# @!attribute [r] error_stats_service_stub
3838
# @return [Google::Devtools::Clouderrorreporting::V1beta1::ErrorStatsService::Stub]
3939
class ErrorStatsServiceApi
40-
attr_reader :stub
40+
attr_reader :error_stats_service_stub
4141

4242
# The default address of the service.
4343
SERVICE_ADDRESS = "clouderrorreporting.googleapis.com".freeze
@@ -126,7 +126,8 @@ def initialize \
126126
require "google/devtools/clouderrorreporting/v1beta1/error_stats_service_services_pb"
127127

128128
google_api_client = "#{app_name}/#{app_version} " \
129-
"#{CODE_GEN_NAME_VERSION} ruby/#{RUBY_VERSION}".freeze
129+
"#{CODE_GEN_NAME_VERSION} gax/#{Google::Gax::VERSION} " \
130+
"ruby/#{RUBY_VERSION}".freeze
130131
headers = { :"x-goog-api-client" => google_api_client }
131132
client_config_file = Pathname.new(__dir__).join(
132133
"error_stats_service_client_config.json"
@@ -143,7 +144,7 @@ def initialize \
143144
kwargs: headers
144145
)
145146
end
146-
@stub = Google::Gax::Grpc.create_stub(
147+
@error_stats_service_stub = Google::Gax::Grpc.create_stub(
147148
service_path,
148149
port,
149150
chan_creds: chan_creds,
@@ -153,15 +154,15 @@ def initialize \
153154
)
154155

155156
@list_group_stats = Google::Gax.create_api_call(
156-
@stub.method(:list_group_stats),
157+
@error_stats_service_stub.method(:list_group_stats),
157158
defaults["list_group_stats"]
158159
)
159160
@list_events = Google::Gax.create_api_call(
160-
@stub.method(:list_events),
161+
@error_stats_service_stub.method(:list_events),
161162
defaults["list_events"]
162163
)
163164
@delete_events = Google::Gax.create_api_call(
164-
@stub.method(:delete_events),
165+
@error_stats_service_stub.method(:delete_events),
165166
defaults["delete_events"]
166167
)
167168
end
@@ -179,17 +180,16 @@ def initialize \
179180
# Example: <code>projects/my-project-123</code>.
180181
# @param group_id [Array<String>]
181182
# [Optional] List all <code>ErrorGroupStats</code> with these IDs.
182-
# If not specified, all error group stats with a non-zero error count
183-
# for the given selection criteria are returned.
184183
# @param service_filter [Google::Devtools::Clouderrorreporting::V1beta1::ServiceContextFilter]
185184
# [Optional] List only <code>ErrorGroupStats</code> which belong to a service
186185
# context that matches the filter.
187186
# Data for all service contexts is returned if this field is not specified.
188187
# @param time_range [Google::Devtools::Clouderrorreporting::V1beta1::QueryTimeRange]
189188
# [Required] List data for the given time range.
190-
# The service is tuned for retrieving data up to (approximately) 'now'.
191-
# Retrieving data for arbitrary time periods in the past can result in
192-
# higher response times or in returning incomplete results.
189+
# Only <code>ErrorGroupStats</code> with a non-zero count in the given time
190+
# range are returned, unless the request contains an explicit group_id list.
191+
# If a group_id list is given, also <code>ErrorGroupStats</code> with zero
192+
# occurrences are returned.
193193
# @param timed_count_duration [Google::Protobuf::Duration]
194194
# [Optional] The preferred duration for a single returned +TimedCount+.
195195
# If not set, no timed counts are returned.
@@ -218,9 +218,9 @@ def initialize \
218218
# object.
219219
# @raise [Google::Gax::GaxError] if the RPC is aborted.
220220
# @example
221-
# require "google/cloud/errorreporting/v1beta1/error_stats_service_api"
221+
# require "google/cloud/error_reporting/v1beta1/error_stats_service_api"
222222
#
223-
# ErrorStatsServiceApi = Google::Cloud::Errorreporting::V1beta1::ErrorStatsServiceApi
223+
# ErrorStatsServiceApi = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsServiceApi
224224
# QueryTimeRange = Google::Devtools::Clouderrorreporting::V1beta1::QueryTimeRange
225225
#
226226
# error_stats_service_api = ErrorStatsServiceApi.new
@@ -280,10 +280,6 @@ def list_group_stats \
280280
# Data for all service contexts is returned if this field is not specified.
281281
# @param time_range [Google::Devtools::Clouderrorreporting::V1beta1::QueryTimeRange]
282282
# [Optional] List only data for the given time range.
283-
# The service is tuned for retrieving data up to (approximately) 'now'.
284-
# Retrieving data for arbitrary time periods in the past can result in
285-
# higher response times or in returning incomplete results.
286-
# Data for the last hour until now is returned if not specified.
287283
# @param page_size [Integer]
288284
# The maximum number of resources contained in the underlying API
289285
# response. If page streaming is performed per-resource, this
@@ -300,9 +296,9 @@ def list_group_stats \
300296
# object.
301297
# @raise [Google::Gax::GaxError] if the RPC is aborted.
302298
# @example
303-
# require "google/cloud/errorreporting/v1beta1/error_stats_service_api"
299+
# require "google/cloud/error_reporting/v1beta1/error_stats_service_api"
304300
#
305-
# ErrorStatsServiceApi = Google::Cloud::Errorreporting::V1beta1::ErrorStatsServiceApi
301+
# ErrorStatsServiceApi = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsServiceApi
306302
#
307303
# error_stats_service_api = ErrorStatsServiceApi.new
308304
# formatted_project_name = ErrorStatsServiceApi.project_path("[PROJECT]")
@@ -351,9 +347,9 @@ def list_events \
351347
# @return [Google::Devtools::Clouderrorreporting::V1beta1::DeleteEventsResponse]
352348
# @raise [Google::Gax::GaxError] if the RPC is aborted.
353349
# @example
354-
# require "google/cloud/errorreporting/v1beta1/error_stats_service_api"
350+
# require "google/cloud/error_reporting/v1beta1/error_stats_service_api"
355351
#
356-
# ErrorStatsServiceApi = Google::Cloud::Errorreporting::V1beta1::ErrorStatsServiceApi
352+
# ErrorStatsServiceApi = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsServiceApi
357353
#
358354
# error_stats_service_api = ErrorStatsServiceApi.new
359355
# formatted_project_name = ErrorStatsServiceApi.project_path("[PROJECT]")

google-cloud-errorreporting/lib/google/cloud/errorreporting/v1beta1/error_stats_service_client_config.json renamed to google-cloud-error_reporting/lib/google/cloud/error_reporting/v1beta1/error_stats_service_client_config.json

File renamed without changes.

0 commit comments

Comments
 (0)