Sets the resource policy for a Table Bucket.
Usage notes
-
A new resource policy overwrites any existing policy on the Table Bucket. To modify a policy, first retrieve the current policy using the
get-table-bucket-policycommand, make your changes, and then apply the updated policy.
Command syntax
ossutil tables-api put-table-bucket-policy --table-bucket-arn value --resource-policy value [flags]
|
Parameter |
Type |
Description |
|
--table-bucket-arn |
string |
The ARN of the Table Bucket. The format is |
|
--resource-policy |
string |
A JSON-formatted string that defines access controls for the Table Bucket. The policy uses fields such as |
-
This command corresponds to the PutTableBucketPolicy API operation. For more information about API parameters, see PutTableBucketPolicy.
-
For supported global command-line options, see ossutil global options.
--resource-policy
The --resource-policy option supports the following JSON syntax:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "osstables:*",
"Resource": "acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket"
}
]
}
Examples
-
Allow all users to perform all operations on a Table Bucket using a JSON argument.
ossutil tables-api put-table-bucket-policy --table-bucket-arn acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket --resource-policy '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":"*","Action":"osstables:*","Resource":"acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket"}]}' -
Set a read-only access policy using a configuration file. The readonly-policy.json file contains the following content:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": "*", "Action": "osstables:GetTable", "Resource": "acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket" } ] }Example command:
ossutil tables-api put-table-bucket-policy --table-bucket-arn acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket --resource-policy file://readonly-policy.json