All Products
Search
Document Center

Object Storage Service:config

Last Updated:Aug 13, 2024

Creates or manages configuration files. Configuration files store access credentials and configuration settings. The config command can be interactive or non-interactive, depending on your use scenarios.

Create a configuration file

ossutil config

The command creates a configuration file and saves long-term access credentials and region information in the [default] section of the configuration file. In this case, the command is interactive.

ossutil config
The command creates a config file and stores configuration settings and credentials.

Please enter the config file name,the file name can include path(default "C:\Users\issuser\.ossutilconfig", carriage return will use the default file. If you specified this option to other file, you should specify --config-file option to the file when you use other commands):

No config file entered, will use the default config file "C:\Users\issuser\.ossutilconfig"For the following settings, carriage return means skip the configuration.
Please enter Access Key ID [None]:
Please enter Access Key Secret [None]:
Please enter Region [cn-hangzhou]:

Create and query configuration settings

Create configuration settings

ossutil config set

The command creates access credential settings or configuration settings. In this case, the command is non-interactive. The --config-file option specifies the path to the configuration file, and the --profile option specifies the profile section.

The following sample command sets the region parameter in the dev section of the myconfig configuration file:

ossutil config set region cn-hangzhou --config-file myconfig --profile dev

To delete a configuration item, set the value to an empty string in the command line or delete the entry by using a text editor.

ossutil config set region "" --config-file myconfig --profile dev

Query configuration settings

ossutil config get

The command queries access credentials or configuration settings. In this case, the command is non-interactive. The --config-file option specifies the path to the configuration file, and the --profile option specifies the profile section to use. The following sample command queries the region parameter in the dev section of the myconfig configuration file:

ossutil config get region --config-file myconfig --profile dev

List all configuration sections

The command lists all sections. In this case, the command is non-interactive.

ossutil config list-profiles

Configure access credentials.

ossutil config credential

The command configures access credentials. In this case, the command is interactive. You are asked whether to encrypt the AccessKey ID, AccessKey secret, and token.

ossutil config credential
The command creates a config file and stores configuration settings and credentials.

Please enter the config file name,the file name can include path(default "C:\Users\issuser\.ossutilconfig", carriage return will use the default file. If you specified this option to other file, you should specify --config-file option to the file when you use other commands):

No config file entered, will use the default config file "C:\Users\issuser\.ossutilconfig"For the following settings, carriage return means skip the configuration.
Please enter profile:
Please enter authenticate mode, supports RamRoleArn,EcsRamRole,Process,Uri,OIDCRoleArn,AK,StsToken:
Do you need to encryt access key id and access key secret (y or N)
Please enter Access Key ID [None]:
Please enter Access Key Secret [None]: