文档

命令行选项

更新时间:

命令行选项的优先级最高,可以覆盖配置文件设置或环境变量设置的参数。命令行选项分为全局命令行选项和局部命令行选项。全局命令行选项适用于所有命令,局部命令行选项仅适用于特定的命令。

查询命令行选项

执行以下命令:

ossutil cp -h

输出内容如下:

Flags:
      --acl string                         The access control list (ACL) of the object, valid value(s): "private","public-read","public-read-write","default"
      --bigfile-threshold int              The threshold of file size, the file size larger than the threshold will use multipart upload, download or copy (default 104857600)
      --cache-control string               The caching behavior of the web page when the object is downloaded
      --checkers int                       Number of checkers to run in parallel (default 16)
      --checkpoint-dir string              The specified directory for breakpoint continuation information (default ".ossutil_checkpoint/")
      --checksum                           Only copy the source file with different size and checksum(if available)
      --content-disposition string         The method that is used to access the object
      --content-encoding string            The method that is used to encode the
....

Global Flags:
  -i, --access-key-id string        AccessKeyID while access oss
  -k, --access-key-secret string    AccessKeySecret while access oss
      --addressing-style string     The style in which to address endpoints (default "virtual"), valid value(s): "virtual","path","cname"
  -c, --config-file string          path of the configuration file (default "~\\.ossutilconfig")
      --connect-timeout int         the client connection timed out, the unit is: s. (default 10)
  -n, --dry-run                     do a trial run with no permanent changes
  -e, --endpoint string             the domain names that other services can use to access OSS.

使用命令行选项

大多数命令行选项都是简单的字符串,例如:

ossutil ls --profile dev

每个带参数的选项都需要一个空格或等号(=)将参数与选项名称分开。如果参数值为包含空格的字符串,则必须使用引号将参数引起来。

支持的全局命令行选项

参数

类型

说明

-i, --access-key-id

string

访问OSS使用的AccessKey ID。

-k, --access-key-secret

string

访问OSS使用的AccessKey Secret。

--addressing-style

string

请求地址的格式。取值:

  • virtual(默认值)

  • path

  • cname

-c, --config-file

string

配置文件的路径。 默认值:~\\.ossutilconfig

--connect-timeout

int

客户端连接超时的时间。单位为秒,默认值10。

-n, --dry-run

/

在不进行任何更改的情况下执行试运行。

-e, --endpoint

string

对外服务的访问域名。

-h, --help

/

显示帮忙信息。

--language

string

显示的语言。

--loglevel

string

日志级别 。取值:

  • off(默认值)

  • info

  • debug

--mode

string

鉴权模式。取值:

  • AK

  • StsToken

  • EcsRamRole

  • Anonymous

--output-format

string

输出格式,默认值raw。

--output-query

string

JMESPath查询条件。

--profile

string

指定配置文件里的profile。

-q, --quiet

/

安静模式,打印尽可能少的信息。

--read-timeout

int

客户端读写请求超时时间。单位为秒,默认值20。

--region

string

数据中心所在的地域。

--retry-times

int

当错误发生时的重试次数。默认值10。

--sign-version

string

请求使用的签名算法版本。取值:

  • v1

  • v4(默认值)

--skip-verify-cert

/

表示不校验服务端的数字证书。

-t, --sts-token

string

访问OSS使用的STS Token。