Class: OCI::FileStorage::FileStorageClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/file_storage/file_storage_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, region: nil, signer: nil) ⇒ FileStorageClient

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

A region must be specified in either the config 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.

  • 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



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/oci/file_storage/file_storage_client.rb', line 34

def initialize(config:nil, region:nil, signer:nil)
  # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
  # 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 unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
  config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
  config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)

  if signer.nil?
    signer = Signer.new(config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase, private_key_content: config.key_content, signing_strategy: Signer::STANDARD)
  end

  @api_client = ApiClient.new(config, signer)

  region ||= config.region
  region ||= signer.region if signer.respond_to?(:region)
  self.region = region
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



12
13
14
# File 'lib/oci/file_storage/file_storage_client.rb', line 12

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


16
17
18
# File 'lib/oci/file_storage/file_storage_client.rb', line 16

def endpoint
  @endpoint
end

#regionString

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

Returns:

  • (String)


20
21
22
# File 'lib/oci/file_storage/file_storage_client.rb', line 20

def region
  @region
end

Instance Method Details

#create_export(create_export_details, opts = {}) ⇒ Response

Creates a new export in the specified export set, path, and file system.

Parameters:

  • create_export_details (CreateExportDetails)

    Details for creating a new export.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:

  • (Response)

    A Response object with data of type OCI::FileStorage::Models::Export



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
# File 'lib/oci/file_storage/file_storage_client.rb', line 87

