AI Platform Notebooks V1beta1 API - Class Google::Cloud::Notebooks::V1beta1::NotebookService::Client (v0.10.0)

Reference documentation and code samples for the AI Platform Notebooks V1beta1 API class Google::Cloud::Notebooks::V1beta1::NotebookService::Client.

Client for the NotebookService service.

API v1beta1 service for Cloud AI Platform Notebooks.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the NotebookService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all NotebookService clients
::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the NotebookService 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.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_environment

def create_environment(request, options = nil) -> ::Gapic::Operation
def create_environment(parent: nil, environment_id: nil, environment: nil) -> ::Gapic::Operation

Creates a new Environment.

Overloads
def create_environment(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_environment via a request object, either of type CreateEnvironmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::CreateEnvironmentRequest, ::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_environment(parent: nil, environment_id: nil, environment: nil) -> ::Gapic::Operation
Pass arguments to create_environment 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).
Parameters
  • parent (::String) — Required. Format: projects/{project_id}/locations/{location}
  • environment_id (::String) — Required. User-defined unique ID of this environment. The environment_id must be 1 to 63 characters long and contain only lowercase letters, numeric characters, and dashes. The first character must be a lowercase letter and the last character cannot be a dash.
  • environment (::Google::Cloud::Notebooks::V1beta1::Environment, ::Hash) — Required. The environment to be created.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::CreateEnvironmentRequest.new

# Call the create_environment method.
result = client.create_environment request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_instance

def create_instance(request, options = nil) -> ::Gapic::Operation
def create_instance(parent: nil, instance_id: nil, instance: nil) -> ::Gapic::Operation

Creates a new Instance in a given project and location.

Overloads
def create_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_instance via a request object, either of type CreateInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::CreateInstanceRequest, ::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_instance(parent: nil, instance_id: nil, instance: nil) -> ::Gapic::Operation
Pass arguments to create_instance 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).
Parameters
  • parent (::String) — Required. Format: parent=projects/{project_id}/locations/{location}
  • instance_id (::String) — Required. User-defined unique ID of this instance.
  • instance (::Google::Cloud::Notebooks::V1beta1::Instance, ::Hash) — Required. The instance to be created.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::CreateInstanceRequest.new

# Call the create_instance method.
result = client.create_instance request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_environment

def delete_environment(request, options = nil) -> ::Gapic::Operation
def delete_environment(name: nil) -> ::Gapic::Operation

Deletes a single Environment.

Overloads
def delete_environment(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_environment via a request object, either of type DeleteEnvironmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::DeleteEnvironmentRequest, ::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_environment(name: nil) -> ::Gapic::Operation
Pass arguments to delete_environment 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).
Parameter
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/environments/{environment_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::DeleteEnvironmentRequest.new

# Call the delete_environment method.
result = client.delete_environment request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_instance

def delete_instance(request, options = nil) -> ::Gapic::Operation
def delete_instance(name: nil) -> ::Gapic::Operation

Deletes a single Instance.

Overloads
def delete_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_instance via a request object, either of type DeleteInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::DeleteInstanceRequest, ::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_instance(name: nil) -> ::Gapic::Operation
Pass arguments to delete_instance 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).
Parameter
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::DeleteInstanceRequest.new

# Call the delete_instance method.
result = client.delete_instance request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#get_environment

def get_environment(request, options = nil) -> ::Google::Cloud::Notebooks::V1beta1::Environment
def get_environment(name: nil) -> ::Google::Cloud::Notebooks::V1beta1::Environment

Gets details of a single Environment.

Overloads
def get_environment(request, options = nil) -> ::Google::Cloud::Notebooks::V1beta1::Environment
Pass arguments to get_environment via a request object, either of type GetEnvironmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::GetEnvironmentRequest, ::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_environment(name: nil) -> ::Google::Cloud::Notebooks::V1beta1::Environment
Pass arguments to get_environment 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).
Parameter
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/environments/{environment_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::GetEnvironmentRequest.new

# Call the get_environment method.
result = client.get_environment request

# The returned object is of type Google::Cloud::Notebooks::V1beta1::Environment.
p result

#get_instance

def get_instance(request, options = nil) -> ::Google::Cloud::Notebooks::V1beta1::Instance
def get_instance(name: nil) -> ::Google::Cloud::Notebooks::V1beta1::Instance

Gets details of a single Instance.

Overloads
def get_instance(request, options = nil) -> ::Google::Cloud::Notebooks::V1beta1::Instance
Pass arguments to get_instance via a request object, either of type GetInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::GetInstanceRequest, ::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_instance(name: nil) -> ::Google::Cloud::Notebooks::V1beta1::Instance
Pass arguments to get_instance 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).
Parameter
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::GetInstanceRequest.new

# Call the get_instance method.
result = client.get_instance request

# The returned object is of type Google::Cloud::Notebooks::V1beta1::Instance.
p result

#iam_policy_client

def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Client

Get the associated client for mix-in of the IAMPolicy.

Returns
  • (Google::Iam::V1::IAMPolicy::Client)

#initialize

def initialize() { |config| ... } -> Client

Create a new NotebookService client object.

Yields
  • (config) — Configure the NotebookService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new do |config|
  config.timeout = 10.0
end

#is_instance_upgradeable

def is_instance_upgradeable(request, options = nil) -> ::Google::Cloud::Notebooks::V1beta1::IsInstanceUpgradeableResponse
def is_instance_upgradeable(notebook_instance: nil) -> ::Google::Cloud::Notebooks::V1beta1::IsInstanceUpgradeableResponse

Check if a notebook instance is upgradable. Deprecated. Please consider using v1.

Overloads
def is_instance_upgradeable(request, options = nil) -> ::Google::Cloud::Notebooks::V1beta1::IsInstanceUpgradeableResponse
Pass arguments to is_instance_upgradeable via a request object, either of type IsInstanceUpgradeableRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::IsInstanceUpgradeableRequest, ::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 is_instance_upgradeable(notebook_instance: nil) -> ::Google::Cloud::Notebooks::V1beta1::IsInstanceUpgradeableResponse
Pass arguments to is_instance_upgradeable 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).
Parameter
  • notebook_instance (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::IsInstanceUpgradeableRequest.new

# Call the is_instance_upgradeable method.
result = client.is_instance_upgradeable request

# The returned object is of type Google::Cloud::Notebooks::V1beta1::IsInstanceUpgradeableResponse.
p result

#list_environments

def list_environments(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1beta1::Environment>
def list_environments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1beta1::Environment>

Lists environments in a project.

Overloads
def list_environments(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1beta1::Environment>
Pass arguments to list_environments via a request object, either of type ListEnvironmentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::ListEnvironmentsRequest, ::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_environments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1beta1::Environment>
Pass arguments to list_environments 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).
Parameters
  • parent (::String) — Required. Format: 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::ListEnvironmentsRequest.new

# Call the list_environments method.
result = client.list_environments request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Notebooks::V1beta1::Environment.
  p item
end

#list_instances

def list_instances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1beta1::Instance>
def list_instances(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1beta1::Instance>

Lists instances in a given project and location.

Overloads
def list_instances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1beta1::Instance>
Pass arguments to list_instances via a request object, either of type ListInstancesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::ListInstancesRequest, ::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_instances(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1beta1::Instance>
Pass arguments to list_instances 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).
Parameters
  • 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::ListInstancesRequest.new

# Call the list_instances method.
result = client.list_instances request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Notebooks::V1beta1::Instance.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#operations_client

def operations_client() -> ::Google::Cloud::Notebooks::V1beta1::NotebookService::Operations

Get the associated client for long-running operations.

#register_instance

def register_instance(request, options = nil) -> ::Gapic::Operation
def register_instance(parent: nil, instance_id: nil) -> ::Gapic::Operation

Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances are instances created with the legacy Compute Engine calls. They are not manageable by the Notebooks API out of the box. This call makes these instances manageable by the Notebooks API.

Overloads
def register_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to register_instance via a request object, either of type RegisterInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::RegisterInstanceRequest, ::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 register_instance(parent: nil, instance_id: nil) -> ::Gapic::Operation
Pass arguments to register_instance 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).
Parameters
  • parent (::String) — Required. Format: parent=projects/{project_id}/locations/{location}
  • instance_id (::String) — Required. User defined unique ID of this instance. The instance_id must be 1 to 63 characters long and contain only lowercase letters, numeric characters, and dashes. The first character must be a lowercase letter and the last character cannot be a dash.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::RegisterInstanceRequest.new

# Call the register_instance method.
result = client.register_instance request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#report_instance_info

def report_instance_info(request, options = nil) -> ::Gapic::Operation
def report_instance_info(name: nil, vm_id: nil, metadata: nil) -> ::Gapic::Operation

Allows notebook instances to report their latest instance information to the Notebooks API server. The server will merge the reported information to the instance metadata store. Do not use this method directly.

Overloads
def report_instance_info(request, options = nil) -> ::Gapic::Operation
Pass arguments to report_instance_info via a request object, either of type ReportInstanceInfoRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::ReportInstanceInfoRequest, ::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_instance_info(name: nil, vm_id: nil, metadata: nil) -> ::Gapic::Operation
Pass arguments to report_instance_info 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).
Parameters
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
  • vm_id (::String) — Required. The VM hardware token for authenticating the VM. https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  • metadata (::Hash{::String => ::String}) — The metadata reported to Notebooks API. This will be merged to the instance metadata store
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::ReportInstanceInfoRequest.new

# Call the report_instance_info method.
result = client.report_instance_info request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#reset_instance

def reset_instance(request, options = nil) -> ::Gapic::Operation
def reset_instance(name: nil) -> ::Gapic::Operation

Resets a notebook instance.

Overloads
def reset_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to reset_instance via a request object, either of type ResetInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::ResetInstanceRequest, ::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_instance(name: nil) -> ::Gapic::Operation
Pass arguments to reset_instance 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).
Parameter
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::ResetInstanceRequest.new

# Call the reset_instance method.
result = client.reset_instance request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#set_instance_accelerator

