All Products
Search
Document Center

Object Storage Service:Go SDK overview

Last Updated:Nov 04, 2024

This topic lists the operations available with Object Storage Service (OSS) SDK for Go.

Bucket-level operations

Category

Method

Scenario

Basic operations

CreateBucket

Creates a bucket.

DeleteBucket

Deletes a bucket.

ListBucket

Queries all buckets.

IsBucketExist

Determine whether buckets exist.

GetBucketInfo

Queries information about a bucket.

GetBucketLocation

Queries the region in which the bucket is located.

GetBucketStat

Queries the storage capacity of a bucket and the number of objects in the bucket.

Retention policy (WORM)

InitiateBucketWorm

Creates a retention policy.

AbortBucketWorm

Deletes an unlocked retention policy.

CompleteBucketWorm

Locks a retention policy.

ExtendBucketWorm

Extends the retention period (days) of objects in a bucket for which a retention policy is locked.

GetBucketWorm

Queries the retention policies that are configured for a bucket.

Access control list (ACL)

SetBucketACL

Configures the ACL of a bucket.

Manage bucket ACLs

Queries the ACL of a bucket .

Lifecycle management

SetBucketLifecycle

Configures lifecycle rules for the objects in a bucket..

GetBucketLifecycle

Queries the lifecycle rules that are configured for objects in a bucket.

DeleteBucketLifecycle

Deletes the lifecycle rules that are configured for objects in a bucket.

Transfer acceleration

SetBucketTransferAcceleration

Configures transfer acceleration for a bucket.

GetBucketTransferAcceleration

Queries the transfer acceleration configurations of the specified bucket.

Versioning

SetBucketVersioning

Configures versioning status of a bucket.

GetBucketVersioning

Queries the versioning status of a bucket.

ListObjectVersions

Lists the versions of all objects in a bucket.

Data replication

PutBucketReplication

Enables and configures data replication rules for a bucket.

PutBucketRTC

Enables or disables Replication Time Control (RTC) for existing cross-region replication (CRR) rules.

GetBucketReplication

Queries the data replication rules that are configured for a bucket.

GetBucketReplicationLocation

Queries the regions in which available destination buckets are located.

GetBucketReplicationProgress

Queries the data replication progress of a bucket.

DeleteBucketReplication

Stops the data replication tasks of a bucket and deletes the data replication configurations of the bucket.

Policy

SetBucketPolicy

Configures a bucket policy.

GetBucketPolicy

Queries the policies configured for a bucket.

DeleteBucketPolicy

Deletes a bucket policy.

Bucket inventory

SetBucketInventory

Configures inventory rules for a bucket.

GetBucketInventory

Queries the specified inventories task configured for a bucket.

ListBucketInventory

Queries all inventories that are configured for a bucket.

DeleteBucketInventory

Deletes a specified inventory task configured for a bucket.

Logging

SetBucketLogging

Enables logging for a bucket.

GetBucketLogging

Queries the logging configurations of a bucket.

DeleteBucketLogging

Disables the logging feature for a bucket.

Static website

SetBucketWebsite

Enables static website hosting for a bucket.

GetBucketWebsite

Queries the status of the static website hosting for a bucket.

DeleteBucketWebsite

Disables static website hosting for a bucket.

Referer-based hotlink protection

SetBucketReferer

Configures hotlink protection rules for a bucket.

GetBucketReferer

Queries the hotlink protection configurations of a bucket.

Tagging

SetBucketTagging

Adds tags to a bucket or modifies the tags of a bucket.

GetBucketTagging

Queries the tags of a bucket.

DeleteBucketTagging

Deletes the tags of a bucket.

Server-side encryption

SetBucketEncryption

Configures encryption rules for a bucket.

GetBucketEncryption

Queries the encryption rules configured for a bucket.

DeleteBucketEncryption

Deletes the encryption rules configured for a bucket.

Pay-by-requester

PutBucketRequestPayment

Enables pay-by-requester for a bucket.

GetBucketRequestPayment

Queries the pay-by-requester configurations of a bucket.

Cross-origin resource sharing (CORS)

SetBucketCors

Configures cross-origin resource sharing (CORS) rules for a bucket.

GetBucketCors