def create_export(create_export_details, opts = {})
  logger.debug "Calling operation FileStorageClient#create_export." if logger

  raise "Missing the required parameter 'create_export_details' when calling create_export." if create_export_details.nil?

  path = "/exports"

  # 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']

  post_body = @api_client.object_to_http_body(create_export_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::FileStorage::Models::Export')
end

#create_file_system(create_file_system_details, opts = {}) ⇒ Response

Creates a new file system in the specified compartment and availability domain. Instances can mount file systems in another availability domain, but doing so might increase latency when compared to mounting instances in the same availability domain.

After you create a file system, you can associate it with a mount target. Instances can then mount the file system by connecting to the mount target’s IP address. You can associate a file system with more than one mount target at a time.

For information about access control and compartments, see [Overview of the IAM Service](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm).

For information about availability domains, see [Regions and Availability Domains](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). To get a list of availability domains, use the ‘ListAvailabilityDomains` operation in the Identity and Access Management Service API.

All Oracle Cloud Infrastructure resources, including file systems, get an Oracle-assigned, unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response. You can also retrieve a resource’s OCID by using a List API operation on that resource type or by viewing the resource in the Console.

Parameters:

  • create_file_system_details (CreateFileSystemDetails)

    Details for creating a new file system.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:

  • (Response)

    A Response object with data of type OCI::FileStorage::Models::FileSystem



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/oci/file_storage/file_storage_client.rb', line 151

def create_file_system(create_file_system_details, opts = {})
  logger.debug "Calling operation FileStorageClient#create_file_system." if logger

  raise "Missing the required parameter 'create_file_system_details' when calling create_file_system." if create_file_system_details.nil?

  path = "/fileSystems"

  # 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']

  post_body = @api_client.object_to_http_body(create_file_system_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::FileStorage::Models::FileSystem')
end

#create_mount_target(create_mount_target_details, opts = {}) ⇒ Response

Creates a new mount target in the specified compartment and subnet. You can associate a file system with a mount target only when they exist in the same availability domain. Instances can connect to mount targets in another availablity domain, but you might see higher latency than with instances in the same availability domain as the mount target.

Mount targets have one or more private IP addresses that you can provide as the host portion of remote target parameters in client mount commands. These private IP addresses are listed in the privateIpIds property of the mount target and are highly available. Mount targets also consume additional IP addresses in their subnet.

For information about access control and compartments, see [Overview of the IAM Service](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm).

For information about availability domains, see [Regions and Availability Domains](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). To get a list of availability domains, use the ‘ListAvailabilityDomains` operation in the Identity and Access Management Service API.

All Oracle Cloud Infrastructure Services resources, including mount targets, get an Oracle-assigned, unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response. You can also retrieve a resource’s OCID by using a List API operation on that resource type, or by viewing the resource in the Console.

Parameters:

  • create_mount_target_details (CreateMountTargetDetails)

    Details for creating a new mount target.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:

  • (Response)

    A Response object with data of type OCI::FileStorage::Models::MountTarget



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
# File 'lib/oci/file_storage/file_storage_client.rb', line 218

def create_mount_target(create_mount_target_details, opts = {})
  logger.debug "Calling operation FileStorageClient#create_mount_target." if logger

  raise "Missing the required parameter 'create_mount_target_details' when calling create_mount_target." if create_mount_target_details.nil?

  path = "/mountTargets"

  # 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']

  post_body = @api_client.object_to_http_body(create_mount_target_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::FileStorage::Models::MountTarget')
end

#create_snapshot(create_snapshot_details, opts = {}) ⇒ Response

Creates a new snapshot of the specified file system. You can access the snapshot at ‘.snapshot/<name>`.

Parameters:

  • create_snapshot_details (CreateSnapshotDetails)

    Details for creating a new snapshot.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:

  • (Response)

    A Response object with data of type OCI::FileStorage::Models::Snapshot



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/oci/file_storage/file_storage_client.rb', line 258

def create_snapshot(create_snapshot_details, opts = {})
  logger.debug "Calling operation FileStorageClient#create_snapshot." if logger

  raise "Missing the required parameter 'create_snapshot_details' when calling create_snapshot." if create_snapshot_details.nil?

  path = "/snapshots"

  # 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']

  post_body = @api_client.object_to_http_body(create_snapshot_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::FileStorage::Models::Snapshot')
end

#delete_export(export_id, opts = {}) ⇒ Response

Deletes the specified export.

Parameters:

  • export_id (String)

    The OCID of the export.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



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
322
# File 'lib/oci/file_storage/file_storage_client.rb', line 297

def delete_export(export_id, opts = {})
  logger.debug "Calling operation FileStorageClient#delete_export." if logger

  raise "Missing the required parameter 'export_id' when calling delete_export." if export_id.nil?

  path = "/exports/{exportId}".sub('{exportId}', export_id.to_s)

  # 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']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_file_system(file_system_id, opts = {}) ⇒ Response

Deletes the specified file system. Before you delete the file system, verify that no remaining export resources still reference it. Deleting a file system also deletes all of its snapshots.

Parameters:

  • file_system_id (String)

    The OCID of the file system.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/oci/file_storage/file_storage_client.rb', line 337

def delete_file_system(file_system_id, opts = {})
  logger.debug "Calling operation FileStorageClient#delete_file_system." if logger

  raise "Missing the required parameter 'file_system_id' when calling delete_file_system." if file_system_id.nil?

  path = "/fileSystems/{fileSystemId}".sub('{fileSystemId}', file_system_id.to_s)

  # 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']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_mount_target(mount_target_id, opts = {}) ⇒ Response

Deletes the specified mount target. This operation also deletes the mount target’s VNICs.

Parameters:

  • mount_target_id (String)

    The OCID of the mount target.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/oci/file_storage/file_storage_client.rb', line 376

def delete_mount_target(mount_target_id, opts = {})
  logger.debug "Calling operation FileStorageClient#delete_mount_target." if logger

  raise "Missing the required parameter 'mount_target_id' when calling delete_mount_target." if mount_target_id.nil?

  path = "/mountTargets/{mountTargetId}".sub('{mountTargetId}', mount_target_id.to_s)

  # 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']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_snapshot(snapshot_id, opts = {}) ⇒ Response

Deletes the specified snapshot.

Parameters:

  • snapshot_id (String)

    The OCID of the snapshot.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/oci/file_storage/file_storage_client.rb', line 414

def delete_snapshot(snapshot_id, opts = {})
  logger.debug "Calling operation FileStorageClient#delete_snapshot." if logger

  raise "Missing the required parameter 'snapshot_id' when calling delete_snapshot." if snapshot_id.nil?

  path = "/snapshots/{snapshotId}".sub('{snapshotId}', snapshot_id.to_s)

  # 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']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#get_export(export_id, opts = {}) ⇒ Response

Gets the specified export’s information.

Parameters:

  • export_id (String)

    The OCID of the export.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OCI::FileStorage::Models::Export



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
# File 'lib/oci/file_storage/file_storage_client.rb', line 445

def get_export(export_id, opts = {})
  logger.debug "Calling operation FileStorageClient#get_export." if logger

  raise "Missing the required parameter 'export_id' when calling get_export." if export_id.nil?

  path = "/exports/{exportId}".sub('{exportId}', export_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::FileStorage::Models::Export')
end

#get_export_set(export_set_id, opts = {}) ⇒ Response

Gets the specified export set’s information.

Parameters:

  • export_set_id (String)

    The OCID of the export set.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OCI::FileStorage::Models::ExportSet



476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
# File 'lib/oci/file_storage/file_storage_client.rb', line 476

def get_export_set(export_set_id, opts = {})
  logger.debug "Calling operation FileStorageClient#get_export_set." if logger

  raise "Missing the required parameter 'export_set_id' when calling get_export_set." if export_set_id.nil?

  path = "/exportSets/{exportSetId}".sub('{exportSetId}', export_set_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::FileStorage::Models::ExportSet')
end

#get_file_system(file_system_id, opts = {}) ⇒ Response

Gets the specified file system’s information.

Parameters:

  • file_system_id (String)

    The OCID of the file system.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OCI::FileStorage::Models::FileSystem



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
# File 'lib/oci/file_storage/file_storage_client.rb', line 507

def get_file_system(file_system_id, opts = {})
  logger.debug "Calling operation FileStorageClient#get_file_system." if logger

  raise "Missing the required parameter 'file_system_id' when calling get_file_system." if file_system_id.nil?

  path = "/fileSystems/{fileSystemId}".sub('{fileSystemId}', file_system_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::FileStorage::Models::FileSystem')
end

#get_mount_target(mount_target_id, opts = {}) ⇒ Response

Gets the specified mount target’s information.

Parameters:

  • mount_target_id (String)

    The OCID of the mount target.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OCI::FileStorage::Models::MountTarget



538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
# File 'lib/oci/file_storage/file_storage_client.rb', line 538

def get_mount_target(mount_target_id, opts = {})
  logger.debug "Calling operation FileStorageClient#get_mount_target." if logger

  raise "Missing the required parameter 'mount_target_id' when calling get_mount_target." if mount_target_id.nil?

  path = "/mountTargets/{mountTargetId}".sub('{mountTargetId}', mount_target_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::FileStorage::Models::MountTarget')
end

#get_snapshot(snapshot_id, opts = {}) ⇒ Response

Gets the specified snapshot’s information.

Parameters:

  • snapshot_id (String)

    The OCID of the snapshot.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OCI::FileStorage::Models::Snapshot



569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
# File 'lib/oci/file_storage/file_storage_client.rb', line 569

def get_snapshot(snapshot_id, opts = {})
  logger.debug "Calling operation FileStorageClient#get_snapshot." if logger

  raise "Missing the required parameter 'snapshot_id' when calling get_snapshot." if snapshot_id.nil?

  path = "/snapshots/{snapshotId}".sub('{snapshotId}', snapshot_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::FileStorage::Models::Snapshot')
end

#list_export_sets(compartment_id, availability_domain, opts = {}) ⇒ Response

Lists the export set resources in the specified compartment.

Parameters:

  • compartment_id (String)

    The OCID of the compartment.

  • availability_domain (String)

    The name of the availability domain.

    Example: ‘Uocm:PHX-AD-1`

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return in a paginated "List" call.

    Example: ‘500`

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous "List" call.

  • :display_name (String)

    A user-friendly name. It does not have to be unique, and it is changeable.

    Example: ‘My resource`

  • :lifecycle_state (String)

    Filter results by the specified lifecycle state. Must be a valid state for the resource type.

    Allowed values are: CREATING, ACTIVE, DELETING, DELETED, FAILED

  • :id (String)

    Filter results by OCID. Must be an OCID of the correct type for the resouce type.

  • :sort_by (String)

    The field to sort by. You can provide either value, but not both. By default, when you sort by time created, results are shown in descending order. When you sort by display name, results are shown in ascending order.

    Allowed values are: TIMECREATED, DISPLAYNAME

  • :sort_order (String)

    The sort order to use, either ‘asc’ or ‘desc’, where ‘asc’ is ascending and ‘desc’ is descending.

    Allowed values are: ASC, DESC

Returns:

  • (Response)

    A Response object with data of type Array<OCI::FileStorage::Models::ExportSetSummary>



632
633
634
635
636
637
638
639
640
641
642
643
644
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
# File 'lib/oci/file_storage/file_storage_client.rb', line 632

def list_export_sets(compartment_id, availability_domain, opts = {})
  logger.debug "Calling operation FileStorageClient#list_export_sets." if logger

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

  if opts[:'lifecycle_state'] && !['CREATING', 'ACTIVE', 'DELETING', 'DELETED', 'FAILED'].include?(opts[:'lifecycle_state'])
    raise 'Invalid value for "lifecycle_state", must be one of CREATING, ACTIVE, DELETING, DELETED, FAILED.'
  end

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

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

  path = "/exportSets"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'availabilityDomain'] = availability_domain
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'displayName'] = opts[:'display_name'] if opts[:'display_name']
  query_params[:'lifecycleState'] = opts[:'lifecycle_state'] if opts[:'lifecycle_state']
  query_params[:'id'] = opts[:'id'] if opts[:'id']
  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'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::FileStorage::Models::ExportSetSummary>')
end

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

Lists the export resources in the specified compartment. You must also specify an export set, a file system, or both.

Parameters:

  • compartment_id (String)

    The OCID of the compartment.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return in a paginated "List" call.

    Example: ‘500`

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous "List" call.

  • :export_set_id (String)

    The OCID of the export set.

  • :file_system_id (String)

    The OCID of the file system.

  • :lifecycle_state (String)

    Filter results by the specified lifecycle state. Must be a valid state for the resource type.

    Allowed values are: CREATING, ACTIVE, DELETING, DELETED, FAILED

  • :id (String)

    Filter results by OCID. Must be an OCID of the correct type for the resouce type.

  • :sort_by (String)

    The field to sort by. You can provide either value, but not both. By default, when you sort by time created, results are shown in descending order. When you sort by path, results are shown in ascending alphanumeric order.

    Allowed values are: TIMECREATED, PATH

  • :sort_order (String)

    The sort order to use, either ‘asc’ or ‘desc’, where ‘asc’ is ascending and ‘desc’ is descending.

    Allowed values are: ASC, DESC

Returns:

  • (Response)

    A Response object with data of type Array<OCI::FileStorage::Models::ExportSummary>



712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
# File 'lib/oci/file_storage/file_storage_client.rb', line 712

def list_exports(compartment_id, opts = {})
  logger.debug "Calling operation FileStorageClient#list_exports." if logger

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

  if opts[:'lifecycle_state'] && !['CREATING', 'ACTIVE', 'DELETING', 'DELETED', 'FAILED'].include?(opts[:'lifecycle_state'])
    raise 'Invalid value for "lifecycle_state", must be one of CREATING, ACTIVE, DELETING, DELETED, FAILED.'
  end

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

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

  path = "/exports"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'exportSetId'] = opts[:'export_set_id'] if opts[:'export_set_id']
  query_params[:'fileSystemId'] = opts[:'file_system_id'] if opts[:'file_system_id']
  query_params[:'lifecycleState'] = opts[:'lifecycle_state'] if opts[:'lifecycle_state']
  query_params[:'id'] = opts[:'id'] if opts[:'id']
  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'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::FileStorage::Models::ExportSummary>')
end

#list_file_systems(compartment_id, availability_domain, opts = {}) ⇒ Response

Lists the file system resources in the specified compartment.

Parameters:

  • compartment_id (String)

    The OCID of the compartment.

  • availability_domain (String)

    The name of the availability domain.

    Example: ‘Uocm:PHX-AD-1`

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return in a paginated "List" call.

    Example: ‘500`

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous "List" call.

  • :display_name (String)

    A user-friendly name. It does not have to be unique, and it is changeable.

    Example: ‘My resource`

  • :lifecycle_state (String)

    Filter results by the specified lifecycle state. Must be a valid state for the resource type.

    Allowed values are: CREATING, ACTIVE, DELETING, DELETED, FAILED

  • :id (String)

    Filter results by OCID. Must be an OCID of the correct type for the resouce type.

  • :sort_by (String)

    The field to sort by. You can provide either value, but not both. By default, when you sort by time created, results are shown in descending order. When you sort by display name, results are shown in ascending order.

    Allowed values are: TIMECREATED, DISPLAYNAME

  • :sort_order (String)

    The sort order to use, either ‘asc’ or ‘desc’, where ‘asc’ is ascending and ‘desc’ is descending.

    Allowed values are: ASC, DESC

