google-cloud-debugger 0.36.3 → 0.40.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +2 -1
  3. data/CHANGELOG.md +23 -0
  4. data/OVERVIEW.md +28 -59
  5. data/lib/google-cloud-debugger.rb +13 -15
  6. data/lib/google/cloud/debugger.rb +18 -16
  7. data/lib/google/cloud/debugger/breakpoint.rb +8 -8
  8. data/lib/google/cloud/debugger/breakpoint/source_location.rb +3 -3
  9. data/lib/google/cloud/debugger/breakpoint/stack_frame.rb +5 -5
  10. data/lib/google/cloud/debugger/breakpoint/status_message.rb +4 -6
  11. data/lib/google/cloud/debugger/breakpoint/variable.rb +5 -5
  12. data/lib/google/cloud/debugger/credentials.rb +9 -6
  13. data/lib/google/cloud/debugger/debuggee.rb +4 -4
  14. data/lib/google/cloud/debugger/service.rb +25 -66
  15. data/lib/google/cloud/debugger/version.rb +1 -1
  16. metadata +9 -67
  17. data/lib/google/cloud/debugger/v2.rb +0 -243
  18. data/lib/google/cloud/debugger/v2/controller2_client.rb +0 -373
  19. data/lib/google/cloud/debugger/v2/controller2_client_config.json +0 -41
  20. data/lib/google/cloud/debugger/v2/credentials.rb +0 -42
  21. data/lib/google/cloud/debugger/v2/debugger2_client.rb +0 -481
  22. data/lib/google/cloud/debugger/v2/debugger2_client_config.json +0 -51
  23. data/lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/controller.rb +0 -91
  24. data/lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/data.rb +0 -443
  25. data/lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/debugger.rb +0 -151
  26. data/lib/google/cloud/debugger/v2/doc/google/devtools/source/v1/source_context.rb +0 -162
  27. data/lib/google/cloud/debugger/v2/doc/google/protobuf/empty.rb +0 -29
  28. data/lib/google/cloud/debugger/v2/doc/google/protobuf/timestamp.rb +0 -113
  29. data/lib/google/devtools/clouddebugger/v2/controller_pb.rb +0 -50
  30. data/lib/google/devtools/clouddebugger/v2/controller_services_pb.rb +0 -98
  31. data/lib/google/devtools/clouddebugger/v2/data_pb.rb +0 -108
  32. data/lib/google/devtools/clouddebugger/v2/debugger_pb.rb +0 -77
  33. data/lib/google/devtools/clouddebugger/v2/debugger_services_pb.rb +0 -66
  34. data/lib/google/devtools/source/v1/source_context_pb.rb +0 -90
@@ -55,7 +55,7 @@ module Google
55
55
 
56
56
  ##
57
57
  # @private New Google::Cloud::Debugger::Breakpoint::SourceLocation
58
- # from a Google::Devtools::Clouddebugger::V2::SourceLocation object.
58
+ # from a Google::Cloud::Debugger::V2::SourceLocation object.
59
59
  def self.from_grpc grpc
60
60
  new.tap do |o|
61
61
  o.function = grpc.function
@@ -76,10 +76,10 @@ module Google
76
76
 
77
77
  ##
78
78
  # @private Exports the StackFrame to a
79
- # Google::Devtools::Clouddebugger::V2::StackFrame object.
79
+ # Google::Cloud::Debugger::V2::StackFrame object.
80
80
  def to_grpc
81
81
  return nil if empty?