Queries the CORS rules that are configured for a bucket.

DeleteBucketCors

Disable the CORS feature for the specified bucket and clears all CORS rules.

Access tracking

PutBucketAccessMonitor

Configures the access tracking status of a bucket.

GetBucketAccessMonitor

Queries the access tracking status of a bucket.

Data indexing

OpenMetaQuery

Enables the metadata management feature for a bucket.

GetMetaQueryStatus

Queries the metadata index library information of a specified bucket.

DoMetaQuery

Queries objects that meet specified conditions and lists the object information based on the specified fields and sorting methods.

CloseMetaQuery

Disables the metadata management feature for a bucket.

Resource group

PutBucketResourceGroup

Configures a resource group to which a bucket belongs.

GetBucketResourceGroup

Queries the ID of the resource group to which a bucket belongs.

Custom domain name (CNAME)

CreateBucketCnameToken

Creates a CNAME token to verify the ownership of a domain name.

GetBucketCnameToken

Queries the created CNAME tokens.

PutBucketCname

Maps a custom domain name to a bucket.

ListBucketCname

Queries the list of custom domain names mapped to a specified bucket.

DeleteBucketCname

Deletes the custom domain names mapped to a specified bucket.

Image processing

ProcessObject

Processes a specified image.

Image style

PutBucketStyle

Creates an image style.

GetBucketStyle

Queries information about a specific image style in a bucket.

ListBucketStyle

Queries all image styles that are created in a bucket.

DeleteBucketStyle

Deletes a specific image from a bucket.

Object-level operations

Category

Method

Scenario

Basic operations

PutObject

Uploads an object.

GetObject

Queries an object.

CopyObject

Copies an object.

AppendObject

Uploads an object by using append upload.

DeleteObject

Deletes a single object.

DeleteMultipleObjects

Deletes multiple objects.

GetObjectMeta

Queries only the basic metadata of an object, including the ETag, size, as well as date and time that the object was last modified.

Callback

To configure upload callbacks, you only need to add the related callback parameters to the upload request that is sent to OSS.

RestoreObject

Restores Archive, Cold Archive, or Deep Cold Archive objects.

SelectObject

Executes SQL statements on an object. After the SQL statements are executed, execution results are returned.

Manage directories

PutObject

Creates a directory.

DeleteObject

Deletes a directory.

Resumable upload

UploadFile

Uploads a large file by using resumable upload.

Multipart upload

InitiateMultipartUpload

Initiates a multipart upload task.

UploadPart

Uploads an object by part based on the specified object name and upload ID.

UploadPartCopy

Copies data from an existing object to upload a part by adding the x-oss-copy-source request header to an UploadPart request to call the UploadPartCopy operation.

CompleteMultipartUpload

Completes the multipart upload task of an object by calling the CompleteMultipartUpload operation.

AbortMultipartUpload

Cancels a multipart upload task and deletes uploaded parts.

ListMultipartUploads

Lists all ongoing multipart upload tasks, which include tasks that have been initiated but are not completed or canceled.

ListParts

Lists all parts that are uploaded by using a specific upload ID.

Access control (ACL)

SetObjectACL

Modifies the ACL of an object.

GetObjectACL

Queries the ACL of an object.

Symbolic link

PutSymlink

Creates a symbolic link.

GetSymlink

Queries a symbolic link.

Tagging

PutObjectTagging

Configures or updates the tags of an object.

GetObjectTagging

Queries the tags of an object.

DeleteObjectTagging

Deletes specified tags of an object.

LiveChannel operations

Category

Method

Scenario

LiveChannel management

CreateLiveChannel

Creates a LiveChannel.

ListLiveChannel

Lists LiveChannels.

PutLiveChannelStatus

Configures the status of a LiveChannel.

SignRtmpURL

Queries the signed URL of a LiveChannel.

GetLiveChannelStat

Queries the status of a LiveChannel.

GetLiveChannelInfo

Queries the configurations of a LiveChannel.

PostVodPlaylist

Generates a playlist for a LiveChannel.

GetVodPlaylist

Queries the LiveChannel playlist.

GetLiveChannelHistory

Queries the stream ingest records of a LiveChannel.

DeleteLiveChannel

Deletes a LiveChannel.