google-cloud-debugger-v2 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,226 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/devtools/clouddebugger/v2/controller_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Debugger
24
+ module V2
25
+ module Controller
26
+ module Rest
27
+ ##
28
+ # REST service stub for the Controller service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
39
+ numeric_enums: true,
40
+ raise_faraday_errors: false
41
+ end
42
+
43
+ ##
44
+ # Baseline implementation for the register_debuggee REST call
45
+ #
46
+ # @param request_pb [::Google::Cloud::Debugger::V2::RegisterDebuggeeRequest]
47
+ # A request object representing the call parameters. Required.
48
+ # @param options [::Gapic::CallOptions]
49
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
50
+ #
51
+ # @yield [result, operation] Access the result along with the TransportOperation object
52
+ # @yieldparam result [::Google::Cloud::Debugger::V2::RegisterDebuggeeResponse]
53
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
54
+ #
55
+ # @return [::Google::Cloud::Debugger::V2::RegisterDebuggeeResponse]
56
+ # A result object deserialized from the server's reply
57
+ def register_debuggee request_pb, options = nil
58
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
59
+
60
+ verb, uri, query_string_params, body = ServiceStub.transcode_register_debuggee_request request_pb
61
+ query_string_params = if query_string_params.any?
62
+ query_string_params.to_h { |p| p.split("=", 2) }
63
+ else
64
+ {}
65
+ end
66
+
67
+ response = @client_stub.make_http_request(
68
+ verb,
69
+ uri: uri,
70
+ body: body || "",
71
+ params: query_string_params,
72
+ options: options
73
+ )
74
+ operation = ::Gapic::Rest::TransportOperation.new response
75
+ result = ::Google::Cloud::Debugger::V2::RegisterDebuggeeResponse.decode_json response.body, ignore_unknown_fields: true
76
+
77
+ yield result, operation if block_given?
78
+ result
79
+ end
80
+
81
+ ##
82
+ # Baseline implementation for the list_active_breakpoints REST call
83
+ #
84
+ # @param request_pb [::Google::Cloud::Debugger::V2::ListActiveBreakpointsRequest]
85
+ # A request object representing the call parameters. Required.
86
+ # @param options [::Gapic::CallOptions]
87
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
88
+ #
89
+ # @yield [result, operation] Access the result along with the TransportOperation object
90
+ # @yieldparam result [::Google::Cloud::Debugger::V2::ListActiveBreakpointsResponse]
91
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
92
+ #
93
+ # @return [::Google::Cloud::Debugger::V2::ListActiveBreakpointsResponse]
94
+ # A result object deserialized from the server's reply
95
+ def list_active_breakpoints request_pb, options = nil
96
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
97
+
98
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_active_breakpoints_request request_pb
99
+ query_string_params = if query_string_params.any?
100
+ query_string_params.to_h { |p| p.split("=", 2) }
101
+ else
102
+ {}
103
+ end
104
+
105
+ response = @client_stub.make_http_request(
106
+ verb,
107
+ uri: uri,
108
+ body: body || "",
109
+ params: query_string_params,
110
+ options: options
111
+ )
112
+ operation = ::Gapic::Rest::TransportOperation.new response
113
+ result = ::Google::Cloud::Debugger::V2::ListActiveBreakpointsResponse.decode_json response.body, ignore_unknown_fields: true
114
+
115
+ yield result, operation if block_given?
116
+ result
117
+ end
118
+
119
+ ##
120
+ # Baseline implementation for the update_active_breakpoint REST call
121
+ #
122
+ # @param request_pb [::Google::Cloud::Debugger::V2::UpdateActiveBreakpointRequest]
123
+ # A request object representing the call parameters. Required.
124
+ # @param options [::Gapic::CallOptions]
125
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
126
+ #
127
+ # @yield [result, operation] Access the result along with the TransportOperation object
128
+ # @yieldparam result [::Google::Cloud::Debugger::V2::UpdateActiveBreakpointResponse]
129
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
130
+ #
131
+ # @return [::Google::Cloud::Debugger::V2::UpdateActiveBreakpointResponse]
132
+ # A result object deserialized from the server's reply
133
+ def update_active_breakpoint request_pb, options = nil
134
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
135
+
136
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_active_breakpoint_request request_pb
137
+ query_string_params = if query_string_params.any?
138
+ query_string_params.to_h { |p| p.split("=", 2) }
139
+ else
140
+ {}
141
+ end
142
+
143
+ response = @client_stub.make_http_request(
144
+ verb,
145
+ uri: uri,
146
+ body: body || "",
147
+ params: query_string_params,
148
+ options: options
149
+ )
150
+ operation = ::Gapic::Rest::TransportOperation.new response
151
+ result = ::Google::Cloud::Debugger::V2::UpdateActiveBreakpointResponse.decode_json response.body, ignore_unknown_fields: true
152
+
153
+ yield result, operation if block_given?
154
+ result
155
+ end
156
+
157
+ ##
158
+ # @private
159
+ #
160
+ # GRPC transcoding helper method for the register_debuggee REST call
161
+ #
162
+ # @param request_pb [::Google::Cloud::Debugger::V2::RegisterDebuggeeRequest]
163
+ # A request object representing the call parameters. Required.
164
+ # @return [Array(String, [String, nil], Hash{String => String})]
165
+ # Uri, Body, Query string parameters
166
+ def self.transcode_register_debuggee_request request_pb
167
+ transcoder = Gapic::Rest::GrpcTranscoder.new
168
+ .with_bindings(
169
+ uri_method: :post,
170
+ uri_template: "/v2/controller/debuggees/register",
171
+ body: "*",
172
+ matches: []
173
+ )
174
+ transcoder.transcode request_pb
175
+ end
176
+
177
+ ##
178
+ # @private
179
+ #
180
+ # GRPC transcoding helper method for the list_active_breakpoints REST call
181
+ #
182
+ # @param request_pb [::Google::Cloud::Debugger::V2::ListActiveBreakpointsRequest]
183
+ # A request object representing the call parameters. Required.
184
+ # @return [Array(String, [String, nil], Hash{String => String})]
185
+ # Uri, Body, Query string parameters
186
+ def self.transcode_list_active_breakpoints_request request_pb
187
+ transcoder = Gapic::Rest::GrpcTranscoder.new
188
+ .with_bindings(
189
+ uri_method: :get,
190
+ uri_template: "/v2/controller/debuggees/{debuggee_id}/breakpoints",
191
+ matches: [
192
+ ["debuggee_id", %r{^[^/]+/?$}, false]
193
+ ]
194
+ )
195
+ transcoder.transcode request_pb
196
+ end
197
+
198
+ ##
199
+ # @private
200
+ #
201
+ # GRPC transcoding helper method for the update_active_breakpoint REST call
202
+ #
203
+ # @param request_pb [::Google::Cloud::Debugger::V2::UpdateActiveBreakpointRequest]
204
+ # A request object representing the call parameters. Required.
205
+ # @return [Array(String, [String, nil], Hash{String => String})]
206
+ # Uri, Body, Query string parameters
207
+ def self.transcode_update_active_breakpoint_request request_pb
208
+ transcoder = Gapic::Rest::GrpcTranscoder.new
209
+ .with_bindings(
210
+ uri_method: :put,
211
+ uri_template: "/v2/controller/debuggees/{debuggee_id}/breakpoints/{breakpoint.id}",
212
+ body: "*",
213
+ matches: [
214
+ ["debuggee_id", %r{^[^/]+/?$}, false],
215
+ ["breakpoint.id", %r{^[^/]+/?$}, false]
216
+ ]
217
+ )
218
+ transcoder.transcode request_pb
219
+ end
220
+ end
221
+ end
222
+ end
223
+ end
224
+ end
225
+ end
226
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/debugger/v2/version"
24
+
25
+ require "google/cloud/debugger/v2/controller/credentials"
26
+ require "google/cloud/debugger/v2/controller/rest/client"
27
+
28
+ module Google
29
+ module Cloud
30
+ module Debugger
31
+ module V2
32
+ ##
33
+ # The Controller service provides the API for orchestrating a collection of
34
+ # debugger agents to perform debugging tasks. These agents are each attached
35
+ # to a process of an application which may include one or more replicas.
36
+ #
37
+ # The debugger agents register with the Controller to identify the application
38
+ # being debugged, the Debuggee. All agents that register with the same data,
39
+ # represent the same Debuggee, and are assigned the same `debuggee_id`.
40
+ #
41
+ # The debugger agents call the Controller to retrieve the list of active
42
+ # Breakpoints. Agents with the same `debuggee_id` get the same breakpoints
43
+ # list. An agent that can fulfill the breakpoint request updates the
44
+ # Controller with the breakpoint result. The controller selects the first
45
+ # result received and discards the rest of the results.
46
+ # Agents that poll again for active breakpoints will no longer have
47
+ # the completed breakpoint in the list and should remove that breakpoint from
48
+ # their attached process.
49
+ #
50
+ # The Controller service does not provide a way to retrieve the results of
51
+ # a completed breakpoint. This functionality is available using the Debugger
52
+ # service.
53
+ #
54
+ # To load this service and instantiate a REST client:
55
+ #
56
+ # require "google/cloud/debugger/v2/controller/rest"
57
+ # client = ::Google::Cloud::Debugger::V2::Controller::Rest::Client.new
58
+ #
59
+ module Controller
60
+ # Client for the REST transport
61
+ module Rest
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+
69
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
70
+ require "google/cloud/debugger/v2/controller/rest/helpers" if ::File.file? helper_path
@@ -24,6 +24,7 @@ require "google/cloud/debugger/v2/version"
24
24
 
25
25
  require "google/cloud/debugger/v2/controller/credentials"
26
26
  require "google/cloud/debugger/v2/controller/client"
27
+ require "google/cloud/debugger/v2/controller/rest"
27
28
 
28
29
  module Google
29
30
  module Cloud
@@ -51,11 +52,16 @@ module Google
51
52
  # a completed breakpoint. This functionality is available using the Debugger
52
53
  # service.
53
54
  #
54
- # To load this service and instantiate a client:
55
+ # @example Load this service and instantiate a gRPC client
55
56
  #
56
57
  # require "google/cloud/debugger/v2/controller"
57
58
  # client = ::Google::Cloud::Debugger::V2::Controller::Client.new
58
59
  #
60
+ # @example Load this service and instantiate a REST client
61
+ #
62
+ # require "google/cloud/debugger/v2/controller/rest"
63
+ # client = ::Google::Cloud::Debugger::V2::Controller::Rest::Client.new
64
+ #
59
65
  module Controller
60
66
  end
61
67
  end