Returns:

  • (Response)

    A Response object with data of type Array<OCI::FileStorage::Models::FileSystemSummary>



796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
# File 'lib/oci/file_storage/file_storage_client.rb', line 796

def list_file_systems(compartment_id, availability_domain, opts = {})
  logger.debug "Calling operation FileStorageClient#list_file_systems." if logger

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

  if opts[:'lifecycle_state'] && !['CREATING', 'ACTIVE', 'DELETING', 'DELETED', 'FAILED'].include?(opts[:'lifecycle_state'])
    raise 'Invalid value for "lifecycle_state", must be one of CREATING, ACTIVE, DELETING, DELETED, FAILED.'
  end

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

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

  path = "/fileSystems"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'availabilityDomain'] = availability_domain
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'displayName'] = opts[:'display_name'] if opts[:'display_name']
  query_params[:'lifecycleState'] = opts[:'lifecycle_state'] if opts[:'lifecycle_state']
  query_params[:'id'] = opts[:'id'] if opts[:'id']
  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'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::FileStorage::Models::FileSystemSummary>')
end

#list_mount_targets(compartment_id, availability_domain, opts = {}) ⇒ Response

Lists the mount target resources in the specified compartment.

Parameters:

  • compartment_id (String)

    The OCID of the compartment.

  • availability_domain (String)

    The name of the availability domain.

    Example: ‘Uocm:PHX-AD-1`

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return in a paginated "List" call.

    Example: ‘500`

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous "List" call.

  • :display_name (String)

    A user-friendly name. It does not have to be unique, and it is changeable.

    Example: ‘My resource`

  • :export_set_id (String)

    The OCID of the export set.

  • :lifecycle_state (String)

    Filter results by the specified lifecycle state. Must be a valid state for the resource type.

    Allowed values are: CREATING, ACTIVE, DELETING, DELETED, FAILED

  • :id (String)

    Filter results by OCID. Must be an OCID of the correct type for the resouce type.

  • :sort_by (String)

    The field to sort by. You can choose either value, but not both. By default, when you sort by time created, results are shown in descending order. When you sort by display name, results are shown in ascending order.

    Allowed values are: TIMECREATED, DISPLAYNAME

  • :sort_order (String)

    The sort order to use, either ‘asc’ or ‘desc’, where ‘asc’ is ascending and ‘desc’ is descending.

    Allowed values are: ASC, DESC

Returns:

  • (Response)

    A Response object with data of type Array<OCI::FileStorage::Models::MountTargetSummary>



882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
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
# File 'lib/oci/file_storage/file_storage_client.rb', line 882

def list_mount_targets(compartment_id, availability_domain, opts = {})
  logger.debug "Calling operation FileStorageClient#list_mount_targets." if logger

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

  if opts[:'lifecycle_state'] && !['CREATING', 'ACTIVE', 'DELETING', 'DELETED', 'FAILED'].include?(opts[:'lifecycle_state'])
    raise 'Invalid value for "lifecycle_state", must be one of CREATING, ACTIVE, DELETING, DELETED, FAILED.'
  end

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

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

  path = "/mountTargets"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'availabilityDomain'] = availability_domain
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'displayName'] = opts[:'display_name'] if opts[:'display_name']
  query_params[:'exportSetId'] = opts[:'export_set_id'] if opts[:'export_set_id']
  query_params[:'lifecycleState'] = opts[:'lifecycle_state'] if opts[:'lifecycle_state']
  query_params[:'id'] = opts[:'id'] if opts[:'id']
  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'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::FileStorage::Models::MountTargetSummary>')
end

#list_snapshots(file_system_id, opts = {}) ⇒ Response

Lists snapshots of the specified file system.

Parameters:

  • file_system_id (String)

    The OCID of the file system.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return in a paginated "List" call.

    Example: ‘500`

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous "List" call.

  • :lifecycle_state (String)

    Filter results by the specified lifecycle state. Must be a valid state for the resource type.

    Allowed values are: CREATING, ACTIVE, DELETING, DELETED, FAILED

  • :id (String)

    Filter results by OCID. Must be an OCID of the correct type for the resouce type.

  • :sort_order (String)

    The sort order to use, either ‘asc’ or ‘desc’, where ‘asc’ is ascending and ‘desc’ is descending.

    Allowed values are: ASC, DESC

