El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Help Center/ Object Storage Service/ SDK Reference/ Go/ API Overview of OBS SDK for Go

API Overview of OBS SDK for Go

Updated on 2023-12-22 GMT+08:00

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.

Table 1 APIs provided by OBS SDK for Go

API

Method

Function

Creating a Bucket

obsClient.CreateBucket

Creates a bucket.

Obtaining a Bucket List

obsClient.ListBuckets

Returns a list of buckets in alphabetical order.

Checking Whether a Bucket Exists

obsClient.HeadBucket

Determines whether a bucket exists.

Deleting a Bucket

obsClient.DeleteBucket

Deletes an empty bucket.

Listing Objects in a Bucket

obsClient.ListObjects

Returns some or all (up to 1,000) of the objects in a bucket.

Listing Object Versions in a Bucket

obsClient.ListVersions

Lists some or all (up to 1,000) of the object versions in a bucket.

Obtaining Bucket Metadata

obsClient.GetBucketMetadata

Returns the metadata information of a bucket.

Obtaining the Region of a Bucket

obsClient.GetBucketLocation

Returns the region where the bucket is created.

Obtaining Storage Information of a Bucket

obsClient.GetBucketStorageInfo

Returns the storage information of a bucket, including the number of objects and the space occupied by the objects in the bucket.

Configuring a Storage Quota

obsClient.SetBucketQuota

Sets a storage quota for a bucket.

Obtaining a Bucket Storage Quota

obsClient.GetBucketQuota

Returns the storage quota of a bucket.

Configuring Storage Class for a Bucket

obsClient.SetBucketStoragePolicy

Configures a storage class for a bucket.

Obtaining the Storage Class of a Bucket

obsClient.GetBucketStoragePolicy

Returns the storage class of a bucket.

Configuring a Bucket ACL

obsClient.SetBucketAcl

Configures the ACL for a bucket.

Obtaining the Bucket ACL

obsClient.GetBucketAcl

Returns the bucket ACL.

Configuring Logging for a Bucket

obsClient.SetBucketLoggingConfiguration

Configures logging for a bucket.

Obtaining the Logging Configuration of a Bucket

obsClient.GetBucketLoggingConfiguration

Returns the logging configuration of a bucket.

Configuring a Bucket Policy

obsClient.SetBucketPolicy

Configures a policy for a bucket.

Obtaining the Policy of a Bucket

obsClient.GetBucketPolicy

Returns the policy of a bucket.

Deleting a Bucket Policy

obsClient.DeleteBucketPolicy

Deletes the policy of a bucket.

Configuring Lifecycle Rules for a Bucket

obsClient.SetBucketLifecycleConfiguration

Configure lifecycle rules for a bucket to periodically transition objects between storage classes and delete objects.

Obtaining the Lifecycle Configuration of a Bucket

obsClient.GetBucketLifecycleConfiguration

Returns the lifecycle configuration of a bucket.

Deleting the Lifecycle Configuration of a Bucket

obsClient.DeleteBucketLifecycleConfiguration

Deletes all lifecycle rules of a bucket.

Configuring Static Website Hosting for 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.

Configuring Versioning for a Bucket

obsClient.SetBucketVersioning

Configures versioning for a bucket.

Obtaining the Versioning Status of a Bucket

obsClient.GetBucketVersioning

Returns the versioning status of a bucket.

Configuring CORS for a Bucket

obsClient.SetBucketCors

Configures CORS for a bucket to allow cross-origin requests.

Obtaining the CORS Configuration of a Bucket

obsClient.GetBucketCors

Returns the CORS rules of a bucket.

Deleting the CORS Configuration of a Bucket

obsClient.DeleteBucketCors

Deletes the CORS configuration of a bucket.

Configuring Tags for a Bucket

obsClient.SetBucketTagging

Adds tags to a bucket.

Obtaining Bucket Tags

obsClient.GetBucketTagging

Returns the tags of a bucket.

Deleting Bucket Tags

obsClient.DeleteBucketTagging

Deletes the tags of a bucket.

Uploading an Object

obsClient.PutObject

Uploads an object to a bucket.

Uploading a File

obsClient.PutFile

Uploads a file or folder to a bucket.

Download an Object

obsClient.GetObject

Downloads an object from a bucket.

Copying an Object

obsClient.CopyObject

Creates a copy for a specified object.

Deleting an Object

obsClient.DeleteObject

Deletes a single object from a bucket.

Batch Deleting Objects

obsClient.DeleteObjects

Delete multiple objects from a bucket in a batch.

Obtaining Object Metadata

obsClient.GetObjectMetadata

Returns the object metadata.

Configuring Object Metadata

obsClient.SetObjectMetadata

Configures the metadata for an object.

Configuring an Object ACL

obsClient.SetObjectAcl

Configures the ACL for an object.

Obtaining Object ACL Information

obsClient.GetObjectAcl

Returns the ACL of an object.

Initiating a Multipart Upload

obsClient.InitiateMultipartUpload

Initiates a multipart upload in a bucket.

Uploading a Part

obsClient.UploadPart

Uploads parts to a bucket by specifying the multipart upload ID.

Copying a Part

obsClient.CopyPart

Copies a part to a specified bucket.

Listing Uploaded Parts

obsClient.ListParts

Returns the uploaded parts in a bucket by specifying the multipart upload ID.

Listing Multipart Uploads

obsClient.ListMultipartUploads

Returns the multipart uploads that are initiated but have not been assembled or aborted in a bucket.

Assembling Parts

obsClient.CompleteMultipartUpload

Completes a multipart upload based on the multipart upload ID and information (including PartNumber and ETag) about the uploaded parts.

Aborting a Multipart Upload

obsClient.AbortMultipartUpload

Aborts a multipart upload in a bucket by specifying the multipart upload ID.

Restoring an Archive Object

obsClient.RestoreObject

Restores an Archive object.

Creating a Signed URL

obsClient.CreateSignedUrl

Creates a signed URL based on the specified AK and SK, HTTP method, and request parameters.

Creating Parameters for Browser-based Upload

obsClient.CreateBrowserBasedSignature

Creates request parameters for authentication to enable browser-based upload with POST.

Uploading an Object - Resumable

obsClient.UploadFile

Enables resumable uploads of objects in the event of unstable network connections or program crashes.

Downloading an Object - Resumable

obsClient.DownloadFile

Enables resumable downloads of objects in the event of unstable network connections or program crashes.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback