config command is used to generate and modify the configuration file:./coscli config [command] [flag]
./coscli config show to view the configurations.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 | Modify one or more configuration items in the base group of the configuration file. The base group includes secretid, secretkey, sessiontoken, mode, and cvmrolename information. |
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 | View the detailed 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 | View the detailed 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 General Options Introduction.config delete sub-command includes the following optional flags:Flag Abbreviation | Flag Name | Description |
-h | --help | View the detailed usage of this command. |
-a | --alias | Bucket alias. |
config set sub-command includes the following optional flags:Flag Abbreviation | Flag Name | Description |
-h | --help | View the detailed 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 enumeration values SecretKey and CvmRole. It can be empty, with a default value of SecretKey, which means using a key to request COS. When the mode is CvmRole, it means using manage instance role to request COS. |
None | --cvm_role_name | |
None | --close_auto_switch_host | Set whether to close automatic switching of the backup domain. Available values: true, false. Can be left blank. If not set or the value is false, the domain name will be switched. If set to true, the domain name will not be switched. |
None | --disable_encryption | Set to turn off key encryption. It defaults to false. If set to true, the key-related information in the configuration file will be unencrypted. |
None | --disable_auto_fetch_bucket_type | Set whether to disable automatically obtaining the bucket type. Available values: true, false. If not set or set to false, the bucket type will be obtained automatically (ensure the account used has cos:HeadBucket permission).If set to true, the bucket type will not be obtained automatically and the bucket type in the user profile will be used (for example, if the Bucket Configuration item ofs in the configuration file is set to true, the bucket type is ofs; if set to false, the bucket type is cos). |
./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
mode and cvmrolename in the default configuration file./coscli config set --mode CvmRole --cvm_role_name testName
Feedback