Returns:

  • (Response)

    A Response object with data of type Array<OCI::FileStorage::Models::SnapshotSummary>



954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
# File 'lib/oci/file_storage/file_storage_client.rb', line 954

def list_snapshots(file_system_id, opts = {})
  logger.debug "Calling operation FileStorageClient#list_snapshots." if logger

  raise "Missing the required parameter 'file_system_id' when calling list_snapshots." if file_system_id.nil?

  if opts[:'lifecycle_state'] && !['CREATING', 'ACTIVE', 'DELETING', 'DELETED', 'FAILED'].include?(opts[:'lifecycle_state'])
    raise 'Invalid value for "lifecycle_state", must be one of CREATING, ACTIVE, DELETING, DELETED, FAILED.'
  end

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

  path = "/snapshots"

  # Query Params
  query_params = {}
  query_params[:'fileSystemId'] = file_system_id
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'lifecycleState'] = opts[:'lifecycle_state'] if opts[:'lifecycle_state']
  query_params[:'id'] = opts[:'id'] if opts[:'id']
  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'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::FileStorage::Models::SnapshotSummary>')
end

#loggerLogger

Returns The logger for this client. May be nil.

Returns:

  • (Logger)

    The logger for this client. May be nil.



70
71
72
# File 'lib/oci/file_storage/file_storage_client.rb', line 70

