← All procedures
s3.download
Download content from S3 bucket
CLI- Package
- @procedures/s3 · README
- Path
["s3","download"]- CLI
mark s3 download --bucket <string> --key <string>- As data
{"$proc":["s3","download"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/s3"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["s3","download"], { bucket: "<bucket>", key: "<key>" });
console.log(JSON.stringify(result));From the command line
$ mark s3 download --bucket <string> --key <string>
As data, in a program
{
"$proc": ["s3", "download"],
"input": { "bucket": "<bucket>", "key": "<key>" }
}Input
| Field | Type | Required | Default | Description |
|---|
bucket | string | yes | | S3 bucket name |
key | string | yes | | Object key (path in bucket) |
encoding | string | no | | Encoding for text content (utf8, ascii, etc.) - omit for base64 binary |
versionId | string | no | | Specific version to download |
destPath | string | no | | Write the object to this file instead of returning it (streams to disk: no size limit, no base64) |
maxBytes | integer | no | | Largest object to load into memory when destPath is not set (default: 64 MiB) |
Output
| Field | Type | Required | Default | Description |
|---|
body | string | yes | | The content: text with an encoding, base64 without one, empty with destPath |
path | string | no | | The file that holds the object, with destPath |
contentLength | number | yes | | The size of the object, in bytes |
contentType | string | no | | The content type |
etag | string | no | | The ETag of the object, without quotes |
lastModified | string | no | | The time of the last change (ISO 8601) |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"bucket": {
"type": "string",
"description": "S3 bucket name"
},
"key": {
"type": "string",
"description": "Object key (path in bucket)"
},
"encoding": {
"description": "Encoding for text content (utf8, ascii, etc.) - omit for base64 binary",
"type": "string"
},
"versionId": {
"description": "Specific version to download",
"type": "string"
},
"destPath": {
"description": "Write the object to this file instead of returning it (streams to disk: no size limit, no base64)",
"type": "string"
},
"maxBytes": {
"description": "Largest object to load into memory when destPath is not set (default: 64 MiB)",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"bucket",
"key"
]
},
"output": {
"type": "object",
"properties": {
"body": {
"type": "string",
"description": "The content: text with an encoding, base64 without one, empty with destPath"
},
"path": {
"description": "The file that holds the object, with destPath",
"type": "string"
},
"contentLength": {
"type": "number",
"description": "The size of the object, in bytes"
},
"contentType": {
"description": "The content type",
"type": "string"
},
"etag": {
"description": "The ETag of the object, without quotes",
"type": "string"
},
"lastModified": {
"description": "The time of the last change (ISO 8601)",
"type": "string"
}
},
"required": [
"body",
"contentLength"
],
"additionalProperties": {}
}
}