ObjectStorageClient

class oci.object_storage.ObjectStorageClient(config, **kwargs)

Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources. For more information, see [Overview of Object Storage](/Content/Object/Concepts/objectstorageoverview.htm) and [Overview of Archive Storage](/Content/Archive/Concepts/archivestorageoverview.htm).

Methods

__init__(config, **kwargs) Creates a new service client
abort_multipart_upload(namespace_name, …) Aborts an in-progress multipart upload and deletes all parts that have been uploaded.
cancel_work_request(work_request_id, **kwargs) Cancels a work request.
commit_multipart_upload(namespace_name, …) Commits a multipart upload, which involves checking part numbers and entity tags (ETags) of the parts, to create an aggregate object.
copy_object(namespace_name, bucket_name, …) Creates a request to copy an object within a region or to another region.
create_bucket(namespace_name, …) Creates a bucket in the given namespace with a bucket name and optional user-defined metadata.
create_multipart_upload(namespace_name, …) Starts a new multipart upload to a specific object in the given bucket in the given namespace.
create_preauthenticated_request(…) Creates a pre-authenticated request specific to the bucket.
create_replication_policy(namespace_name, …) Creates a replication policy for the specified bucket.
create_retention_rule(namespace_name, …) Creates a new retention rule in the specified bucket.
delete_bucket(namespace_name, bucket_name, …) Deletes a bucket if the bucket is already empty.
delete_object(namespace_name, bucket_name, …) Deletes an object.
delete_object_lifecycle_policy(…) Deletes the object lifecycle policy for the bucket.
delete_preauthenticated_request(…) Deletes the pre-authenticated request for the bucket.
delete_replication_policy(namespace_name, …) Deletes the replication policy associated with the source bucket.
delete_retention_rule(namespace_name, …) Deletes the specified rule.
get_bucket(namespace_name, bucket_name, **kwargs) Gets the current representation of the given bucket in the given Object Storage namespace.
get_namespace(**kwargs) Each Oracle Cloud Infrastructure tenant is assigned one unique and uneditable Object Storage namespace.
get_namespace_metadata(namespace_name, **kwargs) Gets the metadata for the Object Storage namespace, which contains defaultS3CompartmentId and defaultSwiftCompartmentId.
get_object(namespace_name, bucket_name, …) Gets the metadata and body of an object.
get_object_lifecycle_policy(namespace_name, …) Gets the object lifecycle policy for the bucket.
get_preauthenticated_request(namespace_name, …) Gets the pre-authenticated request for the bucket.
get_replication_policy(namespace_name, …) Get the replication policy.
get_retention_rule(namespace_name, …) Get the specified retention rule.
get_work_request(work_request_id, **kwargs) Gets the status of the work request for the given ID.
head_bucket(namespace_name, bucket_name, …) Efficiently checks to see if a bucket exists and gets the current entity tag (ETag) for the bucket.
head_object(namespace_name, bucket_name, …) Gets the user-defined metadata and entity tag (ETag) for an object.
list_buckets(namespace_name, compartment_id, …) Gets a list of all BucketSummary items in a compartment.
list_multipart_upload_parts(namespace_name, …) Lists the parts of an in-progress multipart upload.
list_multipart_uploads(namespace_name, …) Lists all of the in-progress multipart uploads for the given bucket in the given Object Storage namespace.
list_object_versions(namespace_name, …) Lists the object versions in a bucket.
list_objects(namespace_name, bucket_name, …) Lists the objects in a bucket.
list_preauthenticated_requests(…) Lists pre-authenticated requests for the bucket.
list_replication_policies(namespace_name, …) List the replication policies associated with a bucket.
list_replication_sources(namespace_name, …) List the replication sources of a destination bucket.
list_retention_rules(namespace_name, …) List the retention rules for a bucket.
list_work_request_errors(work_request_id, …) Lists the errors of the work request with the given ID.
list_work_request_logs(work_request_id, **kwargs) Lists the logs of the work request with the given ID.
list_work_requests(compartment_id, **kwargs) Lists the work requests in a compartment.
make_bucket_writable(namespace_name, …) Stops replication to the destination bucket and removes the replication policy.
put_object(namespace_name, bucket_name, …) Creates a new object or overwrites an existing object with the same name.
put_object_lifecycle_policy(namespace_name, …) Creates or replaces the object lifecycle policy for the bucket.
reencrypt_bucket(namespace_name, …) 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.
reencrypt_object(namespace_name, …) Re-encrypts the data encryption keys that encrypt the object and its chunks.
rename_object(namespace_name, bucket_name, …) Rename an object in the given Object Storage namespace.
restore_objects(namespace_name, bucket_name, …) Restores one or more objects specified by the objectName parameter.
update_bucket(namespace_name, bucket_name, …) Performs a partial or full update of a bucket’s user-defined metadata.
update_namespace_metadata(namespace_name, …) 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.
update_retention_rule(namespace_name, …) Updates the specified retention rule.
upload_part(namespace_name, bucket_name, …) Uploads a single part of a multipart upload.
__init__(config, **kwargs)

