Overview
This document describes all APIs of Object Storage Service (OBS) Go SDK, including the API description, method definition, and parameter description.
SDK API Overview
| Interface | Method Definition | Function Description |
|---|---|---|
| obsClient.CreateBucket | You can use this API to create a bucket. | |
| obsClient.ListBuckets | You can use this API to obtain the bucket list. In the list, bucket names are displayed in lexicographical order. | |
| obsClient.HeadBucket | You can use this API to check whether a bucket exists. | |
| obsClient.DeleteBucket | You can use this API to delete a bucket. The bucket to be deleted must be empty. | |
| obsClient.ListObjects | You can use this API to list objects in a bucket. By default, a maximum of 1000 objects are listed. | |
| obsClient.ListVersions | You can use this API to list versioned objects in a bucket. By default, a maximum of 1000 versioned objects are listed. | |
| obsClient.GetBucketMetadata | You can use this API to send a HEAD request to a bucket to obtain the bucket metadata such as the CORS rules (if set), storage class, and other information. | |
| obsClient.GetBucketLocation | You can use this API to obtain the bucket location. | |
| 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. | |
| 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. | |
| obsClient.GetBucketQuota | You can use this API to obtain the storage capacity quota of a bucket. Value 0 indicates that no upper limit is set for the bucket storage capacity. | |
| 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. | |
| obsClient.GetBucketStoragePolicy | You can use this API to obtain the storage class of a bucket. | |
| obsClient.SetBucketAcl | You can use this API to set a bucket ACL. | |
| obsClient.GetBucketAcl | You can use this API to obtain a bucket ACL. | |
| obsClient.SetBucketLoggingConfiguration | You can use this API to configure the logging function for a bucket. | |
| obsClient.GetBucketLoggingConfiguration | You can use this API to obtain the logging configuration of a bucket. | |
| 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. | |
| obsClient.GetBucketPolicy | You can use this API to obtain the configuration information of a bucket policy. | |
| obsClient.DeleteBucketPolicy | You can use this API to delete a bucket policy. | |
| obsClient.SetBucketLifecycleConfiguration | 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. | |
| obsClient.GetBucketLifecycleConfiguration | You can use this API to obtain the lifecycle configuration information of a bucket. | |
| obsClient.DeleteBucketLifecycleConfiguration | You can use this API to delete all lifecycle rules of a bucket. | |
| obsClient.SetBucketWebsiteConfiguration | You can use this API to configure website hosting for a bucket. | |
| obsClient.GetBucketWebsiteConfiguration | You can use this API to obtain the website hosting settings of a bucket. | |
| obsClient.DeleteBucketWebsiteConfiguration | You can use this API to delete the website hosting settings of a bucket. | |
| obsClient.SetBucketVersioning | You can use this API to set the versioning status for a bucket. | |
| obsClient.GetBucketVersioning | You can use this API to obtain the versioning status of a bucket. | |
| obsClient.SetBucketCors | You can use this API to configure CORS rules for a bucket to allow client browsers to send cross-domain requests. | |
| obsClient.GetBucketCors | You can use this API to obtain the CORS rules of a specified bucket. | |
| obsClient.DeleteBucketCors | You can use this API to delete the CORS rules of a specified bucket. | |
| obsClient.SetBucketNotification | You can use this API to configure event notification for a bucket, so that you can be notified of all specified operations performed on the bucket. | |
| obsClient.GetBucketNotification | You can use this API to obtain the event notification settings of a bucket. | |
| obsClient.SetBucketTagging | You can use this API to add tags to a bucket. | |
| obsClient.GetBucketTagging | You can use this API to obtain the tag settings of a specified bucket. | |
| obsClient.DeleteBucketTagging | You can use this API to delete tags of a specified bucket. | |
| obsClient.PutObject | You can use this API to upload an object to a specified bucket. | |
| obsClient.PutFile | You can use this API to upload a file or folder to a specified bucket. | |
| obsClient.GetObject | You can use this API to download an object in a specified bucket. | |
| obsClient.CopyObject | You can use this API to create a copy for an object in a specified bucket. | |
| obsClient.DeleteObject | You can use this API to delete an object from a specified bucket. | |
| obsClient.DeleteObjects | You can use this API to delete objects from a specified bucket in a batch. | |
| obsClient.GetObjectMetadata | You can use this API to send a HEAD request to obtain the metadata of an object in a specified bucket. | |
| obsClient.SetObjectAcl | You can use this API to set the ACL for an object in a specified bucket. | |
| obsClient.GetObjectAcl | You can use this API to obtain the ACL information of an object in a specified bucket. | |
| obsClient.InitiateMultipartUpload | You can use this API to initialize a multipart upload in a specified bucket. | |
| 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. | |
| obsClient.CopyPart | After a multipart upload is initialized, you can use this API to copy a part of a multipart upload task to a specified bucket. | |
| obsClient.ListParts | You can use this API to list the uploaded parts in a specified bucket by using the multipart upload ID. | |
| obsClient.ListMultipartUploads | You can use this API to list the multipart upload tasks that are initialized but not combined or aborted in a specified bucket. | |
| obsClient.CompleteMultipartUpload | You can use this API to combine the uploaded parts in a specified bucket by using the multipart upload ID. | |
| obsClient.AbortMultipartUpload | You can use this API to abort a multipart upload in a bucket by specifying the multipart upload ID. | |
| obsClient.RestoreObject | You can use this API to restore an object from the OBS Archive storage class in a specified bucket. | |
| obsClient.RestoreObject | You can use this API to restore an object from the OBS Cold storage class in a specified bucket. | |
| 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. | |
| 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. | |
| 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. |
Next Article: SDK Download Links
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.