Class: OCI::Desktops::DesktopServiceClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/desktops/desktop_service_client.rb

Overview

Create and manage cloud-hosted desktops which can be accessed from a web browser or installed client.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ DesktopServiceClient

Creates a new DesktopServiceClient. Notes: If a config is not specified, then the global OCI.config will be used.

This client is not thread-safe

Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the region. A region may be specified in the config or via or the region parameter. If specified in both, then the region parameter will be used.

Parameters:

  • config (Config) (defaults to: nil)

    A Config object.

  • region (String) (defaults to: nil)

    A region used to determine the service endpoint. This will usually correspond to a value in Regions::REGION_ENUM, but may be an arbitrary string.

  • endpoint (String) (defaults to: nil)

    The fully qualified endpoint URL

  • signer (OCI::BaseSigner) (defaults to: nil)

    A signer implementation which can be used by this client. If this is not provided then a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication, so that the instance principals signer can be provided to the client

  • proxy_settings (OCI::ApiClientProxySettings) (defaults to: nil)

    If your environment requires you to use a proxy server for outgoing HTTP requests the details for the proxy can be provided in this parameter

  • retry_config (OCI::Retry::RetryConfig) (defaults to: nil)

    The retry configuration for this service client. This represents the default retry configuration to apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/oci/desktops/desktop_service_client.rb', line 55

def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
  # If the signer is an InstancePrincipalsSecurityTokenSigner or SecurityTokenSigner and no config was supplied (they are self-sufficient signers)
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
  # pass it to this constructor.
  #
  # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
  # so try and load the config from the default file.
  config = OCI::Config.validate_and_build_config_with_signer(config, signer)

  signer = OCI::Signer.config_file_auth_builder(config) if signer.nil?

  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
  @retry_config = retry_config

  if endpoint
    @endpoint = endpoint + '/20220618'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "DesktopServiceClient endpoint set to '#{@endpoint}'." if logger
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



15
16
17
# File 'lib/oci/desktops/desktop_service_client.rb', line 15

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


19
20
21
# File 'lib/oci/desktops/desktop_service_client.rb', line 19

def endpoint
  @endpoint
end

#regionString

The region, which will usually correspond to a value in Regions::REGION_ENUM.

Returns:

  • (String)


29
30
31
# File 'lib/oci/desktops/desktop_service_client.rb', line 29

def region
  @region
end

#retry_configOCI::Retry::RetryConfig (readonly)

The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



25
26
27
# File 'lib/oci/desktops/desktop_service_client.rb', line 25

def retry_config
  @retry_config
end

Instance Method Details

#cancel_work_request(work_request_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use cancel_work_request API.

Cancel work request with the given ID.

Parameters:

  • work_request_id (String)

    The ID of the asynchronous request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control.

  • :opc_request_id (String)

    The unique identifier of the request.

Returns:

  • (Response)

    A Response object with data of type nil



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
147
148
# File 'lib/oci/desktops/desktop_service_client.rb', line 112

