google-cloud-notebooks-v1 0.1.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.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +151 -0
- data/LICENSE.md +201 -0
- data/README.md +139 -0
- data/lib/google/cloud/notebooks/v1/environment_pb.rb +46 -0
- data/lib/google/cloud/notebooks/v1/event_pb.rb +29 -0
- data/lib/google/cloud/notebooks/v1/execution_pb.rb +99 -0
- data/lib/google/cloud/notebooks/v1/instance_config_pb.rb +23 -0
- data/lib/google/cloud/notebooks/v1/instance_pb.rb +177 -0
- data/lib/google/cloud/notebooks/v1/managed_notebook_service/client.rb +1256 -0
- data/lib/google/cloud/notebooks/v1/managed_notebook_service/credentials.rb +51 -0
- data/lib/google/cloud/notebooks/v1/managed_notebook_service/operations.rb +767 -0
- data/lib/google/cloud/notebooks/v1/managed_notebook_service/paths.rb +52 -0
- data/lib/google/cloud/notebooks/v1/managed_notebook_service.rb +50 -0
- data/lib/google/cloud/notebooks/v1/managed_service_pb.rb +75 -0
- data/lib/google/cloud/notebooks/v1/managed_service_services_pb.rb +70 -0
- data/lib/google/cloud/notebooks/v1/notebook_service/client.rb +3643 -0
- data/lib/google/cloud/notebooks/v1/notebook_service/credentials.rb +51 -0
- data/lib/google/cloud/notebooks/v1/notebook_service/operations.rb +767 -0
- data/lib/google/cloud/notebooks/v1/notebook_service/paths.rb +105 -0
- data/lib/google/cloud/notebooks/v1/notebook_service.rb +50 -0
- data/lib/google/cloud/notebooks/v1/runtime_pb.rb +173 -0
- data/lib/google/cloud/notebooks/v1/schedule_pb.rb +45 -0
- data/lib/google/cloud/notebooks/v1/service_pb.rb +243 -0
- data/lib/google/cloud/notebooks/v1/service_services_pb.rb +114 -0
- data/lib/google/cloud/notebooks/v1/version.rb +28 -0
- data/lib/google/cloud/notebooks/v1.rb +41 -0
- data/lib/google-cloud-notebooks-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/notebooks/v1/environment.rb +91 -0
- data/proto_docs/google/cloud/notebooks/v1/event.rb +47 -0
- data/proto_docs/google/cloud/notebooks/v1/execution.rb +330 -0
- data/proto_docs/google/cloud/notebooks/v1/instance.rb +551 -0
- data/proto_docs/google/cloud/notebooks/v1/instance_config.rb +39 -0
- data/proto_docs/google/cloud/notebooks/v1/managed_service.rb +160 -0
- data/proto_docs/google/cloud/notebooks/v1/runtime.rb +607 -0
- data/proto_docs/google/cloud/notebooks/v1/schedule.rb +104 -0
- data/proto_docs/google/cloud/notebooks/v1/service.rb +656 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +141 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/timestamp.rb +129 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- metadata +239 -0
@@ -0,0 +1,3643 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2022 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/cloud/errors"
|
20
|
+
require "google/cloud/notebooks/v1/service_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Notebooks
|
25
|
+
module V1
|
26
|
+
module NotebookService
|
27
|
+
##
|
28
|
+
# Client for the NotebookService service.
|
29
|
+
#
|
30
|
+
# API v1 service for Cloud AI Platform Notebooks.
|
31
|
+
#
|
32
|
+
class Client
|
33
|
+
include Paths
|
34
|
+
|
35
|
+
# @private
|
36
|
+
attr_reader :notebook_service_stub
|
37
|
+
|
38
|
+
##
|
39
|
+
# Configure the NotebookService Client class.
|
40
|
+
#
|
41
|
+
# See {::Google::Cloud::Notebooks::V1::NotebookService::Client::Configuration}
|
42
|
+
# for a description of the configuration fields.
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
#
|
46
|
+
# # Modify the configuration for all NotebookService clients
|
47
|
+
# ::Google::Cloud::Notebooks::V1::NotebookService::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
50
|
+
#
|
51
|
+
# @yield [config] Configure the Client client.
|
52
|
+
# @yieldparam config [Client::Configuration]
|
53
|
+
#
|
54
|
+
# @return [Client::Configuration]
|
55
|
+
#
|
56
|
+
def self.configure
|
57
|
+
@configure ||= begin
|
58
|
+
namespace = ["Google", "Cloud", "Notebooks", "V1"]
|
59
|
+
parent_config = while namespace.any?
|
60
|
+
parent_name = namespace.join "::"
|
61
|
+
parent_const = const_get parent_name
|
62
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
63
|
+
namespace.pop
|
64
|
+
end
|
65
|
+
default_config = Client::Configuration.new parent_config
|
66
|
+
|
67
|
+
default_config.timeout = 60.0
|
68
|
+
default_config.retry_policy = {
|
69
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
70
|
+
}
|
71
|
+
|
72
|
+
default_config.rpcs.list_instances.timeout = 60.0
|
73
|
+
|
74
|
+
default_config.rpcs.get_instance.timeout = 60.0
|
75
|
+
|
76
|
+
default_config.rpcs.create_instance.timeout = 60.0
|
77
|
+
|
78
|
+
default_config.rpcs.register_instance.timeout = 60.0
|
79
|
+
|
80
|
+
default_config.rpcs.set_instance_accelerator.timeout = 60.0
|
81
|
+
|
82
|
+
default_config.rpcs.set_instance_machine_type.timeout = 60.0
|
83
|
+
|
84
|
+
default_config.rpcs.update_instance_config.timeout = 60.0
|
85
|
+
|
86
|
+
default_config.rpcs.update_shielded_instance_config.timeout = 60.0
|
87
|
+
|
88
|
+
default_config.rpcs.set_instance_labels.timeout = 60.0
|
89
|
+
|
90
|
+
default_config.rpcs.delete_instance.timeout = 60.0
|
91
|
+
|
92
|
+
default_config.rpcs.start_instance.timeout = 60.0
|
93
|
+
|
94
|
+
default_config.rpcs.stop_instance.timeout = 60.0
|
95
|
+
|
96
|
+
default_config.rpcs.reset_instance.timeout = 60.0
|
97
|
+
|
98
|
+
default_config.rpcs.report_instance_info.timeout = 60.0
|
99
|
+
|
100
|
+
default_config.rpcs.is_instance_upgradeable.timeout = 60.0
|
101
|
+
|
102
|
+
default_config.rpcs.get_instance_health.timeout = 60.0
|
103
|
+
|
104
|
+
default_config.rpcs.upgrade_instance.timeout = 60.0
|
105
|
+
|
106
|
+
default_config.rpcs.rollback_instance.timeout = 60.0
|
107
|
+
|
108
|
+
default_config.rpcs.upgrade_instance_internal.timeout = 60.0
|
109
|
+
|
110
|
+
default_config.rpcs.list_environments.timeout = 60.0
|
111
|
+
|
112
|
+
default_config.rpcs.get_environment.timeout = 60.0
|
113
|
+
|
114
|
+
default_config.rpcs.create_environment.timeout = 60.0
|
115
|
+
|
116
|
+
default_config.rpcs.delete_environment.timeout = 60.0
|
117
|
+
|
118
|
+
default_config.rpcs.list_schedules.timeout = 60.0
|
119
|
+
|
120
|
+
default_config.rpcs.get_schedule.timeout = 60.0
|
121
|
+
|
122
|
+
default_config.rpcs.delete_schedule.timeout = 60.0
|
123
|
+
|
124
|
+
default_config.rpcs.create_schedule.timeout = 60.0
|
125
|
+
|
126
|
+
default_config.rpcs.list_executions.timeout = 60.0
|
127
|
+
|
128
|
+
default_config.rpcs.get_execution.timeout = 60.0
|
129
|
+
|
130
|
+
default_config.rpcs.delete_execution.timeout = 60.0
|
131
|
+
|
132
|
+
default_config.rpcs.create_execution.timeout = 60.0
|
133
|
+
|
134
|
+
default_config
|
135
|
+
end
|
136
|
+
yield @configure if block_given?
|
137
|
+
@configure
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# Configure the NotebookService Client instance.
|
142
|
+
#
|
143
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
144
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
145
|
+
# should be made on {Client.configure}.
|
146
|
+
#
|
147
|
+
# See {::Google::Cloud::Notebooks::V1::NotebookService::Client::Configuration}
|
148
|
+
# for a description of the configuration fields.
|
149
|
+
#
|
150
|
+
# @yield [config] Configure the Client client.
|
151
|
+
# @yieldparam config [Client::Configuration]
|
152
|
+
#
|
153
|
+
# @return [Client::Configuration]
|
154
|
+
#
|
155
|
+
def configure
|
156
|
+
yield @config if block_given?
|
157
|
+
@config
|
158
|
+
end
|
159
|
+
|
160
|
+
##
|
161
|
+
# Create a new NotebookService client object.
|
162
|
+
#
|
163
|
+
# @example
|
164
|
+
#
|
165
|
+
# # Create a client using the default configuration
|
166
|
+
# client = ::Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
167
|
+
#
|
168
|
+
# # Create a client using a custom configuration
|
169
|
+
# client = ::Google::Cloud::Notebooks::V1::NotebookService::Client.new do |config|
|
170
|
+
# config.timeout = 10.0
|
171
|
+
# end
|
172
|
+
#
|
173
|
+
# @yield [config] Configure the NotebookService client.
|
174
|
+
# @yieldparam config [Client::Configuration]
|
175
|
+
#
|
176
|
+
def initialize
|
177
|
+
# These require statements are intentionally placed here to initialize
|
178
|
+
# the gRPC module only when it's required.
|
179
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
180
|
+
require "gapic/grpc"
|
181
|
+
require "google/cloud/notebooks/v1/service_services_pb"
|
182
|
+
|
183
|
+
# Create the configuration object
|
184
|
+
@config = Configuration.new Client.configure
|
185
|
+
|
186
|
+
# Yield the configuration if needed
|
187
|
+
yield @config if block_given?
|
188
|
+
|
189
|
+
# Create credentials
|
190
|
+
credentials = @config.credentials
|
191
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
192
|
+
# but only if the default endpoint does not have a region prefix.
|
193
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
194
|
+
!@config.endpoint.split(".").first.include?("-")
|
195
|
+
credentials ||= Credentials.default scope: @config.scope,
|
196
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
197
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
198
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
199
|
+
end
|
200
|
+
@quota_project_id = @config.quota_project
|
201
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
202
|
+
|
203
|
+
@operations_client = Operations.new do |config|
|
204
|
+
config.credentials = credentials
|
205
|
+
config.quota_project = @quota_project_id
|
206
|
+
config.endpoint = @config.endpoint
|
207
|
+
end
|
208
|
+
|
209
|
+
@notebook_service_stub = ::Gapic::ServiceStub.new(
|
210
|
+
::Google::Cloud::Notebooks::V1::NotebookService::Stub,
|
211
|
+
credentials: credentials,
|
212
|
+
endpoint: @config.endpoint,
|
213
|
+
channel_args: @config.channel_args,
|
214
|
+
interceptors: @config.interceptors
|
215
|
+
)
|
216
|
+
end
|
217
|
+
|
218
|
+
##
|
219
|
+
# Get the associated client for long-running operations.
|
220
|
+
#
|
221
|
+
# @return [::Google::Cloud::Notebooks::V1::NotebookService::Operations]
|
222
|
+
#
|
223
|
+
attr_reader :operations_client
|
224
|
+
|
225
|
+
# Service calls
|
226
|
+
|
227
|
+
##
|
228
|
+
# Lists instances in a given project and location.
|
229
|
+
#
|
230
|
+
# @overload list_instances(request, options = nil)
|
231
|
+
# Pass arguments to `list_instances` via a request object, either of type
|
232
|
+
# {::Google::Cloud::Notebooks::V1::ListInstancesRequest} or an equivalent Hash.
|
233
|
+
#
|
234
|
+
# @param request [::Google::Cloud::Notebooks::V1::ListInstancesRequest, ::Hash]
|
235
|
+
# A request object representing the call parameters. Required. To specify no
|
236
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
237
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
238
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
239
|
+
#
|
240
|
+
# @overload list_instances(parent: nil, page_size: nil, page_token: nil)
|
241
|
+
# Pass arguments to `list_instances` via keyword arguments. Note that at
|
242
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
243
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
244
|
+
#
|
245
|
+
# @param parent [::String]
|
246
|
+
# Required. Format:
|
247
|
+
# `parent=projects/{project_id}/locations/{location}`
|
248
|
+
# @param page_size [::Integer]
|
249
|
+
# Maximum return size of the list call.
|
250
|
+
# @param page_token [::String]
|
251
|
+
# A previous returned page token that can be used to continue listing
|
252
|
+
# from the last result.
|
253
|
+
#
|
254
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
255
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Instance>]
|
256
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
257
|
+
#
|
258
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Instance>]
|
259
|
+
#
|
260
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
261
|
+
#
|
262
|
+
# @example Basic example
|
263
|
+
# require "google/cloud/notebooks/v1"
|
264
|
+
#
|
265
|
+
# # Create a client object. The client can be reused for multiple calls.
|
266
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
267
|
+
#
|
268
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
269
|
+
# request = Google::Cloud::Notebooks::V1::ListInstancesRequest.new
|
270
|
+
#
|
271
|
+
# # Call the list_instances method.
|
272
|
+
# result = client.list_instances request
|
273
|
+
#
|
274
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
275
|
+
# # iterate over all elements by calling #each, and the enumerable
|
276
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
277
|
+
# # methods are also available for managing paging directly.
|
278
|
+
# result.each do |response|
|
279
|
+
# # Each element is of type ::Google::Cloud::Notebooks::V1::Instance.
|
280
|
+
# p response
|
281
|
+
# end
|
282
|
+
#
|
283
|
+
def list_instances request, options = nil
|
284
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
285
|
+
|
286
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::ListInstancesRequest
|
287
|
+
|
288
|
+
# Converts hash and nil to an options object
|
289
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
290
|
+
|
291
|
+
# Customize the options with defaults
|
292
|
+
metadata = @config.rpcs.list_instances.metadata.to_h
|
293
|
+
|
294
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
295
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
296
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
297
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
298
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
299
|
+
|
300
|
+
header_params = {}
|
301
|
+
if request.parent
|
302
|
+
header_params["parent"] = request.parent
|
303
|
+
end
|
304
|
+
|
305
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
306
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
307
|
+
|
308
|
+
options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
|
309
|
+
metadata: metadata,
|
310
|
+
retry_policy: @config.rpcs.list_instances.retry_policy
|
311
|
+
|
312
|
+
options.apply_defaults timeout: @config.timeout,
|
313
|
+
metadata: @config.metadata,
|
314
|
+
retry_policy: @config.retry_policy
|
315
|
+
|
316
|
+
@notebook_service_stub.call_rpc :list_instances, request, options: options do |response, operation|
|
317
|
+
response = ::Gapic::PagedEnumerable.new @notebook_service_stub, :list_instances, request, response, operation, options
|
318
|
+
yield response, operation if block_given?
|
319
|
+
return response
|
320
|
+
end
|
321
|
+
rescue ::GRPC::BadStatus => e
|
322
|
+
raise ::Google::Cloud::Error.from_error(e)
|
323
|
+
end
|
324
|
+
|
325
|
+
##
|
326
|
+
# Gets details of a single Instance.
|
327
|
+
#
|
328
|
+
# @overload get_instance(request, options = nil)
|
329
|
+
# Pass arguments to `get_instance` via a request object, either of type
|
330
|
+
# {::Google::Cloud::Notebooks::V1::GetInstanceRequest} or an equivalent Hash.
|
331
|
+
#
|
332
|
+
# @param request [::Google::Cloud::Notebooks::V1::GetInstanceRequest, ::Hash]
|
333
|
+
# A request object representing the call parameters. Required. To specify no
|
334
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
335
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
336
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
337
|
+
#
|
338
|
+
# @overload get_instance(name: nil)
|
339
|
+
# Pass arguments to `get_instance` via keyword arguments. Note that at
|
340
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
341
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
342
|
+
#
|
343
|
+
# @param name [::String]
|
344
|
+
# Required. Format:
|
345
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
346
|
+
#
|
347
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
348
|
+
# @yieldparam response [::Google::Cloud::Notebooks::V1::Instance]
|
349
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
350
|
+
#
|
351
|
+
# @return [::Google::Cloud::Notebooks::V1::Instance]
|
352
|
+
#
|
353
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
354
|
+
#
|
355
|
+
# @example Basic example
|
356
|
+
# require "google/cloud/notebooks/v1"
|
357
|
+
#
|
358
|
+
# # Create a client object. The client can be reused for multiple calls.
|
359
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
360
|
+
#
|
361
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
362
|
+
# request = Google::Cloud::Notebooks::V1::GetInstanceRequest.new
|
363
|
+
#
|
364
|
+
# # Call the get_instance method.
|
365
|
+
# result = client.get_instance request
|
366
|
+
#
|
367
|
+
# # The returned object is of type Google::Cloud::Notebooks::V1::Instance.
|
368
|
+
# p result
|
369
|
+
#
|
370
|
+
def get_instance request, options = nil
|
371
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
372
|
+
|
373
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::GetInstanceRequest
|
374
|
+
|
375
|
+
# Converts hash and nil to an options object
|
376
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
377
|
+
|
378
|
+
# Customize the options with defaults
|
379
|
+
metadata = @config.rpcs.get_instance.metadata.to_h
|
380
|
+
|
381
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
382
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
383
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
384
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
385
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
386
|
+
|
387
|
+
header_params = {}
|
388
|
+
if request.name
|
389
|
+
header_params["name"] = request.name
|
390
|
+
end
|
391
|
+
|
392
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
393
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
394
|
+
|
395
|
+
options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
|
396
|
+
metadata: metadata,
|
397
|
+
retry_policy: @config.rpcs.get_instance.retry_policy
|
398
|
+
|
399
|
+
options.apply_defaults timeout: @config.timeout,
|
400
|
+
metadata: @config.metadata,
|
401
|
+
retry_policy: @config.retry_policy
|
402
|
+
|
403
|
+
@notebook_service_stub.call_rpc :get_instance, request, options: options do |response, operation|
|
404
|
+
yield response, operation if block_given?
|
405
|
+
return response
|
406
|
+
end
|
407
|
+
rescue ::GRPC::BadStatus => e
|
408
|
+
raise ::Google::Cloud::Error.from_error(e)
|
409
|
+
end
|
410
|
+
|
411
|
+
##
|
412
|
+
# Creates a new Instance in a given project and location.
|
413
|
+
#
|
414
|
+
# @overload create_instance(request, options = nil)
|
415
|
+
# Pass arguments to `create_instance` via a request object, either of type
|
416
|
+
# {::Google::Cloud::Notebooks::V1::CreateInstanceRequest} or an equivalent Hash.
|
417
|
+
#
|
418
|
+
# @param request [::Google::Cloud::Notebooks::V1::CreateInstanceRequest, ::Hash]
|
419
|
+
# A request object representing the call parameters. Required. To specify no
|
420
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
421
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
422
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
423
|
+
#
|
424
|
+
# @overload create_instance(parent: nil, instance_id: nil, instance: nil)
|
425
|
+
# Pass arguments to `create_instance` via keyword arguments. Note that at
|
426
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
427
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
428
|
+
#
|
429
|
+
# @param parent [::String]
|
430
|
+
# Required. Format:
|
431
|
+
# `parent=projects/{project_id}/locations/{location}`
|
432
|
+
# @param instance_id [::String]
|
433
|
+
# Required. User-defined unique ID of this instance.
|
434
|
+
# @param instance [::Google::Cloud::Notebooks::V1::Instance, ::Hash]
|
435
|
+
# Required. The instance to be created.
|
436
|
+
#
|
437
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
438
|
+
# @yieldparam response [::Gapic::Operation]
|
439
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
440
|
+
#
|
441
|
+
# @return [::Gapic::Operation]
|
442
|
+
#
|
443
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
444
|
+
#
|
445
|
+
# @example Basic example
|
446
|
+
# require "google/cloud/notebooks/v1"
|
447
|
+
#
|
448
|
+
# # Create a client object. The client can be reused for multiple calls.
|
449
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
450
|
+
#
|
451
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
452
|
+
# request = Google::Cloud::Notebooks::V1::CreateInstanceRequest.new
|
453
|
+
#
|
454
|
+
# # Call the create_instance method.
|
455
|
+
# result = client.create_instance request
|
456
|
+
#
|
457
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
458
|
+
# # object to check the status of an operation, cancel it, or wait
|
459
|
+
# # for results. Here is how to block until completion:
|
460
|
+
# result.wait_until_done! timeout: 60
|
461
|
+
# if result.response?
|
462
|
+
# p result.response
|
463
|
+
# else
|
464
|
+
# puts "Error!"
|
465
|
+
# end
|
466
|
+
#
|
467
|
+
def create_instance request, options = nil
|
468
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
469
|
+
|
470
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::CreateInstanceRequest
|
471
|
+
|
472
|
+
# Converts hash and nil to an options object
|
473
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
474
|
+
|
475
|
+
# Customize the options with defaults
|
476
|
+
metadata = @config.rpcs.create_instance.metadata.to_h
|
477
|
+
|
478
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
479
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
480
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
481
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
482
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
483
|
+
|
484
|
+
header_params = {}
|
485
|
+
if request.parent
|
486
|
+
header_params["parent"] = request.parent
|
487
|
+
end
|
488
|
+
|
489
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
490
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
491
|
+
|
492
|
+
options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
|
493
|
+
metadata: metadata,
|
494
|
+
retry_policy: @config.rpcs.create_instance.retry_policy
|
495
|
+
|
496
|
+
options.apply_defaults timeout: @config.timeout,
|
497
|
+
metadata: @config.metadata,
|
498
|
+
retry_policy: @config.retry_policy
|
499
|
+
|
500
|
+
@notebook_service_stub.call_rpc :create_instance, request, options: options do |response, operation|
|
501
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
502
|
+
yield response, operation if block_given?
|
503
|
+
return response
|
504
|
+
end
|
505
|
+
rescue ::GRPC::BadStatus => e
|
506
|
+
raise ::Google::Cloud::Error.from_error(e)
|
507
|
+
end
|
508
|
+
|
509
|
+
##
|
510
|
+
# Registers an existing legacy notebook instance to the Notebooks API server.
|
511
|
+
# Legacy instances are instances created with the legacy Compute Engine
|
512
|
+
# calls. They are not manageable by the Notebooks API out of the box. This
|
513
|
+
# call makes these instances manageable by the Notebooks API.
|
514
|
+
#
|
515
|
+
# @overload register_instance(request, options = nil)
|
516
|
+
# Pass arguments to `register_instance` via a request object, either of type
|
517
|
+
# {::Google::Cloud::Notebooks::V1::RegisterInstanceRequest} or an equivalent Hash.
|
518
|
+
#
|
519
|
+
# @param request [::Google::Cloud::Notebooks::V1::RegisterInstanceRequest, ::Hash]
|
520
|
+
# A request object representing the call parameters. Required. To specify no
|
521
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
522
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
523
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
524
|
+
#
|
525
|
+
# @overload register_instance(parent: nil, instance_id: nil)
|
526
|
+
# Pass arguments to `register_instance` via keyword arguments. Note that at
|
527
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
528
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
529
|
+
#
|
530
|
+
# @param parent [::String]
|
531
|
+
# Required. Format:
|
532
|
+
# `parent=projects/{project_id}/locations/{location}`
|
533
|
+
# @param instance_id [::String]
|
534
|
+
# Required. User defined unique ID of this instance. The `instance_id` must
|
535
|
+
# be 1 to 63 characters long and contain only lowercase letters,
|
536
|
+
# numeric characters, and dashes. The first character must be a lowercase
|
537
|
+
# letter and the last character cannot be a dash.
|
538
|
+
#
|
539
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
540
|
+
# @yieldparam response [::Gapic::Operation]
|
541
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
542
|
+
#
|
543
|
+
# @return [::Gapic::Operation]
|
544
|
+
#
|
545
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
546
|
+
#
|
547
|
+
# @example Basic example
|
548
|
+
# require "google/cloud/notebooks/v1"
|
549
|
+
#
|
550
|
+
# # Create a client object. The client can be reused for multiple calls.
|
551
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
552
|
+
#
|
553
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
554
|
+
# request = Google::Cloud::Notebooks::V1::RegisterInstanceRequest.new
|
555
|
+
#
|
556
|
+
# # Call the register_instance method.
|
557
|
+
# result = client.register_instance request
|
558
|
+
#
|
559
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
560
|
+
# # object to check the status of an operation, cancel it, or wait
|
561
|
+
# # for results. Here is how to block until completion:
|
562
|
+
# result.wait_until_done! timeout: 60
|
563
|
+
# if result.response?
|
564
|
+
# p result.response
|
565
|
+
# else
|
566
|
+
# puts "Error!"
|
567
|
+
# end
|
568
|
+
#
|
569
|
+
def register_instance request, options = nil
|
570
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
571
|
+
|
572
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::RegisterInstanceRequest
|
573
|
+
|
574
|
+
# Converts hash and nil to an options object
|
575
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
576
|
+
|
577
|
+
# Customize the options with defaults
|
578
|
+
metadata = @config.rpcs.register_instance.metadata.to_h
|
579
|
+
|
580
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
581
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
582
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
583
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
584
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
585
|
+
|
586
|
+
header_params = {}
|
587
|
+
if request.parent
|
588
|
+
header_params["parent"] = request.parent
|
589
|
+
end
|
590
|
+
|
591
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
592
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
593
|
+
|
594
|
+
options.apply_defaults timeout: @config.rpcs.register_instance.timeout,
|
595
|
+
metadata: metadata,
|
596
|
+
retry_policy: @config.rpcs.register_instance.retry_policy
|
597
|
+
|
598
|
+
options.apply_defaults timeout: @config.timeout,
|
599
|
+
metadata: @config.metadata,
|
600
|
+
retry_policy: @config.retry_policy
|
601
|
+
|
602
|
+
@notebook_service_stub.call_rpc :register_instance, request, options: options do |response, operation|
|
603
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
604
|
+
yield response, operation if block_given?
|
605
|
+
return response
|
606
|
+
end
|
607
|
+
rescue ::GRPC::BadStatus => e
|
608
|
+
raise ::Google::Cloud::Error.from_error(e)
|
609
|
+
end
|
610
|
+
|
611
|
+
##
|
612
|
+
# Updates the guest accelerators of a single Instance.
|
613
|
+
#
|
614
|
+
# @overload set_instance_accelerator(request, options = nil)
|
615
|
+
# Pass arguments to `set_instance_accelerator` via a request object, either of type
|
616
|
+
# {::Google::Cloud::Notebooks::V1::SetInstanceAcceleratorRequest} or an equivalent Hash.
|
617
|
+
#
|
618
|
+
# @param request [::Google::Cloud::Notebooks::V1::SetInstanceAcceleratorRequest, ::Hash]
|
619
|
+
# A request object representing the call parameters. Required. To specify no
|
620
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
621
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
622
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
623
|
+
#
|
624
|
+
# @overload set_instance_accelerator(name: nil, type: nil, core_count: nil)
|
625
|
+
# Pass arguments to `set_instance_accelerator` via keyword arguments. Note that at
|
626
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
627
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
628
|
+
#
|
629
|
+
# @param name [::String]
|
630
|
+
# Required. Format:
|
631
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
632
|
+
# @param type [::Google::Cloud::Notebooks::V1::Instance::AcceleratorType]
|
633
|
+
# Required. Type of this accelerator.
|
634
|
+
# @param core_count [::Integer]
|
635
|
+
# Required. Count of cores of this accelerator. Note that not all combinations
|
636
|
+
# of `type` and `core_count` are valid. Check [GPUs on
|
637
|
+
# Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to
|
638
|
+
# find a valid combination. TPUs are not supported.
|
639
|
+
#
|
640
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
641
|
+
# @yieldparam response [::Gapic::Operation]
|
642
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
643
|
+
#
|
644
|
+
# @return [::Gapic::Operation]
|
645
|
+
#
|
646
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
647
|
+
#
|
648
|
+
# @example Basic example
|
649
|
+
# require "google/cloud/notebooks/v1"
|
650
|
+
#
|
651
|
+
# # Create a client object. The client can be reused for multiple calls.
|
652
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
653
|
+
#
|
654
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
655
|
+
# request = Google::Cloud::Notebooks::V1::SetInstanceAcceleratorRequest.new
|
656
|
+
#
|
657
|
+
# # Call the set_instance_accelerator method.
|
658
|
+
# result = client.set_instance_accelerator request
|
659
|
+
#
|
660
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
661
|
+
# # object to check the status of an operation, cancel it, or wait
|
662
|
+
# # for results. Here is how to block until completion:
|
663
|
+
# result.wait_until_done! timeout: 60
|
664
|
+
# if result.response?
|
665
|
+
# p result.response
|
666
|
+
# else
|
667
|
+
# puts "Error!"
|
668
|
+
# end
|
669
|
+
#
|
670
|
+
def set_instance_accelerator request, options = nil
|
671
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
672
|
+
|
673
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::SetInstanceAcceleratorRequest
|
674
|
+
|
675
|
+
# Converts hash and nil to an options object
|
676
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
677
|
+
|
678
|
+
# Customize the options with defaults
|
679
|
+
metadata = @config.rpcs.set_instance_accelerator.metadata.to_h
|
680
|
+
|
681
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
682
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
683
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
684
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
685
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
686
|
+
|
687
|
+
header_params = {}
|
688
|
+
if request.name
|
689
|
+
header_params["name"] = request.name
|
690
|
+
end
|
691
|
+
|
692
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
693
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
694
|
+
|
695
|
+
options.apply_defaults timeout: @config.rpcs.set_instance_accelerator.timeout,
|
696
|
+
metadata: metadata,
|
697
|
+
retry_policy: @config.rpcs.set_instance_accelerator.retry_policy
|
698
|
+
|
699
|
+
options.apply_defaults timeout: @config.timeout,
|
700
|
+
metadata: @config.metadata,
|
701
|
+
retry_policy: @config.retry_policy
|
702
|
+
|
703
|
+
@notebook_service_stub.call_rpc :set_instance_accelerator, request, options: options do |response, operation|
|
704
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
705
|
+
yield response, operation if block_given?
|
706
|
+
return response
|
707
|
+
end
|
708
|
+
rescue ::GRPC::BadStatus => e
|
709
|
+
raise ::Google::Cloud::Error.from_error(e)
|
710
|
+
end
|
711
|
+
|
712
|
+
##
|
713
|
+
# Updates the machine type of a single Instance.
|
714
|
+
#
|
715
|
+
# @overload set_instance_machine_type(request, options = nil)
|
716
|
+
# Pass arguments to `set_instance_machine_type` via a request object, either of type
|
717
|
+
# {::Google::Cloud::Notebooks::V1::SetInstanceMachineTypeRequest} or an equivalent Hash.
|
718
|
+
#
|
719
|
+
# @param request [::Google::Cloud::Notebooks::V1::SetInstanceMachineTypeRequest, ::Hash]
|
720
|
+
# A request object representing the call parameters. Required. To specify no
|
721
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
722
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
723
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
724
|
+
#
|
725
|
+
# @overload set_instance_machine_type(name: nil, machine_type: nil)
|
726
|
+
# Pass arguments to `set_instance_machine_type` via keyword arguments. Note that at
|
727
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
728
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
729
|
+
#
|
730
|
+
# @param name [::String]
|
731
|
+
# Required. Format:
|
732
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
733
|
+
# @param machine_type [::String]
|
734
|
+
# Required. The [Compute Engine machine
|
735
|
+
# type](https://cloud.google.com/compute/docs/machine-types).
|
736
|
+
#
|
737
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
738
|
+
# @yieldparam response [::Gapic::Operation]
|
739
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
740
|
+
#
|
741
|
+
# @return [::Gapic::Operation]
|
742
|
+
#
|
743
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
744
|
+
#
|
745
|
+
# @example Basic example
|
746
|
+
# require "google/cloud/notebooks/v1"
|
747
|
+
#
|
748
|
+
# # Create a client object. The client can be reused for multiple calls.
|
749
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
750
|
+
#
|
751
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
752
|
+
# request = Google::Cloud::Notebooks::V1::SetInstanceMachineTypeRequest.new
|
753
|
+
#
|
754
|
+
# # Call the set_instance_machine_type method.
|
755
|
+
# result = client.set_instance_machine_type request
|
756
|
+
#
|
757
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
758
|
+
# # object to check the status of an operation, cancel it, or wait
|
759
|
+
# # for results. Here is how to block until completion:
|
760
|
+
# result.wait_until_done! timeout: 60
|
761
|
+
# if result.response?
|
762
|
+
# p result.response
|
763
|
+
# else
|
764
|
+
# puts "Error!"
|
765
|
+
# end
|
766
|
+
#
|
767
|
+
def set_instance_machine_type request, options = nil
|
768
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
769
|
+
|
770
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::SetInstanceMachineTypeRequest
|
771
|
+
|
772
|
+
# Converts hash and nil to an options object
|
773
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
774
|
+
|
775
|
+
# Customize the options with defaults
|
776
|
+
metadata = @config.rpcs.set_instance_machine_type.metadata.to_h
|
777
|
+
|
778
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
779
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
780
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
781
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
782
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
783
|
+
|
784
|
+
header_params = {}
|
785
|
+
if request.name
|
786
|
+
header_params["name"] = request.name
|
787
|
+
end
|
788
|
+
|
789
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
790
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
791
|
+
|
792
|
+
options.apply_defaults timeout: @config.rpcs.set_instance_machine_type.timeout,
|
793
|
+
metadata: metadata,
|
794
|
+
retry_policy: @config.rpcs.set_instance_machine_type.retry_policy
|
795
|
+
|
796
|
+
options.apply_defaults timeout: @config.timeout,
|
797
|
+
metadata: @config.metadata,
|
798
|
+
retry_policy: @config.retry_policy
|
799
|
+
|
800
|
+
@notebook_service_stub.call_rpc :set_instance_machine_type, request, options: options do |response, operation|
|
801
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
802
|
+
yield response, operation if block_given?
|
803
|
+
return response
|
804
|
+
end
|
805
|
+
rescue ::GRPC::BadStatus => e
|
806
|
+
raise ::Google::Cloud::Error.from_error(e)
|
807
|
+
end
|
808
|
+
|
809
|
+
##
|
810
|
+
# Update Notebook Instance configurations.
|
811
|
+
#
|
812
|
+
# @overload update_instance_config(request, options = nil)
|
813
|
+
# Pass arguments to `update_instance_config` via a request object, either of type
|
814
|
+
# {::Google::Cloud::Notebooks::V1::UpdateInstanceConfigRequest} or an equivalent Hash.
|
815
|
+
#
|
816
|
+
# @param request [::Google::Cloud::Notebooks::V1::UpdateInstanceConfigRequest, ::Hash]
|
817
|
+
# A request object representing the call parameters. Required. To specify no
|
818
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
819
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
820
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
821
|
+
#
|
822
|
+
# @overload update_instance_config(name: nil, config: nil)
|
823
|
+
# Pass arguments to `update_instance_config` via keyword arguments. Note that at
|
824
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
825
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
826
|
+
#
|
827
|
+
# @param name [::String]
|
828
|
+
# Required. Format:
|
829
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
830
|
+
# @param config [::Google::Cloud::Notebooks::V1::InstanceConfig, ::Hash]
|
831
|
+
# The instance configurations to be updated.
|
832
|
+
#
|
833
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
834
|
+
# @yieldparam response [::Gapic::Operation]
|
835
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
836
|
+
#
|
837
|
+
# @return [::Gapic::Operation]
|
838
|
+
#
|
839
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
840
|
+
#
|
841
|
+
# @example Basic example
|
842
|
+
# require "google/cloud/notebooks/v1"
|
843
|
+
#
|
844
|
+
# # Create a client object. The client can be reused for multiple calls.
|
845
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
846
|
+
#
|
847
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
848
|
+
# request = Google::Cloud::Notebooks::V1::UpdateInstanceConfigRequest.new
|
849
|
+
#
|
850
|
+
# # Call the update_instance_config method.
|
851
|
+
# result = client.update_instance_config request
|
852
|
+
#
|
853
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
854
|
+
# # object to check the status of an operation, cancel it, or wait
|
855
|
+
# # for results. Here is how to block until completion:
|
856
|
+
# result.wait_until_done! timeout: 60
|
857
|
+
# if result.response?
|
858
|
+
# p result.response
|
859
|
+
# else
|
860
|
+
# puts "Error!"
|
861
|
+
# end
|
862
|
+
#
|
863
|
+
def update_instance_config request, options = nil
|
864
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
865
|
+
|
866
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::UpdateInstanceConfigRequest
|
867
|
+
|
868
|
+
# Converts hash and nil to an options object
|
869
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
870
|
+
|
871
|
+
# Customize the options with defaults
|
872
|
+
metadata = @config.rpcs.update_instance_config.metadata.to_h
|
873
|
+
|
874
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
875
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
876
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
877
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
878
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
879
|
+
|
880
|
+
header_params = {}
|
881
|
+
if request.name
|
882
|
+
header_params["name"] = request.name
|
883
|
+
end
|
884
|
+
|
885
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
886
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
887
|
+
|
888
|
+
options.apply_defaults timeout: @config.rpcs.update_instance_config.timeout,
|
889
|
+
metadata: metadata,
|
890
|
+
retry_policy: @config.rpcs.update_instance_config.retry_policy
|
891
|
+
|
892
|
+
options.apply_defaults timeout: @config.timeout,
|
893
|
+
metadata: @config.metadata,
|
894
|
+
retry_policy: @config.retry_policy
|
895
|
+
|
896
|
+
@notebook_service_stub.call_rpc :update_instance_config, request, options: options do |response, operation|
|
897
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
898
|
+
yield response, operation if block_given?
|
899
|
+
return response
|
900
|
+
end
|
901
|
+
rescue ::GRPC::BadStatus => e
|
902
|
+
raise ::Google::Cloud::Error.from_error(e)
|
903
|
+
end
|
904
|
+
|
905
|
+
##
|
906
|
+
# Updates the Shielded instance configuration of a single Instance.
|
907
|
+
#
|
908
|
+
# @overload update_shielded_instance_config(request, options = nil)
|
909
|
+
# Pass arguments to `update_shielded_instance_config` via a request object, either of type
|
910
|
+
# {::Google::Cloud::Notebooks::V1::UpdateShieldedInstanceConfigRequest} or an equivalent Hash.
|
911
|
+
#
|
912
|
+
# @param request [::Google::Cloud::Notebooks::V1::UpdateShieldedInstanceConfigRequest, ::Hash]
|
913
|
+
# A request object representing the call parameters. Required. To specify no
|
914
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
915
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
916
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
917
|
+
#
|
918
|
+
# @overload update_shielded_instance_config(name: nil, shielded_instance_config: nil)
|
919
|
+
# Pass arguments to `update_shielded_instance_config` via keyword arguments. Note that at
|
920
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
921
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
922
|
+
#
|
923
|
+
# @param name [::String]
|
924
|
+
# Required. Format:
|
925
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
926
|
+
# @param shielded_instance_config [::Google::Cloud::Notebooks::V1::Instance::ShieldedInstanceConfig, ::Hash]
|
927
|
+
# ShieldedInstance configuration to be updated.
|
928
|
+
#
|
929
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
930
|
+
# @yieldparam response [::Gapic::Operation]
|
931
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
932
|
+
#
|
933
|
+
# @return [::Gapic::Operation]
|
934
|
+
#
|
935
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
936
|
+
#
|
937
|
+
# @example Basic example
|
938
|
+
# require "google/cloud/notebooks/v1"
|
939
|
+
#
|
940
|
+
# # Create a client object. The client can be reused for multiple calls.
|
941
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
942
|
+
#
|
943
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
944
|
+
# request = Google::Cloud::Notebooks::V1::UpdateShieldedInstanceConfigRequest.new
|
945
|
+
#
|
946
|
+
# # Call the update_shielded_instance_config method.
|
947
|
+
# result = client.update_shielded_instance_config request
|
948
|
+
#
|
949
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
950
|
+
# # object to check the status of an operation, cancel it, or wait
|
951
|
+
# # for results. Here is how to block until completion:
|
952
|
+
# result.wait_until_done! timeout: 60
|
953
|
+
# if result.response?
|
954
|
+
# p result.response
|
955
|
+
# else
|
956
|
+
# puts "Error!"
|
957
|
+
# end
|
958
|
+
#
|
959
|
+
def update_shielded_instance_config request, options = nil
|
960
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
961
|
+
|
962
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::UpdateShieldedInstanceConfigRequest
|
963
|
+
|
964
|
+
# Converts hash and nil to an options object
|
965
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
966
|
+
|
967
|
+
# Customize the options with defaults
|
968
|
+
metadata = @config.rpcs.update_shielded_instance_config.metadata.to_h
|
969
|
+
|
970
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
971
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
972
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
973
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
974
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
975
|
+
|
976
|
+
header_params = {}
|
977
|
+
if request.name
|
978
|
+
header_params["name"] = request.name
|
979
|
+
end
|
980
|
+
|
981
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
982
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
983
|
+
|
984
|
+
options.apply_defaults timeout: @config.rpcs.update_shielded_instance_config.timeout,
|
985
|
+
metadata: metadata,
|
986
|
+
retry_policy: @config.rpcs.update_shielded_instance_config.retry_policy
|
987
|
+
|
988
|
+
options.apply_defaults timeout: @config.timeout,
|
989
|
+
metadata: @config.metadata,
|
990
|
+
retry_policy: @config.retry_policy
|
991
|
+
|
992
|
+
@notebook_service_stub.call_rpc :update_shielded_instance_config, request, options: options do |response, operation|
|
993
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
994
|
+
yield response, operation if block_given?
|
995
|
+
return response
|
996
|
+
end
|
997
|
+
rescue ::GRPC::BadStatus => e
|
998
|
+
raise ::Google::Cloud::Error.from_error(e)
|
999
|
+
end
|
1000
|
+
|
1001
|
+
##
|
1002
|
+
# Replaces all the labels of an Instance.
|
1003
|
+
#
|
1004
|
+
# @overload set_instance_labels(request, options = nil)
|
1005
|
+
# Pass arguments to `set_instance_labels` via a request object, either of type
|
1006
|
+
# {::Google::Cloud::Notebooks::V1::SetInstanceLabelsRequest} or an equivalent Hash.
|
1007
|
+
#
|
1008
|
+
# @param request [::Google::Cloud::Notebooks::V1::SetInstanceLabelsRequest, ::Hash]
|
1009
|
+
# A request object representing the call parameters. Required. To specify no
|
1010
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1011
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1012
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1013
|
+
#
|
1014
|
+
# @overload set_instance_labels(name: nil, labels: nil)
|
1015
|
+
# Pass arguments to `set_instance_labels` via keyword arguments. Note that at
|
1016
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1017
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1018
|
+
#
|
1019
|
+
# @param name [::String]
|
1020
|
+
# Required. Format:
|
1021
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
1022
|
+
# @param labels [::Hash{::String => ::String}]
|
1023
|
+
# Labels to apply to this instance.
|
1024
|
+
# These can be later modified by the setLabels method
|
1025
|
+
#
|
1026
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1027
|
+
# @yieldparam response [::Gapic::Operation]
|
1028
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1029
|
+
#
|
1030
|
+
# @return [::Gapic::Operation]
|
1031
|
+
#
|
1032
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1033
|
+
#
|
1034
|
+
# @example Basic example
|
1035
|
+
# require "google/cloud/notebooks/v1"
|
1036
|
+
#
|
1037
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1038
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
1039
|
+
#
|
1040
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1041
|
+
# request = Google::Cloud::Notebooks::V1::SetInstanceLabelsRequest.new
|
1042
|
+
#
|
1043
|
+
# # Call the set_instance_labels method.
|
1044
|
+
# result = client.set_instance_labels request
|
1045
|
+
#
|
1046
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1047
|
+
# # object to check the status of an operation, cancel it, or wait
|
1048
|
+
# # for results. Here is how to block until completion:
|
1049
|
+
# result.wait_until_done! timeout: 60
|
1050
|
+
# if result.response?
|
1051
|
+
# p result.response
|
1052
|
+
# else
|
1053
|
+
# puts "Error!"
|
1054
|
+
# end
|
1055
|
+
#
|
1056
|
+
def set_instance_labels request, options = nil
|
1057
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1058
|
+
|
1059
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::SetInstanceLabelsRequest
|
1060
|
+
|
1061
|
+
# Converts hash and nil to an options object
|
1062
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1063
|
+
|
1064
|
+
# Customize the options with defaults
|
1065
|
+
metadata = @config.rpcs.set_instance_labels.metadata.to_h
|
1066
|
+
|
1067
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1068
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1069
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1070
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
1071
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1072
|
+
|
1073
|
+
header_params = {}
|
1074
|
+
if request.name
|
1075
|
+
header_params["name"] = request.name
|
1076
|
+
end
|
1077
|
+
|
1078
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1079
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1080
|
+
|
1081
|
+
options.apply_defaults timeout: @config.rpcs.set_instance_labels.timeout,
|
1082
|
+
metadata: metadata,
|
1083
|
+
retry_policy: @config.rpcs.set_instance_labels.retry_policy
|
1084
|
+
|
1085
|
+
options.apply_defaults timeout: @config.timeout,
|
1086
|
+
metadata: @config.metadata,
|
1087
|
+
retry_policy: @config.retry_policy
|
1088
|
+
|
1089
|
+
@notebook_service_stub.call_rpc :set_instance_labels, request, options: options do |response, operation|
|
1090
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1091
|
+
yield response, operation if block_given?
|
1092
|
+
return response
|
1093
|
+
end
|
1094
|
+
rescue ::GRPC::BadStatus => e
|
1095
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1096
|
+
end
|
1097
|
+
|
1098
|
+
##
|
1099
|
+
# Deletes a single Instance.
|
1100
|
+
#
|
1101
|
+
# @overload delete_instance(request, options = nil)
|
1102
|
+
# Pass arguments to `delete_instance` via a request object, either of type
|
1103
|
+
# {::Google::Cloud::Notebooks::V1::DeleteInstanceRequest} or an equivalent Hash.
|
1104
|
+
#
|
1105
|
+
# @param request [::Google::Cloud::Notebooks::V1::DeleteInstanceRequest, ::Hash]
|
1106
|
+
# A request object representing the call parameters. Required. To specify no
|
1107
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1108
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1109
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1110
|
+
#
|
1111
|
+
# @overload delete_instance(name: nil)
|
1112
|
+
# Pass arguments to `delete_instance` via keyword arguments. Note that at
|
1113
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1114
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1115
|
+
#
|
1116
|
+
# @param name [::String]
|
1117
|
+
# Required. Format:
|
1118
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
1119
|
+
#
|
1120
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1121
|
+
# @yieldparam response [::Gapic::Operation]
|
1122
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1123
|
+
#
|
1124
|
+
# @return [::Gapic::Operation]
|
1125
|
+
#
|
1126
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1127
|
+
#
|
1128
|
+
# @example Basic example
|
1129
|
+
# require "google/cloud/notebooks/v1"
|
1130
|
+
#
|
1131
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1132
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
1133
|
+
#
|
1134
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1135
|
+
# request = Google::Cloud::Notebooks::V1::DeleteInstanceRequest.new
|
1136
|
+
#
|
1137
|
+
# # Call the delete_instance method.
|
1138
|
+
# result = client.delete_instance request
|
1139
|
+
#
|
1140
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1141
|
+
# # object to check the status of an operation, cancel it, or wait
|
1142
|
+
# # for results. Here is how to block until completion:
|
1143
|
+
# result.wait_until_done! timeout: 60
|
1144
|
+
# if result.response?
|
1145
|
+
# p result.response
|
1146
|
+
# else
|
1147
|
+
# puts "Error!"
|
1148
|
+
# end
|
1149
|
+
#
|
1150
|
+
def delete_instance request, options = nil
|
1151
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1152
|
+
|
1153
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::DeleteInstanceRequest
|
1154
|
+
|
1155
|
+
# Converts hash and nil to an options object
|
1156
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1157
|
+
|
1158
|
+
# Customize the options with defaults
|
1159
|
+
metadata = @config.rpcs.delete_instance.metadata.to_h
|
1160
|
+
|
1161
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1162
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1163
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1164
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
1165
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1166
|
+
|
1167
|
+
header_params = {}
|
1168
|
+
if request.name
|
1169
|
+
header_params["name"] = request.name
|
1170
|
+
end
|
1171
|
+
|
1172
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1173
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1174
|
+
|
1175
|
+
options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
|
1176
|
+
metadata: metadata,
|
1177
|
+
retry_policy: @config.rpcs.delete_instance.retry_policy
|
1178
|
+
|
1179
|
+
options.apply_defaults timeout: @config.timeout,
|
1180
|
+
metadata: @config.metadata,
|
1181
|
+
retry_policy: @config.retry_policy
|
1182
|
+
|
1183
|
+
@notebook_service_stub.call_rpc :delete_instance, request, options: options do |response, operation|
|
1184
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1185
|
+
yield response, operation if block_given?
|
1186
|
+
return response
|
1187
|
+
end
|
1188
|
+
rescue ::GRPC::BadStatus => e
|
1189
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1190
|
+
end
|
1191
|
+
|
1192
|
+
##
|
1193
|
+
# Starts a notebook instance.
|
1194
|
+
#
|
1195
|
+
# @overload start_instance(request, options = nil)
|
1196
|
+
# Pass arguments to `start_instance` via a request object, either of type
|
1197
|
+
# {::Google::Cloud::Notebooks::V1::StartInstanceRequest} or an equivalent Hash.
|
1198
|
+
#
|
1199
|
+
# @param request [::Google::Cloud::Notebooks::V1::StartInstanceRequest, ::Hash]
|
1200
|
+
# A request object representing the call parameters. Required. To specify no
|
1201
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1202
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1203
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1204
|
+
#
|
1205
|
+
# @overload start_instance(name: nil)
|
1206
|
+
# Pass arguments to `start_instance` via keyword arguments. Note that at
|
1207
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1208
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1209
|
+
#
|
1210
|
+
# @param name [::String]
|
1211
|
+
# Required. Format:
|
1212
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
1213
|
+
#
|
1214
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1215
|
+
# @yieldparam response [::Gapic::Operation]
|
1216
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1217
|
+
#
|
1218
|
+
# @return [::Gapic::Operation]
|
1219
|
+
#
|
1220
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1221
|
+
#
|
1222
|
+
# @example Basic example
|
1223
|
+
# require "google/cloud/notebooks/v1"
|
1224
|
+
#
|
1225
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1226
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
1227
|
+
#
|
1228
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1229
|
+
# request = Google::Cloud::Notebooks::V1::StartInstanceRequest.new
|
1230
|
+
#
|
1231
|
+
# # Call the start_instance method.
|
1232
|
+
# result = client.start_instance request
|
1233
|
+
#
|
1234
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1235
|
+
# # object to check the status of an operation, cancel it, or wait
|
1236
|
+
# # for results. Here is how to block until completion:
|
1237
|
+
# result.wait_until_done! timeout: 60
|
1238
|
+
# if result.response?
|
1239
|
+
# p result.response
|
1240
|
+
# else
|
1241
|
+
# puts "Error!"
|
1242
|
+
# end
|
1243
|
+
#
|
1244
|
+
def start_instance request, options = nil
|
1245
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1246
|
+
|
1247
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::StartInstanceRequest
|
1248
|
+
|
1249
|
+
# Converts hash and nil to an options object
|
1250
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1251
|
+
|
1252
|
+
# Customize the options with defaults
|
1253
|
+
metadata = @config.rpcs.start_instance.metadata.to_h
|
1254
|
+
|
1255
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1256
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1257
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1258
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
1259
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1260
|
+
|
1261
|
+
header_params = {}
|
1262
|
+
if request.name
|
1263
|
+
header_params["name"] = request.name
|
1264
|
+
end
|
1265
|
+
|
1266
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1267
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1268
|
+
|
1269
|
+
options.apply_defaults timeout: @config.rpcs.start_instance.timeout,
|
1270
|
+
metadata: metadata,
|
1271
|
+
retry_policy: @config.rpcs.start_instance.retry_policy
|
1272
|
+
|
1273
|
+
options.apply_defaults timeout: @config.timeout,
|
1274
|
+
metadata: @config.metadata,
|
1275
|
+
retry_policy: @config.retry_policy
|
1276
|
+
|
1277
|
+
@notebook_service_stub.call_rpc :start_instance, request, options: options do |response, operation|
|
1278
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1279
|
+
yield response, operation if block_given?
|
1280
|
+
return response
|
1281
|
+
end
|
1282
|
+
rescue ::GRPC::BadStatus => e
|
1283
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1284
|
+
end
|
1285
|
+
|
1286
|
+
##
|
1287
|
+
# Stops a notebook instance.
|
1288
|
+
#
|
1289
|
+
# @overload stop_instance(request, options = nil)
|
1290
|
+
# Pass arguments to `stop_instance` via a request object, either of type
|
1291
|
+
# {::Google::Cloud::Notebooks::V1::StopInstanceRequest} or an equivalent Hash.
|
1292
|
+
#
|
1293
|
+
# @param request [::Google::Cloud::Notebooks::V1::StopInstanceRequest, ::Hash]
|
1294
|
+
# A request object representing the call parameters. Required. To specify no
|
1295
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1296
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1297
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1298
|
+
#
|
1299
|
+
# @overload stop_instance(name: nil)
|
1300
|
+
# Pass arguments to `stop_instance` via keyword arguments. Note that at
|
1301
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1302
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1303
|
+
#
|
1304
|
+
# @param name [::String]
|
1305
|
+
# Required. Format:
|
1306
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
1307
|
+
#
|
1308
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1309
|
+
# @yieldparam response [::Gapic::Operation]
|
1310
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1311
|
+
#
|
1312
|
+
# @return [::Gapic::Operation]
|
1313
|
+
#
|
1314
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1315
|
+
#
|
1316
|
+
# @example Basic example
|
1317
|
+
# require "google/cloud/notebooks/v1"
|
1318
|
+
#
|
1319
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1320
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
1321
|
+
#
|
1322
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1323
|
+
# request = Google::Cloud::Notebooks::V1::StopInstanceRequest.new
|
1324
|
+
#
|
1325
|
+
# # Call the stop_instance method.
|
1326
|
+
# result = client.stop_instance request
|
1327
|
+
#
|
1328
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1329
|
+
# # object to check the status of an operation, cancel it, or wait
|
1330
|
+
# # for results. Here is how to block until completion:
|
1331
|
+
# result.wait_until_done! timeout: 60
|
1332
|
+
# if result.response?
|
1333
|
+
# p result.response
|
1334
|
+
# else
|
1335
|
+
# puts "Error!"
|
1336
|
+
# end
|
1337
|
+
#
|
1338
|
+
def stop_instance request, options = nil
|
1339
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1340
|
+
|
1341
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::StopInstanceRequest
|
1342
|
+
|
1343
|
+
# Converts hash and nil to an options object
|
1344
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1345
|
+
|
1346
|
+
# Customize the options with defaults
|
1347
|
+
metadata = @config.rpcs.stop_instance.metadata.to_h
|
1348
|
+
|
1349
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1350
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1351
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1352
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
1353
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1354
|
+
|
1355
|
+
header_params = {}
|
1356
|
+
if request.name
|
1357
|
+
header_params["name"] = request.name
|
1358
|
+
end
|
1359
|
+
|
1360
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1361
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1362
|
+
|
1363
|
+
options.apply_defaults timeout: @config.rpcs.stop_instance.timeout,
|
1364
|
+
metadata: metadata,
|
1365
|
+
retry_policy: @config.rpcs.stop_instance.retry_policy
|
1366
|
+
|
1367
|
+
options.apply_defaults timeout: @config.timeout,
|
1368
|
+
metadata: @config.metadata,
|
1369
|
+
retry_policy: @config.retry_policy
|
1370
|
+
|
1371
|
+
@notebook_service_stub.call_rpc :stop_instance, request, options: options do |response, operation|
|
1372
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1373
|
+
yield response, operation if block_given?
|
1374
|
+
return response
|
1375
|
+
end
|
1376
|
+
rescue ::GRPC::BadStatus => e
|
1377
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1378
|
+
end
|
1379
|
+
|
1380
|
+
##
|
1381
|
+
# Resets a notebook instance.
|
1382
|
+
#
|
1383
|
+
# @overload reset_instance(request, options = nil)
|
1384
|
+
# Pass arguments to `reset_instance` via a request object, either of type
|
1385
|
+
# {::Google::Cloud::Notebooks::V1::ResetInstanceRequest} or an equivalent Hash.
|
1386
|
+
#
|
1387
|
+
# @param request [::Google::Cloud::Notebooks::V1::ResetInstanceRequest, ::Hash]
|
1388
|
+
# A request object representing the call parameters. Required. To specify no
|
1389
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1390
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1391
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1392
|
+
#
|
1393
|
+
# @overload reset_instance(name: nil)
|
1394
|
+
# Pass arguments to `reset_instance` via keyword arguments. Note that at
|
1395
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1396
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1397
|
+
#
|
1398
|
+
# @param name [::String]
|
1399
|
+
# Required. Format:
|
1400
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
1401
|
+
#
|
1402
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1403
|
+
# @yieldparam response [::Gapic::Operation]
|
1404
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1405
|
+
#
|
1406
|
+
# @return [::Gapic::Operation]
|
1407
|
+
#
|
1408
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1409
|
+
#
|
1410
|
+
# @example Basic example
|
1411
|
+
# require "google/cloud/notebooks/v1"
|
1412
|
+
#
|
1413
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1414
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
1415
|
+
#
|
1416
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1417
|
+
# request = Google::Cloud::Notebooks::V1::ResetInstanceRequest.new
|
1418
|
+
#
|
1419
|
+
# # Call the reset_instance method.
|
1420
|
+
# result = client.reset_instance request
|
1421
|
+
#
|
1422
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1423
|
+
# # object to check the status of an operation, cancel it, or wait
|
1424
|
+
# # for results. Here is how to block until completion:
|
1425
|
+
# result.wait_until_done! timeout: 60
|
1426
|
+
# if result.response?
|
1427
|
+
# p result.response
|
1428
|
+
# else
|
1429
|
+
# puts "Error!"
|
1430
|
+
# end
|
1431
|
+
#
|
1432
|
+
def reset_instance request, options = nil
|
1433
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1434
|
+
|
1435
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::ResetInstanceRequest
|
1436
|
+
|
1437
|
+
# Converts hash and nil to an options object
|
1438
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1439
|
+
|
1440
|
+
# Customize the options with defaults
|
1441
|
+
metadata = @config.rpcs.reset_instance.metadata.to_h
|
1442
|
+
|
1443
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1444
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1445
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1446
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
1447
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1448
|
+
|
1449
|
+
header_params = {}
|
1450
|
+
if request.name
|
1451
|
+
header_params["name"] = request.name
|
1452
|
+
end
|
1453
|
+
|
1454
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1455
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1456
|
+
|
1457
|
+
options.apply_defaults timeout: @config.rpcs.reset_instance.timeout,
|
1458
|
+
metadata: metadata,
|
1459
|
+
retry_policy: @config.rpcs.reset_instance.retry_policy
|
1460
|
+
|
1461
|
+
options.apply_defaults timeout: @config.timeout,
|
1462
|
+
metadata: @config.metadata,
|
1463
|
+
retry_policy: @config.retry_policy
|
1464
|
+
|
1465
|
+
@notebook_service_stub.call_rpc :reset_instance, request, options: options do |response, operation|
|
1466
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1467
|
+
yield response, operation if block_given?
|
1468
|
+
return response
|
1469
|
+
end
|
1470
|
+
rescue ::GRPC::BadStatus => e
|
1471
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1472
|
+
end
|
1473
|
+
|
1474
|
+
##
|
1475
|
+
# Allows notebook instances to
|
1476
|
+
# report their latest instance information to the Notebooks
|
1477
|
+
# API server. The server will merge the reported information to
|
1478
|
+
# the instance metadata store. Do not use this method directly.
|
1479
|
+
#
|
1480
|
+
# @overload report_instance_info(request, options = nil)
|
1481
|
+
# Pass arguments to `report_instance_info` via a request object, either of type
|
1482
|
+
# {::Google::Cloud::Notebooks::V1::ReportInstanceInfoRequest} or an equivalent Hash.
|
1483
|
+
#
|
1484
|
+
# @param request [::Google::Cloud::Notebooks::V1::ReportInstanceInfoRequest, ::Hash]
|
1485
|
+
# A request object representing the call parameters. Required. To specify no
|
1486
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1487
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1488
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1489
|
+
#
|
1490
|
+
# @overload report_instance_info(name: nil, vm_id: nil, metadata: nil)
|
1491
|
+
# Pass arguments to `report_instance_info` via keyword arguments. Note that at
|
1492
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1493
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1494
|
+
#
|
1495
|
+
# @param name [::String]
|
1496
|
+
# Required. Format:
|
1497
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
1498
|
+
# @param vm_id [::String]
|
1499
|
+
# Required. The VM hardware token for authenticating the VM.
|
1500
|
+
# https://cloud.google.com/compute/docs/instances/verifying-instance-identity
|
1501
|
+
# @param metadata [::Hash{::String => ::String}]
|
1502
|
+
# The metadata reported to Notebooks API. This will be merged to the instance
|
1503
|
+
# metadata store
|
1504
|
+
#
|
1505
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1506
|
+
# @yieldparam response [::Gapic::Operation]
|
1507
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1508
|
+
#
|
1509
|
+
# @return [::Gapic::Operation]
|
1510
|
+
#
|
1511
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1512
|
+
#
|
1513
|
+
# @example Basic example
|
1514
|
+
# require "google/cloud/notebooks/v1"
|
1515
|
+
#
|
1516
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1517
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
1518
|
+
#
|
1519
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1520
|
+
# request = Google::Cloud::Notebooks::V1::ReportInstanceInfoRequest.new
|
1521
|
+
#
|
1522
|
+
# # Call the report_instance_info method.
|
1523
|
+
# result = client.report_instance_info request
|
1524
|
+
#
|
1525
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1526
|
+
# # object to check the status of an operation, cancel it, or wait
|
1527
|
+
# # for results. Here is how to block until completion:
|
1528
|
+
# result.wait_until_done! timeout: 60
|
1529
|
+
# if result.response?
|
1530
|
+
# p result.response
|
1531
|
+
# else
|
1532
|
+
# puts "Error!"
|
1533
|
+
# end
|
1534
|
+
#
|
1535
|
+
def report_instance_info request, options = nil
|
1536
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1537
|
+
|
1538
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::ReportInstanceInfoRequest
|
1539
|
+
|
1540
|
+
# Converts hash and nil to an options object
|
1541
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1542
|
+
|
1543
|
+
# Customize the options with defaults
|
1544
|
+
metadata = @config.rpcs.report_instance_info.metadata.to_h
|
1545
|
+
|
1546
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1547
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1548
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1549
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
1550
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1551
|
+
|
1552
|
+
header_params = {}
|
1553
|
+
if request.name
|
1554
|
+
header_params["name"] = request.name
|
1555
|
+
end
|
1556
|
+
|
1557
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1558
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1559
|
+
|
1560
|
+
options.apply_defaults timeout: @config.rpcs.report_instance_info.timeout,
|
1561
|
+
metadata: metadata,
|
1562
|
+
retry_policy: @config.rpcs.report_instance_info.retry_policy
|
1563
|
+
|
1564
|
+
options.apply_defaults timeout: @config.timeout,
|
1565
|
+
metadata: @config.metadata,
|
1566
|
+
retry_policy: @config.retry_policy
|
1567
|
+
|
1568
|
+
@notebook_service_stub.call_rpc :report_instance_info, request, options: options do |response, operation|
|
1569
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1570
|
+
yield response, operation if block_given?
|
1571
|
+
return response
|
1572
|
+
end
|
1573
|
+
rescue ::GRPC::BadStatus => e
|
1574
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1575
|
+
end
|
1576
|
+
|
1577
|
+
##
|
1578
|
+
# Check if a notebook instance is upgradable.
|
1579
|
+
#
|
1580
|
+
# @overload is_instance_upgradeable(request, options = nil)
|
1581
|
+
# Pass arguments to `is_instance_upgradeable` via a request object, either of type
|
1582
|
+
# {::Google::Cloud::Notebooks::V1::IsInstanceUpgradeableRequest} or an equivalent Hash.
|
1583
|
+
#
|
1584
|
+
# @param request [::Google::Cloud::Notebooks::V1::IsInstanceUpgradeableRequest, ::Hash]
|
1585
|
+
# A request object representing the call parameters. Required. To specify no
|
1586
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1587
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1588
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1589
|
+
#
|
1590
|
+
# @overload is_instance_upgradeable(notebook_instance: nil)
|
1591
|
+
# Pass arguments to `is_instance_upgradeable` via keyword arguments. Note that at
|
1592
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1593
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1594
|
+
#
|
1595
|
+
# @param notebook_instance [::String]
|
1596
|
+
# Required. Format:
|
1597
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
1598
|
+
#
|
1599
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1600
|
+
# @yieldparam response [::Google::Cloud::Notebooks::V1::IsInstanceUpgradeableResponse]
|
1601
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1602
|
+
#
|
1603
|
+
# @return [::Google::Cloud::Notebooks::V1::IsInstanceUpgradeableResponse]
|
1604
|
+
#
|
1605
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1606
|
+
#
|
1607
|
+
# @example Basic example
|
1608
|
+
# require "google/cloud/notebooks/v1"
|
1609
|
+
#
|
1610
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1611
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
1612
|
+
#
|
1613
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1614
|
+
# request = Google::Cloud::Notebooks::V1::IsInstanceUpgradeableRequest.new
|
1615
|
+
#
|
1616
|
+
# # Call the is_instance_upgradeable method.
|
1617
|
+
# result = client.is_instance_upgradeable request
|
1618
|
+
#
|
1619
|
+
# # The returned object is of type Google::Cloud::Notebooks::V1::IsInstanceUpgradeableResponse.
|
1620
|
+
# p result
|
1621
|
+
#
|
1622
|
+
def is_instance_upgradeable request, options = nil
|
1623
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1624
|
+
|
1625
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::IsInstanceUpgradeableRequest
|
1626
|
+
|
1627
|
+
# Converts hash and nil to an options object
|
1628
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1629
|
+
|
1630
|
+
# Customize the options with defaults
|
1631
|
+
metadata = @config.rpcs.is_instance_upgradeable.metadata.to_h
|
1632
|
+
|
1633
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1634
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1635
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1636
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
1637
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1638
|
+
|
1639
|
+
header_params = {}
|
1640
|
+
if request.notebook_instance
|
1641
|
+
header_params["notebook_instance"] = request.notebook_instance
|
1642
|
+
end
|
1643
|
+
|
1644
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1645
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1646
|
+
|
1647
|
+
options.apply_defaults timeout: @config.rpcs.is_instance_upgradeable.timeout,
|
1648
|
+
metadata: metadata,
|
1649
|
+
retry_policy: @config.rpcs.is_instance_upgradeable.retry_policy
|
1650
|
+
|
1651
|
+
options.apply_defaults timeout: @config.timeout,
|
1652
|
+
metadata: @config.metadata,
|
1653
|
+
retry_policy: @config.retry_policy
|
1654
|
+
|
1655
|
+
@notebook_service_stub.call_rpc :is_instance_upgradeable, request, options: options do |response, operation|
|
1656
|
+
yield response, operation if block_given?
|
1657
|
+
return response
|
1658
|
+
end
|
1659
|
+
rescue ::GRPC::BadStatus => e
|
1660
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1661
|
+
end
|
1662
|
+
|
1663
|
+
##
|
1664
|
+
# Check if a notebook instance is healthy.
|
1665
|
+
#
|
1666
|
+
# @overload get_instance_health(request, options = nil)
|
1667
|
+
# Pass arguments to `get_instance_health` via a request object, either of type
|
1668
|
+
# {::Google::Cloud::Notebooks::V1::GetInstanceHealthRequest} or an equivalent Hash.
|
1669
|
+
#
|
1670
|
+
# @param request [::Google::Cloud::Notebooks::V1::GetInstanceHealthRequest, ::Hash]
|
1671
|
+
# A request object representing the call parameters. Required. To specify no
|
1672
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1673
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1674
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1675
|
+
#
|
1676
|
+
# @overload get_instance_health(name: nil)
|
1677
|
+
# Pass arguments to `get_instance_health` via keyword arguments. Note that at
|
1678
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1679
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1680
|
+
#
|
1681
|
+
# @param name [::String]
|
1682
|
+
# Required. Format:
|
1683
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
1684
|
+
#
|
1685
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1686
|
+
# @yieldparam response [::Google::Cloud::Notebooks::V1::GetInstanceHealthResponse]
|
1687
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1688
|
+
#
|
1689
|
+
# @return [::Google::Cloud::Notebooks::V1::GetInstanceHealthResponse]
|
1690
|
+
#
|
1691
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1692
|
+
#
|
1693
|
+
# @example Basic example
|
1694
|
+
# require "google/cloud/notebooks/v1"
|
1695
|
+
#
|
1696
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1697
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
1698
|
+
#
|
1699
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1700
|
+
# request = Google::Cloud::Notebooks::V1::GetInstanceHealthRequest.new
|
1701
|
+
#
|
1702
|
+
# # Call the get_instance_health method.
|
1703
|
+
# result = client.get_instance_health request
|
1704
|
+
#
|
1705
|
+
# # The returned object is of type Google::Cloud::Notebooks::V1::GetInstanceHealthResponse.
|
1706
|
+
# p result
|
1707
|
+
#
|
1708
|
+
def get_instance_health request, options = nil
|
1709
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1710
|
+
|
1711
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::GetInstanceHealthRequest
|
1712
|
+
|
1713
|
+
# Converts hash and nil to an options object
|
1714
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1715
|
+
|
1716
|
+
# Customize the options with defaults
|
1717
|
+
metadata = @config.rpcs.get_instance_health.metadata.to_h
|
1718
|
+
|
1719
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1720
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1721
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1722
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
1723
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1724
|
+
|
1725
|
+
header_params = {}
|
1726
|
+
if request.name
|
1727
|
+
header_params["name"] = request.name
|
1728
|
+
end
|
1729
|
+
|
1730
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1731
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1732
|
+
|
1733
|
+
options.apply_defaults timeout: @config.rpcs.get_instance_health.timeout,
|
1734
|
+
metadata: metadata,
|
1735
|
+
retry_policy: @config.rpcs.get_instance_health.retry_policy
|
1736
|
+
|
1737
|
+
options.apply_defaults timeout: @config.timeout,
|
1738
|
+
metadata: @config.metadata,
|
1739
|
+
retry_policy: @config.retry_policy
|
1740
|
+
|
1741
|
+
@notebook_service_stub.call_rpc :get_instance_health, request, options: options do |response, operation|
|
1742
|
+
yield response, operation if block_given?
|
1743
|
+
return response
|
1744
|
+
end
|
1745
|
+
rescue ::GRPC::BadStatus => e
|
1746
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1747
|
+
end
|
1748
|
+
|
1749
|
+
##
|
1750
|
+
# Upgrades a notebook instance to the latest version.
|
1751
|
+
#
|
1752
|
+
# @overload upgrade_instance(request, options = nil)
|
1753
|
+
# Pass arguments to `upgrade_instance` via a request object, either of type
|
1754
|
+
# {::Google::Cloud::Notebooks::V1::UpgradeInstanceRequest} or an equivalent Hash.
|
1755
|
+
#
|
1756
|
+
# @param request [::Google::Cloud::Notebooks::V1::UpgradeInstanceRequest, ::Hash]
|
1757
|
+
# A request object representing the call parameters. Required. To specify no
|
1758
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1759
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1760
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1761
|
+
#
|
1762
|
+
# @overload upgrade_instance(name: nil)
|
1763
|
+
# Pass arguments to `upgrade_instance` via keyword arguments. Note that at
|
1764
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1765
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1766
|
+
#
|
1767
|
+
# @param name [::String]
|
1768
|
+
# Required. Format:
|
1769
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
1770
|
+
#
|
1771
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1772
|
+
# @yieldparam response [::Gapic::Operation]
|
1773
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1774
|
+
#
|
1775
|
+
# @return [::Gapic::Operation]
|
1776
|
+
#
|
1777
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1778
|
+
#
|
1779
|
+
# @example Basic example
|
1780
|
+
# require "google/cloud/notebooks/v1"
|
1781
|
+
#
|
1782
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1783
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
1784
|
+
#
|
1785
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1786
|
+
# request = Google::Cloud::Notebooks::V1::UpgradeInstanceRequest.new
|
1787
|
+
#
|
1788
|
+
# # Call the upgrade_instance method.
|
1789
|
+
# result = client.upgrade_instance request
|
1790
|
+
#
|
1791
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1792
|
+
# # object to check the status of an operation, cancel it, or wait
|
1793
|
+
# # for results. Here is how to block until completion:
|
1794
|
+
# result.wait_until_done! timeout: 60
|
1795
|
+
# if result.response?
|
1796
|
+
# p result.response
|
1797
|
+
# else
|
1798
|
+
# puts "Error!"
|
1799
|
+
# end
|
1800
|
+
#
|
1801
|
+
def upgrade_instance request, options = nil
|
1802
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1803
|
+
|
1804
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::UpgradeInstanceRequest
|
1805
|
+
|
1806
|
+
# Converts hash and nil to an options object
|
1807
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1808
|
+
|
1809
|
+
# Customize the options with defaults
|
1810
|
+
metadata = @config.rpcs.upgrade_instance.metadata.to_h
|
1811
|
+
|
1812
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1813
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1814
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1815
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
1816
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1817
|
+
|
1818
|
+
header_params = {}
|
1819
|
+
if request.name
|
1820
|
+
header_params["name"] = request.name
|
1821
|
+
end
|
1822
|
+
|
1823
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1824
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1825
|
+
|
1826
|
+
options.apply_defaults timeout: @config.rpcs.upgrade_instance.timeout,
|
1827
|
+
metadata: metadata,
|
1828
|
+
retry_policy: @config.rpcs.upgrade_instance.retry_policy
|
1829
|
+
|
1830
|
+
options.apply_defaults timeout: @config.timeout,
|
1831
|
+
metadata: @config.metadata,
|
1832
|
+
retry_policy: @config.retry_policy
|
1833
|
+
|
1834
|
+
@notebook_service_stub.call_rpc :upgrade_instance, request, options: options do |response, operation|
|
1835
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1836
|
+
yield response, operation if block_given?
|
1837
|
+
return response
|
1838
|
+
end
|
1839
|
+
rescue ::GRPC::BadStatus => e
|
1840
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1841
|
+
end
|
1842
|
+
|
1843
|
+
##
|
1844
|
+
# Rollbacks a notebook instance to the previous version.
|
1845
|
+
#
|
1846
|
+
# @overload rollback_instance(request, options = nil)
|
1847
|
+
# Pass arguments to `rollback_instance` via a request object, either of type
|
1848
|
+
# {::Google::Cloud::Notebooks::V1::RollbackInstanceRequest} or an equivalent Hash.
|
1849
|
+
#
|
1850
|
+
# @param request [::Google::Cloud::Notebooks::V1::RollbackInstanceRequest, ::Hash]
|
1851
|
+
# A request object representing the call parameters. Required. To specify no
|
1852
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1853
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1854
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1855
|
+
#
|
1856
|
+
# @overload rollback_instance(name: nil, target_snapshot: nil)
|
1857
|
+
# Pass arguments to `rollback_instance` via keyword arguments. Note that at
|
1858
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1859
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1860
|
+
#
|
1861
|
+
# @param name [::String]
|
1862
|
+
# Required. Format:
|
1863
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
1864
|
+
# @param target_snapshot [::String]
|
1865
|
+
# Required. The snapshot for rollback.
|
1866
|
+
# Example: "projects/test-project/global/snapshots/krwlzipynril".
|
1867
|
+
#
|
1868
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1869
|
+
# @yieldparam response [::Gapic::Operation]
|
1870
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1871
|
+
#
|
1872
|
+
# @return [::Gapic::Operation]
|
1873
|
+
#
|
1874
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1875
|
+
#
|
1876
|
+
# @example Basic example
|
1877
|
+
# require "google/cloud/notebooks/v1"
|
1878
|
+
#
|
1879
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1880
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
1881
|
+
#
|
1882
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1883
|
+
# request = Google::Cloud::Notebooks::V1::RollbackInstanceRequest.new
|
1884
|
+
#
|
1885
|
+
# # Call the rollback_instance method.
|
1886
|
+
# result = client.rollback_instance request
|
1887
|
+
#
|
1888
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1889
|
+
# # object to check the status of an operation, cancel it, or wait
|
1890
|
+
# # for results. Here is how to block until completion:
|
1891
|
+
# result.wait_until_done! timeout: 60
|
1892
|
+
# if result.response?
|
1893
|
+
# p result.response
|
1894
|
+
# else
|
1895
|
+
# puts "Error!"
|
1896
|
+
# end
|
1897
|
+
#
|
1898
|
+
def rollback_instance request, options = nil
|
1899
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1900
|
+
|
1901
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::RollbackInstanceRequest
|
1902
|
+
|
1903
|
+
# Converts hash and nil to an options object
|
1904
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1905
|
+
|
1906
|
+
# Customize the options with defaults
|
1907
|
+
metadata = @config.rpcs.rollback_instance.metadata.to_h
|
1908
|
+
|
1909
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1910
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1911
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1912
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
1913
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1914
|
+
|
1915
|
+
header_params = {}
|
1916
|
+
if request.name
|
1917
|
+
header_params["name"] = request.name
|
1918
|
+
end
|
1919
|
+
|
1920
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1921
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1922
|
+
|
1923
|
+
options.apply_defaults timeout: @config.rpcs.rollback_instance.timeout,
|
1924
|
+
metadata: metadata,
|
1925
|
+
retry_policy: @config.rpcs.rollback_instance.retry_policy
|
1926
|
+
|
1927
|
+
options.apply_defaults timeout: @config.timeout,
|
1928
|
+
metadata: @config.metadata,
|
1929
|
+
retry_policy: @config.retry_policy
|
1930
|
+
|
1931
|
+
@notebook_service_stub.call_rpc :rollback_instance, request, options: options do |response, operation|
|
1932
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1933
|
+
yield response, operation if block_given?
|
1934
|
+
return response
|
1935
|
+
end
|
1936
|
+
rescue ::GRPC::BadStatus => e
|
1937
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1938
|
+
end
|
1939
|
+
|
1940
|
+
##
|
1941
|
+
# Allows notebook instances to
|
1942
|
+
# call this endpoint to upgrade themselves. Do not use this method directly.
|
1943
|
+
#
|
1944
|
+
# @overload upgrade_instance_internal(request, options = nil)
|
1945
|
+
# Pass arguments to `upgrade_instance_internal` via a request object, either of type
|
1946
|
+
# {::Google::Cloud::Notebooks::V1::UpgradeInstanceInternalRequest} or an equivalent Hash.
|
1947
|
+
#
|
1948
|
+
# @param request [::Google::Cloud::Notebooks::V1::UpgradeInstanceInternalRequest, ::Hash]
|
1949
|
+
# A request object representing the call parameters. Required. To specify no
|
1950
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1951
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1952
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1953
|
+
#
|
1954
|
+
# @overload upgrade_instance_internal(name: nil, vm_id: nil)
|
1955
|
+
# Pass arguments to `upgrade_instance_internal` via keyword arguments. Note that at
|
1956
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1957
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1958
|
+
#
|
1959
|
+
# @param name [::String]
|
1960
|
+
# Required. Format:
|
1961
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
1962
|
+
# @param vm_id [::String]
|
1963
|
+
# Required. The VM hardware token for authenticating the VM.
|
1964
|
+
# https://cloud.google.com/compute/docs/instances/verifying-instance-identity
|
1965
|
+
#
|
1966
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1967
|
+
# @yieldparam response [::Gapic::Operation]
|
1968
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1969
|
+
#
|
1970
|
+
# @return [::Gapic::Operation]
|
1971
|
+
#
|
1972
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1973
|
+
#
|
1974
|
+
# @example Basic example
|
1975
|
+
# require "google/cloud/notebooks/v1"
|
1976
|
+
#
|
1977
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1978
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
1979
|
+
#
|
1980
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1981
|
+
# request = Google::Cloud::Notebooks::V1::UpgradeInstanceInternalRequest.new
|
1982
|
+
#
|
1983
|
+
# # Call the upgrade_instance_internal method.
|
1984
|
+
# result = client.upgrade_instance_internal request
|
1985
|
+
#
|
1986
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1987
|
+
# # object to check the status of an operation, cancel it, or wait
|
1988
|
+
# # for results. Here is how to block until completion:
|
1989
|
+
# result.wait_until_done! timeout: 60
|
1990
|
+
# if result.response?
|
1991
|
+
# p result.response
|
1992
|
+
# else
|
1993
|
+
# puts "Error!"
|
1994
|
+
# end
|
1995
|
+
#
|
1996
|
+
def upgrade_instance_internal request, options = nil
|
1997
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1998
|
+
|
1999
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::UpgradeInstanceInternalRequest
|
2000
|
+
|
2001
|
+
# Converts hash and nil to an options object
|
2002
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2003
|
+
|
2004
|
+
# Customize the options with defaults
|
2005
|
+
metadata = @config.rpcs.upgrade_instance_internal.metadata.to_h
|
2006
|
+
|
2007
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2008
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2009
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2010
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
2011
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2012
|
+
|
2013
|
+
header_params = {}
|
2014
|
+
if request.name
|
2015
|
+
header_params["name"] = request.name
|
2016
|
+
end
|
2017
|
+
|
2018
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2019
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2020
|
+
|
2021
|
+
options.apply_defaults timeout: @config.rpcs.upgrade_instance_internal.timeout,
|
2022
|
+
metadata: metadata,
|
2023
|
+
retry_policy: @config.rpcs.upgrade_instance_internal.retry_policy
|
2024
|
+
|
2025
|
+
options.apply_defaults timeout: @config.timeout,
|
2026
|
+
metadata: @config.metadata,
|
2027
|
+
retry_policy: @config.retry_policy
|
2028
|
+
|
2029
|
+
@notebook_service_stub.call_rpc :upgrade_instance_internal, request, options: options do |response, operation|
|
2030
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2031
|
+
yield response, operation if block_given?
|
2032
|
+
return response
|
2033
|
+
end
|
2034
|
+
rescue ::GRPC::BadStatus => e
|
2035
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2036
|
+
end
|
2037
|
+
|
2038
|
+
##
|
2039
|
+
# Lists environments in a project.
|
2040
|
+
#
|
2041
|
+
# @overload list_environments(request, options = nil)
|
2042
|
+
# Pass arguments to `list_environments` via a request object, either of type
|
2043
|
+
# {::Google::Cloud::Notebooks::V1::ListEnvironmentsRequest} or an equivalent Hash.
|
2044
|
+
#
|
2045
|
+
# @param request [::Google::Cloud::Notebooks::V1::ListEnvironmentsRequest, ::Hash]
|
2046
|
+
# A request object representing the call parameters. Required. To specify no
|
2047
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2048
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2049
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2050
|
+
#
|
2051
|
+
# @overload list_environments(parent: nil, page_size: nil, page_token: nil)
|
2052
|
+
# Pass arguments to `list_environments` via keyword arguments. Note that at
|
2053
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2054
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2055
|
+
#
|
2056
|
+
# @param parent [::String]
|
2057
|
+
# Required. Format: `projects/{project_id}/locations/{location}`
|
2058
|
+
# @param page_size [::Integer]
|
2059
|
+
# Maximum return size of the list call.
|
2060
|
+
# @param page_token [::String]
|
2061
|
+
# A previous returned page token that can be used to continue listing from
|
2062
|
+
# the last result.
|
2063
|
+
#
|
2064
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2065
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Environment>]
|
2066
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2067
|
+
#
|
2068
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Environment>]
|
2069
|
+
#
|
2070
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2071
|
+
#
|
2072
|
+
# @example Basic example
|
2073
|
+
# require "google/cloud/notebooks/v1"
|
2074
|
+
#
|
2075
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2076
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
2077
|
+
#
|
2078
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2079
|
+
# request = Google::Cloud::Notebooks::V1::ListEnvironmentsRequest.new
|
2080
|
+
#
|
2081
|
+
# # Call the list_environments method.
|
2082
|
+
# result = client.list_environments request
|
2083
|
+
#
|
2084
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
2085
|
+
# # iterate over all elements by calling #each, and the enumerable
|
2086
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
2087
|
+
# # methods are also available for managing paging directly.
|
2088
|
+
# result.each do |response|
|
2089
|
+
# # Each element is of type ::Google::Cloud::Notebooks::V1::Environment.
|
2090
|
+
# p response
|
2091
|
+
# end
|
2092
|
+
#
|
2093
|
+
def list_environments request, options = nil
|
2094
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2095
|
+
|
2096
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::ListEnvironmentsRequest
|
2097
|
+
|
2098
|
+
# Converts hash and nil to an options object
|
2099
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2100
|
+
|
2101
|
+
# Customize the options with defaults
|
2102
|
+
metadata = @config.rpcs.list_environments.metadata.to_h
|
2103
|
+
|
2104
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2105
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2106
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2107
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
2108
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2109
|
+
|
2110
|
+
header_params = {}
|
2111
|
+
if request.parent
|
2112
|
+
header_params["parent"] = request.parent
|
2113
|
+
end
|
2114
|
+
|
2115
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2116
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2117
|
+
|
2118
|
+
options.apply_defaults timeout: @config.rpcs.list_environments.timeout,
|
2119
|
+
metadata: metadata,
|
2120
|
+
retry_policy: @config.rpcs.list_environments.retry_policy
|
2121
|
+
|
2122
|
+
options.apply_defaults timeout: @config.timeout,
|
2123
|
+
metadata: @config.metadata,
|
2124
|
+
retry_policy: @config.retry_policy
|
2125
|
+
|
2126
|
+
@notebook_service_stub.call_rpc :list_environments, request, options: options do |response, operation|
|
2127
|
+
response = ::Gapic::PagedEnumerable.new @notebook_service_stub, :list_environments, request, response, operation, options
|
2128
|
+
yield response, operation if block_given?
|
2129
|
+
return response
|
2130
|
+
end
|
2131
|
+
rescue ::GRPC::BadStatus => e
|
2132
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2133
|
+
end
|
2134
|
+
|
2135
|
+
##
|
2136
|
+
# Gets details of a single Environment.
|
2137
|
+
#
|
2138
|
+
# @overload get_environment(request, options = nil)
|
2139
|
+
# Pass arguments to `get_environment` via a request object, either of type
|
2140
|
+
# {::Google::Cloud::Notebooks::V1::GetEnvironmentRequest} or an equivalent Hash.
|
2141
|
+
#
|
2142
|
+
# @param request [::Google::Cloud::Notebooks::V1::GetEnvironmentRequest, ::Hash]
|
2143
|
+
# A request object representing the call parameters. Required. To specify no
|
2144
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2145
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2146
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2147
|
+
#
|
2148
|
+
# @overload get_environment(name: nil)
|
2149
|
+
# Pass arguments to `get_environment` via keyword arguments. Note that at
|
2150
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2151
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2152
|
+
#
|
2153
|
+
# @param name [::String]
|
2154
|
+
# Required. Format:
|
2155
|
+
# `projects/{project_id}/locations/{location}/environments/{environment_id}`
|
2156
|
+
#
|
2157
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2158
|
+
# @yieldparam response [::Google::Cloud::Notebooks::V1::Environment]
|
2159
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2160
|
+
#
|
2161
|
+
# @return [::Google::Cloud::Notebooks::V1::Environment]
|
2162
|
+
#
|
2163
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2164
|
+
#
|
2165
|
+
# @example Basic example
|
2166
|
+
# require "google/cloud/notebooks/v1"
|
2167
|
+
#
|
2168
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2169
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
2170
|
+
#
|
2171
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2172
|
+
# request = Google::Cloud::Notebooks::V1::GetEnvironmentRequest.new
|
2173
|
+
#
|
2174
|
+
# # Call the get_environment method.
|
2175
|
+
# result = client.get_environment request
|
2176
|
+
#
|
2177
|
+
# # The returned object is of type Google::Cloud::Notebooks::V1::Environment.
|
2178
|
+
# p result
|
2179
|
+
#
|
2180
|
+
def get_environment request, options = nil
|
2181
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2182
|
+
|
2183
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::GetEnvironmentRequest
|
2184
|
+
|
2185
|
+
# Converts hash and nil to an options object
|
2186
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2187
|
+
|
2188
|
+
# Customize the options with defaults
|
2189
|
+
metadata = @config.rpcs.get_environment.metadata.to_h
|
2190
|
+
|
2191
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2192
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2193
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2194
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
2195
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2196
|
+
|
2197
|
+
header_params = {}
|
2198
|
+
if request.name
|
2199
|
+
header_params["name"] = request.name
|
2200
|
+
end
|
2201
|
+
|
2202
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2203
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2204
|
+
|
2205
|
+
options.apply_defaults timeout: @config.rpcs.get_environment.timeout,
|
2206
|
+
metadata: metadata,
|
2207
|
+
retry_policy: @config.rpcs.get_environment.retry_policy
|
2208
|
+
|
2209
|
+
options.apply_defaults timeout: @config.timeout,
|
2210
|
+
metadata: @config.metadata,
|
2211
|
+
retry_policy: @config.retry_policy
|
2212
|
+
|
2213
|
+
@notebook_service_stub.call_rpc :get_environment, request, options: options do |response, operation|
|
2214
|
+
yield response, operation if block_given?
|
2215
|
+
return response
|
2216
|
+
end
|
2217
|
+
rescue ::GRPC::BadStatus => e
|
2218
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2219
|
+
end
|
2220
|
+
|
2221
|
+
##
|
2222
|
+
# Creates a new Environment.
|
2223
|
+
#
|
2224
|
+
# @overload create_environment(request, options = nil)
|
2225
|
+
# Pass arguments to `create_environment` via a request object, either of type
|
2226
|
+
# {::Google::Cloud::Notebooks::V1::CreateEnvironmentRequest} or an equivalent Hash.
|
2227
|
+
#
|
2228
|
+
# @param request [::Google::Cloud::Notebooks::V1::CreateEnvironmentRequest, ::Hash]
|
2229
|
+
# A request object representing the call parameters. Required. To specify no
|
2230
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2231
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2232
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2233
|
+
#
|
2234
|
+
# @overload create_environment(parent: nil, environment_id: nil, environment: nil)
|
2235
|
+
# Pass arguments to `create_environment` via keyword arguments. Note that at
|
2236
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2237
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2238
|
+
#
|
2239
|
+
# @param parent [::String]
|
2240
|
+
# Required. Format: `projects/{project_id}/locations/{location}`
|
2241
|
+
# @param environment_id [::String]
|
2242
|
+
# Required. User-defined unique ID of this environment. The `environment_id` must
|
2243
|
+
# be 1 to 63 characters long and contain only lowercase letters,
|
2244
|
+
# numeric characters, and dashes. The first character must be a lowercase
|
2245
|
+
# letter and the last character cannot be a dash.
|
2246
|
+
# @param environment [::Google::Cloud::Notebooks::V1::Environment, ::Hash]
|
2247
|
+
# Required. The environment to be created.
|
2248
|
+
#
|
2249
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2250
|
+
# @yieldparam response [::Gapic::Operation]
|
2251
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2252
|
+
#
|
2253
|
+
# @return [::Gapic::Operation]
|
2254
|
+
#
|
2255
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2256
|
+
#
|
2257
|
+
# @example Basic example
|
2258
|
+
# require "google/cloud/notebooks/v1"
|
2259
|
+
#
|
2260
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2261
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
2262
|
+
#
|
2263
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2264
|
+
# request = Google::Cloud::Notebooks::V1::CreateEnvironmentRequest.new
|
2265
|
+
#
|
2266
|
+
# # Call the create_environment method.
|
2267
|
+
# result = client.create_environment request
|
2268
|
+
#
|
2269
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
2270
|
+
# # object to check the status of an operation, cancel it, or wait
|
2271
|
+
# # for results. Here is how to block until completion:
|
2272
|
+
# result.wait_until_done! timeout: 60
|
2273
|
+
# if result.response?
|
2274
|
+
# p result.response
|
2275
|
+
# else
|
2276
|
+
# puts "Error!"
|
2277
|
+
# end
|
2278
|
+
#
|
2279
|
+
def create_environment request, options = nil
|
2280
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2281
|
+
|
2282
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::CreateEnvironmentRequest
|
2283
|
+
|
2284
|
+
# Converts hash and nil to an options object
|
2285
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2286
|
+
|
2287
|
+
# Customize the options with defaults
|
2288
|
+
metadata = @config.rpcs.create_environment.metadata.to_h
|
2289
|
+
|
2290
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2291
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2292
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2293
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
2294
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2295
|
+
|
2296
|
+
header_params = {}
|
2297
|
+
if request.parent
|
2298
|
+
header_params["parent"] = request.parent
|
2299
|
+
end
|
2300
|
+
|
2301
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2302
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2303
|
+
|
2304
|
+
options.apply_defaults timeout: @config.rpcs.create_environment.timeout,
|
2305
|
+
metadata: metadata,
|
2306
|
+
retry_policy: @config.rpcs.create_environment.retry_policy
|
2307
|
+
|
2308
|
+
options.apply_defaults timeout: @config.timeout,
|
2309
|
+
metadata: @config.metadata,
|
2310
|
+
retry_policy: @config.retry_policy
|
2311
|
+
|
2312
|
+
@notebook_service_stub.call_rpc :create_environment, request, options: options do |response, operation|
|
2313
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2314
|
+
yield response, operation if block_given?
|
2315
|
+
return response
|
2316
|
+
end
|
2317
|
+
rescue ::GRPC::BadStatus => e
|
2318
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2319
|
+
end
|
2320
|
+
|
2321
|
+
##
|
2322
|
+
# Deletes a single Environment.
|
2323
|
+
#
|
2324
|
+
# @overload delete_environment(request, options = nil)
|
2325
|
+
# Pass arguments to `delete_environment` via a request object, either of type
|
2326
|
+
# {::Google::Cloud::Notebooks::V1::DeleteEnvironmentRequest} or an equivalent Hash.
|
2327
|
+
#
|
2328
|
+
# @param request [::Google::Cloud::Notebooks::V1::DeleteEnvironmentRequest, ::Hash]
|
2329
|
+
# A request object representing the call parameters. Required. To specify no
|
2330
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2331
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2332
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2333
|
+
#
|
2334
|
+
# @overload delete_environment(name: nil)
|
2335
|
+
# Pass arguments to `delete_environment` via keyword arguments. Note that at
|
2336
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2337
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2338
|
+
#
|
2339
|
+
# @param name [::String]
|
2340
|
+
# Required. Format:
|
2341
|
+
# `projects/{project_id}/locations/{location}/environments/{environment_id}`
|
2342
|
+
#
|
2343
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2344
|
+
# @yieldparam response [::Gapic::Operation]
|
2345
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2346
|
+
#
|
2347
|
+
# @return [::Gapic::Operation]
|
2348
|
+
#
|
2349
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2350
|
+
#
|
2351
|
+
# @example Basic example
|
2352
|
+
# require "google/cloud/notebooks/v1"
|
2353
|
+
#
|
2354
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2355
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
2356
|
+
#
|
2357
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2358
|
+
# request = Google::Cloud::Notebooks::V1::DeleteEnvironmentRequest.new
|
2359
|
+
#
|
2360
|
+
# # Call the delete_environment method.
|
2361
|
+
# result = client.delete_environment request
|
2362
|
+
#
|
2363
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
2364
|
+
# # object to check the status of an operation, cancel it, or wait
|
2365
|
+
# # for results. Here is how to block until completion:
|
2366
|
+
# result.wait_until_done! timeout: 60
|
2367
|
+
# if result.response?
|
2368
|
+
# p result.response
|
2369
|
+
# else
|
2370
|
+
# puts "Error!"
|
2371
|
+
# end
|
2372
|
+
#
|
2373
|
+
def delete_environment request, options = nil
|
2374
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2375
|
+
|
2376
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::DeleteEnvironmentRequest
|
2377
|
+
|
2378
|
+
# Converts hash and nil to an options object
|
2379
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2380
|
+
|
2381
|
+
# Customize the options with defaults
|
2382
|
+
metadata = @config.rpcs.delete_environment.metadata.to_h
|
2383
|
+
|
2384
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2385
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2386
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2387
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
2388
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2389
|
+
|
2390
|
+
header_params = {}
|
2391
|
+
if request.name
|
2392
|
+
header_params["name"] = request.name
|
2393
|
+
end
|
2394
|
+
|
2395
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2396
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2397
|
+
|
2398
|
+
options.apply_defaults timeout: @config.rpcs.delete_environment.timeout,
|
2399
|
+
metadata: metadata,
|
2400
|
+
retry_policy: @config.rpcs.delete_environment.retry_policy
|
2401
|
+
|
2402
|
+
options.apply_defaults timeout: @config.timeout,
|
2403
|
+
metadata: @config.metadata,
|
2404
|
+
retry_policy: @config.retry_policy
|
2405
|
+
|
2406
|
+
@notebook_service_stub.call_rpc :delete_environment, request, options: options do |response, operation|
|
2407
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2408
|
+
yield response, operation if block_given?
|
2409
|
+
return response
|
2410
|
+
end
|
2411
|
+
rescue ::GRPC::BadStatus => e
|
2412
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2413
|
+
end
|
2414
|
+
|
2415
|
+
##
|
2416
|
+
# Lists schedules in a given project and location.
|
2417
|
+
#
|
2418
|
+
# @overload list_schedules(request, options = nil)
|
2419
|
+
# Pass arguments to `list_schedules` via a request object, either of type
|
2420
|
+
# {::Google::Cloud::Notebooks::V1::ListSchedulesRequest} or an equivalent Hash.
|
2421
|
+
#
|
2422
|
+
# @param request [::Google::Cloud::Notebooks::V1::ListSchedulesRequest, ::Hash]
|
2423
|
+
# A request object representing the call parameters. Required. To specify no
|
2424
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2425
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2426
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2427
|
+
#
|
2428
|
+
# @overload list_schedules(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
2429
|
+
# Pass arguments to `list_schedules` via keyword arguments. Note that at
|
2430
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2431
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2432
|
+
#
|
2433
|
+
# @param parent [::String]
|
2434
|
+
# Required. Format:
|
2435
|
+
# `parent=projects/{project_id}/locations/{location}`
|
2436
|
+
# @param page_size [::Integer]
|
2437
|
+
# Maximum return size of the list call.
|
2438
|
+
# @param page_token [::String]
|
2439
|
+
# A previous returned page token that can be used to continue listing
|
2440
|
+
# from the last result.
|
2441
|
+
# @param filter [::String]
|
2442
|
+
# Filter applied to resulting schedules.
|
2443
|
+
# @param order_by [::String]
|
2444
|
+
# Field to order results by.
|
2445
|
+
#
|
2446
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2447
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Schedule>]
|
2448
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2449
|
+
#
|
2450
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Schedule>]
|
2451
|
+
#
|
2452
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2453
|
+
#
|
2454
|
+
# @example Basic example
|
2455
|
+
# require "google/cloud/notebooks/v1"
|
2456
|
+
#
|
2457
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2458
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
2459
|
+
#
|
2460
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2461
|
+
# request = Google::Cloud::Notebooks::V1::ListSchedulesRequest.new
|
2462
|
+
#
|
2463
|
+
# # Call the list_schedules method.
|
2464
|
+
# result = client.list_schedules request
|
2465
|
+
#
|
2466
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
2467
|
+
# # iterate over all elements by calling #each, and the enumerable
|
2468
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
2469
|
+
# # methods are also available for managing paging directly.
|
2470
|
+
# result.each do |response|
|
2471
|
+
# # Each element is of type ::Google::Cloud::Notebooks::V1::Schedule.
|
2472
|
+
# p response
|
2473
|
+
# end
|
2474
|
+
#
|
2475
|
+
def list_schedules request, options = nil
|
2476
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2477
|
+
|
2478
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::ListSchedulesRequest
|
2479
|
+
|
2480
|
+
# Converts hash and nil to an options object
|
2481
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2482
|
+
|
2483
|
+
# Customize the options with defaults
|
2484
|
+
metadata = @config.rpcs.list_schedules.metadata.to_h
|
2485
|
+
|
2486
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2487
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2488
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2489
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
2490
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2491
|
+
|
2492
|
+
header_params = {}
|
2493
|
+
if request.parent
|
2494
|
+
header_params["parent"] = request.parent
|
2495
|
+
end
|
2496
|
+
|
2497
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2498
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2499
|
+
|
2500
|
+
options.apply_defaults timeout: @config.rpcs.list_schedules.timeout,
|
2501
|
+
metadata: metadata,
|
2502
|
+
retry_policy: @config.rpcs.list_schedules.retry_policy
|
2503
|
+
|
2504
|
+
options.apply_defaults timeout: @config.timeout,
|
2505
|
+
metadata: @config.metadata,
|
2506
|
+
retry_policy: @config.retry_policy
|
2507
|
+
|
2508
|
+
@notebook_service_stub.call_rpc :list_schedules, request, options: options do |response, operation|
|
2509
|
+
response = ::Gapic::PagedEnumerable.new @notebook_service_stub, :list_schedules, request, response, operation, options
|
2510
|
+
yield response, operation if block_given?
|
2511
|
+
return response
|
2512
|
+
end
|
2513
|
+
rescue ::GRPC::BadStatus => e
|
2514
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2515
|
+
end
|
2516
|
+
|
2517
|
+
##
|
2518
|
+
# Gets details of schedule
|
2519
|
+
#
|
2520
|
+
# @overload get_schedule(request, options = nil)
|
2521
|
+
# Pass arguments to `get_schedule` via a request object, either of type
|
2522
|
+
# {::Google::Cloud::Notebooks::V1::GetScheduleRequest} or an equivalent Hash.
|
2523
|
+
#
|
2524
|
+
# @param request [::Google::Cloud::Notebooks::V1::GetScheduleRequest, ::Hash]
|
2525
|
+
# A request object representing the call parameters. Required. To specify no
|
2526
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2527
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2528
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2529
|
+
#
|
2530
|
+
# @overload get_schedule(name: nil)
|
2531
|
+
# Pass arguments to `get_schedule` via keyword arguments. Note that at
|
2532
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2533
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2534
|
+
#
|
2535
|
+
# @param name [::String]
|
2536
|
+
# Required. Format:
|
2537
|
+
# `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
|
2538
|
+
#
|
2539
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2540
|
+
# @yieldparam response [::Google::Cloud::Notebooks::V1::Schedule]
|
2541
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2542
|
+
#
|
2543
|
+
# @return [::Google::Cloud::Notebooks::V1::Schedule]
|
2544
|
+
#
|
2545
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2546
|
+
#
|
2547
|
+
# @example Basic example
|
2548
|
+
# require "google/cloud/notebooks/v1"
|
2549
|
+
#
|
2550
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2551
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
2552
|
+
#
|
2553
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2554
|
+
# request = Google::Cloud::Notebooks::V1::GetScheduleRequest.new
|
2555
|
+
#
|
2556
|
+
# # Call the get_schedule method.
|
2557
|
+
# result = client.get_schedule request
|
2558
|
+
#
|
2559
|
+
# # The returned object is of type Google::Cloud::Notebooks::V1::Schedule.
|
2560
|
+
# p result
|
2561
|
+
#
|
2562
|
+
def get_schedule request, options = nil
|
2563
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2564
|
+
|
2565
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::GetScheduleRequest
|
2566
|
+
|
2567
|
+
# Converts hash and nil to an options object
|
2568
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2569
|
+
|
2570
|
+
# Customize the options with defaults
|
2571
|
+
metadata = @config.rpcs.get_schedule.metadata.to_h
|
2572
|
+
|
2573
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2574
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2575
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2576
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
2577
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2578
|
+
|
2579
|
+
header_params = {}
|
2580
|
+
if request.name
|
2581
|
+
header_params["name"] = request.name
|
2582
|
+
end
|
2583
|
+
|
2584
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2585
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2586
|
+
|
2587
|
+
options.apply_defaults timeout: @config.rpcs.get_schedule.timeout,
|
2588
|
+
metadata: metadata,
|
2589
|
+
retry_policy: @config.rpcs.get_schedule.retry_policy
|
2590
|
+
|
2591
|
+
options.apply_defaults timeout: @config.timeout,
|
2592
|
+
metadata: @config.metadata,
|
2593
|
+
retry_policy: @config.retry_policy
|
2594
|
+
|
2595
|
+
@notebook_service_stub.call_rpc :get_schedule, request, options: options do |response, operation|
|
2596
|
+
yield response, operation if block_given?
|
2597
|
+
return response
|
2598
|
+
end
|
2599
|
+
rescue ::GRPC::BadStatus => e
|
2600
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2601
|
+
end
|
2602
|
+
|
2603
|
+
##
|
2604
|
+
# Deletes schedule and all underlying jobs
|
2605
|
+
#
|
2606
|
+
# @overload delete_schedule(request, options = nil)
|
2607
|
+
# Pass arguments to `delete_schedule` via a request object, either of type
|
2608
|
+
# {::Google::Cloud::Notebooks::V1::DeleteScheduleRequest} or an equivalent Hash.
|
2609
|
+
#
|
2610
|
+
# @param request [::Google::Cloud::Notebooks::V1::DeleteScheduleRequest, ::Hash]
|
2611
|
+
# A request object representing the call parameters. Required. To specify no
|
2612
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2613
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2614
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2615
|
+
#
|
2616
|
+
# @overload delete_schedule(name: nil)
|
2617
|
+
# Pass arguments to `delete_schedule` via keyword arguments. Note that at
|
2618
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2619
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2620
|
+
#
|
2621
|
+
# @param name [::String]
|
2622
|
+
# Required. Format:
|
2623
|
+
# `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
|
2624
|
+
#
|
2625
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2626
|
+
# @yieldparam response [::Gapic::Operation]
|
2627
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2628
|
+
#
|
2629
|
+
# @return [::Gapic::Operation]
|
2630
|
+
#
|
2631
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2632
|
+
#
|
2633
|
+
# @example Basic example
|
2634
|
+
# require "google/cloud/notebooks/v1"
|
2635
|
+
#
|
2636
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2637
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
2638
|
+
#
|
2639
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2640
|
+
# request = Google::Cloud::Notebooks::V1::DeleteScheduleRequest.new
|
2641
|
+
#
|
2642
|
+
# # Call the delete_schedule method.
|
2643
|
+
# result = client.delete_schedule request
|
2644
|
+
#
|
2645
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
2646
|
+
# # object to check the status of an operation, cancel it, or wait
|
2647
|
+
# # for results. Here is how to block until completion:
|
2648
|
+
# result.wait_until_done! timeout: 60
|
2649
|
+
# if result.response?
|
2650
|
+
# p result.response
|
2651
|
+
# else
|
2652
|
+
# puts "Error!"
|
2653
|
+
# end
|
2654
|
+
#
|
2655
|
+
def delete_schedule request, options = nil
|
2656
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2657
|
+
|
2658
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::DeleteScheduleRequest
|
2659
|
+
|
2660
|
+
# Converts hash and nil to an options object
|
2661
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2662
|
+
|
2663
|
+
# Customize the options with defaults
|
2664
|
+
metadata = @config.rpcs.delete_schedule.metadata.to_h
|
2665
|
+
|
2666
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2667
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2668
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2669
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
2670
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2671
|
+
|
2672
|
+
header_params = {}
|
2673
|
+
if request.name
|
2674
|
+
header_params["name"] = request.name
|
2675
|
+
end
|
2676
|
+
|
2677
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2678
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2679
|
+
|
2680
|
+
options.apply_defaults timeout: @config.rpcs.delete_schedule.timeout,
|
2681
|
+
metadata: metadata,
|
2682
|
+
retry_policy: @config.rpcs.delete_schedule.retry_policy
|
2683
|
+
|
2684
|
+
options.apply_defaults timeout: @config.timeout,
|
2685
|
+
metadata: @config.metadata,
|
2686
|
+
retry_policy: @config.retry_policy
|
2687
|
+
|
2688
|
+
@notebook_service_stub.call_rpc :delete_schedule, request, options: options do |response, operation|
|
2689
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2690
|
+
yield response, operation if block_given?
|
2691
|
+
return response
|
2692
|
+
end
|
2693
|
+
rescue ::GRPC::BadStatus => e
|
2694
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2695
|
+
end
|
2696
|
+
|
2697
|
+
##
|
2698
|
+
# Creates a new Scheduled Notebook in a given project and location.
|
2699
|
+
#
|
2700
|
+
# @overload create_schedule(request, options = nil)
|
2701
|
+
# Pass arguments to `create_schedule` via a request object, either of type
|
2702
|
+
# {::Google::Cloud::Notebooks::V1::CreateScheduleRequest} or an equivalent Hash.
|
2703
|
+
#
|
2704
|
+
# @param request [::Google::Cloud::Notebooks::V1::CreateScheduleRequest, ::Hash]
|
2705
|
+
# A request object representing the call parameters. Required. To specify no
|
2706
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2707
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2708
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2709
|
+
#
|
2710
|
+
# @overload create_schedule(parent: nil, schedule_id: nil, schedule: nil)
|
2711
|
+
# Pass arguments to `create_schedule` via keyword arguments. Note that at
|
2712
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2713
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2714
|
+
#
|
2715
|
+
# @param parent [::String]
|
2716
|
+
# Required. Format:
|
2717
|
+
# `parent=projects/{project_id}/locations/{location}`
|
2718
|
+
# @param schedule_id [::String]
|
2719
|
+
# Required. User-defined unique ID of this schedule.
|
2720
|
+
# @param schedule [::Google::Cloud::Notebooks::V1::Schedule, ::Hash]
|
2721
|
+
# Required. The schedule to be created.
|
2722
|
+
#
|
2723
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2724
|
+
# @yieldparam response [::Gapic::Operation]
|
2725
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2726
|
+
#
|
2727
|
+
# @return [::Gapic::Operation]
|
2728
|
+
#
|
2729
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2730
|
+
#
|
2731
|
+
# @example Basic example
|
2732
|
+
# require "google/cloud/notebooks/v1"
|
2733
|
+
#
|
2734
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2735
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
2736
|
+
#
|
2737
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2738
|
+
# request = Google::Cloud::Notebooks::V1::CreateScheduleRequest.new
|
2739
|
+
#
|
2740
|
+
# # Call the create_schedule method.
|
2741
|
+
# result = client.create_schedule request
|
2742
|
+
#
|
2743
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
2744
|
+
# # object to check the status of an operation, cancel it, or wait
|
2745
|
+
# # for results. Here is how to block until completion:
|
2746
|
+
# result.wait_until_done! timeout: 60
|
2747
|
+
# if result.response?
|
2748
|
+
# p result.response
|
2749
|
+
# else
|
2750
|
+
# puts "Error!"
|
2751
|
+
# end
|
2752
|
+
#
|
2753
|
+
def create_schedule request, options = nil
|
2754
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2755
|
+
|
2756
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::CreateScheduleRequest
|
2757
|
+
|
2758
|
+
# Converts hash and nil to an options object
|
2759
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2760
|
+
|
2761
|
+
# Customize the options with defaults
|
2762
|
+
metadata = @config.rpcs.create_schedule.metadata.to_h
|
2763
|
+
|
2764
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2765
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2766
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2767
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
2768
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2769
|
+
|
2770
|
+
header_params = {}
|
2771
|
+
if request.parent
|
2772
|
+
header_params["parent"] = request.parent
|
2773
|
+
end
|
2774
|
+
|
2775
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2776
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2777
|
+
|
2778
|
+
options.apply_defaults timeout: @config.rpcs.create_schedule.timeout,
|
2779
|
+
metadata: metadata,
|
2780
|
+
retry_policy: @config.rpcs.create_schedule.retry_policy
|
2781
|
+
|
2782
|
+
options.apply_defaults timeout: @config.timeout,
|
2783
|
+
metadata: @config.metadata,
|
2784
|
+
retry_policy: @config.retry_policy
|
2785
|
+
|
2786
|
+
@notebook_service_stub.call_rpc :create_schedule, request, options: options do |response, operation|
|
2787
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2788
|
+
yield response, operation if block_given?
|
2789
|
+
return response
|
2790
|
+
end
|
2791
|
+
rescue ::GRPC::BadStatus => e
|
2792
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2793
|
+
end
|
2794
|
+
|
2795
|
+
##
|
2796
|
+
# Triggers execution of an existing schedule.
|
2797
|
+
#
|
2798
|
+
# @overload trigger_schedule(request, options = nil)
|
2799
|
+
# Pass arguments to `trigger_schedule` via a request object, either of type
|
2800
|
+
# {::Google::Cloud::Notebooks::V1::TriggerScheduleRequest} or an equivalent Hash.
|
2801
|
+
#
|
2802
|
+
# @param request [::Google::Cloud::Notebooks::V1::TriggerScheduleRequest, ::Hash]
|
2803
|
+
# A request object representing the call parameters. Required. To specify no
|
2804
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2805
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2806
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2807
|
+
#
|
2808
|
+
# @overload trigger_schedule(name: nil)
|
2809
|
+
# Pass arguments to `trigger_schedule` via keyword arguments. Note that at
|
2810
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2811
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2812
|
+
#
|
2813
|
+
# @param name [::String]
|
2814
|
+
# Required. Format:
|
2815
|
+
# `parent=projects/{project_id}/locations/{location}/schedules/{schedule_id}`
|
2816
|
+
#
|
2817
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2818
|
+
# @yieldparam response [::Gapic::Operation]
|
2819
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2820
|
+
#
|
2821
|
+
# @return [::Gapic::Operation]
|
2822
|
+
#
|
2823
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2824
|
+
#
|
2825
|
+
# @example Basic example
|
2826
|
+
# require "google/cloud/notebooks/v1"
|
2827
|
+
#
|
2828
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2829
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
2830
|
+
#
|
2831
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2832
|
+
# request = Google::Cloud::Notebooks::V1::TriggerScheduleRequest.new
|
2833
|
+
#
|
2834
|
+
# # Call the trigger_schedule method.
|
2835
|
+
# result = client.trigger_schedule request
|
2836
|
+
#
|
2837
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
2838
|
+
# # object to check the status of an operation, cancel it, or wait
|
2839
|
+
# # for results. Here is how to block until completion:
|
2840
|
+
# result.wait_until_done! timeout: 60
|
2841
|
+
# if result.response?
|
2842
|
+
# p result.response
|
2843
|
+
# else
|
2844
|
+
# puts "Error!"
|
2845
|
+
# end
|
2846
|
+
#
|
2847
|
+
def trigger_schedule request, options = nil
|
2848
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2849
|
+
|
2850
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::TriggerScheduleRequest
|
2851
|
+
|
2852
|
+
# Converts hash and nil to an options object
|
2853
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2854
|
+
|
2855
|
+
# Customize the options with defaults
|
2856
|
+
metadata = @config.rpcs.trigger_schedule.metadata.to_h
|
2857
|
+
|
2858
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2859
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2860
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2861
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
2862
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2863
|
+
|
2864
|
+
header_params = {}
|
2865
|
+
if request.name
|
2866
|
+
header_params["name"] = request.name
|
2867
|
+
end
|
2868
|
+
|
2869
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2870
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2871
|
+
|
2872
|
+
options.apply_defaults timeout: @config.rpcs.trigger_schedule.timeout,
|
2873
|
+
metadata: metadata,
|
2874
|
+
retry_policy: @config.rpcs.trigger_schedule.retry_policy
|
2875
|
+
|
2876
|
+
options.apply_defaults timeout: @config.timeout,
|
2877
|
+
metadata: @config.metadata,
|
2878
|
+
retry_policy: @config.retry_policy
|
2879
|
+
|
2880
|
+
@notebook_service_stub.call_rpc :trigger_schedule, request, options: options do |response, operation|
|
2881
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2882
|
+
yield response, operation if block_given?
|
2883
|
+
return response
|
2884
|
+
end
|
2885
|
+
rescue ::GRPC::BadStatus => e
|
2886
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2887
|
+
end
|
2888
|
+
|
2889
|
+
##
|
2890
|
+
# Lists executions in a given project and location
|
2891
|
+
#
|
2892
|
+
# @overload list_executions(request, options = nil)
|
2893
|
+
# Pass arguments to `list_executions` via a request object, either of type
|
2894
|
+
# {::Google::Cloud::Notebooks::V1::ListExecutionsRequest} or an equivalent Hash.
|
2895
|
+
#
|
2896
|
+
# @param request [::Google::Cloud::Notebooks::V1::ListExecutionsRequest, ::Hash]
|
2897
|
+
# A request object representing the call parameters. Required. To specify no
|
2898
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2899
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2900
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2901
|
+
#
|
2902
|
+
# @overload list_executions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
2903
|
+
# Pass arguments to `list_executions` via keyword arguments. Note that at
|
2904
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2905
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2906
|
+
#
|
2907
|
+
# @param parent [::String]
|
2908
|
+
# Required. Format:
|
2909
|
+
# `parent=projects/{project_id}/locations/{location}`
|
2910
|
+
# @param page_size [::Integer]
|
2911
|
+
# Maximum return size of the list call.
|
2912
|
+
# @param page_token [::String]
|
2913
|
+
# A previous returned page token that can be used to continue listing
|
2914
|
+
# from the last result.
|
2915
|
+
# @param filter [::String]
|
2916
|
+
# Filter applied to resulting executions. Currently only supports filtering
|
2917
|
+
# executions by a specified schedule_id.
|
2918
|
+
# Format: `schedule_id=<Schedule_ID>`
|
2919
|
+
# @param order_by [::String]
|
2920
|
+
# Sort by field.
|
2921
|
+
#
|
2922
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2923
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Execution>]
|
2924
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2925
|
+
#
|
2926
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Execution>]
|
2927
|
+
#
|
2928
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2929
|
+
#
|
2930
|
+
# @example Basic example
|
2931
|
+
# require "google/cloud/notebooks/v1"
|
2932
|
+
#
|
2933
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2934
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
2935
|
+
#
|
2936
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2937
|
+
# request = Google::Cloud::Notebooks::V1::ListExecutionsRequest.new
|
2938
|
+
#
|
2939
|
+
# # Call the list_executions method.
|
2940
|
+
# result = client.list_executions request
|
2941
|
+
#
|
2942
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
2943
|
+
# # iterate over all elements by calling #each, and the enumerable
|
2944
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
2945
|
+
# # methods are also available for managing paging directly.
|
2946
|
+
# result.each do |response|
|
2947
|
+
# # Each element is of type ::Google::Cloud::Notebooks::V1::Execution.
|
2948
|
+
# p response
|
2949
|
+
# end
|
2950
|
+
#
|
2951
|
+
def list_executions request, options = nil
|
2952
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2953
|
+
|
2954
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::ListExecutionsRequest
|
2955
|
+
|
2956
|
+
# Converts hash and nil to an options object
|
2957
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2958
|
+
|
2959
|
+
# Customize the options with defaults
|
2960
|
+
metadata = @config.rpcs.list_executions.metadata.to_h
|
2961
|
+
|
2962
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2963
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2964
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2965
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
2966
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2967
|
+
|
2968
|
+
header_params = {}
|
2969
|
+
if request.parent
|
2970
|
+
header_params["parent"] = request.parent
|
2971
|
+
end
|
2972
|
+
|
2973
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2974
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2975
|
+
|
2976
|
+
options.apply_defaults timeout: @config.rpcs.list_executions.timeout,
|
2977
|
+
metadata: metadata,
|
2978
|
+
retry_policy: @config.rpcs.list_executions.retry_policy
|
2979
|
+
|
2980
|
+
options.apply_defaults timeout: @config.timeout,
|
2981
|
+
metadata: @config.metadata,
|
2982
|
+
retry_policy: @config.retry_policy
|
2983
|
+
|
2984
|
+
@notebook_service_stub.call_rpc :list_executions, request, options: options do |response, operation|
|
2985
|
+
response = ::Gapic::PagedEnumerable.new @notebook_service_stub, :list_executions, request, response, operation, options
|
2986
|
+
yield response, operation if block_given?
|
2987
|
+
return response
|
2988
|
+
end
|
2989
|
+
rescue ::GRPC::BadStatus => e
|
2990
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2991
|
+
end
|
2992
|
+
|
2993
|
+
##
|
2994
|
+
# Gets details of executions
|
2995
|
+
#
|
2996
|
+
# @overload get_execution(request, options = nil)
|
2997
|
+
# Pass arguments to `get_execution` via a request object, either of type
|
2998
|
+
# {::Google::Cloud::Notebooks::V1::GetExecutionRequest} or an equivalent Hash.
|
2999
|
+
#
|
3000
|
+
# @param request [::Google::Cloud::Notebooks::V1::GetExecutionRequest, ::Hash]
|
3001
|
+
# A request object representing the call parameters. Required. To specify no
|
3002
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3003
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3004
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
3005
|
+
#
|
3006
|
+
# @overload get_execution(name: nil)
|
3007
|
+
# Pass arguments to `get_execution` via keyword arguments. Note that at
|
3008
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3009
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3010
|
+
#
|
3011
|
+
# @param name [::String]
|
3012
|
+
# Required. Format:
|
3013
|
+
# `projects/{project_id}/locations/{location}/executions/{execution_id}`
|
3014
|
+
#
|
3015
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3016
|
+
# @yieldparam response [::Google::Cloud::Notebooks::V1::Execution]
|
3017
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3018
|
+
#
|
3019
|
+
# @return [::Google::Cloud::Notebooks::V1::Execution]
|
3020
|
+
#
|
3021
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3022
|
+
#
|
3023
|
+
# @example Basic example
|
3024
|
+
# require "google/cloud/notebooks/v1"
|
3025
|
+
#
|
3026
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3027
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
3028
|
+
#
|
3029
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3030
|
+
# request = Google::Cloud::Notebooks::V1::GetExecutionRequest.new
|
3031
|
+
#
|
3032
|
+
# # Call the get_execution method.
|
3033
|
+
# result = client.get_execution request
|
3034
|
+
#
|
3035
|
+
# # The returned object is of type Google::Cloud::Notebooks::V1::Execution.
|
3036
|
+
# p result
|
3037
|
+
#
|
3038
|
+
def get_execution request, options = nil
|
3039
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3040
|
+
|
3041
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::GetExecutionRequest
|
3042
|
+
|
3043
|
+
# Converts hash and nil to an options object
|
3044
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3045
|
+
|
3046
|
+
# Customize the options with defaults
|
3047
|
+
metadata = @config.rpcs.get_execution.metadata.to_h
|
3048
|
+
|
3049
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
3050
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3051
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3052
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
3053
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3054
|
+
|
3055
|
+
header_params = {}
|
3056
|
+
if request.name
|
3057
|
+
header_params["name"] = request.name
|
3058
|
+
end
|
3059
|
+
|
3060
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3061
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3062
|
+
|
3063
|
+
options.apply_defaults timeout: @config.rpcs.get_execution.timeout,
|
3064
|
+
metadata: metadata,
|
3065
|
+
retry_policy: @config.rpcs.get_execution.retry_policy
|
3066
|
+
|
3067
|
+
options.apply_defaults timeout: @config.timeout,
|
3068
|
+
metadata: @config.metadata,
|
3069
|
+
retry_policy: @config.retry_policy
|
3070
|
+
|
3071
|
+
@notebook_service_stub.call_rpc :get_execution, request, options: options do |response, operation|
|
3072
|
+
yield response, operation if block_given?
|
3073
|
+
return response
|
3074
|
+
end
|
3075
|
+
rescue ::GRPC::BadStatus => e
|
3076
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3077
|
+
end
|
3078
|
+
|
3079
|
+
##
|
3080
|
+
# Deletes execution
|
3081
|
+
#
|
3082
|
+
# @overload delete_execution(request, options = nil)
|
3083
|
+
# Pass arguments to `delete_execution` via a request object, either of type
|
3084
|
+
# {::Google::Cloud::Notebooks::V1::DeleteExecutionRequest} or an equivalent Hash.
|
3085
|
+
#
|
3086
|
+
# @param request [::Google::Cloud::Notebooks::V1::DeleteExecutionRequest, ::Hash]
|
3087
|
+
# A request object representing the call parameters. Required. To specify no
|
3088
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3089
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3090
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
3091
|
+
#
|
3092
|
+
# @overload delete_execution(name: nil)
|
3093
|
+
# Pass arguments to `delete_execution` via keyword arguments. Note that at
|
3094
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3095
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3096
|
+
#
|
3097
|
+
# @param name [::String]
|
3098
|
+
# Required. Format:
|
3099
|
+
# `projects/{project_id}/locations/{location}/executions/{execution_id}`
|
3100
|
+
#
|
3101
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3102
|
+
# @yieldparam response [::Gapic::Operation]
|
3103
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3104
|
+
#
|
3105
|
+
# @return [::Gapic::Operation]
|
3106
|
+
#
|
3107
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3108
|
+
#
|
3109
|
+
# @example Basic example
|
3110
|
+
# require "google/cloud/notebooks/v1"
|
3111
|
+
#
|
3112
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3113
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
3114
|
+
#
|
3115
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3116
|
+
# request = Google::Cloud::Notebooks::V1::DeleteExecutionRequest.new
|
3117
|
+
#
|
3118
|
+
# # Call the delete_execution method.
|
3119
|
+
# result = client.delete_execution request
|
3120
|
+
#
|
3121
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
3122
|
+
# # object to check the status of an operation, cancel it, or wait
|
3123
|
+
# # for results. Here is how to block until completion:
|
3124
|
+
# result.wait_until_done! timeout: 60
|
3125
|
+
# if result.response?
|
3126
|
+
# p result.response
|
3127
|
+
# else
|
3128
|
+
# puts "Error!"
|
3129
|
+
# end
|
3130
|
+
#
|
3131
|
+
def delete_execution request, options = nil
|
3132
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3133
|
+
|
3134
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::DeleteExecutionRequest
|
3135
|
+
|
3136
|
+
# Converts hash and nil to an options object
|
3137
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3138
|
+
|
3139
|
+
# Customize the options with defaults
|
3140
|
+
metadata = @config.rpcs.delete_execution.metadata.to_h
|
3141
|
+
|
3142
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
3143
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3144
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3145
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
3146
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3147
|
+
|
3148
|
+
header_params = {}
|
3149
|
+
if request.name
|
3150
|
+
header_params["name"] = request.name
|
3151
|
+
end
|
3152
|
+
|
3153
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3154
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3155
|
+
|
3156
|
+
options.apply_defaults timeout: @config.rpcs.delete_execution.timeout,
|
3157
|
+
metadata: metadata,
|
3158
|
+
retry_policy: @config.rpcs.delete_execution.retry_policy
|
3159
|
+
|
3160
|
+
options.apply_defaults timeout: @config.timeout,
|
3161
|
+
metadata: @config.metadata,
|
3162
|
+
retry_policy: @config.retry_policy
|
3163
|
+
|
3164
|
+
@notebook_service_stub.call_rpc :delete_execution, request, options: options do |response, operation|
|
3165
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
3166
|
+
yield response, operation if block_given?
|
3167
|
+
return response
|
3168
|
+
end
|
3169
|
+
rescue ::GRPC::BadStatus => e
|
3170
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3171
|
+
end
|
3172
|
+
|
3173
|
+
##
|
3174
|
+
# Creates a new Scheduled Notebook in a given project and location.
|
3175
|
+
#
|
3176
|
+
# @overload create_execution(request, options = nil)
|
3177
|
+
# Pass arguments to `create_execution` via a request object, either of type
|
3178
|
+
# {::Google::Cloud::Notebooks::V1::CreateExecutionRequest} or an equivalent Hash.
|
3179
|
+
#
|
3180
|
+
# @param request [::Google::Cloud::Notebooks::V1::CreateExecutionRequest, ::Hash]
|
3181
|
+
# A request object representing the call parameters. Required. To specify no
|
3182
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3183
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3184
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
3185
|
+
#
|
3186
|
+
# @overload create_execution(parent: nil, execution_id: nil, execution: nil)
|
3187
|
+
# Pass arguments to `create_execution` via keyword arguments. Note that at
|
3188
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3189
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3190
|
+
#
|
3191
|
+
# @param parent [::String]
|
3192
|
+
# Required. Format:
|
3193
|
+
# `parent=projects/{project_id}/locations/{location}`
|
3194
|
+
# @param execution_id [::String]
|
3195
|
+
# Required. User-defined unique ID of this execution.
|
3196
|
+
# @param execution [::Google::Cloud::Notebooks::V1::Execution, ::Hash]
|
3197
|
+
# Required. The execution to be created.
|
3198
|
+
#
|
3199
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3200
|
+
# @yieldparam response [::Gapic::Operation]
|
3201
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3202
|
+
#
|
3203
|
+
# @return [::Gapic::Operation]
|
3204
|
+
#
|
3205
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3206
|
+
#
|
3207
|
+
# @example Basic example
|
3208
|
+
# require "google/cloud/notebooks/v1"
|
3209
|
+
#
|
3210
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3211
|
+
# client = Google::Cloud::Notebooks::V1::NotebookService::Client.new
|
3212
|
+
#
|
3213
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3214
|
+
# request = Google::Cloud::Notebooks::V1::CreateExecutionRequest.new
|
3215
|
+
#
|
3216
|
+
# # Call the create_execution method.
|
3217
|
+
# result = client.create_execution request
|
3218
|
+
#
|
3219
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
3220
|
+
# # object to check the status of an operation, cancel it, or wait
|
3221
|
+
# # for results. Here is how to block until completion:
|
3222
|
+
# result.wait_until_done! timeout: 60
|
3223
|
+
# if result.response?
|
3224
|
+
# p result.response
|
3225
|
+
# else
|
3226
|
+
# puts "Error!"
|
3227
|
+
# end
|
3228
|
+
#
|
3229
|
+
def create_execution request, options = nil
|
3230
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3231
|
+
|
3232
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::CreateExecutionRequest
|
3233
|
+
|
3234
|
+
# Converts hash and nil to an options object
|
3235
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3236
|
+
|
3237
|
+
# Customize the options with defaults
|
3238
|
+
metadata = @config.rpcs.create_execution.metadata.to_h
|
3239
|
+
|
3240
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
3241
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3242
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3243
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
3244
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3245
|
+
|
3246
|
+
header_params = {}
|
3247
|
+
if request.parent
|
3248
|
+
header_params["parent"] = request.parent
|
3249
|
+
end
|
3250
|
+
|
3251
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3252
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3253
|
+
|
3254
|
+
options.apply_defaults timeout: @config.rpcs.create_execution.timeout,
|
3255
|
+
metadata: metadata,
|
3256
|
+
retry_policy: @config.rpcs.create_execution.retry_policy
|
3257
|
+
|
3258
|
+
options.apply_defaults timeout: @config.timeout,
|
3259
|
+
metadata: @config.metadata,
|
3260
|
+
retry_policy: @config.retry_policy
|
3261
|
+
|
3262
|
+
@notebook_service_stub.call_rpc :create_execution, request, options: options do |response, operation|
|
3263
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
3264
|
+
yield response, operation if block_given?
|
3265
|
+
return response
|
3266
|
+
end
|
3267
|
+
rescue ::GRPC::BadStatus => e
|
3268
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3269
|
+
end
|
3270
|
+
|
3271
|
+
##
|
3272
|
+
# Configuration class for the NotebookService API.
|
3273
|
+
#
|
3274
|
+
# This class represents the configuration for NotebookService,
|
3275
|
+
# providing control over timeouts, retry behavior, logging, transport
|
3276
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
3277
|
+
# applied individually to specific RPCs. See
|
3278
|
+
# {::Google::Cloud::Notebooks::V1::NotebookService::Client::Configuration::Rpcs}
|
3279
|
+
# for a list of RPCs that can be configured independently.
|
3280
|
+
#
|
3281
|
+
# Configuration can be applied globally to all clients, or to a single client
|
3282
|
+
# on construction.
|
3283
|
+
#
|
3284
|
+
# @example
|
3285
|
+
#
|
3286
|
+
# # Modify the global config, setting the timeout for
|
3287
|
+
# # list_instances to 20 seconds,
|
3288
|
+
# # and all remaining timeouts to 10 seconds.
|
3289
|
+
# ::Google::Cloud::Notebooks::V1::NotebookService::Client.configure do |config|
|
3290
|
+
# config.timeout = 10.0
|
3291
|
+
# config.rpcs.list_instances.timeout = 20.0
|
3292
|
+
# end
|
3293
|
+
#
|
3294
|
+
# # Apply the above configuration only to a new client.
|
3295
|
+
# client = ::Google::Cloud::Notebooks::V1::NotebookService::Client.new do |config|
|
3296
|
+
# config.timeout = 10.0
|
3297
|
+
# config.rpcs.list_instances.timeout = 20.0
|
3298
|
+
# end
|
3299
|
+
#
|
3300
|
+
# @!attribute [rw] endpoint
|
3301
|
+
# The hostname or hostname:port of the service endpoint.
|
3302
|
+
# Defaults to `"notebooks.googleapis.com"`.
|
3303
|
+
# @return [::String]
|
3304
|
+
# @!attribute [rw] credentials
|
3305
|
+
# Credentials to send with calls. You may provide any of the following types:
|
3306
|
+
# * (`String`) The path to a service account key file in JSON format
|
3307
|
+
# * (`Hash`) A service account key as a Hash
|
3308
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
3309
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
3310
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
3311
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
3312
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
3313
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
3314
|
+
# * (`nil`) indicating no credentials
|
3315
|
+
# @return [::Object]
|
3316
|
+
# @!attribute [rw] scope
|
3317
|
+
# The OAuth scopes
|
3318
|
+
# @return [::Array<::String>]
|
3319
|
+
# @!attribute [rw] lib_name
|
3320
|
+
# The library name as recorded in instrumentation and logging
|
3321
|
+
# @return [::String]
|
3322
|
+
# @!attribute [rw] lib_version
|
3323
|
+
# The library version as recorded in instrumentation and logging
|
3324
|
+
# @return [::String]
|
3325
|
+
# @!attribute [rw] channel_args
|
3326
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
3327
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
3328
|
+
# @return [::Hash]
|
3329
|
+
# @!attribute [rw] interceptors
|
3330
|
+
# An array of interceptors that are run before calls are executed.
|
3331
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
3332
|
+
# @!attribute [rw] timeout
|
3333
|
+
# The call timeout in seconds.
|
3334
|
+
# @return [::Numeric]
|
3335
|
+
# @!attribute [rw] metadata
|
3336
|
+
# Additional gRPC headers to be sent with the call.
|
3337
|
+
# @return [::Hash{::Symbol=>::String}]
|
3338
|
+
# @!attribute [rw] retry_policy
|
3339
|
+
# The retry policy. The value is a hash with the following keys:
|
3340
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
3341
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
3342
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
3343
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
3344
|
+
# trigger a retry.
|
3345
|
+
# @return [::Hash]
|
3346
|
+
# @!attribute [rw] quota_project
|
3347
|
+
# A separate project against which to charge quota.
|
3348
|
+
# @return [::String]
|
3349
|
+
#
|
3350
|
+
class Configuration
|
3351
|
+
extend ::Gapic::Config
|
3352
|
+
|
3353
|
+
config_attr :endpoint, "notebooks.googleapis.com", ::String
|
3354
|
+
config_attr :credentials, nil do |value|
|
3355
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
3356
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
3357
|
+
allowed.any? { |klass| klass === value }
|
3358
|
+
end
|
3359
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
3360
|
+
config_attr :lib_name, nil, ::String, nil
|
3361
|
+
config_attr :lib_version, nil, ::String, nil
|
3362
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
3363
|
+
config_attr :interceptors, nil, ::Array, nil
|
3364
|
+
config_attr :timeout, nil, ::Numeric, nil
|
3365
|
+
config_attr :metadata, nil, ::Hash, nil
|
3366
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
3367
|
+
config_attr :quota_project, nil, ::String, nil
|
3368
|
+
|
3369
|
+
# @private
|
3370
|
+
def initialize parent_config = nil
|
3371
|
+
@parent_config = parent_config unless parent_config.nil?
|
3372
|
+
|
3373
|
+
yield self if block_given?
|
3374
|
+
end
|
3375
|
+
|
3376
|
+
##
|
3377
|
+
# Configurations for individual RPCs
|
3378
|
+
# @return [Rpcs]
|
3379
|
+
#
|
3380
|
+
def rpcs
|
3381
|
+
@rpcs ||= begin
|
3382
|
+
parent_rpcs = nil
|
3383
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
3384
|
+
Rpcs.new parent_rpcs
|
3385
|
+
end
|
3386
|
+
end
|
3387
|
+
|
3388
|
+
##
|
3389
|
+
# Configuration RPC class for the NotebookService API.
|
3390
|
+
#
|
3391
|
+
# Includes fields providing the configuration for each RPC in this service.
|
3392
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
3393
|
+
# the following configuration fields:
|
3394
|
+
#
|
3395
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
3396
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
3397
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
3398
|
+
# include the following keys:
|
3399
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
3400
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
3401
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
3402
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
3403
|
+
# trigger a retry.
|
3404
|
+
#
|
3405
|
+
class Rpcs
|
3406
|
+
##
|
3407
|
+
# RPC-specific configuration for `list_instances`
|
3408
|
+
# @return [::Gapic::Config::Method]
|
3409
|
+
#
|
3410
|
+
attr_reader :list_instances
|
3411
|
+
##
|
3412
|
+
# RPC-specific configuration for `get_instance`
|
3413
|
+
# @return [::Gapic::Config::Method]
|
3414
|
+
#
|
3415
|
+
attr_reader :get_instance
|
3416
|
+
##
|
3417
|
+
# RPC-specific configuration for `create_instance`
|
3418
|
+
# @return [::Gapic::Config::Method]
|
3419
|
+
#
|
3420
|
+
attr_reader :create_instance
|
3421
|
+
##
|
3422
|
+
# RPC-specific configuration for `register_instance`
|
3423
|
+
# @return [::Gapic::Config::Method]
|
3424
|
+
#
|
3425
|
+
attr_reader :register_instance
|
3426
|
+
##
|
3427
|
+
# RPC-specific configuration for `set_instance_accelerator`
|
3428
|
+
# @return [::Gapic::Config::Method]
|
3429
|
+
#
|
3430
|
+
attr_reader :set_instance_accelerator
|
3431
|
+
##
|
3432
|
+
# RPC-specific configuration for `set_instance_machine_type`
|
3433
|
+
# @return [::Gapic::Config::Method]
|
3434
|
+
#
|
3435
|
+
attr_reader :set_instance_machine_type
|
3436
|
+
##
|
3437
|
+
# RPC-specific configuration for `update_instance_config`
|
3438
|
+
# @return [::Gapic::Config::Method]
|
3439
|
+
#
|
3440
|
+
attr_reader :update_instance_config
|
3441
|
+
##
|
3442
|
+
# RPC-specific configuration for `update_shielded_instance_config`
|
3443
|
+
# @return [::Gapic::Config::Method]
|
3444
|
+
#
|
3445
|
+
attr_reader :update_shielded_instance_config
|
3446
|
+
##
|
3447
|
+
# RPC-specific configuration for `set_instance_labels`
|
3448
|
+
# @return [::Gapic::Config::Method]
|
3449
|
+
#
|
3450
|
+
attr_reader :set_instance_labels
|
3451
|
+
##
|
3452
|
+
# RPC-specific configuration for `delete_instance`
|
3453
|
+
# @return [::Gapic::Config::Method]
|
3454
|
+
#
|
3455
|
+
attr_reader :delete_instance
|
3456
|
+
##
|
3457
|
+
# RPC-specific configuration for `start_instance`
|
3458
|
+
# @return [::Gapic::Config::Method]
|
3459
|
+
#
|
3460
|
+
attr_reader :start_instance
|
3461
|
+
##
|
3462
|
+
# RPC-specific configuration for `stop_instance`
|
3463
|
+
# @return [::Gapic::Config::Method]
|
3464
|
+
#
|
3465
|
+
attr_reader :stop_instance
|
3466
|
+
##
|
3467
|
+
# RPC-specific configuration for `reset_instance`
|
3468
|
+
# @return [::Gapic::Config::Method]
|
3469
|
+
#
|
3470
|
+
attr_reader :reset_instance
|
3471
|
+
##
|
3472
|
+
# RPC-specific configuration for `report_instance_info`
|
3473
|
+
# @return [::Gapic::Config::Method]
|
3474
|
+
#
|
3475
|
+
attr_reader :report_instance_info
|
3476
|
+
##
|
3477
|
+
# RPC-specific configuration for `is_instance_upgradeable`
|
3478
|
+
# @return [::Gapic::Config::Method]
|
3479
|
+
#
|
3480
|
+
attr_reader :is_instance_upgradeable
|
3481
|
+
##
|
3482
|
+
# RPC-specific configuration for `get_instance_health`
|
3483
|
+
# @return [::Gapic::Config::Method]
|
3484
|
+
#
|
3485
|
+
attr_reader :get_instance_health
|
3486
|
+
##
|
3487
|
+
# RPC-specific configuration for `upgrade_instance`
|
3488
|
+
# @return [::Gapic::Config::Method]
|
3489
|
+
#
|
3490
|
+
attr_reader :upgrade_instance
|
3491
|
+
##
|
3492
|
+
# RPC-specific configuration for `rollback_instance`
|
3493
|
+
# @return [::Gapic::Config::Method]
|
3494
|
+
#
|
3495
|
+
attr_reader :rollback_instance
|
3496
|
+
##
|
3497
|
+
# RPC-specific configuration for `upgrade_instance_internal`
|
3498
|
+
# @return [::Gapic::Config::Method]
|
3499
|
+
#
|
3500
|
+
attr_reader :upgrade_instance_internal
|
3501
|
+
##
|
3502
|
+
# RPC-specific configuration for `list_environments`
|
3503
|
+
# @return [::Gapic::Config::Method]
|
3504
|
+
#
|
3505
|
+
attr_reader :list_environments
|
3506
|
+
##
|
3507
|
+
# RPC-specific configuration for `get_environment`
|
3508
|
+
# @return [::Gapic::Config::Method]
|
3509
|
+
#
|
3510
|
+
attr_reader :get_environment
|
3511
|
+
##
|
3512
|
+
# RPC-specific configuration for `create_environment`
|
3513
|
+
# @return [::Gapic::Config::Method]
|
3514
|
+
#
|
3515
|
+
attr_reader :create_environment
|
3516
|
+
##
|
3517
|
+
# RPC-specific configuration for `delete_environment`
|
3518
|
+
# @return [::Gapic::Config::Method]
|
3519
|
+
#
|
3520
|
+
attr_reader :delete_environment
|
3521
|
+
##
|
3522
|
+
# RPC-specific configuration for `list_schedules`
|
3523
|
+
# @return [::Gapic::Config::Method]
|
3524
|
+
#
|
3525
|
+
attr_reader :list_schedules
|
3526
|
+
##
|
3527
|
+
# RPC-specific configuration for `get_schedule`
|
3528
|
+
# @return [::Gapic::Config::Method]
|
3529
|
+
#
|
3530
|
+
attr_reader :get_schedule
|
3531
|
+
##
|
3532
|
+
# RPC-specific configuration for `delete_schedule`
|
3533
|
+
# @return [::Gapic::Config::Method]
|
3534
|
+
#
|
3535
|
+
attr_reader :delete_schedule
|
3536
|
+
##
|
3537
|
+
# RPC-specific configuration for `create_schedule`
|
3538
|
+
# @return [::Gapic::Config::Method]
|
3539
|
+
#
|
3540
|
+
attr_reader :create_schedule
|
3541
|
+
##
|
3542
|
+
# RPC-specific configuration for `trigger_schedule`
|
3543
|
+
# @return [::Gapic::Config::Method]
|
3544
|
+
#
|
3545
|
+
attr_reader :trigger_schedule
|
3546
|
+
##
|
3547
|
+
# RPC-specific configuration for `list_executions`
|
3548
|
+
# @return [::Gapic::Config::Method]
|
3549
|
+
#
|
3550
|
+
attr_reader :list_executions
|
3551
|
+
##
|
3552
|
+
# RPC-specific configuration for `get_execution`
|
3553
|
+
# @return [::Gapic::Config::Method]
|
3554
|
+
#
|
3555
|
+
attr_reader :get_execution
|
3556
|
+
##
|
3557
|
+
# RPC-specific configuration for `delete_execution`
|
3558
|
+
# @return [::Gapic::Config::Method]
|
3559
|
+
#
|
3560
|
+
attr_reader :delete_execution
|
3561
|
+
##
|
3562
|
+
# RPC-specific configuration for `create_execution`
|
3563
|
+
# @return [::Gapic::Config::Method]
|
3564
|
+
#
|
3565
|
+
attr_reader :create_execution
|
3566
|
+
|
3567
|
+
# @private
|
3568
|
+
def initialize parent_rpcs = nil
|
3569
|
+
list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
|
3570
|
+
@list_instances = ::Gapic::Config::Method.new list_instances_config
|
3571
|
+
get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
|
3572
|
+
@get_instance = ::Gapic::Config::Method.new get_instance_config
|
3573
|
+
create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
|
3574
|
+
@create_instance = ::Gapic::Config::Method.new create_instance_config
|
3575
|
+
register_instance_config = parent_rpcs.register_instance if parent_rpcs.respond_to? :register_instance
|
3576
|
+
@register_instance = ::Gapic::Config::Method.new register_instance_config
|
3577
|
+
set_instance_accelerator_config = parent_rpcs.set_instance_accelerator if parent_rpcs.respond_to? :set_instance_accelerator
|
3578
|
+
@set_instance_accelerator = ::Gapic::Config::Method.new set_instance_accelerator_config
|
3579
|
+
set_instance_machine_type_config = parent_rpcs.set_instance_machine_type if parent_rpcs.respond_to? :set_instance_machine_type
|
3580
|
+
@set_instance_machine_type = ::Gapic::Config::Method.new set_instance_machine_type_config
|
3581
|
+
update_instance_config_config = parent_rpcs.update_instance_config if parent_rpcs.respond_to? :update_instance_config
|
3582
|
+
@update_instance_config = ::Gapic::Config::Method.new update_instance_config_config
|
3583
|
+
update_shielded_instance_config_config = parent_rpcs.update_shielded_instance_config if parent_rpcs.respond_to? :update_shielded_instance_config
|
3584
|
+
@update_shielded_instance_config = ::Gapic::Config::Method.new update_shielded_instance_config_config
|
3585
|
+
set_instance_labels_config = parent_rpcs.set_instance_labels if parent_rpcs.respond_to? :set_instance_labels
|
3586
|
+
@set_instance_labels = ::Gapic::Config::Method.new set_instance_labels_config
|
3587
|
+
delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
|
3588
|
+
@delete_instance = ::Gapic::Config::Method.new delete_instance_config
|
3589
|
+
start_instance_config = parent_rpcs.start_instance if parent_rpcs.respond_to? :start_instance
|
3590
|
+
@start_instance = ::Gapic::Config::Method.new start_instance_config
|
3591
|
+
stop_instance_config = parent_rpcs.stop_instance if parent_rpcs.respond_to? :stop_instance
|
3592
|
+
@stop_instance = ::Gapic::Config::Method.new stop_instance_config
|
3593
|
+
reset_instance_config = parent_rpcs.reset_instance if parent_rpcs.respond_to? :reset_instance
|
3594
|
+
@reset_instance = ::Gapic::Config::Method.new reset_instance_config
|
3595
|
+
report_instance_info_config = parent_rpcs.report_instance_info if parent_rpcs.respond_to? :report_instance_info
|
3596
|
+
@report_instance_info = ::Gapic::Config::Method.new report_instance_info_config
|
3597
|
+
is_instance_upgradeable_config = parent_rpcs.is_instance_upgradeable if parent_rpcs.respond_to? :is_instance_upgradeable
|
3598
|
+
@is_instance_upgradeable = ::Gapic::Config::Method.new is_instance_upgradeable_config
|
3599
|
+
get_instance_health_config = parent_rpcs.get_instance_health if parent_rpcs.respond_to? :get_instance_health
|
3600
|
+
@get_instance_health = ::Gapic::Config::Method.new get_instance_health_config
|
3601
|
+
upgrade_instance_config = parent_rpcs.upgrade_instance if parent_rpcs.respond_to? :upgrade_instance
|
3602
|
+
@upgrade_instance = ::Gapic::Config::Method.new upgrade_instance_config
|
3603
|
+
rollback_instance_config = parent_rpcs.rollback_instance if parent_rpcs.respond_to? :rollback_instance
|
3604
|
+
@rollback_instance = ::Gapic::Config::Method.new rollback_instance_config
|
3605
|
+
upgrade_instance_internal_config = parent_rpcs.upgrade_instance_internal if parent_rpcs.respond_to? :upgrade_instance_internal
|
3606
|
+
@upgrade_instance_internal = ::Gapic::Config::Method.new upgrade_instance_internal_config
|
3607
|
+
list_environments_config = parent_rpcs.list_environments if parent_rpcs.respond_to? :list_environments
|
3608
|
+
@list_environments = ::Gapic::Config::Method.new list_environments_config
|
3609
|
+
get_environment_config = parent_rpcs.get_environment if parent_rpcs.respond_to? :get_environment
|
3610
|
+
@get_environment = ::Gapic::Config::Method.new get_environment_config
|
3611
|
+
create_environment_config = parent_rpcs.create_environment if parent_rpcs.respond_to? :create_environment
|
3612
|
+
@create_environment = ::Gapic::Config::Method.new create_environment_config
|
3613
|
+
delete_environment_config = parent_rpcs.delete_environment if parent_rpcs.respond_to? :delete_environment
|
3614
|
+
@delete_environment = ::Gapic::Config::Method.new delete_environment_config
|
3615
|
+
list_schedules_config = parent_rpcs.list_schedules if parent_rpcs.respond_to? :list_schedules
|
3616
|
+
@list_schedules = ::Gapic::Config::Method.new list_schedules_config
|
3617
|
+
get_schedule_config = parent_rpcs.get_schedule if parent_rpcs.respond_to? :get_schedule
|
3618
|
+
@get_schedule = ::Gapic::Config::Method.new get_schedule_config
|
3619
|
+
delete_schedule_config = parent_rpcs.delete_schedule if parent_rpcs.respond_to? :delete_schedule
|
3620
|
+
@delete_schedule = ::Gapic::Config::Method.new delete_schedule_config
|
3621
|
+
create_schedule_config = parent_rpcs.create_schedule if parent_rpcs.respond_to? :create_schedule
|
3622
|
+
@create_schedule = ::Gapic::Config::Method.new create_schedule_config
|
3623
|
+
trigger_schedule_config = parent_rpcs.trigger_schedule if parent_rpcs.respond_to? :trigger_schedule
|
3624
|
+
@trigger_schedule = ::Gapic::Config::Method.new trigger_schedule_config
|
3625
|
+
list_executions_config = parent_rpcs.list_executions if parent_rpcs.respond_to? :list_executions
|
3626
|
+
@list_executions = ::Gapic::Config::Method.new list_executions_config
|
3627
|
+
get_execution_config = parent_rpcs.get_execution if parent_rpcs.respond_to? :get_execution
|
3628
|
+
@get_execution = ::Gapic::Config::Method.new get_execution_config
|
3629
|
+
delete_execution_config = parent_rpcs.delete_execution if parent_rpcs.respond_to? :delete_execution
|
3630
|
+
@delete_execution = ::Gapic::Config::Method.new delete_execution_config
|
3631
|
+
create_execution_config = parent_rpcs.create_execution if parent_rpcs.respond_to? :create_execution
|
3632
|
+
@create_execution = ::Gapic::Config::Method.new create_execution_config
|
3633
|
+
|
3634
|
+
yield self if block_given?
|
3635
|
+
end
|
3636
|
+
end
|
3637
|
+
end
|
3638
|
+
end
|
3639
|
+
end
|
3640
|
+
end
|
3641
|
+
end
|
3642
|
+
end
|
3643
|
+
end
|