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

Reference documentation and code samples for the Cloud Workstations V1 API class Google::Cloud::Workstations::V1::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::V1::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::V1::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::V1::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/v1"

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

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

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

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

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

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

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

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

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

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

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workstations::V1::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::V1::GenerateAccessTokenResponse
def generate_access_token(expire_time: nil, ttl: nil, workstation: nil) -> ::Google::Cloud::Workstations::V1::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::V1::GenerateAccessTokenResponse
Pass arguments to generate_access_token via a request object, either of type GenerateAccessTokenRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1::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::V1::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/v1"

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

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

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

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

#get_workstation

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

Returns the requested workstation.

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

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

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

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

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

#get_workstation_cluster

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

Returns the requested workstation cluster.

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

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

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

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

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

#get_workstation_config

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

Returns the requested workstation configuration.

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

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

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

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

# The returned object is of type Google::Cloud::Workstations::V1::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::V1::Workstations::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Workstations::V1::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::V1::WorkstationConfig>
def list_usable_workstation_configs(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::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::V1::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::V1::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::V1::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/v1"

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

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

#list_usable_workstations

def list_usable_workstations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>
def list_usable_workstations(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::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::V1::Workstation>
Pass arguments to list_usable_workstations via a request object, either of type ListUsableWorkstationsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Workstations::V1::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::V1::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/v1"

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

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

#list_workstation_clusters

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

Returns all workstation clusters in the specified location.

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

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

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

#list_workstation_configs

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

Returns all workstation configurations in the specified cluster.

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

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

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

#list_workstations

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

Returns all Workstations using the specified workstation configuration.

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

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

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

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

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

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

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

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

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

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

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

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

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