google-cloud-notebooks-v1 0.3.0 → 0.4.1
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 +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +1 -1
- data/lib/google/cloud/notebooks/v1/diagnostic_config_pb.rb +28 -0
- data/lib/google/cloud/notebooks/v1/managed_notebook_service/client.rb +364 -0
- data/lib/google/cloud/notebooks/v1/managed_notebook_service/paths.rb +17 -0
- data/lib/google/cloud/notebooks/v1/managed_service_pb.rb +18 -0
- data/lib/google/cloud/notebooks/v1/managed_service_services_pb.rb +6 -0
- data/lib/google/cloud/notebooks/v1/notebook_service/client.rb +133 -0
- data/lib/google/cloud/notebooks/v1/runtime_pb.rb +9 -0
- data/lib/google/cloud/notebooks/v1/service_pb.rb +6 -0
- data/lib/google/cloud/notebooks/v1/service_services_pb.rb +2 -0
- data/lib/google/cloud/notebooks/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/cloud/notebooks/v1/diagnostic_config.rb +64 -0
- data/proto_docs/google/cloud/notebooks/v1/managed_service.rb +65 -0
- data/proto_docs/google/cloud/notebooks/v1/runtime.rb +24 -2
- data/proto_docs/google/cloud/notebooks/v1/service.rb +13 -0
- data/proto_docs/google/protobuf/empty.rb +0 -2
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/type/expr.rb +75 -0
- metadata +50 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d4ee3e61545feb3914c66453e7f9b75d7125ff5ba193db4031783d4c835d380
|
4
|
+
data.tar.gz: 18337a4c34add0c1ed20e18dd1be34f447df5cbc7cf35c4a4476043175dec668
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60ae359568c21c2b4503442d31762b43d3a9ecd51d371a705da5c8ead245c1ba015735c458b83514c88ef477a40d729f269a5e2efbbe91096b88317b4dca9e72
|
7
|
+
data.tar.gz: 836407b41b59b805fd5a0ed0cde569283a0e5e882a1b050569d03139da18282bb7de479ebd9822872df0ce8bd1355f371fae5eb519591620e90f489d1d39f4c1
|
data/AUTHENTICATION.md
CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
114
114
|
To configure your system for this, simply:
|
115
115
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
118
118
|
3. Write code as if already authenticated.
|
119
119
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ for general usage information.
|
|
46
46
|
## Enabling Logging
|
47
47
|
|
48
48
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
49
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/
|
49
|
+
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
|
50
50
|
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
51
51
|
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
52
52
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/notebooks/v1/diagnostic_config.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/field_behavior_pb'
|
7
|
+
|
8
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
|
+
add_file("google/cloud/notebooks/v1/diagnostic_config.proto", :syntax => :proto3) do
|
10
|
+
add_message "google.cloud.notebooks.v1.DiagnosticConfig" do
|
11
|
+
optional :gcs_bucket, :string, 1
|
12
|
+
optional :relative_path, :string, 2
|
13
|
+
optional :repair_flag_enabled, :bool, 3
|
14
|
+
optional :packet_capture_flag_enabled, :bool, 4
|
15
|
+
optional :copy_home_files_flag_enabled, :bool, 5
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module Notebooks
|
23
|
+
module V1
|
24
|
+
DiagnosticConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.DiagnosticConfig").msgclass
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -18,6 +18,8 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/notebooks/v1/managed_service_pb"
|
21
|
+
require "google/cloud/location"
|
22
|
+
require "google/iam/v1"
|
21
23
|
|
22
24
|
module Google
|
23
25
|
module Cloud
|
@@ -75,6 +77,8 @@ module Google
|
|
75
77
|
|
76
78
|
default_config.rpcs.create_runtime.timeout = 60.0
|
77
79
|
|
80
|
+
default_config.rpcs.update_runtime.timeout = 60.0
|
81
|
+
|
78
82
|
default_config.rpcs.delete_runtime.timeout = 60.0
|
79
83
|
|
80
84
|
default_config.rpcs.start_runtime.timeout = 60.0
|
@@ -85,6 +89,8 @@ module Google
|
|
85
89
|
|
86
90
|
default_config.rpcs.report_runtime_event.timeout = 60.0
|
87
91
|
|
92
|
+
default_config.rpcs.diagnose_runtime.timeout = 60.0
|
93
|
+
|
88
94
|
default_config
|
89
95
|
end
|
90
96
|
yield @configure if block_given?
|
@@ -160,6 +166,18 @@ module Google
|
|
160
166
|
config.endpoint = @config.endpoint
|
161
167
|
end
|
162
168
|
|
169
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
170
|
+
config.credentials = credentials
|
171
|
+
config.quota_project = @quota_project_id
|
172
|
+
config.endpoint = @config.endpoint
|
173
|
+
end
|
174
|
+
|
175
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
176
|
+
config.credentials = credentials
|
177
|
+
config.quota_project = @quota_project_id
|
178
|
+
config.endpoint = @config.endpoint
|
179
|
+
end
|
180
|
+
|
163
181
|
@managed_notebook_service_stub = ::Gapic::ServiceStub.new(
|
164
182
|
::Google::Cloud::Notebooks::V1::ManagedNotebookService::Stub,
|
165
183
|
credentials: credentials,
|
@@ -176,6 +194,20 @@ module Google
|
|
176
194
|
#
|
177
195
|
attr_reader :operations_client
|
178
196
|
|
197
|
+
##
|
198
|
+
# Get the associated client for mix-in of the Locations.
|
199
|
+
#
|
200
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
201
|
+
#
|
202
|
+
attr_reader :location_client
|
203
|
+
|
204
|
+
##
|
205
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
206
|
+
#
|
207
|
+
# @return [Google::Iam::V1::IAMPolicy::Client]
|
208
|
+
#
|
209
|
+
attr_reader :iam_policy_client
|
210
|
+
|
179
211
|
# Service calls
|
180
212
|
|
181
213
|
##
|
@@ -463,6 +495,125 @@ module Google
|
|
463
495
|
raise ::Google::Cloud::Error.from_error(e)
|
464
496
|
end
|
465
497
|
|
498
|
+
##
|
499
|
+
# Update Notebook Runtime configuration.
|
500
|
+
#
|
501
|
+
# @overload update_runtime(request, options = nil)
|
502
|
+
# Pass arguments to `update_runtime` via a request object, either of type
|
503
|
+
# {::Google::Cloud::Notebooks::V1::UpdateRuntimeRequest} or an equivalent Hash.
|
504
|
+
#
|
505
|
+
# @param request [::Google::Cloud::Notebooks::V1::UpdateRuntimeRequest, ::Hash]
|
506
|
+
# A request object representing the call parameters. Required. To specify no
|
507
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
508
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
509
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
510
|
+
#
|
511
|
+
# @overload update_runtime(runtime: nil, update_mask: nil, request_id: nil)
|
512
|
+
# Pass arguments to `update_runtime` via keyword arguments. Note that at
|
513
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
514
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
515
|
+
#
|
516
|
+
# @param runtime [::Google::Cloud::Notebooks::V1::Runtime, ::Hash]
|
517
|
+
# Required. The Runtime to be updated.
|
518
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
519
|
+
# Required. Specifies the path, relative to `Runtime`, of
|
520
|
+
# the field to update. For example, to change the software configuration
|
521
|
+
# kernels, the `update_mask` parameter would be
|
522
|
+
# specified as `software_config.kernels`,
|
523
|
+
# and the `PATCH` request body would specify the new value, as follows:
|
524
|
+
#
|
525
|
+
# {
|
526
|
+
# "software_config":{
|
527
|
+
# "kernels": [{
|
528
|
+
# 'repository':
|
529
|
+
# 'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag':
|
530
|
+
# 'latest' }],
|
531
|
+
# }
|
532
|
+
# }
|
533
|
+
#
|
534
|
+
#
|
535
|
+
# Currently, only the following fields can be updated:
|
536
|
+
# - software_config.kernels
|
537
|
+
# - software_config.post_startup_script
|
538
|
+
# - software_config.custom_gpu_driver_path
|
539
|
+
# - software_config.idle_shutdown
|
540
|
+
# - software_config.idle_shutdown_timeout
|
541
|
+
# - software_config.disable_terminal
|
542
|
+
# @param request_id [::String]
|
543
|
+
# Idempotent request UUID.
|
544
|
+
#
|
545
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
546
|
+
# @yieldparam response [::Gapic::Operation]
|
547
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
548
|
+
#
|
549
|
+
# @return [::Gapic::Operation]
|
550
|
+
#
|
551
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
552
|
+
#
|
553
|
+
# @example Basic example
|
554
|
+
# require "google/cloud/notebooks/v1"
|
555
|
+
#
|
556
|
+
# # Create a client object. The client can be reused for multiple calls.
|
557
|
+
# client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new
|
558
|
+
#
|
559
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
560
|
+
# request = Google::Cloud::Notebooks::V1::UpdateRuntimeRequest.new
|
561
|
+
#
|
562
|
+
# # Call the update_runtime method.
|
563
|
+
# result = client.update_runtime request
|
564
|
+
#
|
565
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
566
|
+
# # object to check the status of an operation, cancel it, or wait
|
567
|
+
# # for results. Here is how to block until completion:
|
568
|
+
# result.wait_until_done! timeout: 60
|
569
|
+
# if result.response?
|
570
|
+
# p result.response
|
571
|
+
# else
|
572
|
+
# puts "Error!"
|
573
|
+
# end
|
574
|
+
#
|
575
|
+
def update_runtime request, options = nil
|
576
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
577
|
+
|
578
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::UpdateRuntimeRequest
|
579
|
+
|
580
|
+
# Converts hash and nil to an options object
|
581
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
582
|
+
|
583
|
+
# Customize the options with defaults
|
584
|
+
metadata = @config.rpcs.update_runtime.metadata.to_h
|
585
|
+
|
586
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
587
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
588
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
589
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
590
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
591
|
+
|
592
|
+
header_params = {}
|
593
|
+
if request.runtime&.name
|
594
|
+
header_params["runtime.name"] = request.runtime.name
|
595
|
+
end
|
596
|
+
|
597
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
598
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
599
|
+
|
600
|
+
options.apply_defaults timeout: @config.rpcs.update_runtime.timeout,
|
601
|
+
metadata: metadata,
|
602
|
+
retry_policy: @config.rpcs.update_runtime.retry_policy
|
603
|
+
|
604
|
+
options.apply_defaults timeout: @config.timeout,
|
605
|
+
metadata: @config.metadata,
|
606
|
+
retry_policy: @config.retry_policy
|
607
|
+
|
608
|
+
@managed_notebook_service_stub.call_rpc :update_runtime, request, options: options do |response, operation|
|
609
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
610
|
+
yield response, operation if block_given?
|
611
|
+
return response
|
612
|
+
end
|
613
|
+
rescue ::GRPC::BadStatus => e
|
614
|
+
raise ::Google::Cloud::Error.from_error(e)
|
615
|
+
end
|
616
|
+
|
466
617
|
##
|
467
618
|
# Deletes a single Runtime.
|
468
619
|
#
|
@@ -955,6 +1106,102 @@ module Google
|
|
955
1106
|
raise ::Google::Cloud::Error.from_error(e)
|
956
1107
|
end
|
957
1108
|
|
1109
|
+
##
|
1110
|
+
# Upgrades a Managed Notebook Runtime to the latest version.
|
1111
|
+
#
|
1112
|
+
# @overload upgrade_runtime(request, options = nil)
|
1113
|
+
# Pass arguments to `upgrade_runtime` via a request object, either of type
|
1114
|
+
# {::Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest} or an equivalent Hash.
|
1115
|
+
#
|
1116
|
+
# @param request [::Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest, ::Hash]
|
1117
|
+
# A request object representing the call parameters. Required. To specify no
|
1118
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1119
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1120
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1121
|
+
#
|
1122
|
+
# @overload upgrade_runtime(name: nil, request_id: nil)
|
1123
|
+
# Pass arguments to `upgrade_runtime` via keyword arguments. Note that at
|
1124
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1125
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1126
|
+
#
|
1127
|
+
# @param name [::String]
|
1128
|
+
# Required. Format:
|
1129
|
+
# `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
|
1130
|
+
# @param request_id [::String]
|
1131
|
+
# Idempotent request UUID.
|
1132
|
+
#
|
1133
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1134
|
+
# @yieldparam response [::Gapic::Operation]
|
1135
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1136
|
+
#
|
1137
|
+
# @return [::Gapic::Operation]
|
1138
|
+
#
|
1139
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1140
|
+
#
|
1141
|
+
# @example Basic example
|
1142
|
+
# require "google/cloud/notebooks/v1"
|
1143
|
+
#
|
1144
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1145
|
+
# client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new
|
1146
|
+
#
|
1147
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1148
|
+
# request = Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest.new
|
1149
|
+
#
|
1150
|
+
# # Call the upgrade_runtime method.
|
1151
|
+
# result = client.upgrade_runtime request
|
1152
|
+
#
|
1153
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1154
|
+
# # object to check the status of an operation, cancel it, or wait
|
1155
|
+
# # for results. Here is how to block until completion:
|
1156
|
+
# result.wait_until_done! timeout: 60
|
1157
|
+
# if result.response?
|
1158
|
+
# p result.response
|
1159
|
+
# else
|
1160
|
+
# puts "Error!"
|
1161
|
+
# end
|
1162
|
+
#
|
1163
|
+
def upgrade_runtime request, options = nil
|
1164
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1165
|
+
|
1166
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest
|
1167
|
+
|
1168
|
+
# Converts hash and nil to an options object
|
1169
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1170
|
+
|
1171
|
+
# Customize the options with defaults
|
1172
|
+
metadata = @config.rpcs.upgrade_runtime.metadata.to_h
|
1173
|
+
|
1174
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1175
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1176
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1177
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
1178
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1179
|
+
|
1180
|
+
header_params = {}
|
1181
|
+
if request.name
|
1182
|
+
header_params["name"] = request.name
|
1183
|
+
end
|
1184
|
+
|
1185
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1186
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1187
|
+
|
1188
|
+
options.apply_defaults timeout: @config.rpcs.upgrade_runtime.timeout,
|
1189
|
+
metadata: metadata,
|
1190
|
+
retry_policy: @config.rpcs.upgrade_runtime.retry_policy
|
1191
|
+
|
1192
|
+
options.apply_defaults timeout: @config.timeout,
|
1193
|
+
metadata: @config.metadata,
|
1194
|
+
retry_policy: @config.retry_policy
|
1195
|
+
|
1196
|
+
@managed_notebook_service_stub.call_rpc :upgrade_runtime, request, options: options do |response, operation|
|
1197
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1198
|
+
yield response, operation if block_given?
|
1199
|
+
return response
|
1200
|
+
end
|
1201
|
+
rescue ::GRPC::BadStatus => e
|
1202
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1203
|
+
end
|
1204
|
+
|
958
1205
|
##
|
959
1206
|
# Report and process a runtime event.
|
960
1207
|
#
|
@@ -1144,6 +1391,102 @@ module Google
|
|
1144
1391
|
raise ::Google::Cloud::Error.from_error(e)
|
1145
1392
|
end
|
1146
1393
|
|
1394
|
+
##
|
1395
|
+
# Creates a Diagnostic File and runs Diagnostic Tool given a Runtime.
|
1396
|
+
#
|
1397
|
+
# @overload diagnose_runtime(request, options = nil)
|
1398
|
+
# Pass arguments to `diagnose_runtime` via a request object, either of type
|
1399
|
+
# {::Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest} or an equivalent Hash.
|
1400
|
+
#
|
1401
|
+
# @param request [::Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest, ::Hash]
|
1402
|
+
# A request object representing the call parameters. Required. To specify no
|
1403
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1404
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1405
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1406
|
+
#
|
1407
|
+
# @overload diagnose_runtime(name: nil, diagnostic_config: nil)
|
1408
|
+
# Pass arguments to `diagnose_runtime` via keyword arguments. Note that at
|
1409
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1410
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1411
|
+
#
|
1412
|
+
# @param name [::String]
|
1413
|
+
# Required. Format:
|
1414
|
+
# `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}`
|
1415
|
+
# @param diagnostic_config [::Google::Cloud::Notebooks::V1::DiagnosticConfig, ::Hash]
|
1416
|
+
# Required. Defines flags that are used to run the diagnostic tool
|
1417
|
+
#
|
1418
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1419
|
+
# @yieldparam response [::Gapic::Operation]
|
1420
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1421
|
+
#
|
1422
|
+
# @return [::Gapic::Operation]
|
1423
|
+
#
|
1424
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1425
|
+
#
|
1426
|
+
# @example Basic example
|
1427
|
+
# require "google/cloud/notebooks/v1"
|
1428
|
+
#
|
1429
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1430
|
+
# client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new
|
1431
|
+
#
|
1432
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1433
|
+
# request = Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest.new
|
1434
|
+
#
|
1435
|
+
# # Call the diagnose_runtime method.
|
1436
|
+
# result = client.diagnose_runtime request
|
1437
|
+
#
|
1438
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1439
|
+
# # object to check the status of an operation, cancel it, or wait
|
1440
|
+
# # for results. Here is how to block until completion:
|
1441
|
+
# result.wait_until_done! timeout: 60
|
1442
|
+
# if result.response?
|
1443
|
+
# p result.response
|
1444
|
+
# else
|
1445
|
+
# puts "Error!"
|
1446
|
+
# end
|
1447
|
+
#
|
1448
|
+
def diagnose_runtime request, options = nil
|
1449
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1450
|
+
|
1451
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest
|
1452
|
+
|
1453
|
+
# Converts hash and nil to an options object
|
1454
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1455
|
+
|
1456
|
+
# Customize the options with defaults
|
1457
|
+
metadata = @config.rpcs.diagnose_runtime.metadata.to_h
|
1458
|
+
|
1459
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1460
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1461
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1462
|
+
gapic_version: ::Google::Cloud::Notebooks::V1::VERSION
|
1463
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1464
|
+
|
1465
|
+
header_params = {}
|
1466
|
+
if request.name
|
1467
|
+
header_params["name"] = request.name
|
1468
|
+
end
|
1469
|
+
|
1470
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1471
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1472
|
+
|
1473
|
+
options.apply_defaults timeout: @config.rpcs.diagnose_runtime.timeout,
|
1474
|
+
metadata: metadata,
|
1475
|
+
retry_policy: @config.rpcs.diagnose_runtime.retry_policy
|
1476
|
+
|
1477
|
+
options.apply_defaults timeout: @config.timeout,
|
1478
|
+
metadata: @config.metadata,
|
1479
|
+
retry_policy: @config.retry_policy
|
1480
|
+
|
1481
|
+
@managed_notebook_service_stub.call_rpc :diagnose_runtime, request, options: options do |response, operation|
|
1482
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1483
|
+
yield response, operation if block_given?
|
1484
|
+
return response
|
1485
|
+
end
|
1486
|
+
rescue ::GRPC::BadStatus => e
|
1487
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1488
|
+
end
|
1489
|
+
|
1147
1490
|
##
|
1148
1491
|
# Configuration class for the ManagedNotebookService API.
|
1149
1492
|
#
|
@@ -1295,6 +1638,11 @@ module Google
|
|
1295
1638
|
#
|
1296
1639
|
attr_reader :create_runtime
|
1297
1640
|
##
|
1641
|
+
# RPC-specific configuration for `update_runtime`
|
1642
|
+
# @return [::Gapic::Config::Method]
|
1643
|
+
#
|
1644
|
+
attr_reader :update_runtime
|
1645
|
+
##
|
1298
1646
|
# RPC-specific configuration for `delete_runtime`
|
1299
1647
|
# @return [::Gapic::Config::Method]
|
1300
1648
|
#
|
@@ -1320,6 +1668,11 @@ module Google
|
|
1320
1668
|
#
|
1321
1669
|
attr_reader :reset_runtime
|
1322
1670
|
##
|
1671
|
+
# RPC-specific configuration for `upgrade_runtime`
|
1672
|
+
# @return [::Gapic::Config::Method]
|
1673
|
+
#
|
1674
|
+
attr_reader :upgrade_runtime
|
1675
|
+
##
|
1323
1676
|
# RPC-specific configuration for `report_runtime_event`
|
1324
1677
|
# @return [::Gapic::Config::Method]
|
1325
1678
|
#
|
@@ -1329,6 +1682,11 @@ module Google
|
|
1329
1682
|
# @return [::Gapic::Config::Method]
|
1330
1683
|
#
|
1331
1684
|
attr_reader :refresh_runtime_token_internal
|
1685
|
+
##
|
1686
|
+
# RPC-specific configuration for `diagnose_runtime`
|
1687
|
+
# @return [::Gapic::Config::Method]
|
1688
|
+
#
|
1689
|
+
attr_reader :diagnose_runtime
|
1332
1690
|
|
1333
1691
|
# @private
|
1334
1692
|
def initialize parent_rpcs = nil
|
@@ -1338,6 +1696,8 @@ module Google
|
|
1338
1696
|
@get_runtime = ::Gapic::Config::Method.new get_runtime_config
|
1339
1697
|
create_runtime_config = parent_rpcs.create_runtime if parent_rpcs.respond_to? :create_runtime
|
1340
1698
|
@create_runtime = ::Gapic::Config::Method.new create_runtime_config
|
1699
|
+
update_runtime_config = parent_rpcs.update_runtime if parent_rpcs.respond_to? :update_runtime
|
1700
|
+
@update_runtime = ::Gapic::Config::Method.new update_runtime_config
|
1341
1701
|
delete_runtime_config = parent_rpcs.delete_runtime if parent_rpcs.respond_to? :delete_runtime
|
1342
1702
|
@delete_runtime = ::Gapic::Config::Method.new delete_runtime_config
|
1343
1703
|
start_runtime_config = parent_rpcs.start_runtime if parent_rpcs.respond_to? :start_runtime
|
@@ -1348,10 +1708,14 @@ module Google
|
|
1348
1708
|
@switch_runtime = ::Gapic::Config::Method.new switch_runtime_config
|
1349
1709
|
reset_runtime_config = parent_rpcs.reset_runtime if parent_rpcs.respond_to? :reset_runtime
|
1350
1710
|
@reset_runtime = ::Gapic::Config::Method.new reset_runtime_config
|
1711
|
+
upgrade_runtime_config = parent_rpcs.upgrade_runtime if parent_rpcs.respond_to? :upgrade_runtime
|
1712
|
+
@upgrade_runtime = ::Gapic::Config::Method.new upgrade_runtime_config
|
1351
1713
|
report_runtime_event_config = parent_rpcs.report_runtime_event if parent_rpcs.respond_to? :report_runtime_event
|
1352
1714
|
@report_runtime_event = ::Gapic::Config::Method.new report_runtime_event_config
|
1353
1715
|
refresh_runtime_token_internal_config = parent_rpcs.refresh_runtime_token_internal if parent_rpcs.respond_to? :refresh_runtime_token_internal
|
1354
1716
|
@refresh_runtime_token_internal = ::Gapic::Config::Method.new refresh_runtime_token_internal_config
|
1717
|
+
diagnose_runtime_config = parent_rpcs.diagnose_runtime if parent_rpcs.respond_to? :diagnose_runtime
|
1718
|
+
@diagnose_runtime = ::Gapic::Config::Method.new diagnose_runtime_config
|
1355
1719
|
|
1356
1720
|
yield self if block_given?
|
1357
1721
|
end
|
@@ -24,6 +24,23 @@ module Google
|
|
24
24
|
module ManagedNotebookService
|
25
25
|
# Path helper methods for the ManagedNotebookService API.
|
26
26
|
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Location resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `projects/{project}/locations/{location}`
|
33
|
+
#
|
34
|
+
# @param project [String]
|
35
|
+
# @param location [String]
|
36
|
+
#
|
37
|
+
# @return [::String]
|
38
|
+
def location_path project:, location:
|
39
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
40
|
+
|
41
|
+
"projects/#{project}/locations/#{location}"
|
42
|
+
end
|
43
|
+
|
27
44
|
##
|
28
45
|
# Create a fully-qualified Runtime resource string.
|
29
46
|
#
|
@@ -7,9 +7,11 @@ require 'google/api/annotations_pb'
|
|
7
7
|
require 'google/api/client_pb'
|
8
8
|
require 'google/api/field_behavior_pb'
|
9
9
|
require 'google/api/resource_pb'
|
10
|
+
require 'google/cloud/notebooks/v1/diagnostic_config_pb'
|
10
11
|
require 'google/cloud/notebooks/v1/event_pb'
|
11
12
|
require 'google/cloud/notebooks/v1/runtime_pb'
|
12
13
|
require 'google/longrunning/operations_pb'
|
14
|
+
require 'google/protobuf/field_mask_pb'
|
13
15
|
require 'google/protobuf/timestamp_pb'
|
14
16
|
|
15
17
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
@@ -55,11 +57,20 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
55
57
|
optional :name, :string, 1
|
56
58
|
optional :request_id, :string, 2
|
57
59
|
end
|
60
|
+
add_message "google.cloud.notebooks.v1.UpgradeRuntimeRequest" do
|
61
|
+
optional :name, :string, 1
|
62
|
+
optional :request_id, :string, 2
|
63
|
+
end
|
58
64
|
add_message "google.cloud.notebooks.v1.ReportRuntimeEventRequest" do
|
59
65
|
optional :name, :string, 1
|
60
66
|
optional :vm_id, :string, 2
|
61
67
|
optional :event, :message, 3, "google.cloud.notebooks.v1.Event"
|
62
68
|
end
|
69
|
+
add_message "google.cloud.notebooks.v1.UpdateRuntimeRequest" do
|
70
|
+
optional :runtime, :message, 1, "google.cloud.notebooks.v1.Runtime"
|
71
|
+
optional :update_mask, :message, 2, "google.protobuf.FieldMask"
|
72
|
+
optional :request_id, :string, 3
|
73
|
+
end
|
63
74
|
add_message "google.cloud.notebooks.v1.RefreshRuntimeTokenInternalRequest" do
|
64
75
|
optional :name, :string, 1
|
65
76
|
optional :vm_id, :string, 2
|
@@ -68,6 +79,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
68
79
|
optional :access_token, :string, 1
|
69
80
|
optional :expire_time, :message, 2, "google.protobuf.Timestamp"
|
70
81
|
end
|
82
|
+
add_message "google.cloud.notebooks.v1.DiagnoseRuntimeRequest" do
|
83
|
+
optional :name, :string, 1
|
84
|
+
optional :diagnostic_config, :message, 2, "google.cloud.notebooks.v1.DiagnosticConfig"
|
85
|
+
end
|
71
86
|
end
|
72
87
|
end
|
73
88
|
|
@@ -84,9 +99,12 @@ module Google
|
|
84
99
|
StopRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.StopRuntimeRequest").msgclass
|
85
100
|
SwitchRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.SwitchRuntimeRequest").msgclass
|
86
101
|
ResetRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.ResetRuntimeRequest").msgclass
|
102
|
+
UpgradeRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.UpgradeRuntimeRequest").msgclass
|
87
103
|
ReportRuntimeEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.ReportRuntimeEventRequest").msgclass
|
104
|
+
UpdateRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.UpdateRuntimeRequest").msgclass
|
88
105
|
RefreshRuntimeTokenInternalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.RefreshRuntimeTokenInternalRequest").msgclass
|
89
106
|
RefreshRuntimeTokenInternalResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.RefreshRuntimeTokenInternalResponse").msgclass
|
107
|
+
DiagnoseRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.DiagnoseRuntimeRequest").msgclass
|
90
108
|
end
|
91
109
|
end
|
92
110
|
end
|
@@ -40,6 +40,8 @@ module Google
|
|
40
40
|
rpc :GetRuntime, ::Google::Cloud::Notebooks::V1::GetRuntimeRequest, ::Google::Cloud::Notebooks::V1::Runtime
|
41
41
|
# Creates a new Runtime in a given project and location.
|
42
42
|
rpc :CreateRuntime, ::Google::Cloud::Notebooks::V1::CreateRuntimeRequest, ::Google::Longrunning::Operation
|
43
|
+
# Update Notebook Runtime configuration.
|
44
|
+
rpc :UpdateRuntime, ::Google::Cloud::Notebooks::V1::UpdateRuntimeRequest, ::Google::Longrunning::Operation
|
43
45
|
# Deletes a single Runtime.
|
44
46
|
rpc :DeleteRuntime, ::Google::Cloud::Notebooks::V1::DeleteRuntimeRequest, ::Google::Longrunning::Operation
|
45
47
|
# Starts a Managed Notebook Runtime.
|
@@ -58,11 +60,15 @@ module Google
|
|
58
60
|
rpc :SwitchRuntime, ::Google::Cloud::Notebooks::V1::SwitchRuntimeRequest, ::Google::Longrunning::Operation
|
59
61
|
# Resets a Managed Notebook Runtime.
|
60
62
|
rpc :ResetRuntime, ::Google::Cloud::Notebooks::V1::ResetRuntimeRequest, ::Google::Longrunning::Operation
|
63
|
+
# Upgrades a Managed Notebook Runtime to the latest version.
|
64
|
+
rpc :UpgradeRuntime, ::Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest, ::Google::Longrunning::Operation
|
61
65
|
# Report and process a runtime event.
|
62
66
|
rpc :ReportRuntimeEvent, ::Google::Cloud::Notebooks::V1::ReportRuntimeEventRequest, ::Google::Longrunning::Operation
|
63
67
|
# Gets an access token for the consumer service account that the customer
|
64
68
|
# attached to the runtime. Only accessible from the tenant instance.
|
65
69
|
rpc :RefreshRuntimeTokenInternal, ::Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalRequest, ::Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalResponse
|
70
|
+
# Creates a Diagnostic File and runs Diagnostic Tool given a Runtime.
|
71
|
+
rpc :DiagnoseRuntime, ::Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest, ::Google::Longrunning::Operation
|
66
72
|
end
|
67
73
|
|
68
74
|
Stub = Service.rpc_stub_class
|