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

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

Overview

REST client for the NotebookService service.

The interface for Vertex Notebook service (a.k.a. Colab on Workbench).

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#location_path, #network_path, #notebook_execution_job_path, #notebook_runtime_path, #notebook_runtime_template_path, #reservation_path, #schedule_path, #subnetwork_path

Constructor Details

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

Create a new NotebookService REST client object.

Examples:


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

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

Yields:

  • (config)

    Configure the NotebookService client.

Yield Parameters:



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 128

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::AIPlatform::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::AIPlatform::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)


201
202
203
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 201

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)


194
195
196
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 194

def location_client
  @location_client
end

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

Get the associated client for long-running operations.



187
188
189
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 187

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::AIPlatform::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
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 66

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "AIPlatform", "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
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#assign_notebook_runtime(request, options = nil) ⇒ ::Gapic::Operation #assign_notebook_runtime(parent: nil, notebook_runtime_template: nil, notebook_runtime: nil, notebook_runtime_id: nil) ⇒ ::Gapic::Operation

Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

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

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

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::AssignNotebookRuntimeRequest, ::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.

  • #assign_notebook_runtime(parent: nil, notebook_runtime_template: nil, notebook_runtime: nil, notebook_runtime_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to assign_notebook_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

      Required. The resource name of the Location to get the NotebookRuntime assignment. Format: projects/{project}/locations/{location}

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

      Required. The resource name of the NotebookRuntimeTemplate based on which a NotebookRuntime will be assigned (reuse or create a new one).

    • notebook_runtime (::Google::Cloud::AIPlatform::V1::NotebookRuntime, ::Hash) (defaults to: nil)

      Required. Provide runtime specific information (e.g. runtime owner, notebook id) used for NotebookRuntime assignment.

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

      Optional. User specified ID for the notebook runtime.

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.



741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 741

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AssignNotebookRuntimeRequest

  # 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.assign_notebook_runtime..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::AIPlatform::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.assign_notebook_runtime.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.assign_notebook_runtime.retry_policy

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

  @notebook_service_stub.assign_notebook_runtime 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

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



98
99
100
101
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 98

def configure
  yield @config if block_given?
  @config
end

#create_notebook_execution_job(request, options = nil) ⇒ ::Gapic::Operation #create_notebook_execution_job(parent: nil, notebook_execution_job: nil, notebook_execution_job_id: nil) ⇒ ::Gapic::Operation

Creates a NotebookExecutionJob.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

# Call the create_notebook_execution_job method.
result = client.create_notebook_execution_job 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_notebook_execution_job(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest, ::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_notebook_execution_job(parent: nil, notebook_execution_job: nil, notebook_execution_job_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_notebook_execution_job 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. The resource name of the Location to create the NotebookExecutionJob. Format: projects/{project}/locations/{location}

    • notebook_execution_job (::Google::Cloud::AIPlatform::V1::NotebookExecutionJob, ::Hash) (defaults to: nil)

      Required. The NotebookExecutionJob to create.

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

      Optional. User specified ID for the NotebookExecutionJob.

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.



1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 1417

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest

  # 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_notebook_execution_job..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::AIPlatform::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_notebook_execution_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_notebook_execution_job.retry_policy

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

  @notebook_service_stub.create_notebook_execution_job 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_notebook_runtime_template(request, options = nil) ⇒ ::Gapic::Operation #create_notebook_runtime_template(parent: nil, notebook_runtime_template: nil, notebook_runtime_template_id: nil) ⇒ ::Gapic::Operation

Creates a NotebookRuntimeTemplate.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

# Call the create_notebook_runtime_template method.
result = client.create_notebook_runtime_template 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_notebook_runtime_template(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::CreateNotebookRuntimeTemplateRequest, ::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_notebook_runtime_template(parent: nil, notebook_runtime_template: nil, notebook_runtime_template_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_notebook_runtime_template 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. The resource name of the Location to create the NotebookRuntimeTemplate. Format: projects/{project}/locations/{location}

    • notebook_runtime_template (::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate, ::Hash) (defaults to: nil)

      Required. The NotebookRuntimeTemplate to create.

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

      Optional. User specified ID for the notebook runtime template.

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.



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 260

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateNotebookRuntimeTemplateRequest

  # 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_notebook_runtime_template..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::AIPlatform::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_notebook_runtime_template.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_notebook_runtime_template.retry_policy

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

  @notebook_service_stub.create_notebook_runtime_template 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_notebook_execution_job(request, options = nil) ⇒ ::Gapic::Operation #delete_notebook_execution_job(name: nil) ⇒ ::Gapic::Operation

Deletes a NotebookExecutionJob.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

# Call the delete_notebook_execution_job method.
result = client.delete_notebook_execution_job 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_notebook_execution_job(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::DeleteNotebookExecutionJobRequest, ::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_notebook_execution_job(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_notebook_execution_job 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. The name of the NotebookExecutionJob resource to be deleted.

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.



1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 1704

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteNotebookExecutionJobRequest

  # 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_notebook_execution_job..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::AIPlatform::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_notebook_execution_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_notebook_execution_job.retry_policy

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

  @notebook_service_stub.delete_notebook_execution_job 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_notebook_runtime(request, options = nil) ⇒ ::Gapic::Operation #delete_notebook_runtime(name: nil) ⇒ ::Gapic::Operation

Deletes a NotebookRuntime.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

# Call the delete_notebook_runtime method.
result = client.delete_notebook_runtime 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_notebook_runtime(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeRequest, ::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_notebook_runtime(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_notebook_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

      Required. The name of the NotebookRuntime resource to be deleted. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.

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.



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
1087
1088
1089
1090
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 1055

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeRequest

  # 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_notebook_runtime..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::AIPlatform::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_notebook_runtime.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_notebook_runtime.retry_policy

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

  @notebook_service_stub.delete_notebook_runtime 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_notebook_runtime_template(request, options = nil) ⇒ ::Gapic::Operation #delete_notebook_runtime_template(name: nil) ⇒ ::Gapic::Operation

Deletes a NotebookRuntimeTemplate.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

# Call the delete_notebook_runtime_template method.
result = client.delete_notebook_runtime_template 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_notebook_runtime_template(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeTemplateRequest, ::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_notebook_runtime_template(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_notebook_runtime_template 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. The name of the NotebookRuntimeTemplate resource to be deleted. Format: projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}

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.



558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 558

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeTemplateRequest

  # 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_notebook_runtime_template..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::AIPlatform::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_notebook_runtime_template.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_notebook_runtime_template.retry_policy

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

  @notebook_service_stub.delete_notebook_runtime_template 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_notebook_execution_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::NotebookExecutionJob #get_notebook_execution_job(name: nil, view: nil) ⇒ ::Google::Cloud::AIPlatform::V1::NotebookExecutionJob

Gets a NotebookExecutionJob.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

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

# The returned object is of type Google::Cloud::AIPlatform::V1::NotebookExecutionJob.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 1499

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetNotebookExecutionJobRequest

  # 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_notebook_execution_job..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::AIPlatform::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_notebook_execution_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_notebook_execution_job.retry_policy

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

  @notebook_service_stub.get_notebook_execution_job 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_notebook_runtime(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::NotebookRuntime #get_notebook_runtime(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::NotebookRuntime

Gets a NotebookRuntime.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

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

# The returned object is of type Google::Cloud::AIPlatform::V1::NotebookRuntime.
p result

Overloads:

  • #get_notebook_runtime(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::NotebookRuntime

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeRequest, ::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_notebook_runtime(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::NotebookRuntime

    Pass arguments to get_notebook_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

      Required. The name of the NotebookRuntime resource. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 824

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeRequest

  # 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_notebook_runtime..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::AIPlatform::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_notebook_runtime.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_notebook_runtime.retry_policy

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

  @notebook_service_stub.get_notebook_runtime 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_notebook_runtime_template(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate #get_notebook_runtime_template(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate

Gets a NotebookRuntimeTemplate.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

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

# The returned object is of type Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate.
p result

Overloads:

  • #get_notebook_runtime_template(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeTemplateRequest, ::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_notebook_runtime_template(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate

    Pass arguments to get_notebook_runtime_template 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. The name of the NotebookRuntimeTemplate resource. Format: projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 342

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeTemplateRequest

  # 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_notebook_runtime_template..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::AIPlatform::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_notebook_runtime_template.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_notebook_runtime_template.retry_policy

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

  @notebook_service_stub.get_notebook_runtime_template 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_notebook_execution_jobs(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookExecutionJob> #list_notebook_execution_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, view: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookExecutionJob>

Lists NotebookExecutionJobs in a Location.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

# Call the list_notebook_execution_jobs method.
result = client.list_notebook_execution_jobs 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::AIPlatform::V1::NotebookExecutionJob.
  p item
end

Overloads:

  • #list_notebook_execution_jobs(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookExecutionJob>

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest, ::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_notebook_execution_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, view: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookExecutionJob>

    Pass arguments to list_notebook_execution_jobs 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. The resource name of the Location from which to list the NotebookExecutionJobs. Format: projects/{project}/locations/{location}

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

      Optional. An expression for filtering the results of the request. For field names both snake_case and camelCase are supported.

      • notebookExecutionJob supports = and !=. notebookExecutionJob represents the NotebookExecutionJob ID.
      • displayName supports = and != and regex.
      • schedule supports = and != and regex.

      Some examples:

      • notebookExecutionJob="123"
      • notebookExecutionJob="my-execution-job"
      • displayName="myDisplayName" and displayName=~"myDisplayNameRegex"
    • page_size (::Integer) (defaults to: nil)

      Optional. The standard list page size.

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

      Optional. The standard list page token. Typically obtained via ListNotebookExecutionJobsResponse.next_page_token of the previous NotebookService.ListNotebookExecutionJobs call.

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

      Optional. A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending. Supported fields:

      • display_name
      • create_time
      • update_time

      Example: display_name, create_time desc.

    • view (::Google::Cloud::AIPlatform::V1::NotebookExecutionJobView) (defaults to: nil)

      Optional. The NotebookExecutionJob view. Defaults to BASIC.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 1617

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest

  # 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_notebook_execution_jobs..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::AIPlatform::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_notebook_execution_jobs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_notebook_execution_jobs.retry_policy

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

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

#list_notebook_runtime_templates(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate> #list_notebook_runtime_templates(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate>

Lists NotebookRuntimeTemplates in a Location.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

# Call the list_notebook_runtime_templates method.
result = client.list_notebook_runtime_templates 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::AIPlatform::V1::NotebookRuntimeTemplate.
  p item
end

Overloads:

  • #list_notebook_runtime_templates(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate>

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest, ::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_notebook_runtime_templates(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate>

    Pass arguments to list_notebook_runtime_templates 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. The resource name of the Location from which to list the NotebookRuntimeTemplates. Format: projects/{project}/locations/{location}

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

      Optional. An expression for filtering the results of the request. For field names both snake_case and camelCase are supported.

      • notebookRuntimeTemplate supports = and !=. notebookRuntimeTemplate represents the NotebookRuntimeTemplate ID, i.e. the last segment of the NotebookRuntimeTemplate's [resource name] [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name].
      • display_name supports = and !=
      • labels supports general map functions that is:
        • labels.key=value - key:value equality
        • `labels.key:* or labels:key - key existence
        • A key including a space must be quoted. labels."a key".
      • notebookRuntimeType supports = and !=. notebookRuntimeType enum: [USER_DEFINED, ONE_CLICK].

      Some examples:

      • notebookRuntimeTemplate=notebookRuntimeTemplate123
      • displayName="myDisplayName"
      • labels.myKey="myValue"
      • notebookRuntimeType=USER_DEFINED
    • page_size (::Integer) (defaults to: nil)

      Optional. The standard list page size.

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

      Optional. The standard list page token. Typically obtained via ListNotebookRuntimeTemplatesResponse.next_page_token of the previous NotebookService.ListNotebookRuntimeTemplates call.

    • read_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Optional. Mask specifying which fields to read.

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

      Optional. A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending. Supported fields:

      • display_name
      • create_time
      • update_time

      Example: display_name, create_time desc.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 469

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest

  # 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_notebook_runtime_templates..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::AIPlatform::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_notebook_runtime_templates.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_notebook_runtime_templates.retry_policy

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

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

#list_notebook_runtimes(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntime> #list_notebook_runtimes(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntime>

Lists NotebookRuntimes in a Location.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

# Call the list_notebook_runtimes method.
result = client.list_notebook_runtimes 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::AIPlatform::V1::NotebookRuntime.
  p item
end

Overloads:

  • #list_notebook_runtimes(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntime>

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest, ::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_notebook_runtimes(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntime>

    Pass arguments to list_notebook_runtimes via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

      Required. The resource name of the Location from which to list the NotebookRuntimes. Format: projects/{project}/locations/{location}

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

      Optional. An expression for filtering the results of the request. For field names both snake_case and camelCase are supported.

      • notebookRuntime supports = and !=. notebookRuntime represents the NotebookRuntime ID, i.e. the last segment of the NotebookRuntime's [resource name] [google.cloud.aiplatform.v1.NotebookRuntime.name].
      • displayName supports = and != and regex.
      • notebookRuntimeTemplate supports = and !=. notebookRuntimeTemplate represents the NotebookRuntimeTemplate ID, i.e. the last segment of the NotebookRuntimeTemplate's [resource name] [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name].
      • healthState supports = and !=. healthState enum: [HEALTHY, UNHEALTHY, HEALTH_STATE_UNSPECIFIED].
      • runtimeState supports = and !=. runtimeState enum: [RUNTIME_STATE_UNSPECIFIED, RUNNING, BEING_STARTED, BEING_STOPPED, STOPPED, BEING_UPGRADED, ERROR, INVALID].
      • runtimeUser supports = and !=.
      • API version is UI only: uiState supports = and !=. uiState enum: [UI_RESOURCE_STATE_UNSPECIFIED, UI_RESOURCE_STATE_BEING_CREATED, UI_RESOURCE_STATE_ACTIVE, UI_RESOURCE_STATE_BEING_DELETED, UI_RESOURCE_STATE_CREATION_FAILED].
      • notebookRuntimeType supports = and !=. notebookRuntimeType enum: [USER_DEFINED, ONE_CLICK].

      Some examples:

      • notebookRuntime="notebookRuntime123"
      • displayName="myDisplayName" and displayName=~"myDisplayNameRegex"
      • notebookRuntimeTemplate="notebookRuntimeTemplate321"
      • healthState=HEALTHY
      • runtimeState=RUNNING
      • runtimeUser="test@google.com"
      • uiState=UI_RESOURCE_STATE_BEING_DELETED
      • notebookRuntimeType=USER_DEFINED
    • page_size (::Integer) (defaults to: nil)

      Optional. The standard list page size.

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

      Optional. The standard list page token. Typically obtained via ListNotebookRuntimesResponse.next_page_token of the previous NotebookService.ListNotebookRuntimes call.

    • read_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Optional. Mask specifying which fields to read.

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

      Optional. A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending. Supported fields:

      • display_name
      • create_time
      • update_time

      Example: display_name, create_time desc.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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
996
997
998
999
1000
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 965

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest

  # 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_notebook_runtimes..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::AIPlatform::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_notebook_runtimes.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_notebook_runtimes.retry_policy

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

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

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

Starts a NotebookRuntime.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

# Call the start_notebook_runtime method.
result = client.start_notebook_runtime 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_notebook_runtime(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::StartNotebookRuntimeRequest, ::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_notebook_runtime(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to start_notebook_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

      Required. The name of the NotebookRuntime resource to be started. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.

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.



1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 1235

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StartNotebookRuntimeRequest

  # 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_notebook_runtime..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::AIPlatform::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_notebook_runtime.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.start_notebook_runtime.retry_policy

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

  @notebook_service_stub.start_notebook_runtime 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_notebook_runtime(request, options = nil) ⇒ ::Gapic::Operation #stop_notebook_runtime(name: nil) ⇒ ::Gapic::Operation

Stops a NotebookRuntime.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

# Call the stop_notebook_runtime method.
result = client.stop_notebook_runtime 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_notebook_runtime(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::StopNotebookRuntimeRequest, ::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_notebook_runtime(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to stop_notebook_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

      Required. The name of the NotebookRuntime resource to be stopped. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.

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.



1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 1325

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StopNotebookRuntimeRequest

  # 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_notebook_runtime..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::AIPlatform::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_notebook_runtime.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.stop_notebook_runtime.retry_policy

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

  @notebook_service_stub.stop_notebook_runtime 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)


108
109
110
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 108

def universe_domain
  @notebook_service_stub.universe_domain
end

#update_notebook_runtime_template(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate #update_notebook_runtime_template(notebook_runtime_template: nil, update_mask: nil) ⇒ ::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate

Updates a NotebookRuntimeTemplate.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

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

# The returned object is of type Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 645

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateNotebookRuntimeTemplateRequest

  # 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_notebook_runtime_template..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::AIPlatform::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_notebook_runtime_template.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_notebook_runtime_template.retry_policy

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

  @notebook_service_stub.update_notebook_runtime_template 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

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

Upgrades a NotebookRuntime.

Examples:

Basic example

require "google/cloud/ai_platform/v1"

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

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

# Call the upgrade_notebook_runtime method.
result = client.upgrade_notebook_runtime 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_notebook_runtime(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::UpgradeNotebookRuntimeRequest, ::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_notebook_runtime(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to upgrade_notebook_runtime via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

      Required. The name of the NotebookRuntime resource to be upgrade. Instead of checking whether the name is in valid NotebookRuntime resource name format, directly throw NotFound exception if there is no such NotebookRuntime in spanner.

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.



1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
# File 'lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb', line 1145

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpgradeNotebookRuntimeRequest

  # 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_notebook_runtime..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::AIPlatform::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_notebook_runtime.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.upgrade_notebook_runtime.retry_policy

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

  @notebook_service_stub.upgrade_notebook_runtime 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