ObjectStorageClient

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

Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources.

__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 is that the client never times out. This keyword argument can be provided as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout.
  • signer (AbstractBaseSigner) --

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

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

  • retry_strategy (obj) --

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

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

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

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

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

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

cancel_work_request(work_request_id, **kwargs)

Cancel a work request Cancels a work request.

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

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

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

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

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

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

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

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

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

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

create_bucket(namespace_name, create_bucket_details, **kwargs)

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

Parameters:
  • namespace_name (str) -- (required) The Object Storage namespace used for the request.
  • create_bucket_details (CreateBucketDetails) -- (required) Request object for creating a bucket.
  • opc_client_request_id (str) -- (optional) The client request ID for tracing.
  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type Bucket

Return type:

Response

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

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

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

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

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

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

Returns:

A Response object with data of type MultipartUpload

Return type:

Response

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

Create Preauthenticated Request Creates a pre-authenticated request specific to the bucket.

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

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

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

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

Returns:

A Response object with data of type PreauthenticatedRequest

Return type:

Response

delete_bucket(namespace_name, bucket_name, **kwargs)

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

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

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

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

DELETE Object Deletes an object.

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

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

delete_object_lifecycle_policy(namespace_name, bucket_name, **kwargs)

Delete object lifecycle policy Deletes the object lifecycle policy for the bucket.

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

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

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

DELETE Preauthenticated Request Deletes the pre-authenticated request for the bucket.

