API Overview of OBS SDK for Go¶
Table 1 describes the APIs provided by OBS SDK for Go. You can click an API name in the table to see its detailed information and sample code.
API | 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.GetBucketMetadata | Returns the metadata information of a bucket. | |
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.SetBucketLoggingConfiguration | Configures logging for a bucket. | |
obsClient.GetBucketLoggingConfiguration | Returns the logging configuration of a bucket. | |
obsClient.SetBucketPolicy | Configures a policy for a bucket. | |
obsClient.GetBucketPolicy | Returns the policy of a bucket. | |
obsClient.DeleteBucketPolicy | Deletes the policy of a bucket. | |
obsClient.SetBucketLifecycleConfiguration | Configure lifecycle rules for a bucket to periodically transition objects between storage classes and delete objects. | |
obsClient.GetBucketLifecycleConfiguration | Returns the lifecycle configuration of a bucket. | |
obsClient.DeleteBucketLifecycleConfiguration | Deletes all lifecycle rules of a bucket. | |
obsClient.SetBucketWebsiteConfiguration | Configures static website hosting for a bucket. | |
Obtaining the Static Website Hosting Configuration of a Bucket | obsClient.GetBucketWebsiteConfiguration | Returns the static website hosting configuration of a bucket. |
Deleting the Static Website Hosting Configuration of a Bucket | obsClient.DeleteBucketWebsiteConfiguration | Deletes the static website hosting configuration 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.PutObject | Uploads an object to a bucket. | |
obsClient.PutFile | Uploads a file or folder to a bucket. | |
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 | Delete multiple objects from a bucket in a batch. | |
obsClient.GetObjectMetadata | Returns the object metadata. | |
obsClient.SetObjectMetadata | Configures the metadata for an object. | |
obsClient.SetObjectAcl | Configures the ACL for an object. | |
obsClient.GetObjectAcl | Returns the ACL of an object. | |
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. | |
obsClient.ListParts | Returns the uploaded parts in a bucket by specifying the multipart upload ID. | |
obsClient.ListMultipartUploads | Returns the multipart uploads that are initiated but have not been assembled or aborted in a bucket. | |
obsClient.CompleteMultipartUpload | Completes a multipart upload based on the multipart upload ID and information (including PartNumber and ETag) about the uploaded parts. | |
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. | |
obsClient.CreateBrowserBasedSignature | 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 | Enables resumable downloads of objects in the event of unstable network connections or program crashes. |