Class: Google::Cloud::Workstations::V1beta::Workstations::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/workstations/v1beta/workstations/client.rb

Overview

Client for the Workstations service.

Service for interacting with Cloud Workstations.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#location_path, #workstation_cluster_path, #workstation_config_path, #workstation_path

Constructor Details

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

Create a new Workstations client object.

Examples:


# 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

Yields:

  • (config)

    Configure the Workstations client.

Yield Parameters:



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 193

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/workstations/v1beta/workstations_services_pb"

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

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

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

  @operations_client = Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @workstations_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::Workstations::V1beta::Workstations::Stub,
    credentials: credentials,
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool,
    logger: @config.logger
  )

  @workstations_stub.stub_logger&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end

  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @workstations_stub.endpoint
    config.universe_domain = @workstations_stub.universe_domain
    config.logger = @workstations_stub.logger if config.respond_to? :logger=
  end

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @workstations_stub.endpoint
    config.universe_domain = @workstations_stub.universe_domain
    config.logger = @workstations_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

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

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

Returns:

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


286
287
288
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 286

def iam_policy_client
  @iam_policy_client
end

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

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

Returns:

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


279
280
281
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 279

def location_client
  @location_client
end

#operations_client::Google::Cloud::Workstations::V1beta::Workstations::Operations (readonly)

Get the associated client for long-running operations.



272
273
274
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 272

def operations_client
  @operations_client
end

Class Method Details

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

Configure the Workstations Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all Workstations clients
::Google::Cloud::Workstations::V1beta::Workstations::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



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

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

    default_config.rpcs.get_workstation_cluster.timeout = 60.0
    default_config.rpcs.get_workstation_cluster.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_workstation_clusters.timeout = 60.0
    default_config.rpcs.list_workstation_clusters.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_workstation_cluster.timeout = 60.0

    default_config.rpcs.update_workstation_cluster.timeout = 60.0

    default_config.rpcs.delete_workstation_cluster.timeout = 60.0

    default_config.rpcs.get_workstation_config.timeout = 60.0
    default_config.rpcs.get_workstation_config.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_workstation_configs.timeout = 60.0
    default_config.rpcs.list_workstation_configs.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_usable_workstation_configs.timeout = 60.0
    default_config.rpcs.list_usable_workstation_configs.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_workstation_config.timeout = 60.0

    default_config.rpcs.update_workstation_config.timeout = 60.0

    default_config.rpcs.delete_workstation_config.timeout = 60.0

    default_config.rpcs.get_workstation.timeout = 60.0
    default_config.rpcs.get_workstation.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_workstations.timeout = 60.0
    default_config.rpcs.list_workstations.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_usable_workstations.timeout = 60.0
    default_config.rpcs.list_usable_workstations.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_workstation.timeout = 60.0

    default_config.rpcs.update_workstation.timeout = 60.0

    default_config.rpcs.delete_workstation.timeout = 60.0

    default_config.rpcs.start_workstation.timeout = 60.0

    default_config.rpcs.stop_workstation.timeout = 60.0

    default_config.rpcs.generate_access_token.timeout = 60.0
    default_config.rpcs.generate_access_token.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

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

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



163
164
165
166
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 163

def configure
  yield @config if block_given?
  @config
end

#create_workstation(request, options = nil) ⇒ ::Gapic::Operation #create_workstation(parent: nil, workstation_id: nil, workstation: nil, validate_only: nil) ⇒ ::Gapic::Operation

Creates a new workstation.

Examples:

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

Overloads:

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

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

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

      Required. Parent resource name.

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

      Required. ID to use for the workstation.

    • workstation (::Google::Cloud::Workstations::V1beta::Workstation, ::Hash) (defaults to: nil)

      Required. Workstation to create. If source_workstation is specified, the user must have workstations.workstations.use permission on the source workstation, and the Cloud Workstations Service Agent for the project where you are creating the new workstation must have compute.disks.createSnapshot and compute.snapshots.useReadOnly on the source project.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. If set, validate the request and preview the result, 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.



1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 1725

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :create_workstation, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_workstation_cluster(request, options = nil) ⇒ ::Gapic::Operation #create_workstation_cluster(parent: nil, workstation_cluster_id: nil, workstation_cluster: nil, validate_only: nil) ⇒ ::Gapic::Operation

Creates a new workstation cluster.

Examples:

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

Overloads:

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

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

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

      Required. Parent resource name.

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

      Required. ID to use for the workstation cluster.

    • workstation_cluster (::Google::Cloud::Workstations::V1beta::WorkstationCluster, ::Hash) (defaults to: nil)

      Required. Workstation cluster to create.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. If set, validate the request and preview the result, 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.



541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 541

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :create_workstation_cluster, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_workstation_config(request, options = nil) ⇒ ::Gapic::Operation #create_workstation_config(parent: nil, workstation_config_id: nil, workstation_config: nil, validate_only: nil) ⇒ ::Gapic::Operation

Creates a new workstation configuration.

Examples:

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

