Cloud Dataproc V1 API - Class Google::Cloud::Dataproc::V1::SessionTemplateController::Client (v1.0.0)

Reference documentation and code samples for the Cloud Dataproc V1 API class Google::Cloud::Dataproc::V1::SessionTemplateController::Client.

Client for the SessionTemplateController service.

The SessionTemplateController provides methods to manage session templates.

Inherits

  • Object

Methods

.configure

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

Configure the SessionTemplateController Client class.

See Configuration for a description of the configuration fields.

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

#configure

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

Configure the SessionTemplateController Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

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

#create_session_template

def create_session_template(request, options = nil) -> ::Google::Cloud::Dataproc::V1::SessionTemplate
def create_session_template(parent: nil, session_template: nil) -> ::Google::Cloud::Dataproc::V1::SessionTemplate

Create a session template synchronously.

Overloads
def create_session_template(request, options = nil) -> ::Google::Cloud::Dataproc::V1::SessionTemplate
Pass arguments to create_session_template via a request object, either of type CreateSessionTemplateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_session_template(parent: nil, session_template: nil) -> ::Google::Cloud::Dataproc::V1::SessionTemplate
Pass arguments to create_session_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
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataproc/v1"

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

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

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

# The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate.
p result

#delete_session_template

def delete_session_template(request, options = nil) -> ::Google::Protobuf::Empty
def delete_session_template(name: nil) -> ::Google::Protobuf::Empty

Deletes a session template.

Overloads
def delete_session_template(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_session_template via a request object, either of type DeleteSessionTemplateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_session_template(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_session_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).
Parameter
  • name (::String) — Required. The name of the session template resource to delete.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataproc/v1"

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

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

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

# The returned object is of type Google::Protobuf::Empty.
p result

#get_session_template

def get_session_template(request, options = nil) -> ::Google::Cloud::Dataproc::V1::SessionTemplate
def get_session_template(name: nil) -> ::Google::Cloud::Dataproc::V1::SessionTemplate

Gets the resource representation for a session template.

Overloads
def get_session_template(request, options = nil) -> ::Google::Cloud::Dataproc::V1::SessionTemplate
Pass arguments to get_session_template via a request object, either of type GetSessionTemplateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_session_template(name: nil) -> ::Google::Cloud::Dataproc::V1::SessionTemplate
Pass arguments to get_session_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).
Parameter
  • name (::String) — Required. The name of the session template to retrieve.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataproc/v1"

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

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

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

# The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate.
p result

#iam_policy_client

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

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

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

#initialize

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

Create a new SessionTemplateController client object.

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

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

#list_session_templates

def list_session_templates(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::SessionTemplate>
def list_session_templates(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::SessionTemplate>

Lists session templates.

Overloads
def list_session_templates(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::SessionTemplate>
Pass arguments to list_session_templates via a request object, either of type ListSessionTemplatesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_session_templates(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::SessionTemplate>
Pass arguments to list_session_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) — Required. The parent that owns this collection of session templates.
  • page_size (::Integer) — Optional. The maximum number of sessions to return in each response. The service may return fewer than this value.
  • page_token (::String) — Optional. A page token received from a previous ListSessions call. Provide this token to retrieve the subsequent page.
  • filter (::String) — Optional. A filter for the session templates to return in the response. Filters are case sensitive and have the following syntax:

    [field = value] AND [field [= value]] ...

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataproc/v1"

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

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

# Call the list_session_templates method.
result = client.list_session_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::Dataproc::V1::SessionTemplate.
  p item
end

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_session_template

def update_session_template(request, options = nil) -> ::Google::Cloud::Dataproc::V1::SessionTemplate
def update_session_template(session_template: nil) -> ::Google::Cloud::Dataproc::V1::SessionTemplate

Updates the session template synchronously.

Overloads
def update_session_template(request, options = nil) -> ::Google::Cloud::Dataproc::V1::SessionTemplate
Pass arguments to update_session_template via a request object, either of type UpdateSessionTemplateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_session_template(session_template: nil) -> ::Google::Cloud::Dataproc::V1::SessionTemplate
Pass arguments to update_session_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).
Parameter
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataproc/v1"

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

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

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

# The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate.
p result