def logger
  @api_client.config.logger
end

#update_export_set(export_set_id, update_export_set_details, opts = {}) ⇒ Response

Updates the specified export set’s information.

Parameters:

  • export_set_id (String)

    The OCID of the export set.

  • update_export_set_details (UpdateExportSetDetails)

    Details object for updating an export set.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type OCI::FileStorage::Models::ExportSet



1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
# File 'lib/oci/file_storage/file_storage_client.rb', line 1006

def update_export_set(export_set_id, update_export_set_details, opts = {})
  logger.debug "Calling operation FileStorageClient#update_export_set." if logger

  raise "Missing the required parameter 'export_set_id' when calling update_export_set." if export_set_id.nil?
  raise "Missing the required parameter 'update_export_set_details' when calling update_export_set." if update_export_set_details.nil?

  path = "/exportSets/{exportSetId}".sub('{exportSetId}', export_set_id.to_s)

  # 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']

  post_body = @api_client.object_to_http_body(update_export_set_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::FileStorage::Models::ExportSet')
end

#update_file_system(file_system_id, update_file_system_details, opts = {}) ⇒ Response

Updates the specified file system’s information. You can use this operation to rename a file system.

Parameters:

  • file_system_id (String)

    The OCID of the file system.

  • update_file_system_details (UpdateFileSystemDetails)

    Details object for updating a file system.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type OCI::FileStorage::Models::FileSystem



1048
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
# File 'lib/oci/file_storage/file_storage_client.rb', line 1048

def update_file_system(file_system_id, update_file_system_details, opts = {})
  logger.debug "Calling operation FileStorageClient#update_file_system." if logger

  raise "Missing the required parameter 'file_system_id' when calling update_file_system." if file_system_id.nil?
  raise "Missing the required parameter 'update_file_system_details' when calling update_file_system." if update_file_system_details.nil?

  path = "/fileSystems/{fileSystemId}".sub('{fileSystemId}', file_system_id.to_s)

  # 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']

  post_body = @api_client.object_to_http_body(update_file_system_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::FileStorage::Models::FileSystem')
end

#update_mount_target(mount_target_id, update_mount_target_details, opts = {}) ⇒ Response

Updates the specified mount target’s information.

Parameters:

  • mount_target_id (String)

    The OCID of the mount target.

  • update_mount_target_details (UpdateMountTargetDetails)

    Details object for updating a mount target.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type OCI::FileStorage::Models::MountTarget



1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
# File 'lib/oci/file_storage/file_storage_client.rb', line 1088

def update_mount_target(mount_target_id, update_mount_target_details, opts = {})
  logger.debug "Calling operation FileStorageClient#update_mount_target." if logger

  raise "Missing the required parameter 'mount_target_id' when calling update_mount_target." if mount_target_id.nil?
  raise "Missing the required parameter 'update_mount_target_details' when calling update_mount_target." if update_mount_target_details.nil?

  path = "/mountTargets/{mountTargetId}".sub('{mountTargetId}', mount_target_id.to_s)

  # 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']

  post_body = @api_client.object_to_http_body(update_mount_target_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::FileStorage::Models::MountTarget')
end