Reference documentation and code samples for the AI Platform Notebooks V1 API class Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.
Client for the ManagedNotebookService service.
API v1 service for Managed Notebooks.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the ManagedNotebookService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all ManagedNotebookService clients ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the ManagedNotebookService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_runtime
def create_runtime(request, options = nil) -> ::Gapic::Operation def create_runtime(parent: nil, runtime_id: nil, runtime: nil, request_id: nil) -> ::Gapic::OperationCreates a new Runtime in a given project and location.
def create_runtime(request, options = nil) -> ::Gapic::Operationcreate_runtime via a request object, either of type CreateRuntimeRequest or an equivalent Hash. - request (::Google::Cloud::Notebooks::V1::CreateRuntimeRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_runtime(parent: nil, runtime_id: nil, runtime: nil, request_id: nil) -> ::Gapic::Operationcreate_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). - parent (::String) — Required. Format:
parent=projects/{project_id}/locations/{location} - runtime_id (::String) — Required. User-defined unique ID of this Runtime.
- runtime (::Google::Cloud::Notebooks::V1::Runtime, ::Hash) — Required. The Runtime to be created.
- request_id (::String) — Idempotent request UUID.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/notebooks/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Notebooks::V1::CreateRuntimeRequest.new # Call the create_runtime method. result = client.create_runtime request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#delete_runtime
def delete_runtime(request, options = nil) -> ::Gapic::Operation def delete_runtime(name: nil, request_id: nil) -> ::Gapic::OperationDeletes a single Runtime.
def delete_runtime(request, options = nil) -> ::Gapic::Operationdelete_runtime via a request object, either of type DeleteRuntimeRequest or an equivalent Hash. - request (::Google::Cloud::Notebooks::V1::DeleteRuntimeRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_runtime(name: nil, request_id: nil) -> ::Gapic::Operationdelete_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). - name (::String) — Required. Format:
projects/{project_id}/locations/{location}/runtimes/{runtime_id} - request_id (::String) — Idempotent request UUID.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/notebooks/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Notebooks::V1::DeleteRuntimeRequest.new # Call the delete_runtime method. result = client.delete_runtime request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#diagnose_runtime
def diagnose_runtime(request, options = nil) -> ::Gapic::Operation def diagnose_runtime(name: nil, diagnostic_config: nil) -> ::Gapic::OperationCreates a Diagnostic File and runs Diagnostic Tool given a Runtime.
def diagnose_runtime(request, options = nil) -> ::Gapic::Operationdiagnose_runtime via a request object, either of type DiagnoseRuntimeRequest or an equivalent Hash. - request (::Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def diagnose_runtime(name: nil, diagnostic_config: nil) -> ::Gapic::Operationdiagnose_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). - name (::String) — Required. Format:
projects/{project_id}/locations/{location}/runtimes/{runtimes_id} - diagnostic_config (::Google::Cloud::Notebooks::V1::DiagnosticConfig, ::Hash) — Required. Defines flags that are used to run the diagnostic tool
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/notebooks/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest.new # Call the diagnose_runtime method. result = client.diagnose_runtime request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#get_runtime
def get_runtime(request, options = nil) -> ::Google::Cloud::Notebooks::V1::Runtime def get_runtime(name: nil) -> ::Google::Cloud::Notebooks::V1::RuntimeGets details of a single Runtime. The location must be a regional endpoint rather than zonal.
def get_runtime(request, options = nil) -> ::Google::Cloud::Notebooks::V1::Runtimeget_runtime via a request object, either of type GetRuntimeRequest or an equivalent Hash. - request (::Google::Cloud::Notebooks::V1::GetRuntimeRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_runtime(name: nil) -> ::Google::Cloud::Notebooks::V1::Runtimeget_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). - name (::String) — Required. Format:
projects/{project_id}/locations/{location}/runtimes/{runtime_id}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Notebooks::V1::Runtime)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/notebooks/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Notebooks::V1::GetRuntimeRequest.new # Call the get_runtime method. result = client.get_runtime request # The returned object is of type Google::Cloud::Notebooks::V1::Runtime. p result
#iam_policy_client
def iam_policy_client() -> Google::Iam::V1::IAMPolicy::ClientGet the associated client for mix-in of the IAMPolicy.
- (Google::Iam::V1::IAMPolicy::Client)
#initialize
def initialize() { |config| ... } -> ClientCreate a new ManagedNotebookService client object.
- (config) — Configure the ManagedNotebookService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new do |config| config.timeout = 10.0 end
#list_runtimes
def list_runtimes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Runtime> def list_runtimes(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Runtime>Lists Runtimes in a given project and location.
def list_runtimes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Runtime>list_runtimes via a request object, either of type ListRuntimesRequest or an equivalent Hash. - request (::Google::Cloud::Notebooks::V1::ListRuntimesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_runtimes(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Runtime>list_runtimes via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). - parent (::String) — Required. Format:
parent=projects/{project_id}/locations/{location} - page_size (::Integer) — Maximum return size of the list call.
- page_token (::String) — A previous returned page token that can be used to continue listing from the last result.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Runtime>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Runtime>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/notebooks/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Notebooks::V1::ListRuntimesRequest.new # Call the list_runtimes method. result = client.list_runtimes request # The returned object is of type Gapic::PagedEnumerable. You can # iterate over all elements by calling #each, and the enumerable # will lazily make API calls to fetch subsequent pages. Other # methods are also available for managing paging directly. result.each do |response| # Each element is of type ::Google::Cloud::Notebooks::V1::Runtime. p response end
#location_client
def location_client() -> Google::Cloud::Location::Locations::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#operations_client
def operations_client() -> ::Google::Cloud::Notebooks::V1::ManagedNotebookService::OperationsGet the associated client for long-running operations.
#refresh_runtime_token_internal
def refresh_runtime_token_internal(request, options = nil) -> ::Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalResponse def refresh_runtime_token_internal(name: nil, vm_id: nil) -> ::Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalResponseGets an access token for the consumer service account that the customer attached to the runtime. Only accessible from the tenant instance.
def refresh_runtime_token_internal(request, options = nil) -> ::Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalResponserefresh_runtime_token_internal via a request object, either of type RefreshRuntimeTokenInternalRequest or an equivalent Hash. - request (::Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def refresh_runtime_token_internal(name: nil, vm_id: nil) -> ::Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalResponserefresh_runtime_token_internal via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). - name (::String) — Required. Format:
projects/{project_id}/locations/{location}/runtimes/{runtime_id} - vm_id (::String) — Required. The VM hardware token for authenticating the VM. https://cloud.google.com/compute/docs/instances/verifying-instance-identity
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/notebooks/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalRequest.new # Call the refresh_runtime_token_internal method. result = client.refresh_runtime_token_internal request # The returned object is of type Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalResponse. p result
#report_runtime_event
def report_runtime_event(request, options = nil) -> ::Gapic::Operation def report_runtime_event(name: nil, vm_id: nil, event: nil) -> ::Gapic::OperationReport and process a runtime event.
def report_runtime_event(request, options = nil) -> ::Gapic::Operationreport_runtime_event via a request object, either of type ReportRuntimeEventRequest or an equivalent Hash. - request (::Google::Cloud::Notebooks::V1::ReportRuntimeEventRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def report_runtime_event(name: nil, vm_id: nil, event: nil) -> ::Gapic::Operationreport_runtime_event via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). - name (::String) — Required. Format:
projects/{project_id}/locations/{location}/runtimes/{runtime_id} - vm_id (::String) — Required. The VM hardware token for authenticating the VM. https://cloud.google.com/compute/docs/instances/verifying-instance-identity
- event (::Google::Cloud::Notebooks::V1::Event, ::Hash) — Required. The Event to be reported.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/notebooks/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Notebooks::V1::ReportRuntimeEventRequest.new # Call the report_runtime_event method. result = client.report_runtime_event request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#reset_runtime
def reset_runtime(request, options = nil) -> ::Gapic::Operation def reset_runtime(name: nil, request_id: nil) -> ::Gapic::OperationResets a Managed Notebook Runtime.
def reset_runtime(request, options = nil) -> ::Gapic::Operationreset_runtime via a request object, either of type ResetRuntimeRequest or an equivalent Hash. - request (::Google::Cloud::Notebooks::V1::ResetRuntimeRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def reset_runtime(name: nil, request_id: nil) -> ::Gapic::Operationreset_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). - name (::String) — Required. Format:
projects/{project_id}/locations/{location}/runtimes/{runtime_id} - request_id (::String) — Idempotent request UUID.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/notebooks/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Notebooks::V1::ResetRuntimeRequest.new # Call the reset_runtime method. result = client.reset_runtime request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#start_runtime
def start_runtime(request, options = nil) -> ::Gapic::Operation def start_runtime(name: nil, request_id: nil) -> ::Gapic::OperationStarts a Managed Notebook Runtime. Perform "Start" on GPU instances; "Resume" on CPU instances See: https://cloud.google.com/compute/docs/instances/stop-start-instance https://cloud.google.com/compute/docs/instances/suspend-resume-instance
def start_runtime(request, options = nil) -> ::Gapic::Operationstart_runtime via a request object, either of type StartRuntimeRequest or an equivalent Hash. - request (::Google::Cloud::Notebooks::V1::StartRuntimeRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def start_runtime(name: nil, request_id: nil) -> ::Gapic::Operationstart_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). - name (::String) — Required. Format:
projects/{project_id}/locations/{location}/runtimes/{runtime_id} - request_id (::String) — Idempotent request UUID.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/notebooks/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Notebooks::V1::StartRuntimeRequest.new # Call the start_runtime method. result = client.start_runtime request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#stop_runtime
def stop_runtime(request, options = nil) -> ::Gapic::Operation def stop_runtime(name: nil, request_id: nil) -> ::Gapic::OperationStops a Managed Notebook Runtime. Perform "Stop" on GPU instances; "Suspend" on CPU instances See: https://cloud.google.com/compute/docs/instances/stop-start-instance https://cloud.google.com/compute/docs/instances/suspend-resume-instance
def stop_runtime(request, options = nil) -> ::Gapic::Operationstop_runtime via a request object, either of type StopRuntimeRequest or an equivalent Hash. - request (::Google::Cloud::Notebooks::V1::StopRuntimeRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def stop_runtime(name: nil, request_id: nil) -> ::Gapic::Operationstop_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). - name (::String) — Required. Format:
projects/{project_id}/locations/{location}/runtimes/{runtime_id} - request_id (::String) — Idempotent request UUID.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/notebooks/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Notebooks::V1::StopRuntimeRequest.new # Call the stop_runtime method. result = client.stop_runtime request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#switch_runtime
def switch_runtime(request, options = nil) -> ::Gapic::Operation def switch_runtime(name: nil, machine_type: nil, accelerator_config: nil, request_id: nil) -> ::Gapic::OperationSwitch a Managed Notebook Runtime.
def switch_runtime(request, options = nil) -> ::Gapic::Operationswitch_runtime via a request object, either of type SwitchRuntimeRequest or an equivalent Hash. - request (::Google::Cloud::Notebooks::V1::SwitchRuntimeRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def switch_runtime(name: nil, machine_type: nil, accelerator_config: nil, request_id: nil) -> ::Gapic::Operationswitch_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). - name (::String) — Required. Format:
projects/{project_id}/locations/{location}/runtimes/{runtime_id} - machine_type (::String) — machine type.
- accelerator_config (::Google::Cloud::Notebooks::V1::RuntimeAcceleratorConfig, ::Hash) — accelerator config.
- request_id (::String) — Idempotent request UUID.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/notebooks/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Notebooks::V1::SwitchRuntimeRequest.new # Call the switch_runtime method. result = client.switch_runtime request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#update_runtime
def update_runtime(request, options = nil) -> ::Gapic::Operation def update_runtime(runtime: nil, update_mask: nil, request_id: nil) -> ::Gapic::OperationUpdate Notebook Runtime configuration.
def update_runtime(request, options = nil) -> ::Gapic::Operationupdate_runtime via a request object, either of type UpdateRuntimeRequest or an equivalent Hash. - request (::Google::Cloud::Notebooks::V1::UpdateRuntimeRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_runtime(runtime: nil, update_mask: nil, request_id: nil) -> ::Gapic::Operationupdate_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). - runtime (::Google::Cloud::Notebooks::V1::Runtime, ::Hash) — Required. The Runtime to be updated.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) —
Required. Specifies the path, relative to
Runtime, of the field to update. For example, to change the software configuration kernels, theupdate_maskparameter would be specified assoftware_config.kernels, and thePATCHrequest body would specify the new value, as follows:{ "software_config":{ "kernels": [{ 'repository': 'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag': 'latest' }], } }Currently, only the following fields can be updated:
software_config.kernelssoftware_config.post_startup_scriptsoftware_config.custom_gpu_driver_pathsoftware_config.idle_shutdownsoftware_config.idle_shutdown_timeoutsoftware_config.disable_terminal
- request_id (::String) — Idempotent request UUID.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/notebooks/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Notebooks::V1::UpdateRuntimeRequest.new # Call the update_runtime method. result = client.update_runtime request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#upgrade_runtime
def upgrade_runtime(request, options = nil) -> ::Gapic::Operation def upgrade_runtime(name: nil, request_id: nil) -> ::Gapic::OperationUpgrades a Managed Notebook Runtime to the latest version.
def upgrade_runtime(request, options = nil) -> ::Gapic::Operationupgrade_runtime via a request object, either of type UpgradeRuntimeRequest or an equivalent Hash. - request (::Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def upgrade_runtime(name: nil, request_id: nil) -> ::Gapic::Operationupgrade_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). - name (::String) — Required. Format:
projects/{project_id}/locations/{location}/runtimes/{runtime_id} - request_id (::String) — Idempotent request UUID.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/notebooks/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest.new # Call the upgrade_runtime method. result = client.upgrade_runtime request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end