Piloterr
Referencia de la APICloud storage

Test a cloud connection before saving it

POST
/v1/cloud-connections/test

Takes the body of POST /v1/cloud-connections (name optional) and stores nothing. Checks, step by step, what the keys can do: reach the endpoint (public https only, private addresses refused before any request), find the bucket in its region, sign with the keys, write a small file under the prefix, then delete it. Requests go out exactly like deliveries, through the egress proxy when there is one. A key that may write but not delete passes, with a warning and the file's key. The answer is 200 either way: ok says whether deliveries can upload. Up to 10 tests a minute and 60 an hour per workspace, both test routes together.

Autorización

ApiKeyAuth
headerX-Api-Key<token>

Cuerpo de la solicitud

application/json
  1. body
type?"s3"

s3: Amazon S3 or an S3-compatible store (the only type)

Default"s3"
Value in"s3"
name?string

Your name for the connection, up to 80 characters

Length1 <= length <= 80
endpoint?|

https origin of an S3-compatible store (R2, MinIO, SeaweedFS…); null or absent for AWS S3

Lengthlength <= 300
region?string

The bucket's region, such as us-east-1, or auto for Cloudflare R2

Match^[a-z0-9-]{2,40}$
Default"us-east-1"
bucket*string

The bucket's name: 3 to 63 lowercase letters, digits, dots and hyphens (S3's rules)

prefix?string

Folder for every file, such as exports/

Lengthlength <= 200
Default""
path_style?boolean

Path-style URLs (endpoint/bucket/key); default true with an endpoint

access_key_id*string

The access key id of a key that may write to the bucket; stored encrypted, only shown shortened (access_key_hint)

Length1 <= length <= 128
secret_access_key*string

Its secret access key; stored encrypted and never returned

Length1 <= length <= 256

Cuerpo de la respuesta

The report

application/json
  1. response
ok*boolean

Every required step passed: deliveries can upload

steps*array<>
test_key*|

The test file's key, once it was written

leftover_key*|

Set when the test file could not be deleted: remove it yourself

egress*

Where your bucket sees the requests come from

policy*string

A minimal IAM policy for the key, as a JSON document to copy: s3:PutObject (and s3:AbortMultipartUpload once deliveries use multipart uploads) under the prefix, s3:DeleteObject for the test file only (optional), from the egress IPs when known

Example Request
curl -X POST 'https://dataflow.piloterr.com/v1/cloud-connections/test' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Exports bucket",
  "region": "eu-west-3",
  "bucket": "acme-dataflow",
  "prefix": "exports/",
  "access_key_id": "AKIAIOSFODNN7EXAMPLE",
  "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}'
Example Response
{
  "ok": true,
  "steps": [
    {
      "id": "reachable",
      "status": "ok",
      "required": true,
      "code": null,
      "message": null
    },
    {
      "id": "bucket",
      "status": "ok",
      "required": true,
      "code": null,
      "message": null
    },
    {
      "id": "credentials",
      "status": "ok",
      "required": true,
      "code": null,
      "message": null
    },
    {
      "id": "write",
      "status": "ok",
      "required": true,
      "code": null,
      "message": null
    },
    {
      "id": "multipart",
      "status": "skipped",
      "required": false,
      "code": "not_used",
      "message": "Not needed: deliveries upload each file in a single request"
    },
    {
      "id": "delete",
      "status": "ok",
      "required": false,
      "code": null,
      "message": "The test file was removed"
    }
  ],
  "test_key": "exports/.piloterr-dataflow-test-1794225600000.txt",
  "leftover_key": null,
  "egress": {
    "enabled": true,
    "exit_ips": [
      "203.0.113.7"
    ]
  },
  "policy": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"PiloterrDataflowDeliveries\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"s3:PutObject\",\n        \"s3:DeleteObject\"\n      ],\n      \"Resource\": \"arn:aws:s3:::acme-dataflow/exports/*\",\n      \"Condition\": {\n        \"IpAddress\": {\n          \"aws:SourceIp\": [\n            \"203.0.113.7/32\"\n          ]\n        }\n      }\n    }\n  ]\n}"
}