fbpx

API Documentation

Create Workspace

URL: https://api.tor1.faastruby.io/v2/workspaces
Method: POST
Parameters:

  • name – Required. Must have minimum 3 characters and can only contain letters, numbers, – and _.
  • email – Optional. Must be valid.

Example:

$ curl -X POST \
    -H 'Content-Type: application/json' \
    -d '{"name": "catops-prod", "email": "you@example.com"}' \
    'https://api.tor1.faastruby.io/v2/workspaces'
{
  "object": "workspace",
  "name": "catops-prod",
  "errors": [],
  "credentials": {
    "api_secret": "voeIjDPY5sloCZ0oo68nIw==",
    "api_key": "63a02778c9342993801936ef4a87412e"
  }
}

Destroy Workspace

URL: https://api.tor1.faastruby.io/v2/workspaces/WORKSPACE_NAME
Method: DELETE
Example:

$ curl -X DELETE \
    -H 'API_KEY: 63a02778c9342993801936ef4a87412e' \
    -H 'API_SECRET: voeIjDPY5sloCZ0oo68nIw==' \
    'https://api.tor1.faastruby.io/v2/workspaces/catops-prod'
{
  "success": "Workspace 'catops-prod' was deleted from the server."
}

Show Workspace

URL: https://api.tor1.faastruby.io/v2/workspaces/WORKSPACE_NAME
Method: GET
Example:

$ curl \
    -H 'API_KEY: 63a02778c9342993801936ef4a87412e' \
    -H 'API_SECRET: voeIjDPY5sloCZ0oo68nIw==' \
    'https://api.tor1.faastruby.io/v2/workspaces/catops-prod'
{
  "object": "workspace",
  "name": "catops-prod",
  "functions": [
    "hello-world"
  ],
}

Deploy Function

URL: https://api.tor1.faastruby.io/v2/workspaces/WORKSPACE_NAME/deploy
Method: POST
Parameters:

  • package – Required. Must be a zip file with the contents of the function folder. Should not contain ‘.git’ directory.

Example:

$ curl -X POST \
    -F 'package=@/path/to/hello-world.zip' \
    -H 'API_KEY: 63a02778c9342993801936ef4a87412e' \
    -H 'API_SECRET: voeIjDPY5sloCZ0oo68nIw==' \
    'https://api.tor1.faastruby.io/v2/workspaces/catops-prod/deploy'
{
  "object": "workspace",
  "name": "catops-prod",
  "functions": [
    "hello-world"
  ]
}

Destroy Function

URL: https://api.tor1.faastruby.io/v2/workspaces/WORKSPACE_NAME/functions/FUNCTION_NAME
Method: DELETE
Example:

$ curl -X DELETE \
    -H 'API_KEY: 63a02778c9342993801936ef4a87412e' \
    -H 'API_SECRET: voeIjDPY5sloCZ0oo68nIw==' \
    'https://api.tor1.faastruby.io/v2/workspaces/catops-prod/functions/hello-world'
{
  "object":"workspace",
  "name":"catops-prod"
}

Update Function Context

URL: https://api.tor1.faastruby.io/v2/workspaces/WORKSPACE_NAME/functions/FUNCTION_NAME
Method: PATCH
Parameters:

  • context – Required.

Example:

$ curl -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'API_KEY: 63a02778c9342993801936ef4a87412e' \
    -H 'API_SECRET: voeIjDPY5sloCZ0oo68nIw==' \
    -d '{"context": "{\"super_secret\":\"abc123\"}"}' \
    'https://api.tor1.faastruby.io/v2/workspaces/catops-prod/functions/hello-world'
{
  "object": "function",
  "name": "hello-world",
  "workspace_name": "catops-prod",
  "context": "{\"super_secret\":\"abc123\"}",
  "errors": []
}