API Overview of OBS SDK for Python¶
Table 1 describes the APIs provided by OBS SDK for Python. You can click an API name in the table to see its detailed information and sample code.
SDK API Overview¶
Interface | Method | Function |
---|---|---|
ObsClient.createBucket | Creates a bucket. | |
ObsClient.listBuckets | Returns a list of buckets in alphabetical order. | |
ObsClient.headBucket | Determines whether a bucket exists. | |
ObsClient.deleteBucket | Deletes an empty bucket. | |
ObsClient.listObjects | Returns some or all (up to 1,000) of the objects in a bucket. | |
ObsClient.listVersions | Lists some or all (up to 1,000) of the object versions in a bucket. | |
ObsClient.listMultipartUploads | Lists ongoing multipart uploads. | |
ObsClient.getBucketMetadata | Sends a HEAD request to a bucket to obtain the bucket metadata such as CORS rules (if set), the storage class, and other information. | |
ObsClient.getBucketLocation | Returns the region where the bucket is created. | |
ObsClient.getBucketStorageInfo | Returns the storage information of a bucket, including the number of objects and the space occupied by the objects in the bucket. | |
ObsClient.setBucketQuota | Sets a storage quota for a bucket. | |
ObsClient.getBucketQuota | Returns the storage quota of a bucket. | |
ObsClient.setBucketStoragePolicy | Configures a storage class for a bucket. | |
ObsClient.getBucketStoragePolicy | Returns the storage class of a bucket. | |
ObsClient.setBucketAcl | Configures a bucket ACL. | |
ObsClient.getBucketAcl | Obtains a bucket ACL. | |
ObsClient.setBucketLogging | Configures logging for a bucket. | |
ObsClient.getBucketLogging | Returns the logging configuration of a bucket. | |
ObsClient.setBucketPolicy | Configures a bucket policy. If the bucket already has a policy, the policy will be overwritten by the one specified in this request. | |
ObsClient.getBucketPolicy | Returns the policy of a bucket. | |
ObsClient.deleteBucketPolicy | Deletes the policy of a bucket. | |
ObsClient.setBucketLifecycle | Configures lifecycle rules for a bucket to periodically transition objects between storage classes or delete objects. | |
ObsClient.getBucketLifecycle | Returns the lifecycle configuration of a bucket. | |
ObsClient.deleteBucketLifecycle | Deletes all lifecycle rules of a bucket. | |
ObsClient.setBucketWebsite | Configures static website hosting for a bucket. | |
ObsClient.getBucketWebsite | Returns the static website hosting configuration of a bucket. | |
ObsClient.deleteBucketWebsite | Deletes the static website hosting configurations of a bucket. | |
ObsClient.setBucketVersioning | Configures versioning for a bucket. | |
ObsClient.getBucketVersioning | Returns the versioning status of a bucket. | |
ObsClient.setBucketCors | Configures CORS for a bucket to allow cross-origin requests. | |
ObsClient.getBucketCors | Returns the CORS rules of a bucket. | |
ObsClient.deleteBucketCors | Deletes the CORS configuration of a bucket. | |
ObsClient.setBucketTagging | Configures tags for a bucket. | |
ObsClient.getBucketTagging | Returns the tags of a bucket. | |
ObsClient.deleteBucketTagging | Deletes the tags of a bucket. | |
ObsClient.putContent | Uploads an object to a bucket. | |
ObsClient.putFile | Uploads a file or folder to a bucket. | |
ObsClient.appendObject | Appends content to an uploaded object. | |
ObsClient.getObject | Downloads an object from a bucket. | |
ObsClient.copyObject | Creates a copy for a specified object. | |
ObsClient.deleteObject | Deletes a single object from a bucket. | |
ObsClient.deleteObjects | Deletes multiple objects from a bucket in a batch. | |
ObsClient.getObjectMetadata | Returns the object metadata. | |
ObsClient.setObjectMetadata | Modifies the metadata for an object. | |
ObsClient.setObjectAcl | Configures an ACL for an object in a specified bucket. | |
ObsClient.getObjectAcl | Obtains the ACL of an object in a specified bucket. | |
ObsClient.initiateMultipartUpload | Initiates a multipart upload in a bucket. | |
ObsClient.uploadPart | Uploads parts to a bucket by specifying the multipart upload ID. | |
ObsClient.copyPart | Copies a part to a specified bucket by specifying the multipart upload ID. | |
ObsClient.listParts | Returns the uploaded parts in a bucket by specifying the multipart upload ID. | |
ObsClient.completeMultipartUpload | Completes a multipart upload based on the multipart upload ID. | |
ObsClient.abortMultipartUpload | Aborts a multipart upload in a bucket by specifying the multipart upload ID. | |
ObsClient.restoreObject | Restores a Cold object. | |
ObsClient.createSignedUrl | Creates a signed URL based on the specified AK and SK, HTTP method, and request parameters. | |
Generating Authentication Parameters for Browser-Based Uploads | ObsClient.createPostSignature | Creates request parameters for authentication to enable browser-based upload with POST. |
ObsClient.uploadFile | Enables resumable uploads of objects in the event of unstable network connections or program crashes. | |
ObsClient.downloadFile | Adds the resumable function to the partial download API. |