← All procedures
s3.upload
Upload content to S3 bucket
CLI- Package
- @procedures/s3 · README
- Path
["s3","upload"]- CLI
mark s3 upload --bucket <string> --key <string> --body <string>- As data
{"$proc":["s3","upload"],"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","upload"], { bucket: "<bucket>", key: "<key>", body: "<body>" });
console.log(JSON.stringify(result));From the command line
$ mark s3 upload --bucket <string> --key <string> --body <string>
As data, in a program
{
"$proc": ["s3", "upload"],
"input": { "bucket": "<bucket>", "key": "<key>", "body": "<body>" }
}Input
| Field | Type | Required | Default | Description |
|---|
bucket | string | yes | | S3 bucket name |
key | string | yes | | Object key (path in bucket) |
body | string | yes | | Content to upload - string or base64 encoded binary |
contentType | string | no | | Content type (e.g., "application/json", "text/plain") |
base64 | boolean | no | | If true, body is base64 encoded binary data |
metadata | object | no | | Optional metadata key-value pairs |
Output
| Field | Type | Required | Default | Description |
|---|
etag | string | yes | | The ETag of the object, without quotes |
versionId | string | no | | The version id, when the bucket has versioning |
location | string | yes | | The S3 URI of the object (s3://bucket/key) |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"bucket": {
"type": "string",
"description": "S3 bucket name"
},
"key": {
"type": "string",
"description": "Object key (path in bucket)"
},
"body": {
"type": "string",
"description": "Content to upload - string or base64 encoded binary"
},
"contentType": {
"description": "Content type (e.g., \"application/json\", \"text/plain\")",
"type": "string"
},
"base64": {
"description": "If true, body is base64 encoded binary data",
"type": "boolean"
},
"metadata": {
"description": "Optional metadata key-value pairs",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
}
}
},
"required": [
"bucket",
"key",
"body"
]
},
"output": {
"type": "object",
"properties": {
"etag": {
"type": "string",
"description": "The ETag of the object, without quotes"
},
"versionId": {
"description": "The version id, when the bucket has versioning",
"type": "string"
},
"location": {
"type": "string",
"description": "The S3 URI of the object (s3://bucket/key)"
}
},
"required": [
"etag",
"location"
],
"additionalProperties": {}
}
}