mc share download
The mc share download
command generates a temporary presigned URL with integrated access credentials for downloading objects from an AIStor bucket.
The temporary URL expires after a configurable time limit.
- Applications can perform a
GET
to retrieve the object from the URL. - Users can open the URL in a browser to download the object.
For more information on shareable object URLs, see the Amazon S3 documentation on Pre-Signed URLs.
Syntax
Parameters
ALIAS
Required
The alias of an AIStor deployment and the full path to the object for which to generate a download URL. For example:
mc share download play/mybucket/object.txt
You can specify multiple objects on the same or different AIStor deployments. For example:
mc share download play/mybucket/object.txt play/mybucket/otherobject.txt
If specifying the path to a bucket or bucket prefix, you must also specify the --recursive
argument.
For example:
mc share download --recursive play/mybucket/
mc share download --recursive play/mybucket/myprefix/
--expire
Alias: -E
Optional
Set the expiration time limit for all generated URLs.
Specify a string with format ##h##m##s
format.
For example, specify --expire 12h34m56s
for an expiry of 12 hours, 34 minutes, and 56 seconds after URL generation.
Defaults to 168h
or 168 hours (7 days).
--recursive
Alias: -r
Optional
Recursively generate URLs for all objects in a mc share download ALIAS
bucket or bucket prefix.
Required if any ALIAS
specifies a path to a bucket or bucket prefix.
--version-id
Alias: --vid
Optional
Directs mc share download
to operate only on the specified object version.
--version-id
requires that the specified ALIAS
be an S3-compatible service that supports Bucket Versioning.
For AIStor deployments, use mc version
to enable or disable bucket versioning.
Global Flags
This command supports any of the global flags.
Examples
Get Specific Object
Use mc share download
to generate a URL that supports GET
requests for an object:
mc share download --expire DURATION ALIAS/PATH
- Replace
ALIAS
with the alias of the AIStor deployment. - Replace
PATH
with the path to the object on the AIStor deployment. - Replace
DURATION
with the duration after which the URL expires. For example, to set a 30 day expiry, specify30d
.
Get Object(s) in a Bucket
Use mc share download
with the --recursive
option to generate a URL for each object in a bucket.
Each URL supports GET
requests for its associated object:
mc share download --recursive --expire DURATION ALIAS/PATH
- Replace
ALIAS
with the alias of the AIStor deployment. - Replace
PATH
with the path to the bucket or bucket prefix on the AIStor deployment. - Replace
DURATION
with the duration after which the URL expires. For example, to set a 30 day expiry, specify30d
.
Behavior
S3 Compatibility
The mc
commandline tool is built for compatibility with the AWS S3 API and is tested with AIStor and AWS S3 for expected functionality and behavior.
AIStor provides no guarantees for other S3-compatible services, As their S3 API implementation is unknown and therefore unsupported.
While mc
commands may work as documented, any such usage is at your own risk.