apis-chassis-minio

REST API for S3 file protocol (minio)

Usage no npm install needed!

<script type="module">
  import apisChassisMinio from 'https://cdn.skypack.dev/apis-chassis-minio';
</script>

README

S3/minio File API

It's implemented as a microservice that maps URL sub-paths to s3/minio objects.

The config/default.yaml is used to configure the chassis, specificially the 's3' plugin.

The built-in "openapi" plugin is used to map requests to the 's3' operation.

Options

The "s3" options can be specified as a global config or within relevent the "openapi" definition.

    s3:
      enabled: true
      endPoint: play.minio.io
      port: 9000
      useSSL: true
      accessKey: abc
      secretKey: xyz
      buckets:
        example-01:
        example-02:

openapi plugin

The chassis is configured by an OpenAPI definition. The "operationId" fields must be mapped to a valid plugin.

The "operationId" can be used in more than one path - which is different from the Swagger/Open API specification.

openapi:
  paths:
    /s3/healthz:
      get:
        operationId: s3
        chassis:
          operation: healthz

    "/s3/:Bucket/:Key":
      get:
        operationId: s3
      post:
        operationId: s3
      put:
        operationId: s3
      delete:
        operationId: s3

For example:

    npm install && npm start
    curl -v http://localhost:7002/s3/healthz

Docker Demo

docker run -p 9000:9000 --name minio1 \
  -e "MINIO_ACCESS_KEY=example" \
  -e "MINIO_SECRET_KEY=example1234" \
  minio/minio server /data