AI Platform Notebooks V1 API - Class Google::Cloud::Notebooks::V1::NotebookService::Client (v0.3.0)

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

Client for the NotebookService service.

API v1 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::V1::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::V1::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::V1::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/v1"

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

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

# Call the create_environment method.
result = client.create_environment 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

#create_execution

def create_execution(request, options = nil) -> ::Gapic::Operation
def create_execution(parent: nil, execution_id: nil, execution: nil) -> ::Gapic::Operation

Creates a new Execution in a given project and location.

Overloads
def create_execution(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_execution via a request object, either of type CreateExecutionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::CreateExecutionRequest, ::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_execution(parent: nil, execution_id: nil, execution: nil) -> ::Gapic::Operation
Pass arguments to create_execution 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}
  • execution_id (::String) — Required. User-defined unique ID of this execution.
  • execution (::Google::Cloud::Notebooks::V1::Execution, ::Hash) — Required. The execution 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/v1"

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

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

# Call the create_execution method.
result = client.create_execution 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

#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::V1::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::V1::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/v1"

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

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

# Call the create_instance method.
result = client.create_instance 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

#create_schedule

def create_schedule(request, options = nil) -> ::Gapic::Operation
def create_schedule(parent: nil, schedule_id: nil, schedule: nil) -> ::Gapic::Operation

Creates a new Scheduled Notebook in a given project and location.

Overloads
def create_schedule(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_schedule via a request object, either of type CreateScheduleRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::CreateScheduleRequest, ::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_schedule(parent: nil, schedule_id: nil, schedule: nil) -> ::Gapic::Operation
Pass arguments to create_schedule 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}
  • schedule_id (::String) — Required. User-defined unique ID of this schedule.
  • schedule (::Google::Cloud::Notebooks::V1::Schedule, ::Hash) — Required. The schedule 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/v1"

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

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

# Call the create_schedule method.
result = client.create_schedule 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_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::V1::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/v1"

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

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

# Call the delete_environment method.
result = client.delete_environment 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_execution

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

Deletes execution

Overloads
def delete_execution(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_execution via a request object, either of type DeleteExecutionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::DeleteExecutionRequest, ::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_execution(name: nil) -> ::Gapic::Operation
Pass arguments to delete_execution 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}/executions/{execution_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/v1"

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

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

# Call the delete_execution method.
result = client.delete_execution 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_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::V1::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/v1"

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

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

# Call the delete_instance method.
result = client.delete_instance 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_schedule

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

Deletes schedule and all underlying jobs

Overloads
def delete_schedule(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_schedule via a request object, either of type DeleteScheduleRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::DeleteScheduleRequest, ::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_schedule(name: nil) -> ::Gapic::Operation
Pass arguments to delete_schedule 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}/schedules/{schedule_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/v1"

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

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

# Call the delete_schedule method.
result = client.delete_schedule 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_environment

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

Gets details of a single Environment.

Overloads
def get_environment(request, options = nil) -> ::Google::Cloud::Notebooks::V1::Environment
Pass arguments to get_environment via a request object, either of type GetEnvironmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::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::V1::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/v1"

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

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

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

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

#get_execution

def get_execution(request, options = nil) -> ::Google::Cloud::Notebooks::V1::Execution
def get_execution(name: nil) -> ::Google::Cloud::Notebooks::V1::Execution

Gets details of executions

Overloads
def get_execution(request, options = nil) -> ::Google::Cloud::Notebooks::V1::Execution
Pass arguments to get_execution via a request object, either of type GetExecutionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::GetExecutionRequest, ::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_execution(name: nil) -> ::Google::Cloud::Notebooks::V1::Execution
Pass arguments to get_execution 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}/executions/{execution_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/v1"

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

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

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

# The returned object is of type Google::Cloud::Notebooks::V1::Execution.
p result

#get_instance

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

Gets details of a single Instance.

Overloads
def get_instance(request, options = nil) -> ::Google::Cloud::Notebooks::V1::Instance
Pass arguments to get_instance via a request object, either of type GetInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::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::V1::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/v1"

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

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

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

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

#get_instance_health

def get_instance_health(request, options = nil) -> ::Google::Cloud::Notebooks::V1::GetInstanceHealthResponse
def get_instance_health(name: nil) -> ::Google::Cloud::Notebooks::V1::GetInstanceHealthResponse

Check if a notebook instance is healthy.

Overloads
def get_instance_health(request, options = nil) -> ::Google::Cloud::Notebooks::V1::GetInstanceHealthResponse
Pass arguments to get_instance_health via a request object, either of type GetInstanceHealthRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::GetInstanceHealthRequest, ::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_health(name: nil) -> ::Google::Cloud::Notebooks::V1::GetInstanceHealthResponse
Pass arguments to get_instance_health 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/v1"

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

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

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

# The returned object is of type Google::Cloud::Notebooks::V1::GetInstanceHealthResponse.
p result

#get_schedule

def get_schedule(request, options = nil) -> ::Google::Cloud::Notebooks::V1::Schedule
def get_schedule(name: nil) -> ::Google::Cloud::Notebooks::V1::Schedule

Gets details of schedule

Overloads
def get_schedule(request, options = nil) -> ::Google::Cloud::Notebooks::V1::Schedule
Pass arguments to get_schedule via a request object, either of type GetScheduleRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::GetScheduleRequest, ::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_schedule(name: nil) -> ::Google::Cloud::Notebooks::V1::Schedule
Pass arguments to get_schedule 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}/schedules/{schedule_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/v1"

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

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

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

# The returned object is of type Google::Cloud::Notebooks::V1::Schedule.
p result

#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::V1::NotebookService::Client.new

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

#is_instance_upgradeable

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

Check if a notebook instance is upgradable.

Overloads
def is_instance_upgradeable(request, options = nil) -> ::Google::Cloud::Notebooks::V1::IsInstanceUpgradeableResponse
Pass arguments to is_instance_upgradeable via a request object, either of type IsInstanceUpgradeableRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::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, type: nil) -> ::Google::Cloud::Notebooks::V1::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).
Parameters
  • notebook_instance (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
  • type (::Google::Cloud::Notebooks::V1::UpgradeType) — Optional. The optional UpgradeType. Setting this field will search for additional compute images to upgrade this instance.
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/v1"

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

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

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

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

#list_environments

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

Lists environments in a project.

Overloads
def list_environments(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Environment>
Pass arguments to list_environments via a request object, either of type ListEnvironmentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::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::V1::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/v1"

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

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

# Call the list_environments method.
result = client.list_environments 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::Environment.
  p response
end

#list_executions

def list_executions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Execution>
def list_executions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Execution>

Lists executions in a given project and location

Overloads
def list_executions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Execution>
Pass arguments to list_executions via a request object, either of type ListExecutionsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::ListExecutionsRequest, ::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_executions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Execution>
Pass arguments to list_executions 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.
  • filter (::String) — Filter applied to resulting executions. Currently only supports filtering executions by a specified schedule_id. Format: schedule_id=<Schedule_ID>
  • order_by (::String) — Sort by field.
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/v1"

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

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

# Call the list_executions method.
result = client.list_executions 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::Execution.
  p response
end

#list_instances

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

Lists instances in a given project and location.

Overloads
def list_instances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Instance>
Pass arguments to list_instances via a request object, either of type ListInstancesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::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::V1::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/v1"

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

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

# Call the list_instances method.
result = client.list_instances 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::Instance.
  p response
end

#list_schedules

def list_schedules(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Schedule>
def list_schedules(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Schedule>

Lists schedules in a given project and location.

Overloads
def list_schedules(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Schedule>
Pass arguments to list_schedules via a request object, either of type ListSchedulesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::ListSchedulesRequest, ::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_schedules(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Notebooks::V1::Schedule>
Pass arguments to list_schedules 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.
  • filter (::String) — Filter applied to resulting schedules.
  • order_by (::String) — Field to order results by.
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/v1"

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

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

# Call the list_schedules method.
result = client.list_schedules 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::Schedule.
  p response
end

#operations_client

def operations_client() -> ::Google::Cloud::Notebooks::V1::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::V1::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/v1"

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

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

# Call the register_instance method.
result = client.register_instance 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

#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::V1::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/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1::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 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_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::V1::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/v1"

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

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

# Call the reset_instance method.
result = client.reset_instance 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

#rollback_instance

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

Rollbacks a notebook instance to the previous version.

Overloads
def rollback_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to rollback_instance via a request object, either of type RollbackInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::RollbackInstanceRequest, ::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 rollback_instance(name: nil, target_snapshot: nil) -> ::Gapic::Operation
Pass arguments to rollback_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
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
  • target_snapshot (::String) — Required. The snapshot for rollback. Example: "projects/test-project/global/snapshots/krwlzipynril".
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/v1"

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

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

# Call the rollback_instance method.
result = client.rollback_instance 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

#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::V1::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::V1::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/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1::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 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

#set_instance_labels

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

Replaces all 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::V1::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/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1::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 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

#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::V1::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/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1::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 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_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::V1::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/v1"

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

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

# Call the start_instance method.
result = client.start_instance 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_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::V1::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/v1"

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

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

# Call the stop_instance method.
result = client.stop_instance 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

#trigger_schedule

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

Triggers execution of an existing schedule.

Overloads
def trigger_schedule(request, options = nil) -> ::Gapic::Operation
Pass arguments to trigger_schedule via a request object, either of type TriggerScheduleRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::TriggerScheduleRequest, ::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 trigger_schedule(name: nil) -> ::Gapic::Operation
Pass arguments to trigger_schedule 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: parent=projects/{project_id}/locations/{location}/schedules/{schedule_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/v1"

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

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

# Call the trigger_schedule method.
result = client.trigger_schedule 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_instance_config

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

Update Notebook Instance configurations.

Overloads
def update_instance_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_instance_config via a request object, either of type UpdateInstanceConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::UpdateInstanceConfigRequest, ::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_instance_config(name: nil, config: nil) -> ::Gapic::Operation
Pass arguments to update_instance_config 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
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/v1"

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

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

# Call the update_instance_config method.
result = client.update_instance_config 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_instance_metadata_items

def update_instance_metadata_items(request, options = nil) -> ::Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsResponse
def update_instance_metadata_items(name: nil, items: nil) -> ::Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsResponse

Add/update metadata items for an instance.

Overloads
def update_instance_metadata_items(request, options = nil) -> ::Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsResponse
Pass arguments to update_instance_metadata_items via a request object, either of type UpdateInstanceMetadataItemsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsRequest, ::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_instance_metadata_items(name: nil, items: nil) -> ::Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsResponse
Pass arguments to update_instance_metadata_items 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}
  • items (::Hash{::String => ::String}) — Metadata items to add/update for the instance.
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/v1"

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

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

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

# The returned object is of type Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsResponse.
p result

#update_shielded_instance_config

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

Updates the Shielded instance configuration of a single Instance.

Overloads
def update_shielded_instance_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_shielded_instance_config via a request object, either of type UpdateShieldedInstanceConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Notebooks::V1::UpdateShieldedInstanceConfigRequest, ::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_shielded_instance_config(name: nil, shielded_instance_config: nil) -> ::Gapic::Operation
Pass arguments to update_shielded_instance_config 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
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/v1"

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

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

# Call the update_shielded_instance_config method.
result = client.update_shielded_instance_config 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_instance

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

Upgrades a notebook instance to the latest version.

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::V1::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, type: 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).
Parameters
  • name (::String) — Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}
  • type (::Google::Cloud::Notebooks::V1::UpgradeType) — Optional. The optional UpgradeType. Setting this field will search for additional compute images to upgrade this instance.
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/v1"

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

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

# Call the upgrade_instance method.
result = client.upgrade_instance 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_instance_internal

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

Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method directly.

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::V1::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, type: 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
  • type (::Google::Cloud::Notebooks::V1::UpgradeType) — Optional. The optional UpgradeType. Setting this field will search for additional compute images to upgrade this instance.
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/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Notebooks::V1::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 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