← All procedures

s3.list

List objects in S3 bucket

CLI
Package
@procedures/s3 · README
Path
["s3","list"]
CLI
mark s3 list --bucket <string>
As data
{"$proc":["s3","list"],"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","list"], { bucket: "<bucket>" });
console.log(JSON.stringify(result));

From the command line

$ mark s3 list --bucket <string>

As data, in a program

{ "$proc": ["s3", "list"], "input": { "bucket": "<bucket>" } }

Input

FieldTypeRequiredDefaultDescription
bucketstringyesS3 bucket name
prefixstringnoFilter objects by prefix
maxKeysnumbernoMaximum number of keys to return (default 1000)
continuationTokenstringnoContinuation token for pagination
delimiterstringnoDelimiter for hierarchical listing (e.g., "/")

Output

FieldTypeRequiredDefaultDescription
contentsobject[]yesThe objects of the page
commonPrefixesstring[]yesThe common prefixes (with a delimiter)
isTruncatedbooleanyesTrue when more pages exist
nextContinuationTokenstringnoThe token of the next page
keyCountnumberyesThe number of keys on the page
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "bucket": {
        "type": "string",
        "description": "S3 bucket name"
      },
      "prefix": {
        "description": "Filter objects by prefix",
        "type": "string"
      },
      "maxKeys": {
        "description": "Maximum number of keys to return (default 1000)",
        "type": "number"
      },
      "continuationToken": {
        "description": "Continuation token for pagination",
        "type": "string"
      },
      "delimiter": {
        "description": "Delimiter for hierarchical listing (e.g., \"/\")",
        "type": "string"
      }
    },
    "required": [
      "bucket"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "contents": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "description": "The object key"
            },
            "size": {
              "type": "number",
              "description": "The size, in bytes"
            },
            "lastModified": {
              "type": "string",
              "description": "The time of the last change (ISO 8601)"
            },
            "etag": {
              "type": "string",
              "description": "The ETag, without quotes"
            },
            "storageClass": {
              "description": "The storage class",
              "type": "string"
            }
          },
          "required": [
            "key",
            "size",
            "lastModified",
            "etag"
          ],
          "additionalProperties": {}
        },
        "description": "The objects of the page"
      },
      "commonPrefixes": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "The common prefixes (with a delimiter)"
      },
      "isTruncated": {
        "type": "boolean",
        "description": "True when more pages exist"
      },
      "nextContinuationToken": {
        "description": "The token of the next page",
        "type": "string"
      },
      "keyCount": {
        "type": "number",
        "description": "The number of keys on the page"
      }
    },
    "required": [
      "contents",
      "commonPrefixes",
      "isTruncated",
      "keyCount"
    ],
    "additionalProperties": {}
  }
}