config
command is used to generate and modify the configuration file../coscli config [command] [flag]
./coscli config show
to view the configuration.config
includes the following sub-commands:Command | Description |
add | Adds a new bucket configuration. |
delete | Deletes an existing bucket configuration. |
init | Generates the configuration file interactively. |
set | Modifies one or more configuration items in the base group of the configuration file, which contains secretid , secretkey , and sessiontoken . |
show | Prints information in a specific configuration file. |
config
and its sub-commands include the following optional flags:Flag Abbreviation | Flag Name | Description |
-h | --help | Views the usage of this command. |
-c | --config-path | Path of the configuration file to use |
config add
sub-command includes the following optional flags:Flag Abbreviation | Flag Name | Description |
-h | --help | Views the usage of this command. |
-a | --alias | Bucket alias |
-b | --bucket | Bucket name |
-r | --region | Region of the bucket |
-o | --ofs |
-e
or --endpoint
. For more information, see Common Options.config delete
sub-command includes the following optional flags:Flag Abbreviation | Flag Name | Description |
-h | --help | Views the usage of this command. |
-a | --alias | Bucket alias |
config set
sub-command includes the following optional flags:Flag Abbreviation | Flag Name | Description |
-h | --help | Views the usage of this command. |
None | --secret_id | |
None | --secret_key | |
-t | --session_token | Sets the temporary key token. For more information on temporary key, see Accessing COS Using a Temporary Key. |
None | --mode | Set the identity mode, supporting enumerated values SecretKey and CvmRole . It can be null, with the default value being SecretKey , which means using a key to request COS. When the mode is CvmRole , it means requesting COS with managing roles. |
None | --cvm_role_name | |
None | --close_auto_switch_host | Set whether to disable automatic switch of a backup domain. Optional values are true and false, which can be null. If the value is not set or set to false, the backup domain switch will be executed; If the value is set to true, the backup domain switch will not be executed. |
./coscli config add -b examplebucket3-1250000000 -r ap-chengdu -e cos.ap-chengdu.myqcloud.com -a bucket3
./coscli config delete -a bucket3
session-token
in the default configuration file./coscli config set --session_token test-token123
./coscli config show -c /your/config/path.yaml
./coscli config set --mode CvmRole --cvm_role_name testName
Was this page helpful?