def cancel_work_request(work_request_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#cancel_work_request.' if logger

  raise "Missing the required parameter 'work_request_id' when calling cancel_work_request." if work_request_id.nil?
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#cancel_work_request') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#change_desktop_pool_compartment(desktop_pool_id, change_desktop_pool_compartment_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use change_desktop_pool_compartment API.

Moves a desktop pool into a different compartment within the same tenancy. You must provide the OCID of the desktop pool and the OCID of the compartment that you are moving the pool to.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

  • :if_match (String)

    For optimistic concurrency control.

  • :opc_retry_token (String)

    A token that uniquely identifies a request.

Returns:

  • (Response)

    A Response object with data of type nil



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/oci/desktops/desktop_service_client.rb', line 170

def change_desktop_pool_compartment(desktop_pool_id, change_desktop_pool_compartment_details, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#change_desktop_pool_compartment.' if logger

  raise "Missing the required parameter 'desktop_pool_id' when calling change_desktop_pool_compartment." if desktop_pool_id.nil?
  raise "Missing the required parameter 'change_desktop_pool_compartment_details' when calling change_desktop_pool_compartment." if change_desktop_pool_compartment_details.nil?
  raise "Parameter value for 'desktop_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(desktop_pool_id)

  path = '/desktopPools/{desktopPoolId}/actions/changeCompartment'.sub('{desktopPoolId}', desktop_pool_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(change_desktop_pool_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#change_desktop_pool_compartment') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_desktop_pool(create_desktop_pool_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use create_desktop_pool API.

Creates a desktop pool with the given configuration parameters.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_retry_token (String)

    A token that uniquely identifies a request.

  • :opc_request_id (String)

    The unique identifier of the request.

Returns:



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/oci/desktops/desktop_service_client.rb', line 228

def create_desktop_pool(create_desktop_pool_details, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#create_desktop_pool.' if logger

  raise "Missing the required parameter 'create_desktop_pool_details' when calling create_desktop_pool." if create_desktop_pool_details.nil?

  path = '/desktopPools'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_desktop_pool_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#create_desktop_pool') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Desktops::Models::DesktopPool'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_desktop(desktop_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use delete_desktop API.

Deletes the desktop with the specified OCID. The service terminates the associated compute instance. The end-user loses access to the desktop instance permanently. Any associated block volume becomes inactive but is not deleted.

Parameters:

  • desktop_id (String)

    The OCID of the desktop.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

  • :if_match (String)

    For optimistic concurrency control.

Returns:

  • (Response)

    A Response object with data of type nil



285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/oci/desktops/desktop_service_client.rb', line 285

def delete_desktop(desktop_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#delete_desktop.' if logger

  raise "Missing the required parameter 'desktop_id' when calling delete_desktop." if desktop_id.nil?
  raise "Parameter value for 'desktop_id' must not be blank" if OCI::Internal::Util.blank_string?(desktop_id)

  path = '/desktops/{desktopId}'.sub('{desktopId}', desktop_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#delete_desktop') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_desktop_pool(desktop_pool_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use delete_desktop_pool API.

Deletes a desktop pool with the specified OCID. The service terminates all compute instances and users immediately lose access to their desktops. You can choose to preserve the block volumes associated with the pool.

Parameters:

  • desktop_pool_id (String)

    The OCID of the desktop pool.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

  • :if_match (String)

    For optimistic concurrency control.

  • :are_volumes_preserved (BOOLEAN)

    Whether the volumes are preserved when a desktop pool is deleted. (default to false)

Returns:

  • (Response)

    A Response object with data of type nil



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/oci/desktops/desktop_service_client.rb', line 342

def delete_desktop_pool(desktop_pool_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#delete_desktop_pool.' if logger

  raise "Missing the required parameter 'desktop_pool_id' when calling delete_desktop_pool." if desktop_pool_id.nil?
  raise "Parameter value for 'desktop_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(desktop_pool_id)

  path = '/desktopPools/{desktopPoolId}'.sub('{desktopPoolId}', desktop_pool_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:areVolumesPreserved] = opts[:are_volumes_preserved] if !opts[:are_volumes_preserved].nil?

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#delete_desktop_pool') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_desktop(desktop_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_desktop API.

Provides information about the desktop with the specified OCID.

Parameters:

  • desktop_id (String)

    The OCID of the desktop.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

Returns:



397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/oci/desktops/desktop_service_client.rb', line 397

def get_desktop(desktop_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#get_desktop.' if logger

  raise "Missing the required parameter 'desktop_id' when calling get_desktop." if desktop_id.nil?
  raise "Parameter value for 'desktop_id' must not be blank" if OCI::Internal::Util.blank_string?(desktop_id)

  path = '/desktops/{desktopId}'.sub('{desktopId}', desktop_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#get_desktop') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Desktops::Models::Desktop'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_desktop_pool(desktop_pool_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_desktop_pool API.

Returns information about the desktop pool including all configuration parameters and the current state.

Parameters:

  • desktop_pool_id (String)

    The OCID of the desktop pool.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

Returns:



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
482
483
484
485
486
487
488
# File 'lib/oci/desktops/desktop_service_client.rb', line 452

def get_desktop_pool(desktop_pool_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#get_desktop_pool.' if logger

  raise "Missing the required parameter 'desktop_pool_id' when calling get_desktop_pool." if desktop_pool_id.nil?
  raise "Parameter value for 'desktop_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(desktop_pool_id)

  path = '/desktopPools/{desktopPoolId}'.sub('{desktopPoolId}', desktop_pool_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#get_desktop_pool') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Desktops::Models::DesktopPool'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_work_request(work_request_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_work_request API.

Gets the status of the work request with the given ID.

Parameters:

  • work_request_id (String)

    The ID of the asynchronous request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

Returns:



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# File 'lib/oci/desktops/desktop_service_client.rb', line 506

def get_work_request(work_request_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#get_work_request.' if logger

  raise "Missing the required parameter 'work_request_id' when calling get_work_request." if work_request_id.nil?
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#get_work_request') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Desktops::Models::WorkRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_desktop_pool_desktops(compartment_id, desktop_pool_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_desktop_pool_desktops API.

Returns a list of desktops within a given desktop pool. You can limit the results to an availability domain, desktop name, or desktop state. You can limit the number of results returned, sort the results by time or name, and sort in ascending or descending order.

Parameters:

  • compartment_id (String)

    The OCID of the compartment of the desktop pool.

  • desktop_pool_id (String)

    The OCID of the desktop pool.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :availability_domain (String)

    The name of the availability domain.

  • :display_name (String)

    A filter to return only results with the given displayName.

  • :id (String)

    A filter to return only results with the given OCID.

  • :lifecycle_state (String)

    A filter to return only results with the given lifecycleState.

  • :limit (Integer)

    The maximum number of results to return. (default to 100)

  • :sort_by (String)

    A field to sort by. (default to TIMECREATED) Allowed values are: TIMECREATED, DISPLAYNAME

  • :sort_order (String)

    A field to indicate the sort order. (default to DESC) Allowed values are: ASC, DESC

  • :opc_request_id (String)

    The unique identifier of the request.

  • :page (String)

    For list pagination.

Returns:



572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
# File 'lib/oci/desktops/desktop_service_client.rb', line 572

def list_desktop_pool_desktops(compartment_id, desktop_pool_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#list_desktop_pool_desktops.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_desktop_pool_desktops." if compartment_id.nil?
  raise "Missing the required parameter 'desktop_pool_id' when calling list_desktop_pool_desktops." if desktop_pool_id.nil?

  if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end
  raise "Parameter value for 'desktop_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(desktop_pool_id)

  path = '/desktopPools/{desktopPoolId}/desktops'.sub('{desktopPoolId}', desktop_pool_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:availabilityDomain] = opts[:availability_domain] if opts[:availability_domain]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:page] = opts[:page] if opts[:page]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#list_desktop_pool_desktops') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Desktops::Models::DesktopPoolDesktopCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_desktop_pool_volumes(desktop_pool_id, compartment_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_desktop_pool_volumes API.

Returns a list of volumes within the given desktop pool. You can limit the results to an availability domain, volume name, or volume state. You can limit the number of results returned, sort the results by time or name, and sort in ascending or descending order.

Parameters:

  • desktop_pool_id (String)

    The OCID of the desktop pool.

  • compartment_id (String)

    The OCID of the compartment of the desktop pool.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :availability_domain (String)

    The name of the availability domain.

  • :display_name (String)

    A filter to return only results with the given displayName.

  • :id (String)

    A filter to return only results with the given OCID.

  • :lifecycle_state (String)

    A filter to return only results with the given lifecycleState.

  • :limit (Integer)

    The maximum number of results to return. (default to 100)

  • :sort_by (String)

    A field to sort by. (default to TIMECREATED) Allowed values are: TIMECREATED, DISPLAYNAME

  • :sort_order (String)

    A field to indicate the sort order. (default to DESC) Allowed values are: ASC, DESC

  • :opc_request_id (String)

    The unique identifier of the request.

  • :page (String)

    For list pagination.

Returns:



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
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
# File 'lib/oci/desktops/desktop_service_client.rb', line 656

def list_desktop_pool_volumes(desktop_pool_id, compartment_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#list_desktop_pool_volumes.' if logger

  raise "Missing the required parameter 'desktop_pool_id' when calling list_desktop_pool_volumes." if desktop_pool_id.nil?
  raise "Missing the required parameter 'compartment_id' when calling list_desktop_pool_volumes." if compartment_id.nil?

  if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end
  raise "Parameter value for 'desktop_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(desktop_pool_id)

  path = '/desktopPools/{desktopPoolId}/volumes'.sub('{desktopPoolId}', desktop_pool_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:availabilityDomain] = opts[:availability_domain] if opts[:availability_domain]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:page] = opts[:page] if opts[:page]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#list_desktop_pool_volumes') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Desktops::Models::DesktopPoolVolumeCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_desktop_pools(compartment_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_desktop_pools API.

Returns a list of desktop pools within the given compartment. You can limit the results to an availability domain, pool name, or pool state. You can limit the number of results returned, sort the results by time or name, and sort in ascending or descending order.

Parameters:

  • compartment_id (String)

    The OCID of the compartment of the desktop pool.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :availability_domain (String)

    The name of the availability domain.

  • :display_name (String)

    A filter to return only results with the given displayName.

  • :id (String)

    A filter to return only results with the given OCID.

  • :lifecycle_state (String)

    A filter to return only results with the given lifecycleState.

  • :limit (Integer)

    The maximum number of results to return. (default to 100)

  • :sort_by (String)

    A field to sort by. (default to TIMECREATED) Allowed values are: TIMECREATED, DISPLAYNAME

  • :sort_order (String)

    A field to indicate the sort order. (default to DESC) Allowed values are: ASC, DESC

  • :opc_request_id (String)

    The unique identifier of the request.

  • :page (String)

    For list pagination.

Returns:



739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
# File 'lib/oci/desktops/desktop_service_client.rb', line 739

def list_desktop_pools(compartment_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#list_desktop_pools.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_desktop_pools." if compartment_id.nil?

  if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end

  path = '/desktopPools'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:availabilityDomain] = opts[:availability_domain] if opts[:availability_domain]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:page] = opts[:page] if opts[:page]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#list_desktop_pools') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Desktops::Models::DesktopPoolCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_desktops(compartment_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_desktops API.

Returns a list of desktops filtered by the specified parameters. You can limit the results to an availability domain, desktop name, desktop OCID, desktop state, pool OCID, or compartment OCID. You can limit the number of results returned, sort the results by time or name, and sort in ascending or descending order.

Parameters:

  • compartment_id (String)

    The OCID of the compartment of the desktop pool.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :availability_domain (String)

    The name of the availability domain.

  • :display_name (String)

    A filter to return only results with the given displayName.

  • :id (String)

    A filter to return only results with the given OCID.

  • :lifecycle_state (String)

    A filter to return only results with the given lifecycleState.

  • :limit (Integer)

    The maximum number of results to return. (default to 100)

  • :sort_by (String)

    A field to sort by. (default to TIMECREATED) Allowed values are: TIMECREATED, DISPLAYNAME

  • :sort_order (String)

    A field to indicate the sort order. (default to DESC) Allowed values are: ASC, DESC

  • :opc_request_id (String)

    The unique identifier of the request.

  • :page (String)

    For list pagination.

  • :desktop_pool_id (String)

    The OCID of the desktop pool.

Returns:



821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
# File 'lib/oci/desktops/desktop_service_client.rb', line 821

def list_desktops(compartment_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#list_desktops.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_desktops." if compartment_id.nil?

  if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end

  path = '/desktops'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:availabilityDomain] = opts[:availability_domain] if opts[:availability_domain]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:desktopPoolId] = opts[:desktop_pool_id] if opts[:desktop_pool_id]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#list_desktops') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Desktops::Models::DesktopCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_work_request_errors(work_request_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_work_request_errors API.

Return a (paginated) list of errors for a given work request. Allowed values are: timeAccepted

Parameters:

  • work_request_id (String)

    The ID of the asynchronous request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

  • :page (String)

    For list pagination.

  • :limit (Integer)

    The maximum number of results to return. (default to 100)

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. (default to timeAccepted)

  • :sort_order (String)

    A field to indicate the sort order. (default to DESC) Allowed values are: ASC, DESC

Returns:



899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
# File 'lib/oci/desktops/desktop_service_client.rb', line 899

def list_work_request_errors(work_request_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#list_work_request_errors.' if logger

  raise "Missing the required parameter 'work_request_id' when calling list_work_request_errors." if work_request_id.nil?

  if opts[:sort_by] && !%w[timeAccepted].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeAccepted.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}/errors'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#list_work_request_errors') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Desktops::Models::WorkRequestErrorCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_work_request_logs(work_request_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_work_request_logs API.

Return a (paginated) list of logs for a given work request.

Allowed values are: timeAccepted

Parameters:

  • work_request_id (String)

    The ID of the asynchronous request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

  • :page (String)

    For list pagination.

  • :limit (Integer)

    The maximum number of results to return. (default to 100)

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. (default to timeAccepted)

  • :sort_order (String)

    A field to indicate the sort order. (default to DESC) Allowed values are: ASC, DESC

Returns:



973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
# File 'lib/oci/desktops/desktop_service_client.rb', line 973

def list_work_request_logs(work_request_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#list_work_request_logs.' if logger

  raise "Missing the required parameter 'work_request_id' when calling list_work_request_logs." if work_request_id.nil?

  if opts[:sort_by] && !%w[timeAccepted].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeAccepted.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}/logs'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#list_work_request_logs') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Desktops::Models::WorkRequestLogEntryCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_work_requests(compartment_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_work_requests API.

Lists the work requests in a compartment. Allowed values are: timeAccepted

Parameters:

  • compartment_id (String)

    The OCID of the compartment of the desktop pool.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :work_request_id (String)

    The ID of the asynchronous work request.

  • :status (String)

    A filter to return only resources their lifecycleState matches the given OperationStatus.

  • :resource_id (String)

    The ID of the resource affected by the work request.

  • :opc_request_id (String)

    The unique identifier of the request.

  • :page (String)

    For list pagination.

  • :limit (Integer)

    The maximum number of results to return. (default to 100)

  • :sort_order (String)

    A field to indicate the sort order. (default to DESC) Allowed values are: ASC, DESC

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. (default to timeAccepted)

Returns:



1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
# File 'lib/oci/desktops/desktop_service_client.rb', line 1049

def list_work_requests(compartment_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#list_work_requests.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_work_requests." if compartment_id.nil?

  if opts[:status] && !OCI::Desktops::Models::OPERATION_STATUS_ENUM.include?(opts[:status])
    raise 'Invalid value for "status", must be one of the values in OCI::Desktops::Models::OPERATION_STATUS_ENUM.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end

  if opts[:sort_by] && !%w[timeAccepted].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeAccepted.'
  end

  path = '/workRequests'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:workRequestId] = opts[:work_request_id] if opts[:work_request_id]
  query_params[:status] = opts[:status] if opts[:status]
  query_params[:resourceId] = opts[:resource_id] if opts[:resource_id]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#list_work_requests') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Desktops::Models::WorkRequestSummaryCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#loggerLogger

Returns The logger for this client. May be nil.

Returns:

  • (Logger)

    The logger for this client. May be nil.



94
95
96
# File 'lib/oci/desktops/desktop_service_client.rb', line 94

def logger
  @api_client.config.logger
end

#start_desktop(desktop_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use start_desktop API.

Starts the desktop with the specified OCID.

Parameters:

  • desktop_id (String)

    The OCID of the desktop.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

  • :if_match (String)

    For optimistic concurrency control.

  • :opc_retry_token (String)

    A token that uniquely identifies a request.

Returns:

  • (Response)

    A Response object with data of type nil



1124
1125
1126
1127
1128
1129
1130
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
# File 'lib/oci/desktops/desktop_service_client.rb', line 1124

def start_desktop(desktop_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#start_desktop.' if logger

  raise "Missing the required parameter 'desktop_id' when calling start_desktop." if desktop_id.nil?
  raise "Parameter value for 'desktop_id' must not be blank" if OCI::Internal::Util.blank_string?(desktop_id)

  path = '/desktops/{desktopId}/actions/start'.sub('{desktopId}', desktop_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#start_desktop') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#start_desktop_pool(desktop_pool_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use start_desktop_pool API.

Starts the desktop pool with the specified OCID. Once the pool is ACTIVE, users will have access to their desktops within the pool.

Parameters:

  • desktop_pool_id (String)

    The OCID of the desktop pool.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

  • :if_match (String)

    For optimistic concurrency control.

  • :opc_retry_token (String)

    A token that uniquely identifies a request.

Returns:

  • (Response)

    A Response object with data of type nil



1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
# File 'lib/oci/desktops/desktop_service_client.rb', line 1183

def start_desktop_pool(desktop_pool_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#start_desktop_pool.' if logger

  raise "Missing the required parameter 'desktop_pool_id' when calling start_desktop_pool." if desktop_pool_id.nil?
  raise "Parameter value for 'desktop_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(desktop_pool_id)

  path = '/desktopPools/{desktopPoolId}/actions/start'.sub('{desktopPoolId}', desktop_pool_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#start_desktop_pool') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#stop_desktop(desktop_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use stop_desktop API.

Stops the desktop with the specified OCID. Stopping a desktop causes the end-user to lose access to their desktop instance until the desktop is restarted.

Parameters:

  • desktop_id (String)

    The OCID of the desktop.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

  • :if_match (String)

    For optimistic concurrency control.

  • :opc_retry_token (String)

    A token that uniquely identifies a request.

Returns:

  • (Response)

    A Response object with data of type nil



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
1277
1278
1279
1280
# File 'lib/oci/desktops/desktop_service_client.rb', line 1242

def stop_desktop(desktop_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#stop_desktop.' if logger

  raise "Missing the required parameter 'desktop_id' when calling stop_desktop." if desktop_id.nil?
  raise "Parameter value for 'desktop_id' must not be blank" if OCI::Internal::Util.blank_string?(desktop_id)

  path = '/desktops/{desktopId}/actions/stop'.sub('{desktopId}', desktop_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#stop_desktop') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#stop_desktop_pool(desktop_pool_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use stop_desktop_pool API.

Stops the desktop pool with the specified OCID. Users will lose access to their desktops until you explicitly start the pool again.

Parameters:

  • desktop_pool_id (String)

    The OCID of the desktop pool.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

  • :if_match (String)

    For optimistic concurrency control.

  • :opc_retry_token (String)

    A token that uniquely identifies a request.

Returns:

  • (Response)

    A Response object with data of type nil



1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
# File 'lib/oci/desktops/desktop_service_client.rb', line 1301

def stop_desktop_pool(desktop_pool_id, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#stop_desktop_pool.' if logger

  raise "Missing the required parameter 'desktop_pool_id' when calling stop_desktop_pool." if desktop_pool_id.nil?
  raise "Parameter value for 'desktop_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(desktop_pool_id)

  path = '/desktopPools/{desktopPoolId}/actions/stop'.sub('{desktopPoolId}', desktop_pool_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#stop_desktop_pool') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_desktop(desktop_id, update_desktop_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use update_desktop API.

Modifies information about the desktop such as the name.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

  • :if_match (String)

    For optimistic concurrency control.

Returns:

  • (Response)

    A Response object with data of type nil



1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
# File 'lib/oci/desktops/desktop_service_client.rb', line 1359

def update_desktop(desktop_id, update_desktop_details, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#update_desktop.' if logger

  raise "Missing the required parameter 'desktop_id' when calling update_desktop." if desktop_id.nil?
  raise "Missing the required parameter 'update_desktop_details' when calling update_desktop." if update_desktop_details.nil?
  raise "Parameter value for 'desktop_id' must not be blank" if OCI::Internal::Util.blank_string?(desktop_id)

  path = '/desktops/{desktopId}'.sub('{desktopId}', desktop_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_desktop_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#update_desktop') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_desktop_pool(desktop_pool_id, update_desktop_pool_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use update_desktop_pool API.

Modifies the configuration of the desktop pool such as the availability, contact information, description, name, device policy, pool size, standby size, and start or stop time.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique identifier of the request.

  • :if_match (String)

    For optimistic concurrency control.

Returns:

  • (Response)

    A Response object with data of type nil



1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
# File 'lib/oci/desktops/desktop_service_client.rb', line 1417

def update_desktop_pool(desktop_pool_id, update_desktop_pool_details, opts = {})
  logger.debug 'Calling operation DesktopServiceClient#update_desktop_pool.' if logger

  raise "Missing the required parameter 'desktop_pool_id' when calling update_desktop_pool." if desktop_pool_id.nil?
  raise "Missing the required parameter 'update_desktop_pool_details' when calling update_desktop_pool." if update_desktop_pool_details.nil?
  raise "Parameter value for 'desktop_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(desktop_pool_id)

  path = '/desktopPools/{desktopPoolId}'.sub('{desktopPoolId}', desktop_pool_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_desktop_pool_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DesktopServiceClient#update_desktop_pool') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end