def set_instance_accelerator(request, options = nil) -> ::Gapic::Operation
def set_instance_accelerator(name: nil, type: nil, core_count: nil) -> ::Gapic::Operation

Updates the guest accelerators of a single Instance.

Overloads
def set_instance_accelerator(request, options = nil) -> ::Gapic::Operation
Pass arguments to set_instance_accelerator via a request object, either of type SetInstanceAcceleratorRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::SetInstanceAcceleratorRequest, ::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 set_instance_accelerator(name: nil, type: nil, core_count: nil) -> ::Gapic::Operation
Pass arguments to set_instance_accelerator 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).
Parameters
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
  • type (::Google::Cloud::Notebooks::V1beta1::Instance::AcceleratorType) — Required. Type of this accelerator.
  • core_count (::Integer) — Required. Count of cores of this accelerator. Note that not all combinations of type and core_count are valid. Check GPUs on Compute Engine to find a valid combination. TPUs are not supported.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::SetInstanceAcceleratorRequest.new

# Call the set_instance_accelerator method.
result = client.set_instance_accelerator request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#set_instance_labels

def set_instance_labels(request, options = nil) -> ::Gapic::Operation
def set_instance_labels(name: nil, labels: nil) -> ::Gapic::Operation

Updates the labels of an Instance.

Overloads
def set_instance_labels(request, options = nil) -> ::Gapic::Operation
Pass arguments to set_instance_labels via a request object, either of type SetInstanceLabelsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::SetInstanceLabelsRequest, ::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 set_instance_labels(name: nil, labels: nil) -> ::Gapic::Operation
Pass arguments to set_instance_labels 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).
Parameters
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
  • labels (::Hash{::String => ::String}) — Labels to apply to this instance. These can be later modified by the setLabels method
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::SetInstanceLabelsRequest.new

# Call the set_instance_labels method.
result = client.set_instance_labels request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#set_instance_machine_type

def set_instance_machine_type(request, options = nil) -> ::Gapic::Operation
def set_instance_machine_type(name: nil, machine_type: nil) -> ::Gapic::Operation

Updates the machine type of a single Instance.

Overloads
def set_instance_machine_type(request, options = nil) -> ::Gapic::Operation
Pass arguments to set_instance_machine_type via a request object, either of type SetInstanceMachineTypeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::SetInstanceMachineTypeRequest, ::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 set_instance_machine_type(name: nil, machine_type: nil) -> ::Gapic::Operation
Pass arguments to set_instance_machine_type 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).
Parameters
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
  • machine_type (::String) — Required. The Compute Engine machine type.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::SetInstanceMachineTypeRequest.new

# Call the set_instance_machine_type method.
result = client.set_instance_machine_type request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#start_instance

def start_instance(request, options = nil) -> ::Gapic::Operation
def start_instance(name: nil) -> ::Gapic::Operation

Starts a notebook instance.

Overloads
def start_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to start_instance via a request object, either of type StartInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::StartInstanceRequest, ::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_instance(name: nil) -> ::Gapic::Operation
Pass arguments to start_instance 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).
Parameter
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::StartInstanceRequest.new

# Call the start_instance method.
result = client.start_instance request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#stop_instance

def stop_instance(request, options = nil) -> ::Gapic::Operation
def stop_instance(name: nil) -> ::Gapic::Operation

Stops a notebook instance.

Overloads
def stop_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to stop_instance via a request object, either of type StopInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::StopInstanceRequest, ::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_instance(name: nil) -> ::Gapic::Operation
Pass arguments to stop_instance 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).
Parameter
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::StopInstanceRequest.new

# Call the stop_instance method.
result = client.stop_instance request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#upgrade_instance

def upgrade_instance(request, options = nil) -> ::Gapic::Operation
def upgrade_instance(name: nil) -> ::Gapic::Operation

Upgrades a notebook instance to the latest version. Deprecated. Please consider using v1.

Overloads
def upgrade_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to upgrade_instance via a request object, either of type UpgradeInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::UpgradeInstanceRequest, ::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_instance(name: nil) -> ::Gapic::Operation
Pass arguments to upgrade_instance 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).
Parameter
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::UpgradeInstanceRequest.new

# Call the upgrade_instance method.
result = client.upgrade_instance request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#upgrade_instance_internal

def upgrade_instance_internal(request, options = nil) -> ::Gapic::Operation
def upgrade_instance_internal(name: nil, vm_id: nil) -> ::Gapic::Operation

Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method directly. Deprecated. Please consider using v1.

Overloads
def upgrade_instance_internal(request, options = nil) -> ::Gapic::Operation
Pass arguments to upgrade_instance_internal via a request object, either of type UpgradeInstanceInternalRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1beta1::UpgradeInstanceInternalRequest, ::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_instance_internal(name: nil, vm_id: nil) -> ::Gapic::Operation
Pass arguments to upgrade_instance_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).
Parameters
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
  • vm_id (::String) — Required. The VM hardware token for authenticating the VM. https://cloud.google.com/compute/docs/instances/verifying-instance-identity
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/notebooks/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1beta1::UpgradeInstanceInternalRequest.new

# Call the upgrade_instance_internal method.
result = client.upgrade_instance_internal request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end