Updated on 2024-02-29 GMT+08:00

Updating a Configuration File

Function

You can use this command to update some items in the .obsutilconfig file, including the endpoint, AK, SK, and token.

For details about the parameters in the .obsutilconfig file, see Parameter Description.

Command Line Structure

  • In Windows
    obsutil config -interactive [-crr] [-config=xxx]
  • In Linux or macOS
    ./obsutil config -interactive [-crr] [-config=xxx]

Examples

  • Take Windows as an example. Run the obsutil config -interactive command to update the access keys and OBS endpoint in the default configuration file.
    obsutil config -interactive
    
    Please input your ak:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Please input your sk:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Please input your endpoint:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Please input your token:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Config file url:
      C:\Users\tools\.obsutilconfig
    
    Update config file successfully!
  • Take Linux as an example. Run the ./obsutil config -interactive command to update the access keys and OBS endpoint in the default configuration file.
    ./obsutil config -interactive
    
    Please input your ak:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Please input your sk:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Please input your endpoint:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Please input your token:
    xxxxxxxxxxxxxxxxxxxxxxxxx
    Config file url:
      /root/.obsutilconfig
    
    Update config file successfully!

Parameter Description

Parameter

Optional or Mandatory

Description

interactive

Optional (additional parameter)

Updates configurations in interactive mode.

crr

Optional (additional parameter)

Updates the configurations for client-side cross-region replication in the configuration file.

NOTE:

If this parameter is not configured, the fields updated are endpoint, ak, sk, and token in the configuration file respectively.

If this parameter is configured, the fields updated in the configuration file are changed to endpointCrr, akCrr, skCrr, and tokenCrr respectively.

config

Optional (additional parameter)

User-defined configuration file for executing a command. For details about parameters that can be configured, see Parameter Description.

If this parameter is configured and a path is specified, parameters in the user-defined configuration file can be updated. If this parameter is not configured, parameters in the default configuration file are updated.