Parameters:
  • namespace_name (str) -- (required) The Object Storage namespace used for the request.
  • bucket_name (str) -- (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • par_id (str) -- (required) The unique identifier for the pre-authenticated request. This can be used to manage operations against the pre-authenticated request, such as GET or DELETE.
  • opc_client_request_id (str) -- (optional) The client request ID for tracing.
  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

get_bucket(namespace_name, bucket_name, **kwargs)

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

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

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

    Allowed values are: "approximateCount", "approximateSize"

  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type Bucket

Return type:

Response

get_namespace(**kwargs)

GET Namespace Name 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 the tenancy OCID or the compartment OCID within the tenancy whose Object Storage namespace name has to be retrieved.
  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type str

Return type:

Response

get_namespace_metadata(namespace_name, **kwargs)

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

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

Parameters:
  • namespace_name (str) -- (required) The Object Storage namespace used for the request.
  • opc_client_request_id (str) -- (optional) The client request ID for tracing.
  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type NamespaceMetadata

Return type:

Response

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

GET Object 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
  • if_match (str) -- (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • if_none_match (str) -- (optional) The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) -- (optional) The client request ID for tracing.
  • range (str) --

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

  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type stream

Return type:

Response

get_object_lifecycle_policy(namespace_name, bucket_name, **kwargs)

GET object lifecycle policy Gets the object lifecycle policy for the bucket.

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

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

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

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

Returns:

A Response object with data of type ObjectLifecyclePolicy

Return type:

Response

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

GET Preauthenticated Request Gets the pre-authenticated request for the bucket.

Parameters:
  • namespace_name (str) -- (required) The Object Storage namespace used for the request.
  • bucket_name (str) -- (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • par_id (str) -- (required) The unique identifier for the pre-authenticated request. This can be used to manage operations against the pre-authenticated request, such as GET or DELETE.
  • opc_client_request_id (str) -- (optional) The client request ID for tracing.
  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type PreauthenticatedRequestSummary

Return type:

Response

get_work_request(work_request_id, **kwargs)

GET Work Request Status Gets the status of the work request for the given ID.

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

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

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

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

Returns:

A Response object with data of type WorkRequest

Return type:

Response

head_bucket(namespace_name, bucket_name, **kwargs)

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

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

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

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

HEAD Object 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
  • if_match (str) -- (optional) The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • if_none_match (str) -- (optional) The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a part, this is the entity tag of the target part.
  • opc_client_request_id (str) -- (optional) The client request ID for tracing.
  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

list_buckets(namespace_name, compartment_id, **kwargs)

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

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

Parameters:
  • namespace_name (str) -- (required) The Object Storage namespace used for the request.
  • compartment_id (str) -- (required) The ID of the compartment in which to list buckets.
  • limit (int) -- (optional) The maximum number of items to return.
  • page (str) -- (optional) The page at which to start retrieving results.
  • fields (list[str]) --

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

    Allowed values are: "tags"

  • opc_client_request_id (str) -- (optional) The client request ID for tracing.
  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type list of BucketSummary

Return type:

Response

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

List Multipart Upload Parts Lists the parts of an in-progress multipart upload.

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

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

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

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

Returns:

A Response object with data of type list of MultipartUploadPartSummary

Return type:

Response

list_multipart_uploads(namespace_name, bucket_name, **kwargs)

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

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

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

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

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

Returns:

A Response object with data of type list of MultipartUpload

Return type:

Response

list_objects(namespace_name, bucket_name, **kwargs)

List Objects Lists the objects in a bucket.

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

Parameters:
  • namespace_name (str) -- (required) The Object Storage namespace used for the request.
  • bucket_name (str) -- (required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • prefix (str) -- (optional) The string to use for matching against the start of object names in a list query.
  • start (str) -- (optional) Object names returned by a list query must be greater or equal to this parameter.
  • end (str) -- (optional) Object names returned by a list query must be strictly less than this parameter.
  • limit (int) -- (optional) The maximum number of items to return.
  • delimiter (str) -- (optional) When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are returned in the objects key of the response body. Scanned objects whose names contain the delimiter have the part of their name up to the first occurrence of the delimiter (including the optional prefix) returned as a set of prefixes. Note that only '/' is a supported delimiter character at this time.
  • fields (str) --

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

    Allowed values are: "name", "size", "timeCreated", "md5"

  • opc_client_request_id (str) -- (optional) The client request ID for tracing.
  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type ListObjects

Return type:

Response

list_preauthenticated_requests(namespace_name, bucket_name, **kwargs)

List Preauthenticated Requests Lists pre-authenticated requests for the bucket.

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

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

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

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

Returns:

A Response object with data of type list of PreauthenticatedRequestSummary

Return type:

Response

list_work_request_errors(work_request_id, **kwargs)

List Work Request Errors Lists the errors of the work request with the given ID.

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

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

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

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

Returns:

A Response object with data of type list of WorkRequestError

Return type:

Response

list_work_request_logs(work_request_id, **kwargs)

List Work Request Logs Lists the logs of the work request with the given ID.

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

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

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

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

Returns:

A Response object with data of type list of WorkRequestLogEntry

Return type:

Response

list_work_requests(compartment_id, **kwargs)

List Work Requests Lists the work requests in a compartment.

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

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

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

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

Returns:

A Response object with data of type list of WorkRequestSummary

Return type:

Response

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

PUT Object Creates a new object or overwrites an existing one. See Special Instructions for Object Storage PUT for request signature requirements.

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

    (optional) The base-64 encoded MD5 hash of the body. If the 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 content type of the object. Defaults to 'application/octet-stream' if not overridden during the PutObject call.
  • content_language (str) -- (optional) The content language of the object.
  • content_encoding (str) -- (optional) The content encoding of the object.
  • str) opc_meta (dict(str,) --

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

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

  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

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

Put object lifecycle policy. Creates or replaces the object lifecycle policy for the bucket.

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

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

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

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

Returns:

A Response object with data of type ObjectLifecyclePolicy

Return type:

Response

reencrypt_bucket(namespace_name, bucket_name, **kwargs)

Reencrypt Bucket Data Encryption Key Reencrypts the data encryption key of the bucket and objects in the bucket. This is an asynchronous call, the system will start a work request task to reencrypt the data encryption key of the objects and chunks in the bucket. Only the objects created before the time the API call will be reencrypted. The call can take long time depending on how many objects in the bucket and how big the objects are. This API will return a work request id, so the user can use this id to retrieve the status of the work request task.

A user can update kmsKeyId of the bucket, and then call this API, so the data encryption key of the bucket and objects in the bucket will be reencryped by the new kmsKeyId. Note that the system doesn't maintain what ksmKeyId is used to encrypt the object, the user has to maintain the mapping if they want.

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

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

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

Rename Object Rename an object 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
  • rename_object_details (RenameObjectDetails) -- (required) The sourceName and newName of rename operation.
  • opc_client_request_id (str) -- (optional) The client request ID for tracing.
  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

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

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

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

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

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

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

Returns:

A Response object with data of type None

Return type:

Response

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

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

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

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

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

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

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

Returns:

A Response object with data of type Bucket

Return type:

Response

update_namespace_metadata(namespace_name, update_namespace_metadata_details, **kwargs)

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

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

Parameters:
  • namespace_name (str) -- (required) The Object Storage namespace used for the request.
  • update_namespace_metadata_details (UpdateNamespaceMetadataDetails) -- (required) Request object for update NamespaceMetadata.
  • opc_client_request_id (str) -- (optional) The client request ID for tracing.
  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type NamespaceMetadata

Return type:

Response

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

Upload Multipart Object Part Uploads a single part of a multipart upload.

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

    (optional) The base-64 encoded MD5 hash of the body. If the 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)"

  • retry_strategy (obj) --

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

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

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

Returns:

A Response object with data of type None

Return type:

Response