google-cloud-debugger 0.35.2 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +2 -1
  3. data/CHANGELOG.md +47 -0
  4. data/OVERVIEW.md +28 -59
  5. data/TROUBLESHOOTING.md +2 -8
  6. data/ext/google/cloud/debugger/debugger_c/tracer.c +8 -33
  7. data/lib/google-cloud-debugger.rb +13 -15
  8. data/lib/google/cloud/debugger.rb +18 -16
  9. data/lib/google/cloud/debugger/breakpoint.rb +8 -8
  10. data/lib/google/cloud/debugger/breakpoint/evaluator.rb +1 -1
  11. data/lib/google/cloud/debugger/breakpoint/source_location.rb +3 -3
  12. data/lib/google/cloud/debugger/breakpoint/stack_frame.rb +5 -5
  13. data/lib/google/cloud/debugger/breakpoint/status_message.rb +4 -6
  14. data/lib/google/cloud/debugger/breakpoint/variable.rb +5 -5
  15. data/lib/google/cloud/debugger/credentials.rb +9 -6
  16. data/lib/google/cloud/debugger/debuggee.rb +4 -4
  17. data/lib/google/cloud/debugger/service.rb +25 -66
  18. data/lib/google/cloud/debugger/version.rb +1 -1
  19. metadata +12 -70
  20. data/lib/google/cloud/debugger/v2.rb +0 -243
  21. data/lib/google/cloud/debugger/v2/controller2_client.rb +0 -370
  22. data/lib/google/cloud/debugger/v2/controller2_client_config.json +0 -41
  23. data/lib/google/cloud/debugger/v2/credentials.rb +0 -42
  24. data/lib/google/cloud/debugger/v2/debugger2_client.rb +0 -478
  25. data/lib/google/cloud/debugger/v2/debugger2_client_config.json +0 -51
  26. data/lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/controller.rb +0 -91
  27. data/lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/data.rb +0 -443
  28. data/lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/debugger.rb +0 -151
  29. data/lib/google/cloud/debugger/v2/doc/google/devtools/source/v1/source_context.rb +0 -162
  30. data/lib/google/cloud/debugger/v2/doc/google/protobuf/empty.rb +0 -29
  31. data/lib/google/cloud/debugger/v2/doc/google/protobuf/timestamp.rb +0 -113
  32. data/lib/google/devtools/clouddebugger/v2/controller_pb.rb +0 -50
  33. data/lib/google/devtools/clouddebugger/v2/controller_services_pb.rb +0 -98
  34. data/lib/google/devtools/clouddebugger/v2/data_pb.rb +0 -108
  35. data/lib/google/devtools/clouddebugger/v2/debugger_pb.rb +0 -77
  36. data/lib/google/devtools/clouddebugger/v2/debugger_services_pb.rb +0 -66
  37. data/lib/google/devtools/source/v1/source_context_pb.rb +0 -90
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Debugger
19
- VERSION = "0.35.2".freeze
19
+ VERSION = "0.40.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-debugger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.35.2
4
+ version: 0.40.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heng Xiong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-23 00:00:00.000000000 Z
11
+ date: 2020-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: binding_of_caller
@@ -30,80 +30,40 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.2'
33
+ version: '1.5'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.2'
40
+ version: '1.5'
41
41
  - !ruby/object:Gem::Dependency
42
- name: google-cloud-logging
42
+ name: google-cloud-debugger-v2
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.0'
47
+ version: '0.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.0'
54
+ version: '0.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: google-gax
56
+ name: google-cloud-logging
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.8'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '1.8'
69
- - !ruby/object:Gem::Dependency
70
- name: googleapis-common-protos
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: 1.3.9
76
- - - "<"
77
- - !ruby/object:Gem::Version
78
- version: '2.0'
79
- type: :runtime
80
- prerelease: false
81
- version_requirements: !ruby/object:Gem::Requirement
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- version: 1.3.9
86
- - - "<"
87
- - !ruby/object:Gem::Version
88
- version: '2.0'
89
- - !ruby/object:Gem::Dependency
90
- name: googleapis-common-protos-types
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- version: 1.0.4
96
- - - "<"
97
60
  - !ruby/object:Gem::Version
