Setting Bucket Properties
Function
You can use this command to set the properties of a bucket, such as storage classes and access policies.
Command Line Structure
- In Windows
obsutil chattri obs://bucket [-sc=xxx] [-acl=xxx] [-aclXml=xxx] [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
- In Linux or macOS
./obsutil chattri obs://bucket [-sc=xxx] [-acl=xxx] [-aclXml=xxx] [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
Examples
- Take the Windows OS as an example. Run the obsutil chattri obs://bucket-test -acl=private command to change the access control policy of the bucket to private read and write.
obsutil chattri obs://bucket-test -acl=private Start at 2024-09-29 07:58:46.0506904 +0000 UTC Set the acl of bucket [bucket-test] to [private] successfully, request id [04050000016836C5DA6FB21F14A2A0C0]
Parameter Description
Parameter |
Optional or Mandatory |
Description |
---|---|---|
bucket |
Mandatory |
Bucket name |
sc |
Optional (additional parameter) |
Default storage class of the bucket. Possible values are:
NOTE:
If the multi-AZ mode is enabled for a bucket, the default storage class of the bucket cannot be set to cold. |
acl |
Optional (additional parameter) |
Access control policies that can be specified for buckets. Possible values are:
NOTE:
The preceding three values indicate private read and write, public read, and public read and write. |
aclXml |
Optional (additional parameter) |
Access control policy of the bucket, in XML format. <AccessControlPolicy> <Owner> <ID>ownerid</ID> </Owner> <AccessControlList> <Grant> <Grantee> <ID>userid</ID> </Grantee> <Permission>[WRITE|WRITE_ACP|READ|READ_ACP|FULL_CONTROL]</Permission> </Grant> <Grant> <Grantee> <Canned>Everyone</Canned> </Grantee> <Permission>[WRITE|WRITE_ACP|READ|READ_ACP|FULL_CONTROL]</Permission> </Grant> </AccessControlList> </AccessControlPolicy>
NOTE:
NOTICE:
Because angle brackets (<) and (>) are unavoidably included in the parameter value, you must use quotation marks to enclose them for escaping when running the command. Use single quotation marks for Linux or macOS and quotation marks for Windows. |
config |
Optional (additional parameter) |
User-defined configuration file for executing the current command. To learn the parameters that can be configured in this file, see Configuration Parameters. |
e |
Optional (additional parameter) |
Specifies the endpoint. |
i |
Optional (additional parameter) |
Specifies the user's AK. |
k |
Optional (additional parameter) |
Specifies the user's SK. |
t |
Optional (additional parameter) |
Specifies the user's security token. |
Only one from sc, acl, or aclXml can be set for each command.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot