Class: OCI::ObjectStorage::ObjectStorageClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/object_storage/object_storage_client.rb

Overview

Use Object Storage and Archive Storage APIs to manage buckets, objects, and related resources. For more information, see Overview of Object Storage and Overview of Archive Storage.

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) ⇒ ObjectStorageClient

Creates a new ObjectStorageClient. 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

[View source]

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

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 + '/'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "ObjectStorageClient endpoint set to '#{@endpoint}'." if logger
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:


17
18
19
# File 'lib/oci/object_storage/object_storage_client.rb', line 17

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)

21
22
23
# File 'lib/oci/object_storage/object_storage_client.rb', line 21

def endpoint
  @endpoint
end

#regionString

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

Returns:

  • (String)

31
32
33
# File 'lib/oci/object_storage/object_storage_client.rb', line 31

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


27
28
29
# File 'lib/oci/object_storage/object_storage_client.rb', line 27

def retry_config
  @retry_config
end

Instance Method Details

#abort_multipart_upload(namespace_name, bucket_name, object_name, upload_id, opts = {}) ⇒ Response

Note:

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

Aborts an in-progress multipart upload and deletes all parts that have been uploaded.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • object_name (String)

    The name of the object. Avoid entering confidential information. Example: test/object1.log

  • upload_id (String)

    The upload ID for a multipart upload.

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/oci/object_storage/object_storage_client.rb', line 121

def abort_multipart_upload(namespace_name, bucket_name, object_name, upload_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#abort_multipart_upload.' if logger

  raise "Missing the required parameter 'namespace_name' when calling abort_multipart_upload." if namespace_name.nil?
  raise "Missing the required parameter 'bucket_name' when calling abort_multipart_upload." if bucket_name.nil?
  raise "Missing the required parameter 'object_name' when calling abort_multipart_upload." if object_name.nil?
  raise "Missing the required parameter 'upload_id' when calling abort_multipart_upload." if upload_id.nil?
  raise "Parameter value for 'namespace_name' must not be blank" if OCI::Internal::Util.blank_string?(namespace_name)
  raise "Parameter value for 'bucket_name' must not be blank" if OCI::Internal::Util.blank_string?(bucket_name)
  raise "Parameter value for 'object_name' must not be blank" if OCI::Internal::Util.blank_string?(object_name)

  path = '/n/{namespaceName}/b/{bucketName}/u/{objectName}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:uploadId] = upload_id

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#abort_multipart_upload') 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

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

Note:

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

Cancels a work request.

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_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

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
210
211
212
213
214
215
216
# File 'lib/oci/object_storage/object_storage_client.rb', line 181

def cancel_work_request(work_request_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#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[:'opc-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#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

#commit_multipart_upload(namespace_name, bucket_name, object_name, upload_id, commit_multipart_upload_details, opts = {}) ⇒ Response

Note:

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

Commits a multipart upload, which involves checking part numbers and entity tags (ETags) of the parts, to create an aggregate object.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • object_name (String)

    The name of the object. Avoid entering confidential information. Example: test/object1.log

  • upload_id (String)

    The upload ID for a multipart upload.

  • commit_multipart_upload_details (OCI::ObjectStorage::Models::CommitMultipartUploadDetails)

    The part numbers and entity tags (ETags) for the parts you want to commit.

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

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :if_none_match (String)

    The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the resource already exists.

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

250
251
252
253
254
255
256
257
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
285
286
287
288
289
290
291
292
293
294
# File 'lib/oci/object_storage/object_storage_client.rb', line 250

def commit_multipart_upload(namespace_name, bucket_name, object_name, upload_id, commit_multipart_upload_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#commit_multipart_upload.' if logger

  raise "Missing the required parameter 'namespace_name' when calling commit_multipart_upload." if namespace_name.nil?
  raise "Missing the required parameter 'bucket_name' when calling commit_multipart_upload." if bucket_name.nil?
  raise "Missing the required parameter 'object_name' when calling commit_multipart_upload." if object_name.nil?
  raise "Missing the required parameter 'upload_id' when calling commit_multipart_upload." if upload_id.nil?
  raise "Missing the required parameter 'commit_multipart_upload_details' when calling commit_multipart_upload." if commit_multipart_upload_details.nil?
  raise "Parameter value for 'namespace_name' must not be blank" if OCI::Internal::Util.blank_string?(namespace_name)
  raise "Parameter value for 'bucket_name' must not be blank" if OCI::Internal::Util.blank_string?(bucket_name)
  raise "Parameter value for 'object_name' must not be blank" if OCI::Internal::Util.blank_string?(object_name)

  path = '/n/{namespaceName}/b/{bucketName}/u/{objectName}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:uploadId] = upload_id

  # 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[:'if-none-match'] = opts[:if_none_match] if opts[:if_none_match]
  header_params[:'opc-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(commit_multipart_upload_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#commit_multipart_upload') 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

#copy_object(namespace_name, bucket_name, copy_object_details, opts = {}) ⇒ Response

Note:

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

Creates a request to copy an object within a region or to another region.

See Object Names for object naming requirements.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • copy_object_details (OCI::ObjectStorage::Models::CopyObjectDetails)

    The source and destination of the object to be copied.

  • 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_client_request_id (String)

    The client request ID for tracing.

  • :opc_sse_customer_algorithm (String)

    The optional header that specifies "AES256" as the encryption algorithm. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_customer_key (String)

    The optional header that specifies the base64-encoded 256-bit encryption key to use to encrypt or decrypt the data. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_customer_key_sha256 (String)

    The optional header that specifies the base64-encoded SHA256 hash of the encryption key. This value is used to check the integrity of the encryption key. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_source_sse_customer_algorithm (String)

    The optional header that specifies "AES256" as the encryption algorithm to use to decrypt the source object. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_source_sse_customer_key (String)

    The optional header that specifies the base64-encoded 256-bit encryption key to use to decrypt the source object. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_source_sse_customer_key_sha256 (String)

    The optional header that specifies the base64-encoded SHA256 hash of the encryption key used to decrypt the source object. This value is used to check the integrity of the encryption key. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_kms_key_id (String)

    The OCID of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/oci/object_storage/object_storage_client.rb', line 347

def copy_object(namespace_name, bucket_name, copy_object_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#copy_object.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/actions/copyObject'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  header_params[:'opc-sse-customer-algorithm'] = opts[:opc_sse_customer_algorithm] if opts[:opc_sse_customer_algorithm]
  header_params[:'opc-sse-customer-key'] = opts[:opc_sse_customer_key] if opts[:opc_sse_customer_key]
  header_params[:'opc-sse-customer-key-sha256'] = opts[:opc_sse_customer_key_sha256] if opts[:opc_sse_customer_key_sha256]
  header_params[:'opc-source-sse-customer-algorithm'] = opts[:opc_source_sse_customer_algorithm] if opts[:opc_source_sse_customer_algorithm]
  header_params[:'opc-source-sse-customer-key'] = opts[:opc_source_sse_customer_key] if opts[:opc_source_sse_customer_key]
  header_params[:'opc-source-sse-customer-key-sha256'] = opts[:opc_source_sse_customer_key_sha256] if opts[:opc_source_sse_customer_key_sha256]
  header_params[:'opc-sse-kms-key-id'] = opts[:opc_sse_kms_key_id] if opts[:opc_sse_kms_key_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(copy_object_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#copy_object') 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_bucket(namespace_name, create_bucket_details, opts = {}) ⇒ Response

Note:

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

Creates a bucket in the given namespace with a bucket name and optional user-defined metadata. Avoid entering confidential information in bucket names.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • create_bucket_details (OCI::ObjectStorage::Models::CreateBucketDetails)

    Request object for creating a bucket.

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

413
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
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/oci/object_storage/object_storage_client.rb', line 413

def create_bucket(namespace_name, create_bucket_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#create_bucket.' if logger

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

  path = '/n/{namespaceName}/b/'.sub('{namespaceName}', namespace_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(create_bucket_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#create_bucket') 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::ObjectStorage::Models::Bucket'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_multipart_upload(namespace_name, bucket_name, create_multipart_upload_details, opts = {}) ⇒ Response

Note:

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

Starts a new multipart upload to a specific object in the given bucket in the given namespace.

See Object Names for object naming requirements.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • create_multipart_upload_details (OCI::ObjectStorage::Models::CreateMultipartUploadDetails)

    Request object for creating a multipart upload.

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

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :if_none_match (String)

    The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the resource already exists.

  • :opc_client_request_id (String)

    The client request ID for tracing.

  • :opc_sse_customer_algorithm (String)

    The optional header that specifies "AES256" as the encryption algorithm. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_customer_key (String)

    The optional header that specifies the base64-encoded 256-bit encryption key to use to encrypt or decrypt the data. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_customer_key_sha256 (String)

    The optional header that specifies the base64-encoded SHA256 hash of the encryption key. This value is used to check the integrity of the encryption key. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_kms_key_id (String)

    The OCID of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key.

  • :opc_checksum_algorithm (String)

    The optional checksum algorithm to use to compute and store the checksum of the body of the HTTP request (or the parts in case of multipart uploads), in addition to the default MD5 checksum.

Returns:

[View source]

500
501
502
503
504
505
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
543
544
545
546
547
548
549
550
# File 'lib/oci/object_storage/object_storage_client.rb', line 500

def create_multipart_upload(namespace_name, bucket_name, create_multipart_upload_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#create_multipart_upload.' if logger

  raise "Missing the required parameter 'namespace_name' when calling create_multipart_upload." if namespace_name.nil?
  raise "Missing the required parameter 'bucket_name' when calling create_multipart_upload." if bucket_name.nil?
  raise "Missing the required parameter 'create_multipart_upload_details' when calling create_multipart_upload." if create_multipart_upload_details.nil?

  if opts[:opc_checksum_algorithm] && !OCI::ObjectStorage::Models::CHECKSUM_ALGORITHM_ENUM.include?(opts[:opc_checksum_algorithm])
    raise 'Invalid value for "opc_checksum_algorithm", must be one of the values in OCI::ObjectStorage::Models::CHECKSUM_ALGORITHM_ENUM.'
  end
  raise "Parameter value for 'namespace_name' must not be blank" if OCI::Internal::Util.blank_string?(namespace_name)
  raise "Parameter value for 'bucket_name' must not be blank" if OCI::Internal::Util.blank_string?(bucket_name)

  path = '/n/{namespaceName}/b/{bucketName}/u'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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[:'if-none-match'] = opts[:if_none_match] if opts[:if_none_match]
  header_params[:'opc-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  header_params[:'opc-sse-customer-algorithm'] = opts[:opc_sse_customer_algorithm] if opts[:opc_sse_customer_algorithm]
  header_params[:'opc-sse-customer-key'] = opts[:opc_sse_customer_key] if opts[:opc_sse_customer_key]
  header_params[:'opc-sse-customer-key-sha256'] = opts[:opc_sse_customer_key_sha256] if opts[:opc_sse_customer_key_sha256]
  header_params[:'opc-sse-kms-key-id'] = opts[:opc_sse_kms_key_id] if opts[:opc_sse_kms_key_id]
  header_params[:'opc-checksum-algorithm'] = opts[:opc_checksum_algorithm] if opts[:opc_checksum_algorithm]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(create_multipart_upload_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#create_multipart_upload') 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::ObjectStorage::Models::MultipartUpload'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_preauthenticated_request(namespace_name, bucket_name, create_preauthenticated_request_details, opts = {}) ⇒ Response

Note:

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

Creates a pre-authenticated request specific to the bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • create_preauthenticated_request_details (OCI::ObjectStorage::Models::CreatePreauthenticatedRequestDetails)

    Information needed to create the pre-authenticated 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_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

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
# File 'lib/oci/object_storage/object_storage_client.rb', line 573

def create_preauthenticated_request(namespace_name, bucket_name, create_preauthenticated_request_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#create_preauthenticated_request.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/p/'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(create_preauthenticated_request_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#create_preauthenticated_request') 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::ObjectStorage::Models::PreauthenticatedRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_private_endpoint(namespace_name, create_private_endpoint_details, opts = {}) ⇒ Response

Note:

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

Create a PrivateEndpoint.

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_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

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
# File 'lib/oci/object_storage/object_storage_client.rb', line 632

def create_private_endpoint(namespace_name, create_private_endpoint_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#create_private_endpoint.' if logger

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

  path = '/n/{namespaceName}/pe/'.sub('{namespaceName}', namespace_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(create_private_endpoint_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#create_private_endpoint') 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_replication_policy(namespace_name, bucket_name, create_replication_policy_details, opts = {}) ⇒ Response

Note:

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

Creates a replication policy for the specified bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • create_replication_policy_details (OCI::ObjectStorage::Models::CreateReplicationPolicyDetails)

    The replication policy.

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
# File 'lib/oci/object_storage/object_storage_client.rb', line 691

def create_replication_policy(namespace_name, bucket_name, create_replication_policy_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#create_replication_policy.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/replicationPolicies'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(create_replication_policy_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#create_replication_policy') 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::ObjectStorage::Models::ReplicationPolicy'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_retention_rule(namespace_name, bucket_name, create_retention_rule_details, opts = {}) ⇒ Response

Note:

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

Creates a new retention rule in the specified bucket. The new rule will take effect typically within 30 seconds. Note that a maximum of 100 rules are supported on a bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • create_retention_rule_details (OCI::ObjectStorage::Models::CreateRetentionRuleDetails)

    The retention rule to create for the bucket.

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

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
792
793
# File 'lib/oci/object_storage/object_storage_client.rb', line 754

def create_retention_rule(namespace_name, bucket_name, create_retention_rule_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#create_retention_rule.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/retentionRules'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(create_retention_rule_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#create_retention_rule') 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::ObjectStorage::Models::RetentionRule'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_bucket(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

Deletes a bucket if the bucket is already empty. If the bucket is not empty, use delete_object first. In addition, you cannot delete a bucket that has a multipart upload in progress or a pre-authenticated request associated with that bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

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

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

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
# File 'lib/oci/object_storage/object_storage_client.rb', line 822

def delete_bucket(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#delete_bucket.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#delete_bucket') 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_object(namespace_name, bucket_name, object_name, opts = {}) ⇒ Response

Note:

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

Deletes an object.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • object_name (String)

    The name of the object. Avoid entering confidential information. Example: test/object1.log

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

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :opc_client_request_id (String)

    The client request ID for tracing.

  • :version_id (String)

    VersionId used to identify a particular version of the object

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

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
931
# File 'lib/oci/object_storage/object_storage_client.rb', line 890

def delete_object(namespace_name, bucket_name, object_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#delete_object.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/o/{objectName}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:versionId] = opts[:version_id] if opts[:version_id]

  # 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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#delete_object') 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_object_lifecycle_policy(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

Deletes the object lifecycle policy for the bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • 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_client_request_id (String)

    The client request ID for tracing.

  • :if_match (String)

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

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
994
995
# File 'lib/oci/object_storage/object_storage_client.rb', line 957

def delete_object_lifecycle_policy(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#delete_object_lifecycle_policy.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/l'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_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: 'ObjectStorageClient#delete_object_lifecycle_policy') 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_preauthenticated_request(namespace_name, bucket_name, par_id, opts = {}) ⇒ Response

Note:

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

Deletes the pre-authenticated request for the bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • par_id (String)

    The unique identifier for the pre-authenticated request. This can be used to manage operations against the pre-authenticated request, such as GET or DELETE.

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
# File 'lib/oci/object_storage/object_storage_client.rb', line 1019

def delete_preauthenticated_request(namespace_name, bucket_name, par_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#delete_preauthenticated_request.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/p/{parId}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{parId}', par_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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#delete_preauthenticated_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

#delete_private_endpoint(namespace_name, pe_name, opts = {}) ⇒ Response

Note:

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

Deletes a Private Endpoint if it exists in the given namespace.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • pe_name (String)

    The name of the private endpoint. Avoid entering confidential information. Example: my-new-pe-1

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

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

1084
1085
1086
1087
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
1116
1117
1118
1119
1120
1121
1122
# File 'lib/oci/object_storage/object_storage_client.rb', line 1084

def delete_private_endpoint(namespace_name, pe_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#delete_private_endpoint.' if logger

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

  path = '/n/{namespaceName}/pe/{peName}/'.sub('{namespaceName}', namespace_name.to_s).sub('{peName}', pe_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#delete_private_endpoint') 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_replication_policy(namespace_name, bucket_name, replication_id, opts = {}) ⇒ Response

Note:

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

Deletes the replication policy associated with the source bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • replication_id (String)

    The ID of the replication policy.

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
# File 'lib/oci/object_storage/object_storage_client.rb', line 1145

def delete_replication_policy(namespace_name, bucket_name, replication_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#delete_replication_policy.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/replicationPolicies/{replicationId}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{replicationId}', replication_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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#delete_replication_policy') 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_retention_rule(namespace_name, bucket_name, retention_rule_id, opts = {}) ⇒ Response

Note:

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

Deletes the specified rule. The deletion takes effect typically within 30 seconds.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • retention_rule_id (String)

    The ID of the retention rule.

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

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
# File 'lib/oci/object_storage/object_storage_client.rb', line 1210

def delete_retention_rule(namespace_name, bucket_name, retention_rule_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#delete_retention_rule.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/retentionRules/{retentionRuleId}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{retentionRuleId}', retention_rule_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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#delete_retention_rule') 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_bucket(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

Gets the current representation of the given bucket in the given Object Storage namespace.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

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

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :if_none_match (String)

    The entity tag (ETag) to avoid matching. Wildcards ('*') are not allowed. If the specified ETag does not match the ETag of the existing resource, the request returns the expected response. If the ETag matches the ETag of the existing resource, the request returns an HTTP 304 status without a response body.

  • :opc_client_request_id (String)

    The client request ID for tracing.

  • :fields (Array<String>)

    Bucket summary includes the 'namespace', 'name', 'compartmentId', 'createdBy', 'timeCreated', and 'etag' fields. This parameter can also include 'approximateCount' (approximate number of objects), 'approximateSize' (total approximate size in bytes of all objects) and 'autoTiering' (state of auto tiering on the bucket). For example 'approximateCount,approximateSize,autoTiering'.

    Allowed values are: approximateCount, approximateSize, autoTiering

Returns:

[View source]

1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
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
# File 'lib/oci/object_storage/object_storage_client.rb', line 1286

def get_bucket(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#get_bucket.' if logger

  raise "Missing the required parameter 'namespace_name' when calling get_bucket." if namespace_name.nil?
  raise "Missing the required parameter 'bucket_name' when calling get_bucket." if bucket_name.nil?


  fields_allowable_values = %w[approximateCount approximateSize autoTiering]
  if opts[:fields] && !opts[:fields].empty?
    opts[:fields].each do |val_to_check|
      unless fields_allowable_values.include?(val_to_check)
        raise 'Invalid value for "fields", must be one of approximateCount, approximateSize, autoTiering.'
      end
    end
  end
  raise "Parameter value for 'namespace_name' must not be blank" if OCI::Internal::Util.blank_string?(namespace_name)
  raise "Parameter value for 'bucket_name' must not be blank" if OCI::Internal::Util.blank_string?(bucket_name)

  path = '/n/{namespaceName}/b/{bucketName}/'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:fields] = OCI::ApiClient.build_collection_params(opts[:fields], :csv) if opts[:fields] && !opts[:fields].empty?

  # 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[:'if-none-match'] = opts[:if_none_match] if opts[:if_none_match]
  header_params[:'opc-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#get_bucket') 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::ObjectStorage::Models::Bucket'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_namespace(opts = {}) ⇒ Response

Note:

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

Each Oracle Cloud Infrastructure tenant is assigned one unique and uneditable Object Storage namespace. The namespace is a system-generated string assigned during account creation. For some older tenancies, the namespace string may be the tenancy name in all lower-case letters. You cannot edit a namespace.

GetNamespace returns the name of the Object Storage namespace for the user making the request. If an optional compartmentId query parameter is provided, GetNamespace returns the namespace name of the corresponding tenancy, provided the user has access to it.

Parameters:

  • 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_client_request_id (String)

    The client request ID for tracing.

  • :compartment_id (String)

    This is an optional field representing either the tenancy OCID or the compartment OCID within the tenancy whose Object Storage namespace is to be retrieved.

Returns:

  • (Response)

    A Response object with data of type String

[View source]

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
1397
1398
1399
# File 'lib/oci/object_storage/object_storage_client.rb', line 1364

def get_namespace(opts = {})
  logger.debug 'Calling operation ObjectStorageClient#get_namespace.' if logger


  path = '/n/'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id]

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#get_namespace') 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: 'String'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_namespace_metadata(namespace_name, opts = {}) ⇒ Response

Note:

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

Gets the metadata for the Object Storage namespace, which contains defaultS3CompartmentId and defaultSwiftCompartmentId.

Any user with the OBJECTSTORAGE_NAMESPACE_READ permission will be able to see the current metadata. If you are not authorized, talk to an administrator. If you are an administrator who needs to write policies to give users access, see Getting Started with Policies.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the 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_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

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
1455
1456
1457
1458
1459
1460
# File 'lib/oci/object_storage/object_storage_client.rb', line 1424

def (namespace_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#get_namespace_metadata.' if logger

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

  path = '/n/{namespaceName}'.sub('{namespaceName}', namespace_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#get_namespace_metadata') 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::ObjectStorage::Models::NamespaceMetadata'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_object(namespace_name, bucket_name, object_name, opts = {}, &block) ⇒ Response

Note:

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

Gets the metadata and body of an object.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • object_name (String)

    The name of the object. Avoid entering confidential information. Example: test/object1.log

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

    the optional parameters

  • [Block] (Hash)

    a customizable set of options

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

  • :version_id (String)

    VersionId used to identify a particular version of the object

  • :if_match (String)

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :if_none_match (String)

    The entity tag (ETag) to avoid matching. Wildcards ('*') are not allowed. If the specified ETag does not match the ETag of the existing resource, the request returns the expected response. If the ETag matches the ETag of the existing resource, the request returns an HTTP 304 status without a response body.

  • :opc_client_request_id (String)

    The client request ID for tracing.

  • :range (String)

    Optional byte range to fetch, as described in RFC 7233. Note that only a single range of bytes is supported.

  • :opc_sse_customer_algorithm (String)

    The optional header that specifies "AES256" as the encryption algorithm. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_customer_key (String)

    The optional header that specifies the base64-encoded 256-bit encryption key to use to encrypt or decrypt the data. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_customer_key_sha256 (String)

    The optional header that specifies the base64-encoded SHA256 hash of the encryption key. This value is used to check the integrity of the encryption key. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :http_response_content_disposition (String)

    Specify this query parameter to override the value of the Content-Disposition response header in the GetObject response.

  • :http_response_cache_control (String)

    Specify this query parameter to override the Cache-Control response header in the GetObject response.

  • :http_response_content_type (String)

    Specify this query parameter to override the Content-Type response header in the GetObject response.

  • :http_response_content_language (String)

    Specify this query parameter to override the Content-Language response header in the GetObject response.

  • :http_response_content_encoding (String)

    Specify this query parameter to override the Content-Encoding response header in the GetObject response.

  • :http_response_expires (String)

    Specify this query parameter to override the Expires response header in the GetObject response.

  • :response_target (String, IO)

    Streaming http body into a file (specified by file name or File object) or IO object if the block is not given

Returns:

  • (Response)

    A Response object with data of type String if response_target and block are not given, otherwise with nil data

[View source]

1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
# File 'lib/oci/object_storage/object_storage_client.rb', line 1516

def get_object(namespace_name, bucket_name, object_name, opts = {}, &block)
  logger.debug 'Calling operation ObjectStorageClient#get_object.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/o/{objectName}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:versionId] = opts[:version_id] if opts[:version_id]
  query_params[:httpResponseContentDisposition] = opts[:http_response_content_disposition] if opts[:http_response_content_disposition]
  query_params[:httpResponseCacheControl] = opts[:http_response_cache_control] if opts[:http_response_cache_control]
  query_params[:httpResponseContentType] = opts[:http_response_content_type] if opts[:http_response_content_type]
  query_params[:httpResponseContentLanguage] = opts[:http_response_content_language] if opts[:http_response_content_language]
  query_params[:httpResponseContentEncoding] = opts[:http_response_content_encoding] if opts[:http_response_content_encoding]
  query_params[:httpResponseExpires] = opts[:http_response_expires] if opts[:http_response_expires]

  # Header Params
  header_params = {}
  header_params[:accept] = opts[:accept] if opts[:accept]
  header_params[:accept] ||= 'application/json'
  header_params[:'accept-encoding'] = opts[:accept_encoding] if opts[:accept_encoding]
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'if-none-match'] = opts[:if_none_match] if opts[:if_none_match]
  header_params[:'opc-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  header_params[:range] = opts[:range] if opts[:range]
  header_params[:'opc-sse-customer-algorithm'] = opts[:opc_sse_customer_algorithm] if opts[:opc_sse_customer_algorithm]
  header_params[:'opc-sse-customer-key'] = opts[:opc_sse_customer_key] if opts[:opc_sse_customer_key]
  header_params[:'opc-sse-customer-key-sha256'] = opts[:opc_sse_customer_key_sha256] if opts[:opc_sse_customer_key_sha256]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#get_object') do
    if !block.nil?
      @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: 'Stream',
        &block
      )
    elsif opts[:response_target]
      if opts[:response_target].respond_to? :write
        @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: 'Stream',
          &proc { |chunk, _response| opts[:response_target].write(chunk) }
        )
      elsif opts[:response_target].is_a?(String)
        File.open(opts[:response_target], 'wb') do |output|
          return @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: 'Stream',
            &proc { |chunk, _response| output.write(chunk) }
          )
        end
      end
    else
      @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: 'String'
      )
    end
  end
  # rubocop:enable Metrics/BlockLength
end

#get_object_lifecycle_policy(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

Gets the object lifecycle policy for the bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
# File 'lib/oci/object_storage/object_storage_client.rb', line 1635

def get_object_lifecycle_policy(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#get_object_lifecycle_policy.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/l'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#get_object_lifecycle_policy') 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::ObjectStorage::Models::ObjectLifecyclePolicy'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_preauthenticated_request(namespace_name, bucket_name, par_id, opts = {}) ⇒ Response

Note:

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

Gets the pre-authenticated request for the bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • par_id (String)

    The unique identifier for the pre-authenticated request. This can be used to manage operations against the pre-authenticated request, such as GET or DELETE.

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
# File 'lib/oci/object_storage/object_storage_client.rb', line 1697

def get_preauthenticated_request(namespace_name, bucket_name, par_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#get_preauthenticated_request.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/p/{parId}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{parId}', par_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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#get_preauthenticated_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::ObjectStorage::Models::PreauthenticatedRequestSummary'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_private_endpoint(namespace_name, pe_name, opts = {}) ⇒ Response

Note:

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

Gets the current representation of the given Private Endpoint in the given Object Storage namespace.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • pe_name (String)

    The name of the private endpoint. Avoid entering confidential information. Example: my-new-pe-1

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

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :if_none_match (String)

    The entity tag (ETag) to avoid matching. Wildcards ('*') are not allowed. If the specified ETag does not match the ETag of the existing resource, the request returns the expected response. If the ETag matches the ETag of the existing resource, the request returns an HTTP 304 status without a response body.

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
# File 'lib/oci/object_storage/object_storage_client.rb', line 1767

def get_private_endpoint(namespace_name, pe_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#get_private_endpoint.' if logger

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

  path = '/n/{namespaceName}/pe/{peName}/'.sub('{namespaceName}', namespace_name.to_s).sub('{peName}', pe_name.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[:'if-none-match'] = opts[:if_none_match] if opts[:if_none_match]
  header_params[:'opc-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#get_private_endpoint') 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::ObjectStorage::Models::PrivateEndpoint'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_replication_policy(namespace_name, bucket_name, replication_id, opts = {}) ⇒ Response

Note:

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

Get the replication policy.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • replication_id (String)

    The ID of the replication policy.

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

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

def get_replication_policy(namespace_name, bucket_name, replication_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#get_replication_policy.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/replicationPolicies/{replicationId}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{replicationId}', replication_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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#get_replication_policy') 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::ObjectStorage::Models::ReplicationPolicy'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_retention_rule(namespace_name, bucket_name, retention_rule_id, opts = {}) ⇒ Response

Note:

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

Get the specified retention rule.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • retention_rule_id (String)

    The ID of the retention rule.

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
# File 'lib/oci/object_storage/object_storage_client.rb', line 1892

def get_retention_rule(namespace_name, bucket_name, retention_rule_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#get_retention_rule.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/retentionRules/{retentionRuleId}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{retentionRuleId}', retention_rule_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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#get_retention_rule') 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::ObjectStorage::Models::RetentionRule'
    )
  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 for 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_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
# File 'lib/oci/object_storage/object_storage_client.rb', line 1950

def get_work_request(work_request_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#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::ObjectStorage::Models::WorkRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#head_bucket(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

Efficiently checks to see if a bucket exists and gets the current entity tag (ETag) for the bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

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

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :if_none_match (String)

    The entity tag (ETag) to avoid matching. Wildcards ('*') are not allowed. If the specified ETag does not match the ETag of the existing resource, the request returns the expected response. If the ETag matches the ETag of the existing resource, the request returns an HTTP 304 status without a response body.

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
# File 'lib/oci/object_storage/object_storage_client.rb', line 2016

def head_bucket(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#head_bucket.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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[:'if-none-match'] = opts[:if_none_match] if opts[:if_none_match]
  header_params[:'opc-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#head_bucket') do
    @api_client.call_api(
      :HEAD,
      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

#head_object(namespace_name, bucket_name, object_name, opts = {}) ⇒ Response

Note:

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

Gets the user-defined metadata and entity tag (ETag) for an object.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • object_name (String)

    The name of the object. Avoid entering confidential information. Example: test/object1.log

  • 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

  • :version_id (String)

    VersionId used to identify a particular version of the object

  • :if_match (String)

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :if_none_match (String)

    The entity tag (ETag) to avoid matching. Wildcards ('*') are not allowed. If the specified ETag does not match the ETag of the existing resource, the request returns the expected response. If the ETag matches the ETag of the existing resource, the request returns an HTTP 304 status without a response body.

  • :opc_client_request_id (String)

    The client request ID for tracing.

  • :opc_sse_customer_algorithm (String)

    The optional header that specifies "AES256" as the encryption algorithm. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_customer_key (String)

    The optional header that specifies the base64-encoded 256-bit encryption key to use to encrypt or decrypt the data. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_customer_key_sha256 (String)

    The optional header that specifies the base64-encoded SHA256 hash of the encryption key. This value is used to check the integrity of the encryption key. For more information, see Using Your Own Keys for Server-Side Encryption.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
# File 'lib/oci/object_storage/object_storage_client.rb', line 2100

def head_object(namespace_name, bucket_name, object_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#head_object.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/o/{objectName}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:versionId] = opts[:version_id] if opts[:version_id]

  # 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[:'if-none-match'] = opts[:if_none_match] if opts[:if_none_match]
  header_params[:'opc-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  header_params[:'opc-sse-customer-algorithm'] = opts[:opc_sse_customer_algorithm] if opts[:opc_sse_customer_algorithm]
  header_params[:'opc-sse-customer-key'] = opts[:opc_sse_customer_key] if opts[:opc_sse_customer_key]
  header_params[:'opc-sse-customer-key-sha256'] = opts[:opc_sse_customer_key_sha256] if opts[:opc_sse_customer_key_sha256]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#head_object') do
    @api_client.call_api(
      :HEAD,
      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

#list_buckets(namespace_name, compartment_id, opts = {}) ⇒ Response

Note:

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

Gets a list of all BucketSummary items in a compartment. A BucketSummary contains only summary fields for the bucket and does not contain fields like the user-defined metadata.

ListBuckets returns a BucketSummary containing at most 1000 buckets. To paginate through more buckets, use the returned opc-next-page value with the page request parameter.

To use this and other API operations, you must be authorized in an IAM policy. If you are not authorized, talk to an administrator. If you are an administrator who needs to write policies to give users access, see Getting Started with Policies.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • compartment_id (String)

    The ID of the compartment in which to list buckets.

  • 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

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :fields (Array<String>)

    Bucket summary in list of buckets includes the 'namespace', 'name', 'compartmentId', 'createdBy', 'timeCreated', and 'etag' fields. This parameter can also include 'tags' (freeformTags and definedTags). The only supported value of this parameter is 'tags' for now. Example 'tags'.

    Allowed values are: tags

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
# File 'lib/oci/object_storage/object_storage_client.rb', line 2184

def list_buckets(namespace_name, compartment_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#list_buckets.' if logger

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


  fields_allowable_values = %w[tags]
  if opts[:fields] && !opts[:fields].empty?
    opts[:fields].each do |val_to_check|
      unless fields_allowable_values.include?(val_to_check)
        raise 'Invalid value for "fields", must be one of tags.'
      end
    end
  end
  raise "Parameter value for 'namespace_name' must not be blank" if OCI::Internal::Util.blank_string?(namespace_name)

  path = '/n/{namespaceName}/b/'.sub('{namespaceName}', namespace_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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[:fields] = OCI::ApiClient.build_collection_params(opts[:fields], :csv) if opts[:fields] && !opts[:fields].empty?

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#list_buckets') 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: 'Array<OCI::ObjectStorage::Models::BucketSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_multipart_upload_parts(namespace_name, bucket_name, object_name, upload_id, opts = {}) ⇒ Response

Note:

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

Lists the parts of an in-progress multipart upload.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • object_name (String)

    The name of the object. Avoid entering confidential information. Example: test/object1.log

  • upload_id (String)

    The upload ID for a multipart upload.

  • 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

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
# File 'lib/oci/object_storage/object_storage_client.rb', line 2268

def list_multipart_upload_parts(namespace_name, bucket_name, object_name, upload_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#list_multipart_upload_parts.' if logger

  raise "Missing the required parameter 'namespace_name' when calling list_multipart_upload_parts." if namespace_name.nil?
  raise "Missing the required parameter 'bucket_name' when calling list_multipart_upload_parts." if bucket_name.nil?
  raise "Missing the required parameter 'object_name' when calling list_multipart_upload_parts." if object_name.nil?
  raise "Missing the required parameter 'upload_id' when calling list_multipart_upload_parts." if upload_id.nil?
  raise "Parameter value for 'namespace_name' must not be blank" if OCI::Internal::Util.blank_string?(namespace_name)
  raise "Parameter value for 'bucket_name' must not be blank" if OCI::Internal::Util.blank_string?(bucket_name)
  raise "Parameter value for 'object_name' must not be blank" if OCI::Internal::Util.blank_string?(object_name)

  path = '/n/{namespaceName}/b/{bucketName}/u/{objectName}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:uploadId] = upload_id
  query_params[:limit] = opts[:limit] if opts[:limit]
  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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#list_multipart_upload_parts') 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: 'Array<OCI::ObjectStorage::Models::MultipartUploadPartSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_multipart_uploads(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

Lists all of the in-progress multipart uploads for the given bucket in the given Object Storage namespace.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • 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

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

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

def list_multipart_uploads(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#list_multipart_uploads.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/u'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#list_multipart_uploads') 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: 'Array<OCI::ObjectStorage::Models::MultipartUpload>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_object_versions(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

Lists the object versions in a bucket.

ListObjectVersions returns an ObjectVersionCollection containing at most 1000 object versions. To paginate through more object versions, use the returned opc-next-page value with the page request parameter.

To use this and other API operations, you must be authorized in an IAM policy. If you are not authorized, talk to an administrator. If you are an administrator who needs to write policies to give users access, see Getting Started with Policies.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • 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

  • :prefix (String)

    The string to use for matching against the start of object names in a list query.

  • :start (String)

    Returns object names which are lexicographically greater than or equal to this parameter.

  • :_end (String)

    Returns object names which are lexicographically strictly less than this parameter.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

  • :delimiter (String)

    When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are returned in the objects key of the response body. Scanned objects whose names contain the delimiter have the part of their name up to the first occurrence of the delimiter (including the optional prefix) returned as a set of prefixes. Note that only '/' is a supported delimiter character at this time.

  • :fields (String)

    Object summary by default includes only the 'name' field. Use this parameter to also include 'size' (object size in bytes), 'etag', 'md5', 'timeCreated' (object creation date and time), 'timeModified' (object modification date and time), 'storageTier' and 'archivalState' fields. Specify the value of this parameter as a comma-separated, case-insensitive list of those field names. For example 'name,etag,timeCreated,md5,timeModified,storageTier,archivalState'.

    Allowed values are: name, size, etag, timeCreated, md5, timeModified, storageTier, archivalState

  • :opc_client_request_id (String)

    The client request ID for tracing.

  • :start_after (String)

    Returns object names which are lexicographically strictly greater than this parameter.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

Returns:

[View source]

2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
# File 'lib/oci/object_storage/object_storage_client.rb', line 2434

def list_object_versions(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#list_object_versions.' if logger

  raise "Missing the required parameter 'namespace_name' when calling list_object_versions." if namespace_name.nil?
  raise "Missing the required parameter 'bucket_name' when calling list_object_versions." if bucket_name.nil?

  if opts[:fields] && !%w[name size etag timeCreated md5 timeModified storageTier archivalState].include?(opts[:fields])
    raise 'Invalid value for "fields", must be one of name, size, etag, timeCreated, md5, timeModified, storageTier, archivalState.'
  end
  raise "Parameter value for 'namespace_name' must not be blank" if OCI::Internal::Util.blank_string?(namespace_name)
  raise "Parameter value for 'bucket_name' must not be blank" if OCI::Internal::Util.blank_string?(bucket_name)

  path = '/n/{namespaceName}/b/{bucketName}/objectversions'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:prefix] = opts[:prefix] if opts[:prefix]
  query_params[:start] = opts[:start] if opts[:start]
  query_params[:end] = opts[:_end] if opts[:_end]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:delimiter] = opts[:delimiter] if opts[:delimiter]
  query_params[:fields] = opts[:fields] if opts[:fields]
  query_params[:startAfter] = opts[:start_after] if opts[:start_after]
  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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#list_object_versions') 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::ObjectStorage::Models::ObjectVersionCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_objects(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

Lists the objects in a bucket. By default, ListObjects returns object names only. See the fields parameter for other fields that you can optionally include in ListObjects response.

ListObjects returns at most 1000 objects. To paginate through more objects, use the returned 'nextStartWith' value with the 'start' parameter. To filter which objects ListObjects returns, use the 'start' and 'end' parameters.

To use this and other API operations, you must be authorized in an IAM policy. If you are not authorized, talk to an administrator. If you are an administrator who needs to write policies to give users access, see Getting Started with Policies.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • 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

  • :prefix (String)

    The string to use for matching against the start of object names in a list query.

  • :start (String)

    Returns object names which are lexicographically greater than or equal to this parameter.

  • :_end (String)

    Returns object names which are lexicographically strictly less than this parameter.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

  • :delimiter (String)

    When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are returned in the objects key of the response body. Scanned objects whose names contain the delimiter have the part of their name up to the first occurrence of the delimiter (including the optional prefix) returned as a set of prefixes. Note that only '/' is a supported delimiter character at this time.

  • :fields (String)

    Object summary by default includes only the 'name' field. Use this parameter to also include 'size' (object size in bytes), 'etag', 'md5', 'timeCreated' (object creation date and time), 'timeModified' (object modification date and time), 'storageTier' and 'archivalState' fields. Specify the value of this parameter as a comma-separated, case-insensitive list of those field names. For example 'name,etag,timeCreated,md5,timeModified,storageTier,archivalState'.

  • :opc_client_request_id (String)

    The client request ID for tracing.

  • :start_after (String)

    Returns object names which are lexicographically strictly greater than this parameter.

Returns:

[View source]

2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
# File 'lib/oci/object_storage/object_storage_client.rb', line 2535

def list_objects(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#list_objects.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/o'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:prefix] = opts[:prefix] if opts[:prefix]
  query_params[:start] = opts[:start] if opts[:start]
  query_params[:end] = opts[:_end] if opts[:_end]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:delimiter] = opts[:delimiter] if opts[:delimiter]
  query_params[:fields] = opts[:fields] if opts[:fields]
  query_params[:startAfter] = opts[:start_after] if opts[:start_after]

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#list_objects') 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::ObjectStorage::Models::ListObjects'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_preauthenticated_requests(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

Lists pre-authenticated requests for the bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • 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

  • :object_name_prefix (String)

    User-specified object name prefixes can be used to query and return a list of pre-authenticated requests.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
# File 'lib/oci/object_storage/object_storage_client.rb', line 2610

def list_preauthenticated_requests(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#list_preauthenticated_requests.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/p/'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:objectNamePrefix] = opts[:object_name_prefix] if opts[:object_name_prefix]
  query_params[:limit] = opts[:limit] if opts[:limit]
  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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#list_preauthenticated_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: 'Array<OCI::ObjectStorage::Models::PreauthenticatedRequestSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_private_endpoints(namespace_name, compartment_id, opts = {}) ⇒ Response

Note:

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

Gets a list of all PrivateEndpointSummary in a compartment associated with a namespace. To use this and other API operations, you must be authorized in an IAM policy. If you are not authorized, talk to an administrator. If you are an administrator who needs to write policies to give users access, see Getting Started with Policies.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • compartment_id (String)

    The ID of the compartment in which to list buckets.

  • 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

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :fields (Array<String>)

    PrivateEndpoint summary in list of PrivateEndpoints includes the 'namespace', 'name', 'compartmentId', 'createdBy', 'timeCreated', 'timeModified' and 'etag' fields. This parameter can also include 'tags' (freeformTags and definedTags). The only supported value of this parameter is 'tags' for now. Example 'tags'.

    Allowed values are: tags

  • :opc_client_request_id (String)

    The client request ID for tracing.

  • :lifecycle_state (String)

    The lifecycle state of the Private Endpoint

Returns:

[View source]

2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
# File 'lib/oci/object_storage/object_storage_client.rb', line 2688

def list_private_endpoints(namespace_name, compartment_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#list_private_endpoints.' if logger

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


  fields_allowable_values = %w[tags]
  if opts[:fields] && !opts[:fields].empty?
    opts[:fields].each do |val_to_check|
      unless fields_allowable_values.include?(val_to_check)
        raise 'Invalid value for "fields", must be one of tags.'
      end
    end
  end

  if opts[:lifecycle_state] && !OCI::ObjectStorage::Models::PrivateEndpoint::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::ObjectStorage::Models::PrivateEndpoint::LIFECYCLE_STATE_ENUM.'
  end
  raise "Parameter value for 'namespace_name' must not be blank" if OCI::Internal::Util.blank_string?(namespace_name)

  path = '/n/{namespaceName}/pe/'.sub('{namespaceName}', namespace_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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[:fields] = OCI::ApiClient.build_collection_params(opts[:fields], :csv) if opts[:fields] && !opts[:fields].empty?
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#list_private_endpoints') 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: 'Array<OCI::ObjectStorage::Models::PrivateEndpointSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_replication_policies(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

List the replication policies associated with a bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • 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_client_request_id (String)

    The client request ID for tracing.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination. (default to 100)

Returns:

[View source]

2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
# File 'lib/oci/object_storage/object_storage_client.rb', line 2773

def list_replication_policies(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#list_replication_policies.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/replicationPolicies'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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]

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#list_replication_policies') 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: 'Array<OCI::ObjectStorage::Models::ReplicationPolicySummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_replication_sources(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

List the replication sources of a destination bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • 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_client_request_id (String)

    The client request ID for tracing.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination. (default to 100)

Returns:

[View source]

2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
# File 'lib/oci/object_storage/object_storage_client.rb', line 2842

def list_replication_sources(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#list_replication_sources.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/replicationSources'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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]

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#list_replication_sources') 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: 'Array<OCI::ObjectStorage::Models::ReplicationSource>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_retention_rules(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

List the retention rules for a bucket. The retention rules are sorted based on creation time, with the most recently created retention rule returned first.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • 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

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

Returns:

[View source]

2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
# File 'lib/oci/object_storage/object_storage_client.rb', line 2907

def list_retention_rules(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#list_retention_rules.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/retentionRules'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:page] = opts[:page] if opts[:page]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#list_retention_rules') 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::ObjectStorage::Models::RetentionRuleCollection'
    )
  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.

Lists the errors 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

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
# File 'lib/oci/object_storage/object_storage_client.rb', line 2970

def list_work_request_errors(work_request_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#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?
  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]

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#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: 'Array<OCI::ObjectStorage::Models::WorkRequestError>'
    )
  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.

Lists the logs 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

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
# File 'lib/oci/object_storage/object_storage_client.rb', line 3033

def list_work_request_logs(work_request_id, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#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?
  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]

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#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: 'Array<OCI::ObjectStorage::Models::WorkRequestLogEntry>'
    )
  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.

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list buckets.

  • 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

  • :private_endpoint_name (String)

    The name of the privateEndpoint for which to list work requests.

  • :opc_client_request_id (String)

    The client request ID for tracing.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

Returns:

[View source]

3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
# File 'lib/oci/object_storage/object_storage_client.rb', line 3098

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

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

  path = '/workRequests'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:privateEndpointName] = opts[:private_endpoint_name] if opts[:private_endpoint_name]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#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: 'Array<OCI::ObjectStorage::Models::WorkRequestSummary>'
    )
  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.

[View source]

96
97
98
# File 'lib/oci/object_storage/object_storage_client.rb', line 96

def logger
  @api_client.config.logger
end

#make_bucket_writable(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

Stops replication to the destination bucket and removes the replication policy. When the replication policy was created, this destination bucket became read-only except for new and changed objects replicated automatically from the source bucket. MakeBucketWritable removes the replication policy. This bucket is no longer the target for replication and is now writable, allowing users to make changes to bucket contents.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
# File 'lib/oci/object_storage/object_storage_client.rb', line 3162

def make_bucket_writable(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#make_bucket_writable.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/actions/makeBucketWritable'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#make_bucket_writable') 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

#put_object(namespace_name, bucket_name, object_name, put_object_body, opts = {}) ⇒ Response

Note:

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

Creates a new object or overwrites an existing object with the same name. The maximum object size allowed by PutObject is 50 GiB.

See Object Names for object naming requirements.

See Special Instructions for Object Storage PUT for request signature requirements.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • object_name (String)

    The name of the object. Avoid entering confidential information. Example: test/object1.log

  • put_object_body (String, IO)

    The object to upload to the object store.

  • 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

  • :content_length (Integer)

    The content length of the body.

  • :if_match (String)

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :if_none_match (String)

    The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the resource already exists.

  • :opc_client_request_id (String)

    The client request ID for tracing.

  • :expect (String)

    A value of 100-continue requests preliminary verification of the request method, path, and headers before the request body is sent. If no error results from such verification, the server will send a 100 (Continue) interim response to indicate readiness for the request body. The only allowed value for this parameter is "100-Continue" (case-insensitive).

  • :content_md5 (String)

    The optional header that defines the base64-encoded MD5 hash of the body. If the optional Content-MD5 header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the MD5 hash for the body and comparing it to the MD5 hash supplied in the header. If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content MD5 error is returned with the message:

    "The computed MD5 of the request body (ACTUAL_MD5) does not match the Content-MD5 header (HEADER_MD5)"

  • :opc_checksum_algorithm (String)

    The optional checksum algorithm to use to compute and store the checksum of the body of the HTTP request (or the parts in case of multipart uploads), in addition to the default MD5 checksum.

  • :opc_content_crc32c (String)

    Applicable only if CRC32C is specified in the opc-checksum-algorithm request header.

    The optional header that defines the base64-encoded, 32-bit CRC32C (Castagnoli) checksum of the body. If the optional opc-content-crc32c header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the CRC32C checksum for the body and comparing it to the CRC32C checksum supplied in the header. If the two checksums do not match, the object is rejected and an HTTP-400 Unmatched Content CRC32C error is returned with the message:

    "The computed CRC32C of the request body (ACTUAL_CRC32C) does not match the opc-content-crc32c header (HEADER_CRC32C)"

  • :opc_content_sha256 (String)

    Applicable only if SHA256 is specified in the opc-checksum-algorithm request header.

    The optional header that defines the base64-encoded SHA256 hash of the body. If the optional opc-content-sha256 header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the SHA256 hash for the body and comparing it to the SHA256 hash supplied in the header. If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content SHA256 error is returned with the message:

    "The computed SHA256 of the request body (ACTUAL_SHA256) does not match the opc-content-sha256 header (HEADER_SHA256)"

  • :opc_content_sha384 (String)

    Applicable only if SHA384 is specified in the opc-checksum-algorithm request header.

    The optional header that defines the base64-encoded SHA384 hash of the body. If the optional opc-content-sha384 header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the SHA384 hash for the body and comparing it to the SHA384 hash supplied in the header. If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content SHA384 error is returned with the message:

    "The computed SHA384 of the request body (ACTUAL_SHA384) does not match the opc-content-sha384 header (HEADER_SHA384)"

  • :content_type (String)

    The optional Content-Type header that defines the standard MIME type format of the object. Content type defaults to 'application/octet-stream' if not specified in the PutObject call. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify and perform special operations on text only objects.

  • :content_language (String)

    The optional Content-Language header that defines the content language of the object to upload. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify and differentiate objects based on a particular language.

  • :content_encoding (String)

    The optional Content-Encoding header that defines the content encodings that were applied to the object to upload. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to determine what decoding mechanisms need to be applied to obtain the media-type specified by the Content-Type header of the object.

  • :content_disposition (String)

    The optional Content-Disposition header that defines presentational information for the object to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to let users download objects with custom filenames in a browser.

  • :cache_control (String)

    The optional Cache-Control header that defines the caching behavior value to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify objects that require caching restrictions.

  • :opc_sse_customer_algorithm (String)

    The optional header that specifies "AES256" as the encryption algorithm. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_customer_key (String)

    The optional header that specifies the base64-encoded 256-bit encryption key to use to encrypt or decrypt the data. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_customer_key_sha256 (String)

    The optional header that specifies the base64-encoded SHA256 hash of the encryption key. This value is used to check the integrity of the encryption key. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_kms_key_id (String)

    The OCID of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key.

  • :storage_tier (String)

    The storage tier that the object should be stored in. If not specified, the object will be stored in the same storage tier as the bucket.

  • :opc_meta (Hash<String, String>)

    Optional user-defined metadata key and value. “opc-meta-” will be appended to each Hash key before it is sent to the server.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
# File 'lib/oci/object_storage/object_storage_client.rb', line 3326

def put_object(namespace_name, bucket_name, object_name, put_object_body, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#put_object.' if logger

  raise "Missing the required parameter 'namespace_name' when calling put_object." if namespace_name.nil?
  raise "Missing the required parameter 'bucket_name' when calling put_object." if bucket_name.nil?
  raise "Missing the required parameter 'object_name' when calling put_object." if object_name.nil?
  raise "Missing the required parameter 'put_object_body' when calling put_object." if put_object_body.nil?

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

  if opts[:storage_tier] && !OCI::ObjectStorage::Models::STORAGE_TIER_ENUM.include?(opts[:storage_tier])
    raise 'Invalid value for "storage_tier", must be one of the values in OCI::ObjectStorage::Models::STORAGE_TIER_ENUM.'
  end
  raise "Parameter value for 'namespace_name' must not be blank" if OCI::Internal::Util.blank_string?(namespace_name)
  raise "Parameter value for 'bucket_name' must not be blank" if OCI::Internal::Util.blank_string?(bucket_name)
  raise "Parameter value for 'object_name' must not be blank" if OCI::Internal::Util.blank_string?(object_name)

  path = '/n/{namespaceName}/b/{bucketName}/o/{objectName}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s)
  operation_signing_strategy = :exclude_body

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

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'if-none-match'] = opts[:if_none_match] if opts[:if_none_match]
  header_params[:'opc-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  header_params[:expect] = opts[:expect] if opts[:expect]
  header_params[:'content-length'] = opts[:content_length] if opts[:content_length]
  header_params[:'content-md5'] = opts[:content_md5] if opts[:content_md5]
  header_params[:'opc-checksum-algorithm'] = opts[:opc_checksum_algorithm] if opts[:opc_checksum_algorithm]
  header_params[:'opc-content-crc32c'] = opts[:opc_content_crc32c] if opts[:opc_content_crc32c]
  header_params[:'opc-content-sha256'] = opts[:opc_content_sha256] if opts[:opc_content_sha256]
  header_params[:'opc-content-sha384'] = opts[:opc_content_sha384] if opts[:opc_content_sha384]
  header_params[:'content-type'] = opts[:content_type] if opts[:content_type]
  header_params[:'content-language'] = opts[:content_language] if opts[:content_language]
  header_params[:'content-encoding'] = opts[:content_encoding] if opts[:content_encoding]
  header_params[:'content-disposition'] = opts[:content_disposition] if opts[:content_disposition]
  header_params[:'cache-control'] = opts[:cache_control] if opts[:cache_control]
  header_params[:'opc-sse-customer-algorithm'] = opts[:opc_sse_customer_algorithm] if opts[:opc_sse_customer_algorithm]
  header_params[:'opc-sse-customer-key'] = opts[:opc_sse_customer_key] if opts[:opc_sse_customer_key]
  header_params[:'opc-sse-customer-key-sha256'] = opts[:opc_sse_customer_key_sha256] if opts[:opc_sse_customer_key_sha256]
  header_params[:'opc-sse-kms-key-id'] = opts[:opc_sse_kms_key_id] if opts[:opc_sse_kms_key_id]
  header_params[:'storage-tier'] = opts[:storage_tier] if opts[:storage_tier]
  # rubocop:enable Style/NegatedIf

  if opts[:opc_meta]
    opts[:opc_meta].each do |key, value|
      header_params["opc-meta-#{key}".to_sym] = value
    end
  end
  header_params[:'content-type'] ||= 'application/octet-stream'
  header_params[:expect] ||= '100-continue'

  post_body = @api_client.object_to_http_body(put_object_body)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#put_object') 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

#put_object_lifecycle_policy(namespace_name, bucket_name, put_object_lifecycle_policy_details, opts = {}) ⇒ Response

Note:

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

Creates or replaces the object lifecycle policy for the bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • put_object_lifecycle_policy_details (OCI::ObjectStorage::Models::PutObjectLifecyclePolicyDetails)

    The lifecycle policy to apply to the bucket.

  • 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_client_request_id (String)

    The client request ID for tracing.

  • :if_match (String)

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :if_none_match (String)

    The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the resource already exists.

Returns:

[View source]

3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
# File 'lib/oci/object_storage/object_storage_client.rb', line 3430

def put_object_lifecycle_policy(namespace_name, bucket_name, put_object_lifecycle_policy_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#put_object_lifecycle_policy.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/l'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'if-none-match'] = opts[:if_none_match] if opts[:if_none_match]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(put_object_lifecycle_policy_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#put_object_lifecycle_policy') 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,
      return_type: 'OCI::ObjectStorage::Models::ObjectLifecyclePolicy'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#reencrypt_bucket(namespace_name, bucket_name, opts = {}) ⇒ Response

Note:

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

Re-encrypts the unique data encryption key that encrypts each object written to the bucket by using the most recent version of the master encryption key assigned to the bucket. (All data encryption keys are encrypted by a master encryption key. Master encryption keys are assigned to buckets and managed by Oracle by default, but you can assign a key that you created and control through the Oracle Cloud Infrastructure Key Management service.) The kmsKeyId property of the bucket determines which master encryption key is assigned to the bucket. If you assigned a different Key Management master encryption key to the bucket, you can call this API to re-encrypt all data encryption keys with the newly assigned key. Similarly, you might want to re-encrypt all data encryption keys if the assigned key has been rotated to a new key version since objects were last added to the bucket. If you call this API and there is no kmsKeyId associated with the bucket, the call will fail.

Calling this API starts a work request task to re-encrypt the data encryption key of all objects in the bucket. Only objects created before the time of the API call will be re-encrypted. The call can take a long time, depending on how many objects are in the bucket and how big they are. This API returns a work request ID that you can use to retrieve the status of the work request task. All the versions of objects will be re-encrypted whether versioning is enabled or suspended at the bucket.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
# File 'lib/oci/object_storage/object_storage_client.rb', line 3507

def reencrypt_bucket(namespace_name, bucket_name, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#reencrypt_bucket.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/actions/reencrypt'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#reencrypt_bucket') 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

#reencrypt_object(namespace_name, bucket_name, object_name, reencrypt_object_details, opts = {}) ⇒ Response

Note:

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

Re-encrypts the data encryption keys that encrypt the object and its chunks. By default, when you create a bucket, the Object Storage service manages the master encryption key used to encrypt each object's data encryption keys. The encryption mechanism that you specify for the bucket applies to the objects it contains.

You can alternatively employ one of these encryption strategies for an object:

  • You can assign a key that you created and control through the Oracle Cloud Infrastructure Vault service.

  • You can encrypt an object using your own encryption key. The key you supply is known as a customer-provided encryption key (SSE-C).

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • object_name (String)

    The name of the object. Avoid entering confidential information. Example: test/object1.log

  • reencrypt_object_details (OCI::ObjectStorage::Models::ReencryptObjectDetails)

    Request object for re-encrypting the data encryption key associated with an object.

  • 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

  • :version_id (String)

    VersionId used to identify a particular version of the object

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
# File 'lib/oci/object_storage/object_storage_client.rb', line 3579

def reencrypt_object(namespace_name, bucket_name, object_name, reencrypt_object_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#reencrypt_object.' if logger

  raise "Missing the required parameter 'namespace_name' when calling reencrypt_object." if namespace_name.nil?
  raise "Missing the required parameter 'bucket_name' when calling reencrypt_object." if bucket_name.nil?
  raise "Missing the required parameter 'object_name' when calling reencrypt_object." if object_name.nil?
  raise "Missing the required parameter 'reencrypt_object_details' when calling reencrypt_object." if reencrypt_object_details.nil?
  raise "Parameter value for 'namespace_name' must not be blank" if OCI::Internal::Util.blank_string?(namespace_name)
  raise "Parameter value for 'bucket_name' must not be blank" if OCI::Internal::Util.blank_string?(bucket_name)
  raise "Parameter value for 'object_name' must not be blank" if OCI::Internal::Util.blank_string?(object_name)

  path = '/n/{namespaceName}/b/{bucketName}/actions/reencrypt/{objectName}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:versionId] = opts[:version_id] if opts[:version_id]

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

  post_body = @api_client.object_to_http_body(reencrypt_object_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#reencrypt_object') 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

#rename_object(namespace_name, bucket_name, rename_object_details, opts = {}) ⇒ Response

Note:

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

Rename an object in the given Object Storage namespace.

See Object Names for object naming requirements.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • rename_object_details (OCI::ObjectStorage::Models::RenameObjectDetails)

    The sourceName and newName of rename operation. Avoid entering confidential information.

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
# File 'lib/oci/object_storage/object_storage_client.rb', line 3646

def rename_object(namespace_name, bucket_name, rename_object_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#rename_object.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/actions/renameObject'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(rename_object_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#rename_object') 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

#restore_objects(namespace_name, bucket_name, restore_objects_details, opts = {}) ⇒ Response

Note:

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

Restores the object specified by the objectName parameter. By default object will be restored for 24 hours. Duration can be configured using the hours parameter.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • restore_objects_details (OCI::ObjectStorage::Models::RestoreObjectsDetails)

    Request to restore object.

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
# File 'lib/oci/object_storage/object_storage_client.rb', line 3708

def restore_objects(namespace_name, bucket_name, restore_objects_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#restore_objects.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/actions/restoreObjects'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(restore_objects_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#restore_objects') 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_bucket(namespace_name, bucket_name, update_bucket_details, opts = {}) ⇒ Response

Note:

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

Performs a partial or full update of a bucket's user-defined metadata.

Use UpdateBucket to move a bucket from one compartment to another within the same tenancy. Supply the compartmentID of the compartment that you want to move the bucket to. For more information about moving resources between compartments, see Moving Resources to a Different Compartment.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • update_bucket_details (OCI::ObjectStorage::Models::UpdateBucketDetails)

    Request object for updating a bucket.

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

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
# File 'lib/oci/object_storage/object_storage_client.rb', line 3777

def update_bucket(namespace_name, bucket_name, update_bucket_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#update_bucket.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_bucket_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#update_bucket') 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::ObjectStorage::Models::Bucket'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_namespace_metadata(namespace_name, update_namespace_metadata_details, opts = {}) ⇒ Response

Note:

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

By default, buckets created using the Amazon S3 Compatibility API or the Swift API are created in the root compartment of the Oracle Cloud Infrastructure tenancy.

You can change the default Swift/Amazon S3 compartmentId designation to a different compartmentId. All subsequent bucket creations will use the new default compartment, but no previously created buckets will be modified. A user must have OBJECTSTORAGE_NAMESPACE_UPDATE permission to make changes to the default compartments for Amazon S3 and Swift.

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_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
# File 'lib/oci/object_storage/object_storage_client.rb', line 3843

def (namespace_name, , opts = {})
  logger.debug 'Calling operation ObjectStorageClient#update_namespace_metadata.' if logger

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

  path = '/n/{namespaceName}'.sub('{namespaceName}', namespace_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body()

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#update_namespace_metadata') 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,
      return_type: 'OCI::ObjectStorage::Models::NamespaceMetadata'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_object_storage_tier(namespace_name, bucket_name, update_object_storage_tier_details, opts = {}) ⇒ Response

Note:

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

Changes the storage tier of the object specified by the objectName parameter.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • update_object_storage_tier_details (OCI::ObjectStorage::Models::UpdateObjectStorageTierDetails)

    The object name and the desired storage tier.

  • 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_client_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
# File 'lib/oci/object_storage/object_storage_client.rb', line 3903

def update_object_storage_tier(namespace_name, bucket_name, update_object_storage_tier_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#update_object_storage_tier.' if logger

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

  path = '/n/{namespaceName}/b/{bucketName}/actions/updateObjectStorageTier'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_object_storage_tier_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#update_object_storage_tier') 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_private_endpoint(namespace_name, pe_name, update_private_endpoint_details, opts = {}) ⇒ Response

Note:

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

Performs a partial or full update of a user-defined data associated with the Private Endpoint.

Use UpdatePrivateEndpoint to move a Private Endpoint from one compartment to another within the same tenancy. Supply the compartmentID of the compartment that you want to move the Private Endpoint to. Or use it to update the name, subnetId, endpointFqdn or privateEndpointIp or accessTargets of the Private Endpoint. For more information about moving resources between compartments, see Moving Resources to a Different Compartment.

This API follows replace semantics (rather than merge semantics). That means if the body provides values for parameters and the resource has exisiting ones, this operation will replace those existing values.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • pe_name (String)

    The name of the private endpoint. Avoid entering confidential information. Example: my-new-pe-1

  • update_private_endpoint_details (OCI::ObjectStorage::Models::UpdatePrivateEndpointDetails)

    Request object for updating the Private Endpoint.

  • 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_client_request_id (String)

    The client request ID for tracing.

  • :if_match (String)

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
# File 'lib/oci/object_storage/object_storage_client.rb', line 3975

def update_private_endpoint(namespace_name, pe_name, update_private_endpoint_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#update_private_endpoint.' if logger

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

  path = '/n/{namespaceName}/pe/{peName}/'.sub('{namespaceName}', namespace_name.to_s).sub('{peName}', pe_name.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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_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_private_endpoint_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#update_private_endpoint') 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_retention_rule(namespace_name, bucket_name, retention_rule_id, update_retention_rule_details, opts = {}) ⇒ Response

Note:

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

Updates the specified retention rule. Rule changes take effect typically within 30 seconds.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • retention_rule_id (String)

    The ID of the retention rule.

  • update_retention_rule_details (OCI::ObjectStorage::Models::UpdateRetentionRuleDetails)

    Request object for updating the retention rule.

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

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :opc_client_request_id (String)

    The client request ID for tracing.

Returns:

[View source]

4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
# File 'lib/oci/object_storage/object_storage_client.rb', line 4042

def update_retention_rule(namespace_name, bucket_name, retention_rule_id, update_retention_rule_details, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#update_retention_rule.' if logger

  raise "Missing the required parameter 'namespace_name' when calling update_retention_rule." if namespace_name.nil?
  raise "Missing the required parameter 'bucket_name' when calling update_retention_rule." if bucket_name.nil?
  raise "Missing the required parameter 'retention_rule_id' when calling update_retention_rule." if retention_rule_id.nil?
  raise "Missing the required parameter 'update_retention_rule_details' when calling update_retention_rule." if update_retention_rule_details.nil?
  raise "Parameter value for 'namespace_name' must not be blank" if OCI::Internal::Util.blank_string?(namespace_name)
  raise "Parameter value for 'bucket_name' must not be blank" if OCI::Internal::Util.blank_string?(bucket_name)
  raise "Parameter value for 'retention_rule_id' must not be blank" if OCI::Internal::Util.blank_string?(retention_rule_id)

  path = '/n/{namespaceName}/b/{bucketName}/retentionRules/{retentionRuleId}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{retentionRuleId}', retention_rule_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-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_retention_rule_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#update_retention_rule') 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,
      return_type: 'OCI::ObjectStorage::Models::RetentionRule'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#upload_part(namespace_name, bucket_name, object_name, upload_id, upload_part_num, upload_part_body, opts = {}) ⇒ Response

Note:

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

Uploads a single part of a multipart upload.

Parameters:

  • namespace_name (String)

    The Object Storage namespace used for the request.

  • bucket_name (String)

    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

  • object_name (String)

    The name of the object. Avoid entering confidential information. Example: test/object1.log

  • upload_id (String)

    The upload ID for a multipart upload.

  • upload_part_num (Integer)

    The part number that identifies the object part currently being uploaded.

  • upload_part_body (String, IO)

    The part being uploaded to the Object Storage service.

  • 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

  • :content_length (Integer)

    The content length of the body.

  • :opc_client_request_id (String)

    The client request ID for tracing.

  • :if_match (String)

    The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

  • :if_none_match (String)

    The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the resource already exists.

  • :expect (String)

    A value of 100-continue requests preliminary verification of the request method, path, and headers before the request body is sent. If no error results from such verification, the server will send a 100 (Continue) interim response to indicate readiness for the request body. The only allowed value for this parameter is "100-Continue" (case-insensitive).

  • :content_md5 (String)

    The optional header that defines the base64-encoded MD5 hash of the body. If the optional Content-MD5 header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the MD5 hash for the body and comparing it to the MD5 hash supplied in the header. If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content MD5 error is returned with the message:

    "The computed MD5 of the request body (ACTUAL_MD5) does not match the Content-MD5 header (HEADER_MD5)"

  • :opc_checksum_algorithm (String)

    The optional checksum algorithm to use to compute and store the checksum of the body of the HTTP request (or the parts in case of multipart uploads), in addition to the default MD5 checksum.

  • :opc_content_crc32c (String)

    Applicable only if CRC32C is specified in the opc-checksum-algorithm request header.

    The optional header that defines the base64-encoded, 32-bit CRC32C (Castagnoli) checksum of the body. If the optional opc-content-crc32c header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the CRC32C checksum for the body and comparing it to the CRC32C checksum supplied in the header. If the two checksums do not match, the object is rejected and an HTTP-400 Unmatched Content CRC32C error is returned with the message:

    "The computed CRC32C of the request body (ACTUAL_CRC32C) does not match the opc-content-crc32c header (HEADER_CRC32C)"

  • :opc_content_sha256 (String)

    Applicable only if SHA256 is specified in the opc-checksum-algorithm request header.

    The optional header that defines the base64-encoded SHA256 hash of the body. If the optional opc-content-sha256 header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the SHA256 hash for the body and comparing it to the SHA256 hash supplied in the header. If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content SHA256 error is returned with the message:

    "The computed SHA256 of the request body (ACTUAL_SHA256) does not match the opc-content-sha256 header (HEADER_SHA256)"

  • :opc_content_sha384 (String)

    Applicable only if SHA384 is specified in the opc-checksum-algorithm request header.

    The optional header that defines the base64-encoded SHA384 hash of the body. If the optional opc-content-sha384 header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the SHA384 hash for the body and comparing it to the SHA384 hash supplied in the header. If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content SHA384 error is returned with the message:

    "The computed SHA384 of the request body (ACTUAL_SHA384) does not match the opc-content-sha384 header (HEADER_SHA384)"

  • :opc_sse_customer_algorithm (String)

    The optional header that specifies "AES256" as the encryption algorithm. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_customer_key (String)

    The optional header that specifies the base64-encoded 256-bit encryption key to use to encrypt or decrypt the data. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_customer_key_sha256 (String)

    The optional header that specifies the base64-encoded SHA256 hash of the encryption key. This value is used to check the integrity of the encryption key. For more information, see Using Your Own Keys for Server-Side Encryption.

  • :opc_sse_kms_key_id (String)

    The OCID of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key.

Returns:

  • (Response)

    A Response object with data of type nil

[View source]

4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
# File 'lib/oci/object_storage/object_storage_client.rb', line 4175

def upload_part(namespace_name, bucket_name, object_name, upload_id, upload_part_num, upload_part_body, opts = {})
  logger.debug 'Calling operation ObjectStorageClient#upload_part.' if logger

  raise "Missing the required parameter 'namespace_name' when calling upload_part." if namespace_name.nil?
  raise "Missing the required parameter 'bucket_name' when calling upload_part." if bucket_name.nil?
  raise "Missing the required parameter 'object_name' when calling upload_part." if object_name.nil?
  raise "Missing the required parameter 'upload_id' when calling upload_part." if upload_id.nil?
  raise "Missing the required parameter 'upload_part_num' when calling upload_part." if upload_part_num.nil?
  raise "Missing the required parameter 'upload_part_body' when calling upload_part." if upload_part_body.nil?

  if opts[:opc_checksum_algorithm] && !OCI::ObjectStorage::Models::CHECKSUM_ALGORITHM_ENUM.include?(opts[:opc_checksum_algorithm])
    raise 'Invalid value for "opc_checksum_algorithm", must be one of the values in OCI::ObjectStorage::Models::CHECKSUM_ALGORITHM_ENUM.'
  end
  raise "Parameter value for 'namespace_name' must not be blank" if OCI::Internal::Util.blank_string?(namespace_name)
  raise "Parameter value for 'bucket_name' must not be blank" if OCI::Internal::Util.blank_string?(bucket_name)
  raise "Parameter value for 'object_name' must not be blank" if OCI::Internal::Util.blank_string?(object_name)

  path = '/n/{namespaceName}/b/{bucketName}/u/{objectName}'.sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s)
  operation_signing_strategy = :exclude_body

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:uploadId] = upload_id
  query_params[:uploadPartNum] = upload_part_num

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'opc-client-request-id'] = opts[:opc_client_request_id] if opts[:opc_client_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'if-none-match'] = opts[:if_none_match] if opts[:if_none_match]
  header_params[:expect] = opts[:expect] if opts[:expect]
  header_params[:'content-length'] = opts[:content_length] if opts[:content_length]
  header_params[:'content-md5'] = opts[:content_md5] if opts[:content_md5]
  header_params[:'opc-checksum-algorithm'] = opts[:opc_checksum_algorithm] if opts[:opc_checksum_algorithm]
  header_params[:'opc-content-crc32c'] = opts[:opc_content_crc32c] if opts[:opc_content_crc32c]
  header_params[:'opc-content-sha256'] = opts[:opc_content_sha256] if opts[:opc_content_sha256]
  header_params[:'opc-content-sha384'] = opts[:opc_content_sha384] if opts[:opc_content_sha384]
  header_params[:'opc-sse-customer-algorithm'] = opts[:opc_sse_customer_algorithm] if opts[:opc_sse_customer_algorithm]
  header_params[:'opc-sse-customer-key'] = opts[:opc_sse_customer_key] if opts[:opc_sse_customer_key]
  header_params[:'opc-sse-customer-key-sha256'] = opts[:opc_sse_customer_key_sha256] if opts[:opc_sse_customer_key_sha256]
  header_params[:'opc-sse-kms-key-id'] = opts[:opc_sse_kms_key_id] if opts[:opc_sse_kms_key_id]
  # rubocop:enable Style/NegatedIf
  header_params[:'content-type'] ||= 'application/octet-stream'
  header_params[:expect] ||= '100-continue'

  post_body = @api_client.object_to_http_body(upload_part_body)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ObjectStorageClient#upload_part') 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