98
61
  version: '2.0'
99
62
  type: :runtime
100
63
  prerelease: false
101
64
  version_requirements: !ruby/object:Gem::Requirement
102
65
  requirements:
103
- - - ">="
104
- - !ruby/object:Gem::Version
105
- version: 1.0.4
106
- - - "<"
66
+ - - "~>"
107
67
  - !ruby/object:Gem::Version
108
68
  version: '2.0'
109
69
  - !ruby/object:Gem::Dependency
@@ -154,14 +114,14 @@ dependencies:
154
114
  requirements:
155
115
  - - "~>"
156
116
  - !ruby/object:Gem::Version
157
- version: '5.10'
117
+ version: '5.14'
158
118
  type: :development
159
119
  prerelease: false
160
120
  version_requirements: !ruby/object:Gem::Requirement
161
121
  requirements:
162
122
  - - "~>"
163
123
  - !ruby/object:Gem::Version
164
- version: '5.10'
124
+ version: '5.14'
165
125
  - !ruby/object:Gem::Dependency
166
126
  name: minitest-autotest
167
127
  requirement: !ruby/object:Gem::Requirement
@@ -366,25 +326,7 @@ files:
366
326
  - lib/google/cloud/debugger/snappoint.rb
367
327
  - lib/google/cloud/debugger/tracer.rb
368
328
  - lib/google/cloud/debugger/transmitter.rb
369
- - lib/google/cloud/debugger/v2.rb
370
- - lib/google/cloud/debugger/v2/controller2_client.rb
371
- - lib/google/cloud/debugger/v2/controller2_client_config.json
372
- - lib/google/cloud/debugger/v2/credentials.rb
373
- - lib/google/cloud/debugger/v2/debugger2_client.rb
374
- - lib/google/cloud/debugger/v2/debugger2_client_config.json
375
- - lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/controller.rb
376
- - lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/data.rb
377
- - lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/debugger.rb
378
- - lib/google/cloud/debugger/v2/doc/google/devtools/source/v1/source_context.rb
379
- - lib/google/cloud/debugger/v2/doc/google/protobuf/empty.rb
380
- - lib/google/cloud/debugger/v2/doc/google/protobuf/timestamp.rb
381
329
  - lib/google/cloud/debugger/version.rb
382
- - lib/google/devtools/clouddebugger/v2/controller_pb.rb
383
- - lib/google/devtools/clouddebugger/v2/controller_services_pb.rb
384
- - lib/google/devtools/clouddebugger/v2/data_pb.rb
385
- - lib/google/devtools/clouddebugger/v2/debugger_pb.rb
386
- - lib/google/devtools/clouddebugger/v2/debugger_services_pb.rb
387
- - lib/google/devtools/source/v1/source_context_pb.rb
388
330
  homepage: https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-debugger
389
331
  licenses:
390
332
  - Apache-2.0
@@ -404,7 +346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
404
346
  - !ruby/object:Gem::Version
405
347
  version: '0'
406
348
  requirements: []
407
- rubygems_version: 3.0.6
349
+ rubygems_version: 3.1.3
408
350
  signing_key:
409
351
  specification_version: 4
410
352
  summary: API Client and instrumentation library for Stackdriver Debugger