82
- Google::Devtools::Clouddebugger::V2::StackFrame.new(
82
+ Google::Cloud::Debugger::V2::StackFrame.new(
83
83
  function: function.to_s,
84
84
  location: location.to_grpc,
85
85
  arguments: arguments_to_grpc,
@@ -91,14 +91,14 @@ module Google
91
91
 
92
92
  ##
93
93
  # @private Exports the StackFrame arguments to an array of
94
- # Google::Devtools::Clouddebugger::V2::Variable objects.
94
+ # Google::Cloud::Debugger::V2::Variable objects.
95
95
  def arguments_to_grpc
96
96
  arguments.nil? ? [] : arguments.map(&:to_grpc)
97
97
  end
98
98
 
99
99
  ##
100
100
  # @private Exports the StackFrame locals to an array of
101
- # Google::Devtools::Clouddebugger::V2::Variable objects.
101
+ # Google::Cloud::Debugger::V2::Variable objects.
102
102
  def locals_to_grpc
103
103
  locals.nil? ? [] : locals.map(&:to_grpc)
104
104
  end
@@ -50,7 +50,7 @@ module Google
50
50
 
51
51
  ##
52
52
  # New Google::Cloud::Debugger::Breakpoint::StatusMessage
53
- # from a Google::Devtools::Clouddebugger::V2::StatusMessage object.
53
+ # from a Google::Cloud::Debugger::V2::StatusMessage object.
54
54
  def self.from_grpc grpc
55
55
  return nil if grpc.nil?
56
56
  new.tap do |s|
@@ -76,14 +76,12 @@ module Google
76
76
 
77
77
  ##
78
78
  # Exports the StatusMessage to a
79
- # Google::Devtools::Clouddebugger::V2::StatusMessage object.
79
+ # Google::Cloud::Debugger::V2::StatusMessage object.
80
80
  def to_grpc
81
81
  return nil if empty?
82
- description_grpc =
83
- Google::Devtools::Clouddebugger::V2::FormatMessage.new \
84
- format: description.to_s
82
+ description_grpc = Google::Cloud::Debugger::V2::FormatMessage.new format: description.to_s
85
83
 
86
- Google::Devtools::Clouddebugger::V2::StatusMessage.new \
84
+ Google::Cloud::Debugger::V2::StatusMessage.new \
87
85
  is_error: true,
88
86
  refers_to: refers_to,
89
87
  description: description_grpc
@@ -408,7 +408,7 @@ module Google
408
408
 
409
409
  ##
410
410
  # @private New Google::Cloud::Debugger::Breakpoint::Variable
411
- # from a Google::Devtools::Clouddebugger::V2::Variable object.
411
+ # from a Google::Cloud::Debugger::V2::Variable object.
412
412
  def self.from_grpc grpc
413
413
  return new if grpc.nil?
414
414
  new.tap do |o|
@@ -423,7 +423,7 @@ module Google
423
423
 
424
424
  ##
425
425
  # @private New array of Google::Cloud::Debugger::Breakpoint::Variable
426
- # from an array of Google::Devtools::Clouddebugger::V2::Variable
426
+ # from an array of Google::Cloud::Debugger::V2::Variable
427
427
  # objects.
428
428
  def self.from_grpc_list grpc_list
429
429
  return [] if grpc_list.nil?
@@ -458,10 +458,10 @@ module Google
458
458
 
459
459
  ##
460
460
  # Exports the Variable to a
461
- # Google::Devtools::Clouddebugger::V2::Variable object.
461
+ # Google::Cloud::Debugger::V2::Variable object.
462
462
  def to_grpc
463
463
  return nil if empty?
464
- Google::Devtools::Clouddebugger::V2::Variable.new(
464
+ Google::Cloud::Debugger::V2::Variable.new(
465
465
  name: name.to_s,
466
466
  value: value.to_s,
467
467
  type: type.to_s,
@@ -584,7 +584,7 @@ module Google
584
584
 
585
585
  ##
586
586
  # @private Exports the Variable members to an array of
587
- # Google::Devtools::Clouddebugger::V2::Variable objects.
587
+ # Google::Cloud::Debugger::V2::Variable objects.
588
588
  def members_to_grpc
589
589
  members.nil? ? nil : members.map(&:to_grpc)
590
590
  end
@@ -12,9 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
-
16
- require "google/cloud/debugger/v2/credentials"
17
- require "google/cloud/logging/credentials"
15
+ require "google/cloud/debugger/v2/debugger/credentials"
18
16
 
19
17
  module Google
20
18
  module Cloud
@@ -38,9 +36,14 @@ module Google
38
36
  #
39
37
  # debugger.project_id #=> "my-project"
40
38
  #
41
- class Credentials < Google::Cloud::Debugger::V2::Credentials
42
- SCOPE = (Google::Cloud::Debugger::V2::Credentials::SCOPE +
43
- Google::Cloud::Logging::Credentials::SCOPE).uniq.freeze
39
+ class Credentials < Google::Cloud::Debugger::V2::Debugger::Credentials
40
+ self.scope = [
41
+ "https://www.googleapis.com/auth/cloud-platform",
42
+ "https://www.googleapis.com/auth/cloud_debugger",
43
+ "https://www.googleapis.com/auth/logging.admin",
44
+ "https://www.googleapis.com/auth/logging.read",
45
+ "https://www.googleapis.com/auth/logging.write"
46
+ ]
44
47
  end
45
48
  end
46
49
  end
@@ -28,7 +28,7 @@ module Google
28
28
  #
29
29
  # Represent a debuggee application. Contains information that identifies
30
30
  # debuggee applications from each other. Maps to gRPC struct
31
- # {Google::Devtools::Clouddebugger::V2::Debuggee}.
31
+ # Google::Cloud::Debugger::V2::Debuggee.
32
32
  #
33
33
  # It also automatically loads source context information generated from
34
34
  # Cloud SDK. See [Stackdriver Debugger
@@ -111,10 +111,10 @@ module Google
111
111
 
112
112
  ##
113
113
  # Convert this debuggee into a gRPC
114
- # Google::Devtools::Clouddebugger::V2::Debuggee struct.
114
+ # Google::Cloud::Debugger::V2::Debuggee struct.
115
115
  def to_grpc
116
116
  source_context = source_context_from_json_file "source-context.json"
117
- Google::Devtools::Clouddebugger::V2::Debuggee.new(
117
+ Google::Cloud::Debugger::V2::Debuggee.new(
118
118
  id: id.to_s,
119
119
  project: project_id_for_request_arg.to_s,
120
120
  description: description.to_s,
@@ -179,7 +179,7 @@ module Google
179
179
  # project ID if available (and if it matches the project set in the
180
180
  # configuration). Otherwise, use the configured project.
181
181
  def project_id_for_request_arg
182
- if project_id == @env.project_id
182
+ if project_id == @env.lookup_metadata("project", "project-id")
183
183
  numeric_id = @env.numeric_project_id
184
184
  return numeric_id.to_s if numeric_id
185
185
  end
@@ -16,7 +16,6 @@
16
16
  require "google/cloud/errors"
17
17
  require "google/cloud/debugger/version"
18
18
  require "google/cloud/debugger/v2"
19
- require "google/gax/errors"
20
19
  require "uri"
21
20
 
22
21
  module Google
@@ -26,103 +25,63 @@ module Google
26
25
  # @private Represents the gRPC Debugger service, including all the API
27
26
  # methods.
28
27
  class Service
29
- attr_accessor :project, :credentials, :timeout, :client_config, :host
28
+ attr_accessor :project, :credentials, :timeout, :host
30
29
 
31
30
  ##
32
31
  # Creates a new Service instance.
33
- def initialize project, credentials, timeout: nil, client_config: nil,
34
- host: nil
32
+ def initialize project, credentials, timeout: nil, host: nil
35
33
  @project = project
36
34
  @credentials = credentials
37
35
  @timeout = timeout
38
- @client_config = client_config || {}
39
- @host = host || V2::Debugger2Client::SERVICE_ADDRESS
36
+ @host = host
40
37
  end
41
38
 
42
39
  def cloud_debugger
43
40
  return mocked_debugger if mocked_debugger
44
41
  @cloud_debugger ||=
45
- V2::Controller2Client.new(
46
- credentials: credentials,
47
- timeout: timeout,
48
- client_config: client_config,
49
- service_address: service_address,
50
- service_port: service_port,
51
- lib_name: "gccl",
52
- lib_version: Google::Cloud::Debugger::VERSION
53
- )
42
+ V2::Controller::Client.new do |config|
43
+ config.credentials = credentials if credentials
44
+ config.timeout = timeout if timeout
45
+ config.endpoint = host if host
46
+ config.lib_name = "gccl"
47
+ config.lib_version = Google::Cloud::Debugger::VERSION
48
+ config.metadata = { "google-cloud-resource-prefix" => "projects/#{@project}" }
49
+ end
54
50
  end
55
51
  attr_accessor :mocked_debugger
56
52
 
57
53
  def transmitter
58
54
  return mocked_transmitter if mocked_transmitter
59
55
  @transmitter ||=
60
- V2::Controller2Client.new(
61
- credentials: credentials,
62
- timeout: timeout,
63
- client_config: client_config,
64
- service_address: service_address,
65
- service_port: service_port,
66
- lib_name: "gccl",
67
- lib_version: Google::Cloud::Debugger::VERSION
68
- )
56
+ V2::Controller::Client.new do |config|
57
+ config.credentials = credentials if credentials
58
+ config.timeout = timeout if timeout
59
+ config.endpoint = host if host
60
+ config.lib_name = "gccl"
61
+ config.lib_version = Google::Cloud::Debugger::VERSION
62
+ config.metadata = { "google-cloud-resource-prefix" => "projects/#{@project}" }
63
+ end
69
64
  end
70
65
  attr_accessor :mocked_transmitter
71
66
 
72
67
  def register_debuggee debuggee_grpc
73
- execute do
74
- cloud_debugger.register_debuggee debuggee_grpc,
75
- options: default_options
76
- end
68
+ cloud_debugger.register_debuggee debuggee: debuggee_grpc
77
69
  end
78
70
 
79
71
  def list_active_breakpoints debuggee_id, wait_token
80
- execute do
81
- cloud_debugger.list_active_breakpoints debuggee_id.to_s,
82
- wait_token: wait_token.to_s,
83
- success_on_timeout: true,
84
- options: default_options
85
- end
72
+ cloud_debugger.list_active_breakpoints debuggee_id: debuggee_id.to_s,
73
+ wait_token: wait_token.to_s,
74
+ success_on_timeout: true
86
75
  end
87
76
 
88
77
  def update_active_breakpoint debuggee_id, breakpoint
89
- execute do
90
- transmitter.update_active_breakpoint debuggee_id.to_s,
91
- breakpoint.to_grpc,
92
- options: default_options
93
- end
78
+ transmitter.update_active_breakpoint debuggee_id: debuggee_id.to_s,
79
+ breakpoint: breakpoint.to_grpc
94
80
  end
95
81
 
96
82
  def inspect
97
83
  "#{self.class}(#{@project})"
98
84
  end
99
-
100
- protected
101
-
102
- def service_address
103
- return nil if host.nil?
104
- URI.parse("//#{host}").host
105
- end
106
-
107
- def service_port
108
- return nil if host.nil?
109
- URI.parse("//#{host}").port
110
- end
111
-
112
- def default_headers
113
- { "google-cloud-resource-prefix" => "projects/#{@project}" }
114
- end
115
-
116
- def default_options
117
- Google::Gax::CallOptions.new kwargs: default_headers
118
- end
119
-
120
- def execute
121
- yield
122
- rescue Google::Gax::GaxError => e
123
- # GaxError wraps BadStatus, but exposes it as #cause
124
- raise Google::Cloud::Error.from_error(e.cause)
125
- end
126
85
  end
127
86
  end
128
87
  end
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Debugger
19
- VERSION = "0.36.3".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.36.3
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-07-06 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
@@ -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
@@ -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
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