Generating the Download Link of an Object
Function
You can use this command to generate the download link of a specified object in a bucket or generate the download links of objects in a bucket in batches by object name prefix.
Command Line Structure
- In Windows
- Generating the download link of a single object
obsutil sign obs://bucket/key [-e=300] [-config=xxx]
- Generating the download links of objects in batches by object name prefix
obsutil sign obs://bucket[/key] -r [-e=300] [-timeRange=time1-time2] [-include=*.xxx] [-exclude=*.xxx] [-o=xxx] [-config=xxx]
- Generating the download link of a single object
- In Linux or macOS
- Generating the download link of a single object
./obsutil sign obs://bucket/key [-e=300] [-config=xxx]
- Generating the download links of objects in batches by object name prefix
./obsutil sign obs://bucket[/key] -r [-e=300] [-timeRange=time1-time2] [-include=*.xxx] [-exclude=*.xxx] [-o=xxx] [-config=xxx]
- Generating the download link of a single object
Examples
- Take the Windows OS as an example. Run the obsutil sign obs://bucket-test/test.txt command to generate the download link of a single object.
obsutil sign obs://bucket-test/test.txt Download url of [obs://bucket-test/test.txt] is: http://your-endpoint/bucket-test/test.txt?AccessKeyId=xxxx&Expires=1552548758&Signature=xxxx
Parameter Description
Parameter |
Optional or Mandatory |
Description |
---|---|---|
bucket |
Mandatory |
Bucket name |
key |
Optional |
Object name used for generating the download link of a single object, or object name prefix used for generating download links of objects in batches |
e |
Optional (additional parameter) |
Validity period of the generated download links of objects, in seconds. Minimum value: 60s. Default value: 300s |
r |
Mandatory when generating download links of objects in batches (additional parameter) |
Generates the download links of objects in batches by a specified object name prefix. |
exclude |
Optional when generating download links of objects in batches (additional parameter) |
Indicates the matching patterns of objects that are excluded, for example: *.txt.
NOTE:
NOTICE:
|
include |
Optional when generating download links of objects in batches (additional parameter) |
Indicates the matching patterns of objects that are included, for example: *.jpg.
NOTE:
NOTICE:
|
timeRange |
Optional (additional parameter) |
Indicates the time range matching pattern when generating download links of objects. Only the download links of objects whose latest modification time is within the configured time range are generated. This pattern has a lower priority than the object matching patterns (exclude/include). That is, the time range matching pattern is executed after the configured object matching patterns.
NOTE:
|
o |
Optional when generating download links of objects in batches (additional parameter) |
Indicates the folder where operation result lists reside. After the command is executed, result lists (possibly including success and failure files) are generated in the folder. The default value is .obsutil_output, the subfolder in the home directory of the user who executes obsutil commands.
NOTE:
|
config |
Optional (additional parameter) |
User-defined configuration file for executing a command. For details about parameters that can be configured, see Parameter Description. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot