Class: Google::Cloud::Notebooks::V1::NotebookService::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb

Overview

REST client for the NotebookService service.

API v1 service for Cloud AI Platform Notebooks.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#environment_path, #execution_path, #instance_path, #schedule_path, #tensorboard_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new NotebookService REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new

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

Yields:

  • (config)

    Configure the NotebookService client.

Yield Parameters:



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 197

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = ::Google::Cloud::Notebooks::V1::NotebookService::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @notebook_service_stub = ::Google::Cloud::Notebooks::V1::NotebookService::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials
  )

  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @notebook_service_stub.endpoint
    config.universe_domain = @notebook_service_stub.universe_domain
    config.bindings_override = @config.bindings_override
  end

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @notebook_service_stub.endpoint
    config.universe_domain = @notebook_service_stub.universe_domain
    config.bindings_override = @config.bindings_override
  end
end

Instance Attribute Details

#iam_policy_clientGoogle::Iam::V1::IAMPolicy::Rest::Client (readonly)

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

Returns:

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


270
271
272
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 270

def iam_policy_client
  @iam_policy_client
end

#location_clientGoogle::Cloud::Location::Locations::Rest::Client (readonly)

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

Returns:

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


263
264
265
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 263

def location_client
  @location_client
end

#operations_client::Google::Cloud::Notebooks::V1::NotebookService::Rest::Operations (readonly)

Get the associated client for long-running operations.



256
257
258
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 256

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the NotebookService Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all NotebookService clients
::Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 66

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Notebooks", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.timeout = 60.0
    default_config.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_instances.timeout = 60.0

    default_config.rpcs.get_instance.timeout = 60.0

    default_config.rpcs.create_instance.timeout = 60.0

    default_config.rpcs.register_instance.timeout = 60.0

    default_config.rpcs.set_instance_accelerator.timeout = 60.0

    default_config.rpcs.set_instance_machine_type.timeout = 60.0

    default_config.rpcs.update_instance_config.timeout = 60.0

    default_config.rpcs.update_shielded_instance_config.timeout = 60.0

    default_config.rpcs.set_instance_labels.timeout = 60.0

    default_config.rpcs.delete_instance.timeout = 60.0

    default_config.rpcs.start_instance.timeout = 60.0

    default_config.rpcs.stop_instance.timeout = 60.0

    default_config.rpcs.reset_instance.timeout = 60.0

    default_config.rpcs.report_instance_info.timeout = 60.0

    default_config.rpcs.is_instance_upgradeable.timeout = 60.0

    default_config.rpcs.get_instance_health.timeout = 60.0

    default_config.rpcs.upgrade_instance.timeout = 60.0

    default_config.rpcs.rollback_instance.timeout = 60.0

    default_config.rpcs.diagnose_instance.timeout = 60.0

    default_config.rpcs.upgrade_instance_internal.timeout = 60.0

    default_config.rpcs.list_environments.timeout = 60.0

    default_config.rpcs.get_environment.timeout = 60.0

    default_config.rpcs.create_environment.timeout = 60.0

    default_config.rpcs.delete_environment.timeout = 60.0

    default_config.rpcs.list_schedules.timeout = 60.0

    default_config.rpcs.get_schedule.timeout = 60.0

    default_config.rpcs.delete_schedule.timeout = 60.0

    default_config.rpcs.create_schedule.timeout = 60.0

    default_config.rpcs.list_executions.timeout = 60.0

    default_config.rpcs.get_execution.timeout = 60.0

    default_config.rpcs.delete_execution.timeout = 60.0

    default_config.rpcs.create_execution.timeout = 60.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



167
168
169
170
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 167

def configure
  yield @config if block_given?
  @config
end

#create_environment(request, options = nil) ⇒ ::Gapic::Operation #create_environment(parent: nil, environment_id: nil, environment: nil) ⇒ ::Gapic::Operation

Creates a new Environment.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}

    • environment_id (::String) (defaults to: nil)

      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) (defaults to: nil)

      Required. The environment to be created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 2374

