ObjectStorageClient

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

Use Object Storage and Archive Storage APIs to manage 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_object_storage_tier(namespace_name, …) Changes the storage tier of the object specified by the objectName parameter.
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.

  • circuit_breaker_strategy (obj) – (optional) A circuit breaker strategy to apply to all calls made by this service client (i.e. at the client level). This client uses DEFAULT_CIRCUIT_BREAKER_STRATEGY as default if no circuit breaker strategy is provided. The specifics of circuit breaker strategy are described here.
  • circuit_breaker_callback (function) – (optional) Callback function to receive any exceptions triggerred by the circuit breaker.
  • client_level_realm_specific_endpoint_template_enabled (bool) – (optional) A boolean flag to indicate whether or not this client should be created with realm specific endpoint template enabled or disable. By default, this will be set as None.
  • allow_control_chars – (optional) allow_control_chars is a boolean to indicate whether or not this client should allow control characters in the response object. By default, the client will not allow control characters to be in the response object.
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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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 (oci.object_storage.models.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 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 (str) – (optional) 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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

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

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
  • copy_object_details (oci.object_storage.models.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.

  • opc_sse_kms_key_id (str) –

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

  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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 (oci.object_storage.models.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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Bucket

Return type:

Response

Example:

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

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.

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
  • create_multipart_upload_details (oci.object_storage.models.CreateMultipartUploadDetails) – (required) Request object for creating a multipart upload.
  • if_match (str) – (optional) 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 (str) – (optional) 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 (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_sse_kms_key_id (str) –

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

  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type MultipartUpload

Return type:

Response

Example:

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

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 (oci.object_storage.models.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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type PreauthenticatedRequest

Return type:

Response

Example:

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

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 (oci.object_storage.models.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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ReplicationPolicy

Return type:

Response

Example:

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

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 (oci.object_storage.models.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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type RetentionRule

Return type:

Response

Example:

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

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 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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 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.
  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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

  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Bucket

Return type:

Response

Example:

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

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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type str

Return type:

Response

Example:

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

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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type NamespaceMetadata

Return type:

Response

Example:

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

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 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 (str) – (optional) 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 (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) Specify this query parameter to override the value of the Content-Disposition response header in the GetObject response.
  • http_response_cache_control (str) – (optional) Specify this query parameter to override the Cache-Control response header in the GetObject response.
  • http_response_content_type (str) – (optional) Specify this query parameter to override the Content-Type response header in the GetObject response.
  • http_response_content_language (str) – (optional) Specify this query parameter to override the Content-Language response header in the GetObject response.
  • http_response_content_encoding (str) – (optional) Specify this query parameter to override the Content-Encoding response header in the GetObject response.
  • http_response_expires (str) – (optional) Specify this query parameter to override the Expires response header in the GetObject 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type stream

Return type:

Response

Example:

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

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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ObjectLifecyclePolicy

Return type:

Response

Example:

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

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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type PreauthenticatedRequestSummary

Return type:

Response

Example:

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

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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ReplicationPolicy

Return type:

Response

Example:

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

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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type RetentionRule

Return type:

Response

Example:

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

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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type WorkRequest

Return type:

Response

Example:

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

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 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 (str) – (optional) 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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 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 (str) – (optional) 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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.

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

    (optional) 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type list of BucketSummary

Return type:

Response

Example:

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

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

    (optional) 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type list of MultipartUploadPartSummary

Return type:

Response

Example:

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

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

    (optional) 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type list of MultipartUpload

Return type:

Response

Example:

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

list_object_versions(namespace_name, bucket_name, **kwargs)

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

  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ObjectVersionCollection

Return type:

Response

Example:

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

list_objects(namespace_name, bucket_name, **kwargs)

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 (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) 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 (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 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ListObjects

Return type:

Response

Example:

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

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

    (optional) 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type list of PreauthenticatedRequestSummary

Return type:

Response

Example:

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

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) 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 (int) –

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

  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type list of ReplicationPolicySummary

Return type:

Response

Example:

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

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) 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 (int) –

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

  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type list of ReplicationSource

Return type:

Response

Example:

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

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

  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type RetentionRuleCollection

Return type:

Response

Example:

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

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) 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 (int) –

    (optional) 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type list of WorkRequestError

Return type:

Response

Example:

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

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) 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 (int) –

    (optional) 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type list of WorkRequestLogEntry

Return type:

Response

Example:

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

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) 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 (int) –

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

  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type list of WorkRequestSummary

Return type:

Response

Example:

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

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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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

  • opc_sse_kms_key_id (str) –

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

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

    Allowed values are: “Standard”, “InfrequentAccess”, “Archive”

  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
  • buffer_limit (int) –

    (optional) A buffer limit for the stream to be buffered. buffer_limit is used to set the buffer size capacity. Streams will be read until the size of the buffer reaches the buffer_limit. If the stream size is greater than the buffer_limit, a BufferError exception will be thrown.

    The buffer_limit parameter is used when the stream object does not have a seek, tell, or fileno property for the Python Request library to calculate out the content length. If buffer_limit is not passed, then the buffer_limit will be defaulted to 100MB. Large streams can cause the process to freeze, consider passing in content-length for large streams instead.

Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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 (oci.object_storage.models.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 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 (str) – (optional) The entity tag (ETag) to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the resource already exists.
  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ObjectLifecyclePolicy

Return type:

Response

Example:

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

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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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 (oci.object_storage.models.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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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 (oci.object_storage.models.RenameObjectDetails) – (required) The sourceName and newName of rename operation. Avoid entering confidential information.
  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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 (oci.object_storage.models.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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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 (oci.object_storage.models.UpdateBucketDetails) – (required) Request object for updating a bucket.
  • if_match (str) – (optional) 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Bucket

Return type:

Response

Example:

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

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 (oci.object_storage.models.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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type NamespaceMetadata

Return type:

Response

Example:

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

update_object_storage_tier(namespace_name, bucket_name, update_object_storage_tier_details, **kwargs)

Changes the storage tier of the object specified by the objectName 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
  • update_object_storage_tier_details (oci.object_storage.models.UpdateObjectStorageTierDetails) – (required) The object name and the desired storage tier.
  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

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 (oci.object_storage.models.UpdateRetentionRuleDetails) – (required) Request object for updating the retention rule.
  • if_match (str) – (optional) 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 (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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type RetentionRule

Return type:

Response

Example:

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

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

  • opc_sse_kms_key_id (str) –

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

  • 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. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

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

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
  • buffer_limit (int) –

    (optional) A buffer limit for the stream to be buffered. buffer_limit is used to set the buffer size capacity. Streams will be read until the size of the buffer reaches the buffer_limit. If the stream size is greater than the buffer_limit, a BufferError exception will be thrown.

    The buffer_limit parameter is used when the stream object does not have a seek, tell, or fileno property for the Python Request library to calculate out the content length. If buffer_limit is not passed, then the buffer_limit will be defaulted to 100MB. Large streams can cause the process to freeze, consider passing in content-length for large streams instead.

Returns:

A Response object with data of type None

Return type:

Response

Example:

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