@@ -1,243 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "google/cloud/debugger/v2/debugger2_client"
17
- require "google/cloud/debugger/v2/controller2_client"
18
-
19
- module Google
20
- module Cloud
21
- module Debugger
22
- # rubocop:disable LineLength
23
-
24
- ##
25
- # # Ruby Client for Stackdriver Debugger API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
26
- #
27
- # [Stackdriver Debugger API][Product Documentation]:
28
- # Examines the call stack and variables of a running application without
29
- # stopping or slowing it down.
30
- # - [Product Documentation][]
31
- #
32
- # ## Quick Start
33
- # In order to use this library, you first need to go through the following
34
- # steps:
35
- #
36
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
37
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
38
- # 3. [Enable the Stackdriver Debugger API.](https://console.cloud.google.com/apis/library/clouddebugger.googleapis.com)
39
- # 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-debugger/latest/file.AUTHENTICATION.html)
40
- #
41
- # ### Installation
42
- # ```
43
- # $ gem install google-cloud-debugger
44
- # ```
45
- #
46
- # ### Next Steps
47
- # - Read the [Stackdriver Debugger API Product documentation][Product Documentation]
48
- # to learn more about the product and see How-to Guides.
49
- # - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
50
- # to see the full list of Cloud APIs that we cover.
51
- #
52
- # [Product Documentation]: https://cloud.google.com/debugger
53
- #
54
- # ## Enabling Logging
55
- #
56
- # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
57
- # The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
58
- # or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
59
- # that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
60
- # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
61
- #
62
- # Configuring a Ruby stdlib logger:
63
- #
64
- # ```ruby
65
- # require "logger"
66
- #
67
- # module MyLogger
68
- # LOGGER = Logger.new $stderr, level: Logger::WARN
69
- # def logger
70
- # LOGGER
71
- # end
72
- # end
73
- #
74
- # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
75
- # module GRPC
76
- # extend MyLogger
77
- # end
78
- # ```
79
- #
80
- module V2
81
- # rubocop:enable LineLength
82
-
83
- module Debugger2
84
- ##
85
- # The Debugger service provides the API that allows users to collect run-time
86
- # information from a running application, without stopping or slowing it down
87
- # and without modifying its state. An application may include one or
88
- # more replicated processes performing the same work.
89
- #
90
- # A debugged application is represented using the Debuggee concept. The
91
- # Debugger service provides a way to query for available debuggees, but does
92
- # not provide a way to create one. A debuggee is created using the Controller
93
- # service, usually by running a debugger agent with the application.
94
- #
95
- # The Debugger service enables the client to set one or more Breakpoints on a
96
- # Debuggee and collect the results of the set Breakpoints.
97
- #
98
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
99
- # Provides the means for authenticating requests made by the client. This parameter can
100
- # be many types.
101
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
102
- # authenticating requests made by this client.
103
- # A `String` will be treated as the path to the keyfile to be used for the construction of
104
- # credentials for this client.
105
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
106
- # credentials for this client.
107
- # A `GRPC::Core::Channel` will be used to make calls through.
108
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
109
- # should already be composed with a `GRPC::Core::CallCredentials` object.
110
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
111
- # metadata for requests, generally, to give OAuth credentials.
112
- # @param scopes [Array<String>]
113
- # The OAuth scopes for this service. This parameter is ignored if
114
- # an updater_proc is supplied.
115
- # @param client_config [Hash]
116
- # A Hash for call options for each method. See
117
- # Google::Gax#construct_settings for the structure of
118
- # this data. Falls back to the default config if not specified
119
- # or the specified config is missing data points.
120
- # @param timeout [Numeric]
121
- # The default timeout, in seconds, for calls made through this client.
122
- # @param metadata [Hash]
123
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
124
- # @param service_address [String]
125
- # Override for the service hostname, or `nil` to leave as the default.
126
- # @param service_port [Integer]
127
- # Override for the service port, or `nil` to leave as the default.
128
- # @param exception_transformer [Proc]
129
- # An optional proc that intercepts any exceptions raised during an API call to inject
130
- # custom error handling.
131
- def self.new \
132
- credentials: nil,
133
- scopes: nil,
134
- client_config: nil,
135
- timeout: nil,
136
- metadata: nil,
137
- service_address: nil,
138
- service_port: nil,
139
- exception_transformer: nil,
140
- lib_name: nil,
141
- lib_version: nil
142
- kwargs = {
143
- credentials: credentials,
144
- scopes: scopes,
145
- client_config: client_config,
146
- timeout: timeout,
147
- metadata: metadata,
148
- exception_transformer: exception_transformer,
149
- lib_name: lib_name,
150
- service_address: service_address,
151
- service_port: service_port,
152
- lib_version: lib_version
153
- }.select { |_, v| v != nil }
154
- Google::Cloud::Debugger::V2::Debugger2Client.new(**kwargs)
155
- end
156
- end
157
-
158
- module Controller2
159
- ##
160
- # The Controller service provides the API for orchestrating a collection of
161
- # debugger agents to perform debugging tasks. These agents are each attached
162
- # to a process of an application which may include one or more replicas.
163
- #
164
- # The debugger agents register with the Controller to identify the application
165
- # being debugged, the Debuggee. All agents that register with the same data,
166
- # represent the same Debuggee, and are assigned the same `debuggee_id`.
167
- #
168
- # The debugger agents call the Controller to retrieve the list of active
169
- # Breakpoints. Agents with the same `debuggee_id` get the same breakpoints
170
- # list. An agent that can fulfill the breakpoint request updates the
171
- # Controller with the breakpoint result. The controller selects the first
172
- # result received and discards the rest of the results.
173
- # Agents that poll again for active breakpoints will no longer have
174
- # the completed breakpoint in the list and should remove that breakpoint from
175
- # their attached process.
176
- #
177
- # The Controller service does not provide a way to retrieve the results of
178
- # a completed breakpoint. This functionality is available using the Debugger
179
- # service.
180
- #
181
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
182
- # Provides the means for authenticating requests made by the client. This parameter can
183
- # be many types.
184
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
185
- # authenticating requests made by this client.
186
- # A `String` will be treated as the path to the keyfile to be used for the construction of
187
- # credentials for this client.
188
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
189
- # credentials for this client.
190
- # A `GRPC::Core::Channel` will be used to make calls through.
191
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
192
- # should already be composed with a `GRPC::Core::CallCredentials` object.
193
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
194
- # metadata for requests, generally, to give OAuth credentials.
195
- # @param scopes [Array<String>]
196
- # The OAuth scopes for this service. This parameter is ignored if
197
- # an updater_proc is supplied.
198
- # @param client_config [Hash]
199
- # A Hash for call options for each method. See
200
- # Google::Gax#construct_settings for the structure of
201
- # this data. Falls back to the default config if not specified
202
- # or the specified config is missing data points.
203
- # @param timeout [Numeric]
204
- # The default timeout, in seconds, for calls made through this client.
205
- # @param metadata [Hash]
206
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
207
- # @param service_address [String]
208
- # Override for the service hostname, or `nil` to leave as the default.
209
- # @param service_port [Integer]
210
- # Override for the service port, or `nil` to leave as the default.
211
- # @param exception_transformer [Proc]
212
- # An optional proc that intercepts any exceptions raised during an API call to inject
213
- # custom error handling.
214
- def self.new \
215
- credentials: nil,
216
- scopes: nil,
217
- client_config: nil,
218
- timeout: nil,
219
- metadata: nil,
220
- service_address: nil,
221
- service_port: nil,
222
- exception_transformer: nil,
223
- lib_name: nil,
224
- lib_version: nil
225
- kwargs = {
226
- credentials: credentials,
227
- scopes: scopes,
228
- client_config: client_config,
229
- timeout: timeout,
230
- metadata: metadata,
231
- exception_transformer: exception_transformer,
232
- lib_name: lib_name,
233
- service_address: service_address,
234
- service_port: service_port,
235
- lib_version: lib_version
236
- }.select { |_, v| v != nil }
237
- Google::Cloud::Debugger::V2::Controller2Client.new(**kwargs)
238
- end
239
- end
240
- end
241
- end
242
- end
243
- end
@@ -1,370 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- #
15
- # EDITING INSTRUCTIONS
16
- # This file was generated from the file
17
- # https://github.com/googleapis/googleapis/blob/master/google/devtools/clouddebugger/v2/controller.proto,
18
- # and updates to that file get reflected here through a refresh process.
19
- # For the short term, the refresh process will only be runnable by Google
20
- # engineers.
21
-
22
-
23
- require "json"
24
- require "pathname"
25
-
26
- require "google/gax"
27
-
28
- require "google/devtools/clouddebugger/v2/controller_pb"
29
- require "google/cloud/debugger/v2/credentials"
30
- require "google/cloud/debugger/version"
31
-
32
- module Google
33
- module Cloud
34
- module Debugger
35
- module V2
36
- # The Controller service provides the API for orchestrating a collection of
37
- # debugger agents to perform debugging tasks. These agents are each attached
38
- # to a process of an application which may include one or more replicas.
39
- #
40
- # The debugger agents register with the Controller to identify the application
41
- # being debugged, the Debuggee. All agents that register with the same data,
42
- # represent the same Debuggee, and are assigned the same `debuggee_id`.
43
- #
44
- # The debugger agents call the Controller to retrieve the list of active
45
- # Breakpoints. Agents with the same `debuggee_id` get the same breakpoints
46
- # list. An agent that can fulfill the breakpoint request updates the
47
- # Controller with the breakpoint result. The controller selects the first
48
- # result received and discards the rest of the results.
49
- # Agents that poll again for active breakpoints will no longer have
50
- # the completed breakpoint in the list and should remove that breakpoint from
51
- # their attached process.
52
- #
53
- # The Controller service does not provide a way to retrieve the results of
54
- # a completed breakpoint. This functionality is available using the Debugger
55
- # service.
56
- #
57
- # @!attribute [r] controller2_stub
58
- # @return [Google::Devtools::Clouddebugger::V2::Controller2::Stub]
59
- class Controller2Client
60
- # @private
61
- attr_reader :controller2_stub
62
-
63
- # The default address of the service.
64
- SERVICE_ADDRESS = "clouddebugger.googleapis.com".freeze
65
-
66
- # The default port of the service.
67
- DEFAULT_SERVICE_PORT = 443
68
-
69
- # The default set of gRPC interceptors.
70
- GRPC_INTERCEPTORS = []
71
-
72
- DEFAULT_TIMEOUT = 30
73
-
74
- # The scopes needed to make gRPC calls to all of the methods defined in
75
- # this service.
76
- ALL_SCOPES = [
77
- "https://www.googleapis.com/auth/cloud-platform",
78
- "https://www.googleapis.com/auth/cloud_debugger"
79
- ].freeze
80
-
81
-
82
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
83
- # Provides the means for authenticating requests made by the client. This parameter can
84
- # be many types.
85
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
86
- # authenticating requests made by this client.
87
- # A `String` will be treated as the path to the keyfile to be used for the construction of
88
- # credentials for this client.
89
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
90
- # credentials for this client.
91
- # A `GRPC::Core::Channel` will be used to make calls through.
92
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
93
- # should already be composed with a `GRPC::Core::CallCredentials` object.
94
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
95
- # metadata for requests, generally, to give OAuth credentials.
96
- # @param scopes [Array<String>]
97
- # The OAuth scopes for this service. This parameter is ignored if
98
- # an updater_proc is supplied.
99
- # @param client_config [Hash]
100
- # A Hash for call options for each method. See
101
- # Google::Gax#construct_settings for the structure of
102
- # this data. Falls back to the default config if not specified
103
- # or the specified config is missing data points.
104
- # @param timeout [Numeric]
105
- # The default timeout, in seconds, for calls made through this client.
106
- # @param metadata [Hash]
107
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
108
- # @param service_address [String]
109
- # Override for the service hostname, or `nil` to leave as the default.
110
- # @param service_port [Integer]
111
- # Override for the service port, or `nil` to leave as the default.
112
- # @param exception_transformer [Proc]
113
- # An optional proc that intercepts any exceptions raised during an API call to inject
114
- # custom error handling.
115
- def initialize \
116
- credentials: nil,
117
- scopes: ALL_SCOPES,
118
- client_config: {},
119
- timeout: DEFAULT_TIMEOUT,
120
- metadata: nil,
121
- service_address: nil,
122
- service_port: nil,
123
- exception_transformer: nil,
124
- lib_name: nil,
125
- lib_version: ""
126
- # These require statements are intentionally placed here to initialize
127
- # the gRPC module only when it's required.
128
- # See https://github.com/googleapis/toolkit/issues/446
129
- require "google/gax/grpc"
130
- require "google/devtools/clouddebugger/v2/controller_services_pb"
131
-
132
- credentials ||= Google::Cloud::Debugger::V2::Credentials.default
133
-
134
- if credentials.is_a?(String) || credentials.is_a?(Hash)
135
- updater_proc = Google::Cloud::Debugger::V2::Credentials.new(credentials).updater_proc
136
- end
137
- if credentials.is_a?(GRPC::Core::Channel)
138
- channel = credentials
139
- end
140
- if credentials.is_a?(GRPC::Core::ChannelCredentials)
141
- chan_creds = credentials
142
- end
143
- if credentials.is_a?(Proc)
144
- updater_proc = credentials
145
- end
146
- if credentials.is_a?(Google::Auth::Credentials)
147
- updater_proc = credentials.updater_proc
148
- end
149
-
150
- package_version = Google::Cloud::Debugger::VERSION
151
-
152
- google_api_client = "gl-ruby/#{RUBY_VERSION}"
153
- google_api_client << " #{lib_name}/#{lib_version}" if lib_name
154
- google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
155
- google_api_client << " grpc/#{GRPC::VERSION}"
156
- google_api_client.freeze
157
-
158
- headers = { :"x-goog-api-client" => google_api_client }
159
- headers.merge!(metadata) unless metadata.nil?
160
- client_config_file = Pathname.new(__dir__).join(
161
- "controller2_client_config.json"
162
- )
163
- defaults = client_config_file.open do |f|
164
- Google::Gax.construct_settings(
165
- "google.devtools.clouddebugger.v2.Controller2",
166
- JSON.parse(f.read),
167
- client_config,
168
- Google::Gax::Grpc::STATUS_CODE_NAMES,
169
- timeout,
170
- errors: Google::Gax::Grpc::API_ERRORS,
171
- metadata: headers
172
- )
173
- end
174
-
175
- # Allow overriding the service path/port in subclasses.
176
- service_path = service_address || self.class::SERVICE_ADDRESS
177
- port = service_port || self.class::DEFAULT_SERVICE_PORT
178
- interceptors = self.class::GRPC_INTERCEPTORS
179
- @controller2_stub = Google::Gax::Grpc.create_stub(
180
- service_path,
181
- port,
182
- chan_creds: chan_creds,
183
- channel: channel,
184
- updater_proc: updater_proc,
185
- scopes: scopes,
186
- interceptors: interceptors,
187
- &Google::Devtools::Clouddebugger::V2::Controller2::Stub.method(:new)
188
- )
189
-
190
- @update_active_breakpoint = Google::Gax.create_api_call(
191
- @controller2_stub.method(:update_active_breakpoint),
192
- defaults["update_active_breakpoint"],
193
- exception_transformer: exception_transformer
194
- )
195
- @register_debuggee = Google::Gax.create_api_call(
196
- @controller2_stub.method(:register_debuggee),
197
- defaults["register_debuggee"],
198
- exception_transformer: exception_transformer
199
- )
200
- @list_active_breakpoints = Google::Gax.create_api_call(
201
- @controller2_stub.method(:list_active_breakpoints),
202
- defaults["list_active_breakpoints"],
203
- exception_transformer: exception_transformer,
204
- params_extractor: proc do |request|
205
- {'debuggee_id' => request.debuggee_id}
206
- end
207
- )
208
- end
209
-
210
- # Service calls
211
-
212
- # Updates the breakpoint state or mutable fields.
213
- # The entire Breakpoint message must be sent back to the controller service.
214
- #
215
- # Updates to active breakpoint fields are only allowed if the new value
216
- # does not change the breakpoint specification. Updates to the `location`,
217
- # `condition` and `expressions` fields should not alter the breakpoint
218
- # semantics. These may only make changes such as canonicalizing a value
219
- # or snapping the location to the correct line of code.
220
- #
221
- # @param debuggee_id [String]
222
- # Required. Identifies the debuggee being debugged.
223
- # @param breakpoint [Google::Devtools::Clouddebugger::V2::Breakpoint | Hash]
224
- # Required. Updated breakpoint information.
225
- # The field `id` must be set.
226
- # The agent must echo all Breakpoint specification fields in the update.
227
- # A hash of the same form as `Google::Devtools::Clouddebugger::V2::Breakpoint`
228
- # can also be provided.
229
- # @param options [Google::Gax::CallOptions]
230
- # Overrides the default settings for this call, e.g, timeout,
231
- # retries, etc.
232
- # @yield [result, operation] Access the result along with the RPC operation
233
- # @yieldparam result [Google::Devtools::Clouddebugger::V2::UpdateActiveBreakpointResponse]
234
- # @yieldparam operation [GRPC::ActiveCall::Operation]
235
- # @return [Google::Devtools::Clouddebugger::V2::UpdateActiveBreakpointResponse]
236
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
237
- # @example
238
- # require "google/cloud/debugger/v2"
239
- #
240
- # controller2_client = Google::Cloud::Debugger::V2::Controller2.new
241
- #
242
- # # TODO: Initialize `debuggee_id`:
243
- # debuggee_id = ''
244
- #
245
- # # TODO: Initialize `breakpoint`:
246
- # breakpoint = {}
247
- # response = controller2_client.update_active_breakpoint(debuggee_id, breakpoint)
248
-
249
- def update_active_breakpoint \
250
- debuggee_id,
251
- breakpoint,
252
- options: nil,
253
- &block
254
- req = {
255
- debuggee_id: debuggee_id,
256
- breakpoint: breakpoint
257
- }.delete_if { |_, v| v.nil? }
258
- req = Google::Gax::to_proto(req, Google::Devtools::Clouddebugger::V2::UpdateActiveBreakpointRequest)
259
- @update_active_breakpoint.call(req, options, &block)
260
- end
261
-
262
- # Registers the debuggee with the controller service.
263
- #
264
- # All agents attached to the same application must call this method with
265
- # exactly the same request content to get back the same stable `debuggee_id`.
266
- # Agents should call this method again whenever `google.rpc.Code.NOT_FOUND`
267
- # is returned from any controller method.
268
- #
269
- # This protocol allows the controller service to disable debuggees, recover
270
- # from data loss, or change the `debuggee_id` format. Agents must handle
271
- # `debuggee_id` value changing upon re-registration.
272
- #
273
- # @param debuggee [Google::Devtools::Clouddebugger::V2::Debuggee | Hash]
274
- # Required. Debuggee information to register.
275
- # The fields `project`, `uniquifier`, `description` and `agent_version`
276
- # of the debuggee must be set.
277
- # A hash of the same form as `Google::Devtools::Clouddebugger::V2::Debuggee`
278
- # can also be provided.
279
- # @param options [Google::Gax::CallOptions]
280
- # Overrides the default settings for this call, e.g, timeout,
281
- # retries, etc.
282
- # @yield [result, operation] Access the result along with the RPC operation
283
- # @yieldparam result [Google::Devtools::Clouddebugger::V2::RegisterDebuggeeResponse]
284
- # @yieldparam operation [GRPC::ActiveCall::Operation]
285
- # @return [Google::Devtools::Clouddebugger::V2::RegisterDebuggeeResponse]
286
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
287
- # @example
288
- # require "google/cloud/debugger/v2"
289
- #
290
- # controller2_client = Google::Cloud::Debugger::V2::Controller2.new
291
- #
292
- # # TODO: Initialize `debuggee`:
293
- # debuggee = {}
294
- # response = controller2_client.register_debuggee(debuggee)
295
-
296
- def register_debuggee \
297
- debuggee,
298
- options: nil,
299
- &block
300
- req = {
301
- debuggee: debuggee
302
- }.delete_if { |_, v| v.nil? }
303
- req = Google::Gax::to_proto(req, Google::Devtools::Clouddebugger::V2::RegisterDebuggeeRequest)
304
- @register_debuggee.call(req, options, &block)
305
- end
306
-
307
- # Returns the list of all active breakpoints for the debuggee.
308
- #
309
- # The breakpoint specification (`location`, `condition`, and `expressions`
310
- # fields) is semantically immutable, although the field values may
311
- # change. For example, an agent may update the location line number
312
- # to reflect the actual line where the breakpoint was set, but this
313
- # doesn't change the breakpoint semantics.
314
- #
315
- # This means that an agent does not need to check if a breakpoint has changed
316
- # when it encounters the same breakpoint on a successive call.
317
- # Moreover, an agent should remember the breakpoints that are completed
318
- # until the controller removes them from the active list to avoid
319
- # setting those breakpoints again.
320
- #
321
- # @param debuggee_id [String]
322
- # Required. Identifies the debuggee.
323
- # @param wait_token [String]
324
- # A token that, if specified, blocks the method call until the list
325
- # of active breakpoints has changed, or a server-selected timeout has
326
- # expired. The value should be set from the `next_wait_token` field in
327
- # the last response. The initial value should be set to `"init"`.
328
- # @param success_on_timeout [true, false]
329
- # If set to `true` (recommended), returns `google.rpc.Code.OK` status and
330
- # sets the `wait_expired` response field to `true` when the server-selected
331
- # timeout has expired.
332
- #
333
- # If set to `false` (deprecated), returns `google.rpc.Code.ABORTED` status
334
- # when the server-selected timeout has expired.
335
- # @param options [Google::Gax::CallOptions]
336
- # Overrides the default settings for this call, e.g, timeout,
337
- # retries, etc.
338
- # @yield [result, operation] Access the result along with the RPC operation
339
- # @yieldparam result [Google::Devtools::Clouddebugger::V2::ListActiveBreakpointsResponse]
340
- # @yieldparam operation [GRPC::ActiveCall::Operation]
341
- # @return [Google::Devtools::Clouddebugger::V2::ListActiveBreakpointsResponse]
342
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
343
- # @example
344
- # require "google/cloud/debugger/v2"
345
- #
346
- # controller2_client = Google::Cloud::Debugger::V2::Controller2.new
347
- #
348
- # # TODO: Initialize `debuggee_id`:
349
- # debuggee_id = ''
350
- # response = controller2_client.list_active_breakpoints(debuggee_id)
351
-
352
- def list_active_breakpoints \
353
- debuggee_id,
354
- wait_token: nil,
355
- success_on_timeout: nil,
356
- options: nil,
357
- &block
358
- req = {
359
- debuggee_id: debuggee_id,
360
- wait_token: wait_token,
361
- success_on_timeout: success_on_timeout
362
- }.delete_if { |_, v| v.nil? }
363
- req = Google::Gax::to_proto(req, Google::Devtools::Clouddebugger::V2::ListActiveBreakpointsRequest)
364
- @list_active_breakpoints.call(req, options, &block)
365
- end
366
- end
367
- end
368
- end
369
- end
370
- end