def create_environment request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::CreateEnvironmentRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_environment..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_environment.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_environment.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.create_environment request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_execution(request, options = nil) ⇒ ::Gapic::Operation #create_execution(parent: nil, execution_id: nil, execution: nil) ⇒ ::Gapic::Operation

Creates a new Execution in a given project and location.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: parent=projects/{project_id}/locations/{location}

    • execution_id (::String) (defaults to: nil)

      Required. User-defined unique ID of this execution.

    • execution (::Google::Cloud::Notebooks::V1::Execution, ::Hash) (defaults to: nil)

      Required. The execution to be created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 3258

def create_execution request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::CreateExecutionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_execution..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_execution.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_execution.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.create_execution request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_instance(request, options = nil) ⇒ ::Gapic::Operation #create_instance(parent: nil, instance_id: nil, instance: nil) ⇒ ::Gapic::Operation

Creates a new Instance in a given project and location.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: parent=projects/{project_id}/locations/{location}

    • instance_id (::String) (defaults to: nil)

      Required. User-defined unique ID of this instance.

    • instance (::Google::Cloud::Notebooks::V1::Instance, ::Hash) (defaults to: nil)

      Required. The instance to be created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 498

def create_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::CreateInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.create_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_schedule(request, options = nil) ⇒ ::Gapic::Operation #create_schedule(parent: nil, schedule_id: nil, schedule: nil) ⇒ ::Gapic::Operation

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

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: parent=projects/{project_id}/locations/{location}

    • schedule_id (::String) (defaults to: nil)

      Required. User-defined unique ID of this schedule.

    • schedule (::Google::Cloud::Notebooks::V1::Schedule, ::Hash) (defaults to: nil)

      Required. The schedule to be created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 2815

def create_schedule request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::CreateScheduleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_schedule..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_schedule.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_schedule.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.create_schedule request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_environment(request, options = nil) ⇒ ::Gapic::Operation #delete_environment(name: nil) ⇒ ::Gapic::Operation

Deletes a single Environment.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/environments/{environment_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 2462

def delete_environment request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::DeleteEnvironmentRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_environment..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_environment.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_environment.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.delete_environment request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_execution(request, options = nil) ⇒ ::Gapic::Operation #delete_execution(name: nil) ⇒ ::Gapic::Operation

Deletes execution

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/executions/{execution_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 3166

def delete_execution request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::DeleteExecutionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_execution..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_execution.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_execution.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.delete_execution request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_instance(request, options = nil) ⇒ ::Gapic::Operation #delete_instance(name: nil) ⇒ ::Gapic::Operation

Deletes a single Instance.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 1221

def delete_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::DeleteInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.delete_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_schedule(request, options = nil) ⇒ ::Gapic::Operation #delete_schedule(name: nil) ⇒ ::Gapic::Operation

Deletes schedule and all underlying jobs

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/schedules/{schedule_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 2723

def delete_schedule request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::DeleteScheduleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_schedule..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_schedule.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_schedule.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.delete_schedule request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#diagnose_instance(request, options = nil) ⇒ ::Gapic::Operation #diagnose_instance(name: nil, diagnostic_config: nil) ⇒ ::Gapic::Operation

Creates a Diagnostic File and runs Diagnostic Tool given an Instance.

Examples:

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::Rest::Client.new

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

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

Overloads:

  • #diagnose_instance(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to diagnose_instance via a request object, either of type DiagnoseInstanceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Notebooks::V1::DiagnoseInstanceRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #diagnose_instance(name: nil, diagnostic_config: nil) ⇒ ::Gapic::Operation

    Pass arguments to diagnose_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) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

    • diagnostic_config (::Google::Cloud::Notebooks::V1::DiagnosticConfig, ::Hash) (defaults to: nil)

      Required. Defines flags that are used to run the diagnostic tool

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 2017

def diagnose_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::DiagnoseInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.diagnose_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.diagnose_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.diagnose_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.diagnose_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_environment(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::Environment #get_environment(name: nil) ⇒ ::Google::Cloud::Notebooks::V1::Environment

Gets details of a single Environment.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/environments/{environment_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 2281

def get_environment request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::GetEnvironmentRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_environment..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_environment.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_environment.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.get_environment request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_execution(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::Execution #get_execution(name: nil) ⇒ ::Google::Cloud::Notebooks::V1::Execution

Gets details of executions

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/executions/{execution_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 3079

def get_execution request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::GetExecutionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_execution..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_execution.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_execution.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.get_execution request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_instance(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::Instance #get_instance(name: nil) ⇒ ::Google::Cloud::Notebooks::V1::Instance

Gets details of a single Instance.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 407

def get_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::GetInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.get_instance request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_instance_health(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::GetInstanceHealthResponse #get_instance_health(name: nil) ⇒ ::Google::Cloud::Notebooks::V1::GetInstanceHealthResponse

Check if a notebook instance is healthy.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 1746

def get_instance_health request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::GetInstanceHealthRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_instance_health..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_instance_health.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_instance_health.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.get_instance_health request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_schedule(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::Schedule #get_schedule(name: nil) ⇒ ::Google::Cloud::Notebooks::V1::Schedule

Gets details of schedule

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/schedules/{schedule_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 2636

def get_schedule request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::GetScheduleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_schedule..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_schedule.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_schedule.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.get_schedule request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#is_instance_upgradeable(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::IsInstanceUpgradeableResponse #is_instance_upgradeable(notebook_instance: nil, type: nil) ⇒ ::Google::Cloud::Notebooks::V1::IsInstanceUpgradeableResponse

Check if a notebook instance is upgradable.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

    • type (::Google::Cloud::Notebooks::V1::UpgradeType) (defaults to: nil)

      Optional. The optional UpgradeType. Setting this field will search for additional compute images to upgrade this instance.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 1666

def is_instance_upgradeable request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::IsInstanceUpgradeableRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.is_instance_upgradeable..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.is_instance_upgradeable.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.is_instance_upgradeable.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.is_instance_upgradeable request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_environments(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::ListEnvironmentsResponse #list_environments(parent: nil, page_size: nil, page_token: nil) ⇒ ::Google::Cloud::Notebooks::V1::ListEnvironmentsResponse

Lists environments in a project.

Examples:

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::Rest::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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Notebooks::V1::Environment.
  p item
end

Overloads:

  • #list_environments(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::ListEnvironmentsResponse

    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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_environments(parent: nil, page_size: nil, page_token: nil) ⇒ ::Google::Cloud::Notebooks::V1::ListEnvironmentsResponse

    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) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}

    • page_size (::Integer) (defaults to: nil)

      Maximum return size of the list call.

    • page_token (::String) (defaults to: nil)

      A previous returned page token that can be used to continue listing from the last result.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 2201

def list_environments request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::ListEnvironmentsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_environments..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_environments.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_environments.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.list_environments request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_executions(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::ListExecutionsResponse #list_executions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Notebooks::V1::ListExecutionsResponse

Lists executions in a given project and location

Examples:

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::Rest::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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Notebooks::V1::Execution.
  p item
end

Overloads:

  • #list_executions(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::ListExecutionsResponse

    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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_executions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Notebooks::V1::ListExecutionsResponse

    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) (defaults to: nil)

      Required. Format: parent=projects/{project_id}/locations/{location}

    • page_size (::Integer) (defaults to: nil)

      Maximum return size of the list call.

    • page_token (::String) (defaults to: nil)

      A previous returned page token that can be used to continue listing from the last result.

    • filter (::String) (defaults to: nil)

      Filter applied to resulting executions. Currently only supports filtering executions by a specified schedule_id. Format: schedule_id=<Schedule_ID>

    • order_by (::String) (defaults to: nil)

      Sort by field.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 2999

def list_executions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::ListExecutionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_executions..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_executions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_executions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.list_executions request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_instances(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::ListInstancesResponse #list_instances(parent: nil, page_size: nil, page_token: nil) ⇒ ::Google::Cloud::Notebooks::V1::ListInstancesResponse

Lists instances in a given project and location.

Examples:

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::Rest::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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Notebooks::V1::Instance.
  p item
end

Overloads:

  • #list_instances(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::ListInstancesResponse

    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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_instances(parent: nil, page_size: nil, page_token: nil) ⇒ ::Google::Cloud::Notebooks::V1::ListInstancesResponse

    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) (defaults to: nil)

      Required. Format: parent=projects/{project_id}/locations/{location}

    • page_size (::Integer) (defaults to: nil)

      Maximum return size of the list call.

    • page_token (::String) (defaults to: nil)

      A previous returned page token that can be used to continue listing from the last result.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 327

def list_instances request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::ListInstancesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_instances..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_instances.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_instances.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.list_instances request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_schedules(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::ListSchedulesResponse #list_schedules(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Notebooks::V1::ListSchedulesResponse

Lists schedules in a given project and location.

Examples:

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::Rest::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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Notebooks::V1::Schedule.
  p item
end

Overloads:

  • #list_schedules(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::ListSchedulesResponse

    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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_schedules(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Notebooks::V1::ListSchedulesResponse

    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) (defaults to: nil)

      Required. Format: parent=projects/{project_id}/locations/{location}

    • page_size (::Integer) (defaults to: nil)

      Maximum return size of the list call.

    • page_token (::String) (defaults to: nil)

      A previous returned page token that can be used to continue listing from the last result.

    • filter (::String) (defaults to: nil)

      Filter applied to resulting schedules.

    • order_by (::String) (defaults to: nil)

      Field to order results by.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 2556

def list_schedules request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::ListSchedulesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_schedules..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_schedules.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_schedules.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.list_schedules request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#register_instance(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: parent=projects/{project_id}/locations/{location}

    • instance_id (::String) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 594

def register_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::RegisterInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.register_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.register_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.register_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.register_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#report_instance_info(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

    • vm_id (::String) (defaults to: nil)

      Required. The VM hardware token for authenticating the VM. https://cloud.google.com/compute/docs/instances/verifying-instance-identity

    • metadata (::Hash{::String => ::String}) (defaults to: nil)

      The metadata reported to Notebooks API. This will be merged to the instance metadata store

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 1582

def report_instance_info request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::ReportInstanceInfoRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.report_instance_info..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.report_instance_info.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.report_instance_info.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.report_instance_info request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#reset_instance(request, options = nil) ⇒ ::Gapic::Operation #reset_instance(name: nil) ⇒ ::Gapic::Operation

Resets a notebook instance.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 1485

def reset_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::ResetInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.reset_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.reset_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.reset_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.reset_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#rollback_instance(request, options = nil) ⇒ ::Gapic::Operation #rollback_instance(name: nil, target_snapshot: nil) ⇒ ::Gapic::Operation

Rollbacks a notebook instance to the previous version.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

    • target_snapshot (::String) (defaults to: nil)

      Required. The snapshot for rollback. Example: projects/test-project/global/snapshots/krwlzipynril.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 1927

def rollback_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::RollbackInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.rollback_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.rollback_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.rollback_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.rollback_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_instance_accelerator(request, options = nil) ⇒ ::Gapic::Operation #set_instance_accelerator(name: nil, type: nil, core_count: nil) ⇒ ::Gapic::Operation

Updates the guest accelerators of a single Instance.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

    • type (::Google::Cloud::Notebooks::V1::Instance::AcceleratorType) (defaults to: nil)

      Required. Type of this accelerator.

    • core_count (::Integer) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 689

def set_instance_accelerator request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::SetInstanceAcceleratorRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.set_instance_accelerator..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.set_instance_accelerator.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.set_instance_accelerator.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.set_instance_accelerator request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_instance_labels(request, options = nil) ⇒ ::Gapic::Operation #set_instance_labels(name: nil, labels: nil) ⇒ ::Gapic::Operation

Replaces all the labels of an Instance.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

    • labels (::Hash{::String => ::String}) (defaults to: nil)

      Labels to apply to this instance. These can be later modified by the setLabels method

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 1051

def set_instance_labels request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::SetInstanceLabelsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.set_instance_labels..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.set_instance_labels.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.set_instance_labels.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.set_instance_labels request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_instance_machine_type(request, options = nil) ⇒ ::Gapic::Operation #set_instance_machine_type(name: nil, machine_type: nil) ⇒ ::Gapic::Operation

Updates the machine type of a single Instance.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

    • machine_type (::String) (defaults to: nil)

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 780

def set_instance_machine_type request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::SetInstanceMachineTypeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.set_instance_machine_type..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.set_instance_machine_type.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.set_instance_machine_type.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.set_instance_machine_type request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#start_instance(request, options = nil) ⇒ ::Gapic::Operation #start_instance(name: nil) ⇒ ::Gapic::Operation

Starts a notebook instance.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 1309

def start_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::StartInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.start_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.start_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.start_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.start_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#stop_instance(request, options = nil) ⇒ ::Gapic::Operation #stop_instance(name: nil) ⇒ ::Gapic::Operation

Stops a notebook instance.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 1397

def stop_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::StopInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.stop_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.stop_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.stop_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.stop_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#trigger_schedule(request, options = nil) ⇒ ::Gapic::Operation #trigger_schedule(name: nil) ⇒ ::Gapic::Operation

Triggers execution of an existing schedule.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Format: parent=projects/{project_id}/locations/{location}/schedules/{schedule_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 2903

def trigger_schedule request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::TriggerScheduleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.trigger_schedule..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.trigger_schedule.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.trigger_schedule.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.trigger_schedule request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


177
178
179
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 177

def universe_domain
  @notebook_service_stub.universe_domain
end

#update_instance_config(request, options = nil) ⇒ ::Gapic::Operation #update_instance_config(name: nil, config: nil) ⇒ ::Gapic::Operation

Update Notebook Instance configurations.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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:

    • name (::String) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

    • config (::Google::Cloud::Notebooks::V1::InstanceConfig, ::Hash) (defaults to: nil)

      The instance configurations to be updated.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 870

def update_instance_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::UpdateInstanceConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_instance_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_instance_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_instance_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.update_instance_config request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_instance_metadata_items(request, options = nil) ⇒ ::Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsResponse #update_instance_metadata_items(name: nil, items: nil) ⇒ ::Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsResponse

Add/update metadata items for an instance.

Examples:

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::Rest::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. request

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

    • items (::Hash{::String => ::String}) (defaults to: nil)

      Metadata items to add/update for the instance.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 1134

def  request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs...to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs..timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs..retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub. request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_shielded_instance_config(request, options = nil) ⇒ ::Gapic::Operation #update_shielded_instance_config(name: nil, shielded_instance_config: nil) ⇒ ::Gapic::Operation

Updates the Shielded instance configuration of a single Instance.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 960

def update_shielded_instance_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::UpdateShieldedInstanceConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_shielded_instance_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_shielded_instance_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_shielded_instance_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.update_shielded_instance_config request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#upgrade_instance(request, options = nil) ⇒ ::Gapic::Operation #upgrade_instance(name: nil, type: nil) ⇒ ::Gapic::Operation

Upgrades a notebook instance to the latest version.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: projects/{project_id}/locations/{location}/instances/{instance_id}

    • type (::Google::Cloud::Notebooks::V1::UpgradeType) (defaults to: nil)

      Optional. The optional UpgradeType. Setting this field will search for additional compute images to upgrade this instance.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 1836

def upgrade_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::UpgradeInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.upgrade_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.upgrade_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.upgrade_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.upgrade_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#upgrade_instance_internal(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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::Rest::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 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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
# File 'lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb', line 2112

def upgrade_instance_internal request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::UpgradeInstanceInternalRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.upgrade_instance_internal..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Notebooks::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.upgrade_instance_internal.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.upgrade_instance_internal.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @notebook_service_stub.upgrade_instance_internal request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end