检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
This example uploads string Hello OBS to bucket bucketname as object objectname.
When versioning is enabled for a bucket, OBS keeps multiple versions of an object in the bucket, allowing you to easily retrieve and restore historical versions or recover data in the event of accidental changes or application failures.
Restrictions OBS creates log files and uploads them to the bucket. Before enabling logging for a bucket, you need to create an IAM agency to delegate OBS to upload log files to the specified bucket.
For details, see Introduction to OBS Access Control, IAM Custom Policies, and Creating a Custom Bucket Policy. The mapping between OBS regions and endpoints must comply with what is listed in Regions and Endpoints.
For details, see Introduction to OBS Access Control, IAM Custom Policies, and Configuring an Object Policy. The mapping between OBS regions and endpoints must comply with what is listed in Regions and Endpoints.
OBS supports CORS rules that allow the resources in OBS to be requested by other domains. You can call the API to configure CORS for a bucket to allow cross-origin requests from client browsers. The configured CORS rules follow the principle of new ones overwriting old ones.
When versioning is enabled for a bucket, OBS keeps multiple versions of an object in the bucket, allowing you to easily retrieve and restore historical versions or recover data in the event of accidental changes or application failures.
When versioning is enabled for a bucket, OBS keeps multiple versions of an object in the bucket, allowing you to easily retrieve and restore historical versions or recover data in the event of accidental changes or application failures.
When versioning is enabled for a bucket, OBS keeps multiple versions of an object in the bucket, allowing you to easily retrieve and restore historical versions or recover data in the event of accidental changes or application failures.
When versioning is enabled for a bucket, OBS keeps multiple versions of an object in the bucket, allowing you to easily retrieve and restore historical versions or recover data in the event of accidental changes or application failures.
When versioning is enabled for a bucket, OBS keeps multiple versions of an object in the bucket, allowing you to easily retrieve and restore historical versions or recover data in the event of accidental changes or application failures.
Default value: None requestId str Explanation: Request ID returned by the OBS server Default value: None indicator str Explanation: Error indicator returned by the OBS server. Default value: None hostId str Explanation: Requested server ID.
import ObsClient, HeadPermission from obs import ACL from obs import Owner from obs import Grantee from obs import Grant from obs import Group from obs import Permission import os import traceback # Obtain an AK and SK pair using environment variables or import the AK and SK pair
Restrictions To obtain an object ACL, you must be the bucket owner or have the required permission (obs:object:GetObjectAcl in IAM or GetObjectAcl in a bucket policy). For details, see Introduction to OBS Access Control, IAM Custom Policies, and Configuring an Object Policy.
Ways to Restore Objects You can use OBS Console, APIs, SDKs, OBS Browser+, or obsutil to restore Archive or Deep Archive objects. Using OBS Console In the navigation pane of OBS Console, choose Object Storage. In the bucket list, click the bucket you want to operate.
If there is no such a default master key, OBS will create one and use it by default.
If there is no such a default master key, OBS will create one and use it by default.
Example: obsutil cp d:\temp\test.txt obs://bucket-test/key -threshold=52428800 In this command: obsutil cp d:\temp\test.txt obs://bucket-test/key uploads file test.txt in the temp directory under D drive to bucket bucket-test and renames the file key.
OBS supports two versioning statuses. Versioning Status Description Value in OBS Android SDK Enabled OBS creates a unique version ID for each uploaded object. Namesake objects are not overwritten and are distinguished by their own version IDs.
This method only supports setting the object expiration time in days, and the expired objects will be automatically deleted by OBS, with a higher priority than bucket lifecycle rules.