Creates a new service client

Parameters:
  • config (dict) – Configuration keys and values as per SDK and Tool Configuration. The from_file() method can be used to load configuration from a file. Alternatively, a dict can be passed. You can validate_config the dict using validate_config()
  • service_endpoint (str) – (optional) The endpoint of the service to call using this client. For example https://iaas.us-ashburn-1.oraclecloud.com. If this keyword argument is not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit need to specify a service endpoint.
  • timeout (float or tuple(float, float)) – (optional) The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout.
  • signer (AbstractBaseSigner) –

    (optional) The signer to use when signing requests made by the service client. The default is to use a Signer based on the values provided in the config parameter.

    One use case for this parameter is for Instance Principals authentication by passing an instance of InstancePrincipalsSecurityTokenSigner as the value for this keyword argument

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. Retry strategies can also be applied at the operation level by passing a retry_strategy keyword argument as part of calling the operation. Any value provided at the operation level will override whatever is specified at the client level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

abort_multipart_upload(namespace_name, bucket_name, object_name, upload_id, **kwargs)

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

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • object_name (str) – (required) The name of the object. Avoid entering confidential information. Example: test/object1.log
  • upload_id (str) – (required) The upload ID for a multipart upload.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

cancel_work_request(work_request_id, **kwargs)

Cancels a work request.

Parameters:
  • work_request_id (str) – (required) The ID of the asynchronous request.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

commit_multipart_upload(namespace_name, bucket_name, object_name, upload_id, commit_multipart_upload_details, **kwargs)

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

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • object_name (str) – (required) The name of the object. Avoid entering confidential information. Example: test/object1.log
  • upload_id (str) – (required) The upload ID for a multipart upload.
  • commit_multipart_upload_details (CommitMultipartUploadDetails) – (required) The part numbers and entity tags (ETags) for the parts you want to commit.
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • if_none_match (str) – (optional) The entity tag (ETag) to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

copy_object(namespace_name, bucket_name, copy_object_details, **kwargs)

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

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • copy_object_details (CopyObjectDetails) – (required) The source and destination of the object to be copied.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • opc_sse_customer_algorithm (str) –

    (optional) 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 (str) –

    (optional) 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 (str) –

    (optional) 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 (str) –

    (optional) 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 (str) –

    (optional) 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 (str) –

    (optional) 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.

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

create_bucket(namespace_name, create_bucket_details, **kwargs)

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 (str) – (required) The Object Storage namespace used for the request.
  • create_bucket_details (CreateBucketDetails) – (required) Request object for creating a bucket.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Bucket

Return type:

Response