Overloads:

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

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

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

      Required. Parent resource name.

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

      Required. ID to use for the workstation configuration.

    • workstation_config (::Google::Cloud::Workstations::V1beta::WorkstationConfig, ::Hash) (defaults to: nil)

      Required. Workstation configuration to create.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. If set, validate the request and preview the result, 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.



1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 1131

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :create_workstation_config, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_workstation(request, options = nil) ⇒ ::Gapic::Operation #delete_workstation(name: nil, validate_only: nil, etag: nil) ⇒ ::Gapic::Operation

Deletes the specified workstation.

Examples:

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

Overloads:

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

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

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

      Required. Name of the workstation to delete.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. If set, validate the request and preview the result, but do not actually apply it.

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

      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.



1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 1928

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :delete_workstation, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_workstation_cluster(request, options = nil) ⇒ ::Gapic::Operation #delete_workstation_cluster(name: nil, validate_only: nil, etag: nil, force: nil) ⇒ ::Gapic::Operation

Deletes the specified workstation cluster.

Examples:

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

Overloads:

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

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

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

      Required. Name of the workstation cluster to delete.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. If set, validate the request and preview the result, but do not apply it.

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

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

      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.



749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 749

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :delete_workstation_cluster, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_workstation_config(request, options = nil) ⇒ ::Gapic::Operation #delete_workstation_config(name: nil, validate_only: nil, etag: nil, force: nil) ⇒ ::Gapic::Operation

Deletes the specified workstation configuration.

Examples:

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

Overloads:

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

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

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

      Required. Name of the workstation configuration to delete.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. If set, validate the request and preview the result, but do not actually apply it.

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

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

      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.



1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 1339

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :delete_workstation_config, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#generate_access_token(request, options = nil) ⇒ ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse #generate_access_token(expire_time: nil, ttl: nil, workstation: nil, port: nil) ⇒ ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse

Returns a short-lived credential that can be used to send authenticated and authorized traffic to a workstation. Once generated this token cannot be revoked and is good for the lifetime of the token.

Examples:

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

Overloads:

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

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

  • #generate_access_token(expire_time: nil, ttl: nil, workstation: nil, port: 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) (defaults to: nil)

      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.

      Note: The following parameters are mutually exclusive: expire_time, ttl. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • ttl (::Google::Protobuf::Duration, ::Hash) (defaults to: nil)

      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.

      Note: The following parameters are mutually exclusive: ttl, expire_time. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

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

      Required. Name of the workstation for which the access token should be generated.

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

      Optional. Port for which the access token should be generated. If specified, the generated access token grants access only to the specified port of the workstation. If specified, values must be within the range [1 - 65535]. If not specified, the generated access token grants access to all ports of the workstation.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 2241

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.workstation
    header_params["workstation"] = request.workstation
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :generate_access_token, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_workstation(request, options = nil) ⇒ ::Google::Cloud::Workstations::V1beta::Workstation #get_workstation(name: nil) ⇒ ::Google::Cloud::Workstations::V1beta::Workstation

Returns the requested workstation.

Examples:

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

Overloads:

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

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

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

    Parameters:

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

      Required. Name of the requested resource.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 1426

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :get_workstation, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_workstation_cluster(request, options = nil) ⇒ ::Google::Cloud::Workstations::V1beta::WorkstationCluster #get_workstation_cluster(name: nil) ⇒ ::Google::Cloud::Workstations::V1beta::WorkstationCluster

Returns the requested workstation cluster.

Examples:

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

Overloads:

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

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

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

    Parameters:

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

      Required. Name of the requested resource.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 343

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :get_workstation_cluster, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_workstation_config(request, options = nil) ⇒ ::Google::Cloud::Workstations::V1beta::WorkstationConfig #get_workstation_config(name: nil) ⇒ ::Google::Cloud::Workstations::V1beta::WorkstationConfig

Returns the requested workstation configuration.

Examples:

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

Overloads:

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

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

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

    Parameters:

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

      Required. Name of the requested resource.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 836

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :get_workstation_config, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_usable_workstation_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig> #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.

Examples:

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

Overloads:

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

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

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

      Required. Parent resource name.

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

      Optional. Maximum number of items to return.

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

      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.



1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 1030

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :list_usable_workstation_configs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_usable_workstation_configs, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_usable_workstations(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation> #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.

Examples:

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

Overloads:

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

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

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

      Required. Parent resource name.

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

      Optional. Maximum number of items to return.

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

      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.



1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 1620

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :list_usable_workstations, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_usable_workstations, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Returns all workstation clusters in the specified location.

Examples:

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

Overloads:

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

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

  • #list_workstation_clusters(parent: nil, page_size: nil, page_token: nil, filter: 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) (defaults to: nil)

      Required. Parent resource name.

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

      Optional. Maximum number of items to return.

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

      Optional. next_page_token value returned from a previous List request, if any.

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

      Optional. Filter the WorkstationClusters to be listed. Possible filters are described in https://google.aip.dev/160.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 440

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :list_workstation_clusters, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstation_clusters, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Returns all workstation configurations in the specified cluster.

Examples:

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

Overloads:

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

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

  • #list_workstation_configs(parent: nil, page_size: nil, page_token: nil, filter: 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) (defaults to: nil)

      Required. Parent resource name.

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

      Optional. Maximum number of items to return.

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

      Optional. next_page_token value returned from a previous List request, if any.

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

      Optional. Filter the WorkstationConfigs to be listed. Possible filters are described in https://google.aip.dev/160.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 933

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :list_workstation_configs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstation_configs, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Returns all Workstations using the specified workstation configuration.

Examples:

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

Overloads:

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

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

  • #list_workstations(parent: nil, page_size: nil, page_token: nil, filter: 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) (defaults to: nil)

      Required. Parent resource name.

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

      Optional. Maximum number of items to return.

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

      Optional. next_page_token value returned from a previous List request, if any.

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

      Optional. Filter the Workstations to be listed. Possible filters are described in https://google.aip.dev/160.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 1523

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :list_workstations, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstations, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


293
294
295
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 293

def logger
  @workstations_stub.logger
end

#push_credentials(request, options = nil) ⇒ ::Gapic::Operation #push_credentials(workstation: nil, application_default_credentials: nil) ⇒ ::Gapic::Operation

Pushes credentials to a running workstation on behalf of a user. Once complete, supported credential types (application_default_credentials) are made available to processes running in the user container.

Examples:

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::PushCredentialsRequest.new

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::Workstations::V1beta::PushCredentialsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

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

  • #push_credentials(workstation: nil, application_default_credentials: nil) ⇒ ::Gapic::Operation

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

    Parameters:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 2340

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::PushCredentialsRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.workstation
    header_params["workstation"] = request.workstation
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :push_credentials, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#start_workstation(request, options = nil) ⇒ ::Gapic::Operation #start_workstation(name: nil, validate_only: nil, etag: nil, boost_config: nil) ⇒ ::Gapic::Operation

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

Examples:

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

Overloads:

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

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

  • #start_workstation(name: nil, validate_only: nil, etag: nil, boost_config: 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) (defaults to: nil)

      Required. Name of the workstation to start.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. If set, validate the request and preview the result, but do not actually apply it.

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

      Optional. If set, the request will be rejected if the latest version of the workstation on the server does not have this ETag.

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

      Optional. If set, the workstation starts using the boost configuration with the specified ID.

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.



2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 2031

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::StartWorkstationRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :start_workstation, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#stop_workstation(request, options = nil) ⇒ ::Gapic::Operation #stop_workstation(name: nil, validate_only: nil, etag: nil) ⇒ ::Gapic::Operation

Stops running a workstation, reducing costs.

Examples:

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

Overloads:

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

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

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

      Required. Name of the workstation to stop.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. If set, validate the request and preview the result, but do not actually apply it.

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

      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.



2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 2131

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::StopWorkstationRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :stop_workstation, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


173
174
175
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 173

def universe_domain
  @workstations_stub.universe_domain
end

#update_workstation(request, options = nil) ⇒ ::Gapic::Operation #update_workstation(workstation: nil, update_mask: nil, validate_only: nil, allow_missing: nil) ⇒ ::Gapic::Operation

Updates an existing workstation.

Examples:

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

Overloads:

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

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

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

      Required. Workstation to update.

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

      Required. Mask specifying which fields in the workstation should be updated.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. If set, validate the request and preview the result, but do not actually apply it.

    • allow_missing (::Boolean) (defaults to: nil)

      Optional. If set and the workstation is not found, a new workstation 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.



1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 1828

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.workstation&.name
    header_params["workstation.name"] = request.workstation.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :update_workstation, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_workstation_cluster(request, options = nil) ⇒ ::Gapic::Operation #update_workstation_cluster(workstation_cluster: nil, update_mask: nil, validate_only: nil, allow_missing: nil) ⇒ ::Gapic::Operation

Updates an existing workstation cluster.

Examples:

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

Overloads:

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

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

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

      Required. Workstation cluster to update.

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

      Required. Mask that specifies which fields in the workstation cluster should be updated.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. If set, validate the request and preview the result, but do not actually apply it.

    • allow_missing (::Boolean) (defaults to: nil)

      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.



645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
# File 'lib/google/cloud/workstations/v1beta/workstations/client.rb', line 645

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.workstation_cluster&.name
    header_params["workstation_cluster.name"] = request.workstation_cluster.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :update_workstation_cluster, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_workstation_config(request, options = nil) ⇒ ::Gapic::Operation #update_workstation_config(workstation_config: nil, update_mask: nil, validate_only: nil, allow_missing: nil) ⇒ ::Gapic::Operation

Updates an existing workstation configuration.

Examples:

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

Overloads:

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

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

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

      Required. Workstation configuration to update.

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

      Required. Mask specifying which fields in the workstation configuration should be updated.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. If set, validate the request and preview the result, but do not actually apply it.

    • allow_missing (::Boolean) (defaults to: nil)

      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.



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

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest

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

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

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Workstations::V1beta::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.workstation_config&.name
    header_params["workstation_config.name"] = request.workstation_config.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @workstations_stub.call_rpc :update_workstation_config, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end