Cloud Workstations V1BETA API - Class Google::Cloud::Workstations::V1beta::Workstations::Client (v0.1.1)

Reference documentation and code samples for the Cloud Workstations V1BETA API class Google::Cloud::Workstations::V1beta::Workstations::Client.

Client for the Workstations service.

Service for interacting with Cloud Workstations.

Inherits

  • Object

Methods

.configure

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

Configure the Workstations 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 Workstations clients
::Google::Cloud::Workstations::V1beta::Workstations::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the Workstations 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_workstation

def create_workstation(request, options = nil) -> ::Gapic::Operation
def create_workstation(parent: nil, workstation_id: nil, workstation: nil, validate_only: nil) -> ::Gapic::Operation

Creates a new workstation.

Overloads
def create_workstation(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_workstation via a request object, either of type CreateWorkstationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest, ::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_workstation(parent: nil, workstation_id: nil, workstation: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_workstation 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. Parent resource name.
  • workstation_id (::String) — Required. ID to use for the workstation.
  • workstation (::Google::Cloud::Workstations::V1beta::Workstation, ::Hash) — Required. Workstation to create.
  • validate_only (::Boolean) — Optional. If set, validate the request and preview the review, but do not actually apply it.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new

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

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

#create_workstation_cluster

def create_workstation_cluster(request, options = nil) -> ::Gapic::Operation
def create_workstation_cluster(parent: nil, workstation_cluster_id: nil, workstation_cluster: nil, validate_only: nil) -> ::Gapic::Operation

Creates a new workstation cluster.

Overloads
def create_workstation_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_workstation_cluster via a request object, either of type CreateWorkstationClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest, ::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_workstation_cluster(parent: nil, workstation_cluster_id: nil, workstation_cluster: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_workstation_cluster 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. Parent resource name.
  • workstation_cluster_id (::String) — Required. ID to use for the workstation cluster.
  • workstation_cluster (::Google::Cloud::Workstations::V1beta::WorkstationCluster, ::Hash) — Required. Workstation cluster to create.
  • validate_only (::Boolean) — Optional. If set, validate the request and preview the review, but do not actually apply it.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new

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

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

#create_workstation_config

def create_workstation_config(request, options = nil) -> ::Gapic::Operation
def create_workstation_config(parent: nil, workstation_config_id: nil, workstation_config: nil, validate_only: nil) -> ::Gapic::Operation

Creates a new workstation configuration.

Overloads
def create_workstation_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_workstation_config via a request object, either of type CreateWorkstationConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest, ::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_workstation_config(parent: nil, workstation_config_id: nil, workstation_config: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_workstation_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Parent resource name.
  • workstation_config_id (::String) — Required. ID to use for the workstation configuration.
  • workstation_config (::Google::Cloud::Workstations::V1beta::WorkstationConfig, ::Hash) — Required. Config to create.
  • validate_only (::Boolean) — Optional. If set, validate the request and preview the review, but do not actually apply it.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new

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

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

#delete_workstation

def delete_workstation(request, options = nil) -> ::Gapic::Operation
def delete_workstation(name: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation

Deletes the specified workstation.

Overloads
def delete_workstation(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_workstation via a request object, either of type DeleteWorkstationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest, ::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_workstation(name: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation
Pass arguments to delete_workstation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. Name of the workstation to delete.
  • validate_only (::Boolean) — Optional. If set, validate the request and preview the review, but do not actually apply it.
  • etag (::String) — Optional. If set, the request will be rejected if the latest version of the workstation on the server does not have this ETag.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new

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

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

#delete_workstation_cluster

def delete_workstation_cluster(request, options = nil) -> ::Gapic::Operation
def delete_workstation_cluster(name: nil, validate_only: nil, etag: nil, force: nil) -> ::Gapic::Operation

Deletes the specified workstation cluster.

Overloads
def delete_workstation_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_workstation_cluster via a request object, either of type DeleteWorkstationClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest, ::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_workstation_cluster(name: nil, validate_only: nil, etag: nil, force: nil) -> ::Gapic::Operation
Pass arguments to delete_workstation_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. Name of the workstation cluster to delete.
  • validate_only (::Boolean) — Optional. If set, validate the request and preview the review, but do not apply it.
  • etag (::String) — Optional. If set, the request will be rejected if the latest version of the workstation cluster on the server does not have this ETag.
  • force (::Boolean) — Optional. If set, any workstation configurations and workstations in the workstation cluster are also deleted. Otherwise, the request only works if the workstation cluster has no configurations or workstations.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new

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

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

#delete_workstation_config

def delete_workstation_config(request, options = nil) -> ::Gapic::Operation
def delete_workstation_config(name: nil, validate_only: nil, etag: nil, force: nil) -> ::Gapic::Operation

Deletes the specified workstation configuration.

Overloads
def delete_workstation_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_workstation_config via a request object, either of type DeleteWorkstationConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest, ::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_workstation_config(name: nil, validate_only: nil, etag: nil, force: nil) -> ::Gapic::Operation
Pass arguments to delete_workstation_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. Name of the workstation configuration to delete.
  • validate_only (::Boolean) — Optional. If set, validate the request and preview the review, but do not actually apply it.
  • etag (::String) — Optional. If set, the request is rejected if the latest version of the workstation configuration on the server does not have this ETag.
  • force (::Boolean) — Optional. If set, any workstations in the workstation configuration are also deleted. Otherwise, the request works only if the workstation configuration has no workstations.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new

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

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

#generate_access_token

def generate_access_token(request, options = nil) -> ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse
def generate_access_token(expire_time: nil, ttl: nil, workstation: nil) -> ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse

Returns a short-lived credential that can be used to send authenticated and authorized traffic to a workstation.

Overloads
def generate_access_token(request, options = nil) -> ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse
Pass arguments to generate_access_token via a request object, either of type GenerateAccessTokenRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest, ::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 generate_access_token(expire_time: nil, ttl: nil, workstation: nil) -> ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse
Pass arguments to generate_access_token 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
  • expire_time (::Google::Protobuf::Timestamp, ::Hash) — Desired expiration time of the access token. This value must be at most 24 hours in the future. If a value is not specified, the token's expiration time will be set to a default value of 1 hour in the future.
  • ttl (::Google::Protobuf::Duration, ::Hash) — Desired lifetime duration of the access token. This value must be at most 24 hours. If a value is not specified, the token's lifetime will be set to a default value of 1 hour.
  • workstation (::String) — Required. Name of the workstation for which the access token should be generated.
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/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new

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

# The returned object is of type Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse.
p result

#get_workstation

def get_workstation(request, options = nil) -> ::Google::Cloud::Workstations::V1beta::Workstation
def get_workstation(name: nil) -> ::Google::Cloud::Workstations::V1beta::Workstation

Returns the requested workstation.

Overloads
def get_workstation(request, options = nil) -> ::Google::Cloud::Workstations::V1beta::Workstation
Pass arguments to get_workstation via a request object, either of type GetWorkstationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::GetWorkstationRequest, ::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_workstation(name: nil) -> ::Google::Cloud::Workstations::V1beta::Workstation
Pass arguments to get_workstation 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. Name of the requested resource.
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/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::GetWorkstationRequest.new

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

# The returned object is of type Google::Cloud::Workstations::V1beta::Workstation.
p result

#get_workstation_cluster

def get_workstation_cluster(request, options = nil) -> ::Google::Cloud::Workstations::V1beta::WorkstationCluster
def get_workstation_cluster(name: nil) -> ::Google::Cloud::Workstations::V1beta::WorkstationCluster

Returns the requested workstation cluster.

Overloads
def get_workstation_cluster(request, options = nil) -> ::Google::Cloud::Workstations::V1beta::WorkstationCluster
Pass arguments to get_workstation_cluster via a request object, either of type GetWorkstationClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest, ::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_workstation_cluster(name: nil) -> ::Google::Cloud::Workstations::V1beta::WorkstationCluster
Pass arguments to get_workstation_cluster 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. Name of the requested resource.
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/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new

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

# The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationCluster.
p result

#get_workstation_config

def get_workstation_config(request, options = nil) -> ::Google::Cloud::Workstations::V1beta::WorkstationConfig
def get_workstation_config(name: nil) -> ::Google::Cloud::Workstations::V1beta::WorkstationConfig

Returns the requested workstation configuration.

Overloads
def get_workstation_config(request, options = nil) -> ::Google::Cloud::Workstations::V1beta::WorkstationConfig
Pass arguments to get_workstation_config via a request object, either of type GetWorkstationConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest, ::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_workstation_config(name: nil) -> ::Google::Cloud::Workstations::V1beta::WorkstationConfig
Pass arguments to get_workstation_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Name of the requested resource.
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/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.new

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

# The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationConfig.
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 Workstations client object.

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

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

#list_usable_workstation_configs

def list_usable_workstation_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>
def list_usable_workstation_configs(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>

Returns all workstation configurations in the specified cluster on which the caller has the "workstations.workstation.create" permission.

Overloads
def list_usable_workstation_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>
Pass arguments to list_usable_workstation_configs via a request object, either of type ListUsableWorkstationConfigsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest, ::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_usable_workstation_configs(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>
Pass arguments to list_usable_workstation_configs 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. Parent resource name.
  • page_size (::Integer) — Optional. Maximum number of items to return.
  • page_token (::String) — Optional. next_page_token value returned from a previous List request, if any.
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/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.new

# Call the list_usable_workstation_configs method.
result = client.list_usable_workstation_configs 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::Workstations::V1beta::WorkstationConfig.
  p item
end

#list_usable_workstations

def list_usable_workstations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>
def list_usable_workstations(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>

Returns all workstations using the specified workstation configuration on which the caller has the "workstations.workstations.use" permission.

Overloads
def list_usable_workstations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>
Pass arguments to list_usable_workstations via a request object, either of type ListUsableWorkstationsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest, ::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_usable_workstations(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>
Pass arguments to list_usable_workstations 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. Parent resource name.
  • page_size (::Integer) — Optional. Maximum number of items to return.
  • page_token (::String) — Optional. next_page_token value returned from a previous List request, if any.
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/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.new

# Call the list_usable_workstations method.
result = client.list_usable_workstations 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::Workstations::V1beta::Workstation.
  p item
end

#list_workstation_clusters

def list_workstation_clusters(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationCluster>
def list_workstation_clusters(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationCluster>

Returns all workstation clusters in the specified location.

Overloads
def list_workstation_clusters(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationCluster>
Pass arguments to list_workstation_clusters via a request object, either of type ListWorkstationClustersRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest, ::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_workstation_clusters(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationCluster>
Pass arguments to list_workstation_clusters 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. Parent resource name.
  • page_size (::Integer) — Optional. Maximum number of items to return.
  • page_token (::String) — Optional. next_page_token value returned from a previous List request, if any.
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/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.new

# Call the list_workstation_clusters method.
result = client.list_workstation_clusters 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::Workstations::V1beta::WorkstationCluster.
  p item
end

#list_workstation_configs

def list_workstation_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>
def list_workstation_configs(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>

Returns all workstation configurations in the specified cluster.

Overloads
def list_workstation_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>
Pass arguments to list_workstation_configs via a request object, either of type ListWorkstationConfigsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest, ::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_workstation_configs(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>
Pass arguments to list_workstation_configs 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. Parent resource name.
  • page_size (::Integer) — Optional. Maximum number of items to return.
  • page_token (::String) — Optional. next_page_token value returned from a previous List request, if any.
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/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.new

# Call the list_workstation_configs method.
result = client.list_workstation_configs 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::Workstations::V1beta::WorkstationConfig.
  p item
end

#list_workstations

def list_workstations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>
def list_workstations(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>

Returns all Workstations using the specified workstation configuration.

Overloads
def list_workstations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>
Pass arguments to list_workstations via a request object, either of type ListWorkstationsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest, ::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_workstations(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>
Pass arguments to list_workstations 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. Parent resource name.
  • page_size (::Integer) — Optional. Maximum number of items to return.
  • page_token (::String) — Optional. next_page_token value returned from a previous List request, if any.
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/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.new

# Call the list_workstations method.
result = client.list_workstations 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::Workstations::V1beta::Workstation.
  p item
end

#location_client

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

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

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

#operations_client

def operations_client() -> ::Google::Cloud::Workstations::V1beta::Workstations::Operations

Get the associated client for long-running operations.

#start_workstation

def start_workstation(request, options = nil) -> ::Gapic::Operation
def start_workstation(name: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation

Starts running a workstation so that users can connect to it.

Overloads
def start_workstation(request, options = nil) -> ::Gapic::Operation
Pass arguments to start_workstation via a request object, either of type StartWorkstationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::StartWorkstationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def start_workstation(name: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation
Pass arguments to start_workstation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. Name of the workstation to start.
  • validate_only (::Boolean) — Optional. If set, validate the request and preview the review, but do not actually apply it.
  • etag (::String) — Optional. If set, the request will be rejected if the latest version of the workstation on the server does not have this ETag.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new

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

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

#stop_workstation

def stop_workstation(request, options = nil) -> ::Gapic::Operation
def stop_workstation(name: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation

Stops running a workstation, reducing costs.

Overloads
def stop_workstation(request, options = nil) -> ::Gapic::Operation
Pass arguments to stop_workstation via a request object, either of type StopWorkstationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::StopWorkstationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def stop_workstation(name: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation
Pass arguments to stop_workstation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. Name of the workstation to stop.
  • validate_only (::Boolean) — Optional. If set, validate the request and preview the review, but do not actually apply it.
  • etag (::String) — Optional. If set, the request will be rejected if the latest version of the workstation on the server does not have this ETag.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new

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

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

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_workstation

def update_workstation(request, options = nil) -> ::Gapic::Operation
def update_workstation(workstation: nil, update_mask: nil, validate_only: nil, allow_missing: nil) -> ::Gapic::Operation

Updates an existing workstation.

Overloads
def update_workstation(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_workstation via a request object, either of type UpdateWorkstationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest, ::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_workstation(workstation: nil, update_mask: nil, validate_only: nil, allow_missing: nil) -> ::Gapic::Operation
Pass arguments to update_workstation 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
  • workstation (::Google::Cloud::Workstations::V1beta::Workstation, ::Hash) — Required. Workstation to update.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Mask specifying which fields in the workstation configuration should be updated.
  • validate_only (::Boolean) — Optional. If set, validate the request and preview the review, but do not actually apply it.
  • allow_missing (::Boolean) — Optional. If set and the workstation configuration is not found, a new workstation configuration is created. In this situation, update_mask is ignored.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new

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

#update_workstation_cluster

def update_workstation_cluster(request, options = nil) -> ::Gapic::Operation
def update_workstation_cluster(workstation_cluster: nil, update_mask: nil, validate_only: nil, allow_missing: nil) -> ::Gapic::Operation

Updates an existing workstation cluster.

Overloads
def update_workstation_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_workstation_cluster via a request object, either of type UpdateWorkstationClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest, ::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_workstation_cluster(workstation_cluster: nil, update_mask: nil, validate_only: nil, allow_missing: nil) -> ::Gapic::Operation
Pass arguments to update_workstation_cluster 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
  • workstation_cluster (::Google::Cloud::Workstations::V1beta::WorkstationCluster, ::Hash) — Required. Workstation cluster to update.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Mask that specifies which fields in the workstation cluster should be updated.
  • validate_only (::Boolean) — Optional. If set, validate the request and preview the review, but do not actually apply it.
  • allow_missing (::Boolean) — Optional. If set, and the workstation cluster is not found, a new workstation cluster will be created. In this situation, update_mask is ignored.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new

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

#update_workstation_config

def update_workstation_config(request, options = nil) -> ::Gapic::Operation
def update_workstation_config(workstation_config: nil, update_mask: nil, validate_only: nil, allow_missing: nil) -> ::Gapic::Operation

Updates an existing workstation configuration.

Overloads
def update_workstation_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_workstation_config via a request object, either of type UpdateWorkstationConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest, ::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_workstation_config(workstation_config: nil, update_mask: nil, validate_only: nil, allow_missing: nil) -> ::Gapic::Operation
Pass arguments to update_workstation_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • workstation_config (::Google::Cloud::Workstations::V1beta::WorkstationConfig, ::Hash) — Required. Config to update.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Mask specifying which fields in the workstation configuration should be updated.
  • validate_only (::Boolean) — Optional. If set, validate the request and preview the review, but do not actually apply it.
  • allow_missing (::Boolean) — Optional. If set and the workstation configuration is not found, a new workstation configuration will be created. In this situation, update_mask is ignored.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workstations/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workstations::V1beta::Workstations::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new

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

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