SDK reference

Repositories, databases and buckets

Each route's function in the SDK, its call beside the same request in cURL.
orgResources

GET/v1/orgs/:orgId/resources

Lists repositories, databases and buckets, optionally of one type.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/resources' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgResources

POST/v1/orgs/:orgId/resources

Creates a repository, database or bucket in a location. With projectId, a database or bucket is linked to that Serverless App Service. Databases take an optional key schema (default pk/sk strings; sortKey: null for a partition key only).

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/resources' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "repository",
    "name": "Example"
  }'
patchOrgResourcesByResourceId

PATCH/v1/orgs/:orgId/resources/:type/:resourceId

Links a database or bucket to a Serverless App Service, or unlinks it with projectId: null. Takes effect on the Serverless App Service's next deployment.

Parameters and answers
curl -X PATCH 'https://api.cactive.com.au/v1/orgs/{orgId}/resources/{type}/{resourceId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "projectId": "<projectId>"
  }'
deleteOrgResourcesByResourceId

DELETE/v1/orgs/:orgId/resources/:type/:resourceId

Deletes a resource and the AWS resource behind it. Databases must have deletion protection off; buckets must be empty. On failure the resource keeps its status.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/resources/{type}/{resourceId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"