ossutil 2.0 new features

Updated at:

Compared with ossutil 1.0, ossutil 2.0 organizes commands in tiers and introduces updates to many items, such as configuration files, access credentials, and filters. This topic describes new features of ossutil 2.0.

New feature

Description

Command tiering

ossutil 2.0 supports multiple tiers of commands:

  • API-level commands: in the ossutil api [command name] form. Example: ossutil api put-bucket-acl.

  • High-level commands: in the ossutil [command name] form. Example: ossutil config

Basic Configuration

To avoid failures caused by missing configuration items when using ossutil, ensure that the following items are configured: AccessKey ID, AccessKey Secret, and region ID. The region ID is required, for the signature algorithm has been upgraded to V4. For more infomation, see Regions and endpoints

Configuration file modification

A configuration file can contain multiple profiles. A profile in a configuration file can be imported by using the --profile option.

You can use the source-profile key to import settings from another profile in the configuration file.

Extended access credential support

  • ossutil 2.0 supports external credentials. You can obtain external credentials by using URIs or from external processes.

  • ossutil 2.0 supports OpenID Connect (OIDC) credentials.

  • In the access mode of using instance RAM roles, the instance RAM roles can be automatically detected.

Enhancements to the config command

The config command provides interactive experience and supports basic settings:

  • config set/get: adds, removes, or modifies settings.

  • config list-profiles: queries all existing profiles.

  • config credential: sets credentials in the specified profile.

Output formatting

You can use the --output-format option to format command output in JSON, YAML, or XML. By default, output uses the raw format (XML or text).

If you convert the output to XML from a different format, the root node of XML data is root, regardless of the root node name in the original format.

Output filtering

You can use the --output-query option to filter output.

New documentation structure

The documentation structure is improved for better clarity. Command line options are divided into global and local options in documents.

Rich filter support

You can specify filters in high-level commands for batch processing, such as ls, cp, and rm:

  • By path, file name, or object name

  • By list of paths, file names, or object names

  • By file size or object size

  • By last modified time of files or objects

  • By object metadata

Unified control options for batch processing commands

All batching processing commands support unified control options. These options allow you to:

  • Specify the key range to query.

  • Specify the number of results to return.

  • Specify that the command performs the operation recursively under the specified directory.

  • Force the operation without requiring your confirmation.

Control on metadata and tag copy

The --copy-props option is added for you to control the copy operations of metadata and tags. You can disable metadata and tag copy, copy only metadata, and copy metadata and tags.

Note

If you do not specify this option, metadata and tags are copied.

New environment variables

ossutil 2.0 adds environment variables for the following credential-related parameters: region, endpoint, config-file, and profile. Environment variables allow you to specify access credentials in a more secure way than directly specifying them by using command-line parameters.

Simulated command execution (--dry-run/-n)

The --dry-run option allows you to perform a command test, without making any changes.

Addressing style

ossutil 2.0 adds the --addressing-style option, which allows you to specify an addressing style. The supported addressing styles are virtual domains, path-style addresses, and CNAME.

Standard input support for parameters and command-line options

The standard input allows you to chain commands by using the pipe symbol.

Command alias

ossutil 2.0 supports aliases for some commands.

Standardized return codes

Return codes are more standardized and consistent across commands.

A non-zero return code indicates an error during command execution. Return codes that indicate errors vary with phases in which error occurred. This design enables efficient error handling based on return codes.

User-friendly option settings

  • Some options support values with a unit suffix, which provides better readability. For example, you can specify --max-size 1M in the command line to indicate 1024 × 1024 bytes, and --max-age 1.5d to indicate one and a half days (36 hours).

  • Some options support a list of values separated by commas (,), as in --tagging key=value,key1=value1, which is equivalent to --tagging key=value --tagging key1=value1.

Client-side auto time sync

When the gap between the client-side time and the server-side time exceeds 15 minutes, the RequestTimeTooSkewed error is returned from the server. ossutil 2.0 automatically synchronizes time upon detection of the error.

Note

Auto time synch is used in a client environment that has inconsistent timing with the server environment.