create_multipart_upload(namespace_name, bucket_name, create_multipart_upload_details, **kwargs)

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

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • create_multipart_upload_details (CreateMultipartUploadDetails) – (required) Request object for creating a multipart upload.
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • if_none_match (str) – (optional) The entity tag (ETag) to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • opc_sse_customer_algorithm (str) –

    (optional) 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 (str) –

    (optional) 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 (str) –

    (optional) 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.

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type MultipartUpload

Return type:

Response

create_preauthenticated_request(namespace_name, bucket_name, create_preauthenticated_request_details, **kwargs)

Creates a pre-authenticated request specific to the bucket.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • create_preauthenticated_request_details (CreatePreauthenticatedRequestDetails) – (required) Information needed to create the pre-authenticated request.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type PreauthenticatedRequest

Return type:

Response

create_replication_policy(namespace_name, bucket_name, create_replication_policy_details, **kwargs)

Creates a replication policy for the specified bucket.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • create_replication_policy_details (CreateReplicationPolicyDetails) – (required) The replication policy.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type ReplicationPolicy

Return type:

Response

create_retention_rule(namespace_name, bucket_name, create_retention_rule_details, **kwargs)

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 (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • create_retention_rule_details (CreateRetentionRuleDetails) – (required) The retention rule to create for the bucket.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type RetentionRule

Return type:

Response

delete_bucket(namespace_name, bucket_name, **kwargs)

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 (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

delete_object(namespace_name, bucket_name, object_name, **kwargs)

Deletes an object.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • object_name (str) – (required) The name of the object. Avoid entering confidential information. Example: test/object1.log
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • version_id (str) – (optional) VersionId used to identify a particular version of the object
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

delete_object_lifecycle_policy(namespace_name, bucket_name, **kwargs)

Deletes the object lifecycle policy for the bucket.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

delete_preauthenticated_request(namespace_name, bucket_name, par_id, **kwargs)

Deletes the pre-authenticated request for the bucket.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • par_id (str) – (required) 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.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

delete_replication_policy(namespace_name, bucket_name, replication_id, **kwargs)

Deletes the replication policy associated with the source bucket.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • replication_id (str) – (required) The ID of the replication policy.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

delete_retention_rule(namespace_name, bucket_name, retention_rule_id, **kwargs)

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

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • retention_rule_id (str) – (required) The ID of the retention rule.
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

get_bucket(namespace_name, bucket_name, **kwargs)

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

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • if_none_match (str) – (optional) The entity tag (ETag) to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • fields (list[str]) –

    (optional) Bucket summary includes the ‘namespace’, ‘name’, ‘compartmentId’, ‘createdBy’, ‘timeCreated’, and ‘etag’ fields. This parameter can also include ‘approximateCount’ (approximate number of objects) and ‘approximateSize’ (total approximate size in bytes of all objects). For example ‘approximateCount,approximateSize’.

    Allowed values are: “approximateCount”, “approximateSize”

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Bucket

Return type:

Response

get_namespace(**kwargs)

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:
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • compartment_id (str) –

    (optional) 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.

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type str

Return type:

Response

get_namespace_metadata(namespace_name, **kwargs)

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 (str) – (required) The Object Storage namespace used for the request.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type NamespaceMetadata

Return type:

Response

get_object(namespace_name, bucket_name, object_name, **kwargs)

Gets the metadata and body of an object.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • object_name (str) – (required) The name of the object. Avoid entering confidential information. Example: test/object1.log
  • version_id (str) – (optional) VersionId used to identify a particular version of the object
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • if_none_match (str) – (optional) The entity tag (ETag) to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • range (str) –

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

  • opc_sse_customer_algorithm (str) –

    (optional) 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 (str) –

    (optional) 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 (str) –

    (optional) 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 (str) – (optional) This value will be used in Content-Disposition header of the response.
  • http_response_cache_control (str) – (optional) This value will be used in Cache-Control header of the response.
  • http_response_content_type (str) – (optional) This value will be used in Content-Type header of the response.
  • http_response_content_language (str) – (optional) This value will be used in Content-Language header of the response.
  • http_response_content_encoding (str) – (optional) This value will be used in Content-Encoding header of the response
  • http_response_expires (str) – (optional) This value will be used in Expires header of the response
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type stream

Return type:

Response

get_object_lifecycle_policy(namespace_name, bucket_name, **kwargs)

Gets the object lifecycle policy for the bucket.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type ObjectLifecyclePolicy

Return type:

Response

get_preauthenticated_request(namespace_name, bucket_name, par_id, **kwargs)

Gets the pre-authenticated request for the bucket.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • par_id (str) – (required) 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.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type PreauthenticatedRequestSummary

Return type:

Response

get_replication_policy(namespace_name, bucket_name, replication_id, **kwargs)

Get the replication policy.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • replication_id (str) – (required) The ID of the replication policy.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type ReplicationPolicy

Return type:

Response

get_retention_rule(namespace_name, bucket_name, retention_rule_id, **kwargs)

Get the specified retention rule.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • retention_rule_id (str) – (required) The ID of the retention rule.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type RetentionRule

Return type:

Response

get_work_request(work_request_id, **kwargs)

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

Parameters:
  • work_request_id (str) – (required) The ID of the asynchronous request.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type WorkRequest

Return type:

Response

head_bucket(namespace_name, bucket_name, **kwargs)

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

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • if_none_match (str) – (optional) The entity tag (ETag) to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

head_object(namespace_name, bucket_name, object_name, **kwargs)

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

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • object_name (str) – (required) The name of the object. Avoid entering confidential information. Example: test/object1.log
  • version_id (str) – (optional) VersionId used to identify a particular version of the object
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • if_none_match (str) – (optional) The entity tag (ETag) to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • opc_sse_customer_algorithm (str) –

    (optional) 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 (str) –

    (optional) 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 (str) –

    (optional) 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.

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

list_buckets(namespace_name, compartment_id, **kwargs)

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.

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 (str) – (required) The Object Storage namespace used for the request.
  • compartment_id (str) – (required) The ID of the compartment in which to list buckets.
  • limit (int) – (optional) The maximum number of items to return.
  • page (str) – (optional) The page at which to start retrieving results.
  • fields (list[str]) –

    (optional) 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 (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type list of BucketSummary

Return type:

Response

list_multipart_upload_parts(namespace_name, bucket_name, object_name, upload_id, **kwargs)

Lists the parts of an in-progress multipart upload.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • object_name (str) – (required) The name of the object. Avoid entering confidential information. Example: test/object1.log
  • upload_id (str) – (required) The upload ID for a multipart upload.
  • limit (int) – (optional) The maximum number of items to return.
  • page (str) – (optional) The page at which to start retrieving results.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type list of MultipartUploadPartSummary

Return type:

Response

list_multipart_uploads(namespace_name, bucket_name, **kwargs)

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

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • limit (int) – (optional) The maximum number of items to return.
  • page (str) – (optional) The page at which to start retrieving results.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type list of MultipartUpload

Return type:

Response

list_object_versions(namespace_name, bucket_name, **kwargs)

Lists the object versions in a bucket.

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 (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • prefix (str) – (optional) The string to use for matching against the start of object names in a list query.
  • start (str) – (optional) Object names returned by a list query must be greater or equal to this parameter.
  • end (str) – (optional) Object names returned by a list query must be strictly less than this parameter.
  • limit (int) – (optional) The maximum number of items to return.
  • delimiter (str) – (optional) 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 (str) –

    (optional) Object summary in list of objects includes the ‘name’ field. This parameter can also include ‘size’ (object size in bytes), ‘etag’, ‘md5’, ‘timeCreated’ (object creation date and time) and ‘timeModified’ (object modification date and time). Value of this parameter should be a comma-separated, case-insensitive list of those field names. For example ‘name,etag,timeCreated,md5,timeModified’

    Allowed values are: “name”, “size”, “etag”, “timeCreated”, “md5”, “timeModified”

  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • start_after (str) – (optional) Object names returned by a list query must be greater than this parameter.
  • page (str) – (optional) The page at which to start retrieving results.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type ObjectVersionCollection

Return type:

Response

list_objects(namespace_name, bucket_name, **kwargs)

Lists the objects in a bucket.

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 (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • prefix (str) – (optional) The string to use for matching against the start of object names in a list query.
  • start (str) – (optional) Object names returned by a list query must be greater or equal to this parameter.
  • end (str) – (optional) Object names returned by a list query must be strictly less than this parameter.
  • limit (int) – (optional) The maximum number of items to return.
  • delimiter (str) – (optional) 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 (str) –

    (optional) Object summary in list of objects includes the ‘name’ field. This parameter can also include ‘size’ (object size in bytes), ‘etag’, ‘md5’, ‘timeCreated’ (object creation date and time) and ‘timeModified’ (object modification date and time). Value of this parameter should be a comma-separated, case-insensitive list of those field names. For example ‘name,etag,timeCreated,md5,timeModified’

    Allowed values are: “name”, “size”, “etag”, “timeCreated”, “md5”, “timeModified”

  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • start_after (str) – (optional) Object names returned by a list query must be greater than this parameter.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type ListObjects

Return type:

Response

list_preauthenticated_requests(namespace_name, bucket_name, **kwargs)

Lists pre-authenticated requests for the bucket.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • object_name_prefix (str) – (optional) User-specified object name prefixes can be used to query and return a list of pre-authenticated requests.
  • limit (int) – (optional) The maximum number of items to return.
  • page (str) – (optional) The page at which to start retrieving results.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type list of PreauthenticatedRequestSummary

Return type:

Response

list_replication_policies(namespace_name, bucket_name, **kwargs)

List the replication policies associated with a bucket.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • page (str) – (optional) The page at which to start retrieving results.
  • limit (int) – (optional) The maximum number of items to return.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type list of ReplicationPolicySummary

Return type:

Response

list_replication_sources(namespace_name, bucket_name, **kwargs)

List the replication sources of a destination bucket.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • page (str) – (optional) The page at which to start retrieving results.
  • limit (int) – (optional) The maximum number of items to return.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type list of ReplicationSource

Return type:

Response

list_retention_rules(namespace_name, bucket_name, **kwargs)

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 (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • page (str) – (optional) The page at which to start retrieving results.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type RetentionRuleCollection

Return type:

Response

list_work_request_errors(work_request_id, **kwargs)

Lists the errors of the work request with the given ID.

Parameters:
  • work_request_id (str) – (required) The ID of the asynchronous request.
  • page (str) – (optional) The page at which to start retrieving results.
  • limit (int) – (optional) The maximum number of items to return.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type list of WorkRequestError

Return type:

Response

list_work_request_logs(work_request_id, **kwargs)

Lists the logs of the work request with the given ID.

Parameters:
  • work_request_id (str) – (required) The ID of the asynchronous request.
  • page (str) – (optional) The page at which to start retrieving results.
  • limit (int) – (optional) The maximum number of items to return.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type list of WorkRequestLogEntry

Return type:

Response

list_work_requests(compartment_id, **kwargs)

Lists the work requests in a compartment.

Parameters:
  • compartment_id (str) – (required) The ID of the compartment in which to list buckets.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • page (str) – (optional) The page at which to start retrieving results.
  • limit (int) – (optional) The maximum number of items to return.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type list of WorkRequestSummary

Return type:

Response

make_bucket_writable(namespace_name, bucket_name, **kwargs)

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 (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

put_object(namespace_name, bucket_name, object_name, put_object_body, **kwargs)

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 (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • object_name (str) – (required) The name of the object. Avoid entering confidential information. Example: test/object1.log
  • put_object_body (stream) – (required) The object to upload to the object store.
  • content_length (int) – (optional) The content length of the body.
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • if_none_match (str) – (optional) The entity tag (ETag) to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • expect (str) – (optional) 100-continue
  • content_md5 (str) –

    (optional) The optional base-64 header that defines the 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)”

  • content_type (str) – (optional) 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 (str) – (optional) 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 (str) – (optional) 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 (str) – (optional) 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 (str) – (optional) 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 (str) –

    (optional) 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 (str) –

    (optional) 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 (str) –

    (optional) 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.

  • str) opc_meta (dict(str,) –

    (optional) Optional user-defined metadata key and value.

    ”opc-meta-” will be appended to each dict key before it is sent to the server.

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

put_object_lifecycle_policy(namespace_name, bucket_name, put_object_lifecycle_policy_details, **kwargs)

Creates or replaces the object lifecycle policy for the bucket.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • put_object_lifecycle_policy_details (PutObjectLifecyclePolicyDetails) – (required) The lifecycle policy to apply to the bucket.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • if_none_match (str) – (optional) The entity tag (ETag) to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type ObjectLifecyclePolicy

Return type:

Response

reencrypt_bucket(namespace_name, bucket_name, **kwargs)

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 (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

reencrypt_object(namespace_name, bucket_name, object_name, reencrypt_object_details, **kwargs)

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 (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • object_name (str) – (required) The name of the object. Avoid entering confidential information. Example: test/object1.log
  • reencrypt_object_details (ReencryptObjectDetails) – (required) Request object for re-encrypting the data encryption key associated with an object.
  • version_id (str) – (optional) VersionId used to identify a particular version of the object
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

rename_object(namespace_name, bucket_name, rename_object_details, **kwargs)

Rename an object in the given Object Storage namespace.

See Object Names for object naming requirements.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • rename_object_details (RenameObjectDetails) – (required) The sourceName and newName of rename operation.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

restore_objects(namespace_name, bucket_name, restore_objects_details, **kwargs)

Restores one or more objects specified by the objectName parameter. By default objects will be restored for 24 hours. Duration can be configured using the hours parameter.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • restore_objects_details (RestoreObjectsDetails) – (required) Request to restore objects.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

update_bucket(namespace_name, bucket_name, update_bucket_details, **kwargs)

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 (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • update_bucket_details (UpdateBucketDetails) – (required) Request object for updating a bucket.
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Bucket

Return type:

Response

update_namespace_metadata(namespace_name, update_namespace_metadata_details, **kwargs)

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:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • update_namespace_metadata_details (UpdateNamespaceMetadataDetails) – (required) Request object for update NamespaceMetadata.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type NamespaceMetadata

Return type:

Response

update_retention_rule(namespace_name, bucket_name, retention_rule_id, update_retention_rule_details, **kwargs)

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

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • retention_rule_id (str) – (required) The ID of the retention rule.
  • update_retention_rule_details (UpdateRetentionRuleDetails) – (required) Request object for updating the retention rule.
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type RetentionRule

Return type:

Response

upload_part(namespace_name, bucket_name, object_name, upload_id, upload_part_num, upload_part_body, **kwargs)

Uploads a single part of a multipart upload.

Parameters:
  • namespace_name (str) – (required) The Object Storage namespace used for the request.
  • bucket_name (str) – (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • object_name (str) – (required) The name of the object. Avoid entering confidential information. Example: test/object1.log
  • upload_id (str) – (required) The upload ID for a multipart upload.
  • upload_part_num (int) – (required) The part number that identifies the object part currently being uploaded.
  • upload_part_body (stream) – (required) The part being uploaded to the Object Storage service.
  • content_length (int) – (optional) The content length of the body.
  • opc_client_request_id (str) – (optional) The client request ID for tracing.
  • if_match (str) – (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • if_none_match (str) – (optional) The entity tag (ETag) to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • expect (str) – (optional) 100-continue
  • content_md5 (str) –

    (optional) The optional base-64 header that defines the 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_sse_customer_algorithm (str) –

    (optional) 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 (str) –

    (optional) 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 (str) –

    (optional) 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.

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response