Overview

This document describes all APIs of Object Storage Service (OBS) Python SDK, including the API description, method definition, and parameter description.

SDK API Overview

Interface

Method Definition

Function Description

Creating a Bucket

ObsClient.createBucket

You can use this API to create a bucket.

Listing Buckets

ObsClient.listBuckets

You can use this API to obtain the bucket list. In the list, bucket names are displayed in lexicographical order.

Checking Whether a Bucket Exists

ObsClient.headBucket

You can use this API to check whether a bucket exists.

Deleting a Bucket

ObsClient.deleteBucket

You can use this API to delete a bucket. The bucket to be deleted must be empty.

Listing Objects in a Bucket

ObsClient.listObjects

You can use this API to list objects in a bucket. By default, a maximum of 1000 objects are listed.

Listing Versioned Objects in a Bucket

ObsClient.listVersions

You can use this API to list versioned objects in a bucket. By default, a maximum of 1000 versioned objects are listed.

Listing Multipart Uploads

ObsClient.listMultipartUploads

You can use this API to list the multipart uploads that are initialized but not combined or aborted in a specified bucket.

Obtaining Bucket Metadata

ObsClient.getBucketMetadata

You can use this API to send a HEAD request to a bucket to obtain the bucket metadata such as CORS rules (if set), the storage class, and other information.

Obtaining a Bucket Location

ObsClient.getBucketLocation

You can use this API to obtain the bucket location.

Obtaining Bucket Storage Information

ObsClient.getBucketStorageInfo

You can use this API to obtain storage information about a bucket, including the bucket size and number of objects in the bucket.

Setting the Storage Capacity Quota for a Bucket

ObsClient.setBucketQuota

You can use this API to set the bucket quota. A bucket quota must be expressed in bytes and the maximum value is 263-1. Value 0 indicates that no upper limit is set for the bucket quota.

Obtaining the Storage Capacity Quota of a Bucket

ObsClient.getBucketQuota

You can use this API to obtain the bucket quota. Value 0 indicates that no upper limit is set for the bucket quota.

Setting a Storage Class for a Bucket

ObsClient.setBucketStoragePolicy

You can use this API to set a storage class for a bucket. The storage class of an object defaults to be that of its residing bucket.

Obtaining the Storage Class of a Bucket

ObsClient.getBucketStoragePolicy

You can use this API to obtain a storage class of a bucket.

Setting a Bucket ACL

ObsClient.setBucketAcl

You can use this API to set a bucket ACL.

Obtaining a Bucket ACL

ObsClient.getBucketAcl

You can use this API to obtain a bucket ACL.

Configuring Logging for a Bucket

ObsClient.setBucketLogging

You can use this API to set access logging configuration for a bucket.

Obtaining Logging Configuration of a Bucket

ObsClient.getBucketLogging

You can use this API to obtain access logging configuration of a bucket.

Configuring a Bucket Policy

ObsClient.setBucketPolicy

You can use this API to set a bucket policy. If the bucket already has a policy, the policy will be overwritten by the one specified in this request.

Obtaining a Bucket Policy

ObsClient.getBucketPolicy

You can use this API to obtain a bucket policy.

Deleting a Bucket Policy

ObsClient.deleteBucketPolicy

You can use this API to delete the policy of a bucket.

Configuring a Lifecycle Rule for a Bucket

ObsClient.setBucketLifecycle

You can use this API to set lifecycle rules for a bucket, to periodically transit storage classes of objects and delete objects in the bucket.

Obtaining the Lifecycle Configuration Information of a Bucket

ObsClient.getBucketLifecycle

You can use this API to obtain the lifecycle rules of a bucket.

Deleting Lifecycle Rules of a Bucket

ObsClient.deleteBucketLifecycle

You can use this API to delete all lifecycle rules of a bucket.

Configuring Website Hosting for a Bucket

ObsClient.setBucketWebsite

You can use this API to set website hosting for a bucket.

Obtaining Website Hosting Settings of a Bucket

ObsClient.getBucketWebsite

You can use this API to obtain the website hosting settings of a bucket.

Deleting Website Hosting Settings of a Bucket

ObsClient.deleteBucketWebsite

You can use this API to delete the website hosting settings of a bucket.

Setting the Versioning Status for a Bucket

ObsClient.setBucketVersioning

You can use this API to set the versioning status for a bucket.

Obtaining the Versioning Status of a Bucket

ObsClient.getBucketVersioning

You can use this API to obtain the versioning status of a bucket.

Configuring CORS Rules for a Bucket

ObsClient.setBucketCors

You can use this API to set CORS rules for a bucket to allow client browsers to send cross-domain requests.

Obtaining the CORS Configuration Information of a Bucket

ObsClient.getBucketCors

You can use this API to obtain the CORS rules of a specified bucket.

Deleting CORS Rules of a Bucket

ObsClient.deleteBucketCors

You can use this API to delete the CORS rules of a specified bucket.

Configuring Event Notification for a Bucket

ObsClient.setBucketNotification

You can use this API to configure event notification for a bucket. You will be notified of all specified operations performed on the bucket.

Obtaining the Event Notification Settings of a Bucket

ObsClient.getBucketNotification

You can use this API to obtain the event notification configuration of a bucket.

Adding Tags to a Bucket

ObsClient.setBucketTagging

You can use this API to set the tags for a bucket.

Obtaining the Tag Settings of a Bucket

ObsClient.getBucketTagging

You can use this API to obtain the tags of a specified bucket.

Deleting Tags of a Bucket

ObsClient.deleteBucketTagging

You can use this API to delete the tags of a specified bucket.

Object Upload Overview

ObsClient.putContent

You can use this API to upload an object to a specified bucket.

Uploading Objects - File-Based

ObsClient.putFile

You can use this API to upload a file or folder to a specified bucket.

Uploading Objects - Appending

ObsClient.appendObject

You can use this API to upload an object in appendable mode and append data to the object.

Object Download Overview

ObsClient.getObject

You can use this API to download an object in a specified bucket.

Copying an Object

ObsClient.copyObject

You can use this API to create a copy for an object in a specified bucket.

Deleting an Object

ObsClient.deleteObject

You can use this API to delete an object from a specified bucket.

Deleting Objects in a Batch

ObsClient.deleteObjects

You can use this API to delete objects from a specified bucket in a batch.

Obtaining Object Metadata

ObsClient.getObjectMetadata

You can use this API to send a HEAD request to the object of a specified bucket to obtain its metadata.

Modifying Object Metadata

ObsClient.setObjectMetadata

You can use this API to modify metadata of objects in a specified bucket.

Setting Object ACL

ObsClient.setObjectAcl

You can use this API to set the ACL for an object in a specified bucket.

Overview

ObsClient.getObjectAcl

You can use this API to obtain the ACL of an object in a specified bucket.

Initializing a Multipart Upload

ObsClient.initiateMultipartUpload

You can use this API to initialize a multipart upload in a specified bucket.

Uploading a Part

ObsClient.uploadPart

After a multipart upload is initialized, you can use this API to upload a part to a specified bucket by using the multipart upload ID.

Copying a Part

ObsClient.copyPart

After a multipart upload is initialized, you can use this API to copy a part to a specified bucket by using the multipart upload ID.

Listing Uploaded Parts

ObsClient.listParts

You can use this API to list the uploaded parts in a specified bucket by using the multipart upload ID.

Merging Parts

ObsClient.completeMultipartUpload

You can use this API to combine the uploaded parts in a specified bucket by using the multipart upload ID.

Aborting a Multipart Upload

ObsClient.abortMultipartUpload

You can use this API to abort a multipart upload in a specified bucket by using the multipart upload ID.

Restoring an Archive Object

ObsClient.restoreObject

You can use this API to restore an object in the OBS Archive storage class in a specified bucket.

Creating a Signed URL

ObsClient.createSignedUrl

You can use this API to generate a URL whose Query parameter is carried with authentication information, by specifying the AK and SK, HTTP method, and request parameter. You can use a signed URL to perform specific operations on OBS.

Generating Browser-Based Upload Parameters with Authentication Information

ObsClient.createPostSignature

You can use this API to generate parameters for authentication. The parameters can be used to upload data through POST operations based on a browser.

Uploading Objects - Resumable Transfer

ObsClient.uploadFile

You can use this API to encapsulate and enhance multipart upload in response to an upload failure of large files due to unstable network or program breakdown.

Downloading Objects - Resumable Transfer

ObsClient.downloadFile

You can use this API to encapsulate and enhance partial download in response to a download failure of large files due to unstable network or program breakdown.

Creating a Workflow

WorkflowClient.createWorkflow

You can use this API to create a workflow based on a template.

Querying a Workflow

WorkflowClient.getWorkflow

You can use this API to query workflows by name.

Deleting a Workflow

WorkflowClient.deleteWorkflow

You can use this API to delete a workflow.

Updating a Workflow

WorkflowClient.updateWorkflow

You can use this API to update a workflow.

Querying the Workflow List

WorkflowClient.listWorkflow

You can use this API to query the workflow list.

Calling an API to Trigger a Workflow

WorkflowClient.asyncAPIStartWorkflow

You can call this API to configure the triggering of a workflow by an API.

Querying the Workflow Instance List

WorkflowClient.listWorkflowExecution

You can use this API to query the workflow instance list.

Querying a Workflow Instance

WorkflowClient.getWorkflowExecution

You can use this API to query the details of a workflow instance.

Resuming a Failed Workflow Instance

WorkflowClient.restoreFailedWorkflowExecution

You can use this API to restore a failed workflow instance. A workflow instance can be restored only when it fails to be executed. Once restored, the execution continues from where the workflow instance failed. Executed parts are not executed again.

Configuring a Bucket Trigger

WorkflowClient.putTriggerPolicy

You can use this API to bind a workflow trigger to a bucket.

Querying a Bucket Trigger

WorkflowClient.getTriggerPolicy

You can use this API to query a workflow trigger bound to a bucket.

Deleting a Bucket Trigger

WorkflowClient.deleteTriggerPolicy

You can use this API to delete a workflow trigger bound to a bucket.