The request-payment command is used to configure the pay-by-requester mode for buckets, or query the pay-by-requester configurations for buckets.

Note For more information about the pay-by-requester mode, see Enable the pay-by-requester mode.

Command syntax

  • Set the pay-by-requester mode
    ./ossutil request-payment --method put oss://bucket payment_parameter
    Valid values of payment_parameter are Requester and BucketOwner.
    • Requester: enables the pay-by-requester mode. Requesters pay the cost of requests and the data download from buckets.
    • BucketOwner: disables the pay-by-requester mode. Bucket owners pay the cost of requests and the data download from their buckets.
  • Query the pay-by-requester configurations
    ./ossutil request-payment --method get oss://bucket

Examples

  • Enable the pay-by-requester mode
    ./ossutil request-payment --method put oss://bucket1 Requester
  • Disable the pay-by-requester mode
    ./ossutil request-payment --method put oss://bucket1 BucketOwner
  • Query the pay-by-requester configurations
    ./ossutil request-payment --method get oss://bucket1
    BucketOwner
    0.178036(s) elapsed

Common options

The following table describes the options you can add to the request-payment command.
Option Description
--method Specifies the HTTP request method. Valid values:
  • put: enables or disables the pay-by-requester mode.
  • get: obtains pay-by-requester configurations.
--loglevel Specifies the log level. The default value is null, indicating that no log files are generated. Valid values:
  • info: generates prompt logs.
  • debug: generates detailed logs that contain corresponding HTTP request and response information.
--proxy-host Specifies the URL of the proxy server. HTTP, HTTPS, and SOCKS5 are supported. An example of the URL is http://120.79. **.**:3128 or socks5://120.79. **. **:1080.
--proxy-user Specifies the username of the proxy server. The default value is null.
--proxy-pwd Specifies the password of the proxy server. The default value is null.
Note For more information about common options, see View all supported options.