Cycle Scheduler API (1.0.0)

Download OpenAPI specification:Download

E-mail: support@cycle.io License: Apache-2.0

Functions

Containers configured to be pre-allocated and started on demand - useful for batch processing and tasks with elastic demand. Managed by a scheduler service (this API) on a per-environment basis.

Claim Instance

Reserves an instance of the target function Container. The scheduler will release the claim back into the pool if the Instance is not claimed within ten seconds.

SecurityaccessKey
Request
path Parameters
containerId
required
string

The ID of the requested Container.

Request Body schema: application/json
required
token
required
string

A custom token used for identifying and managing a claim. Can be any valid string, and must be used with spawning and releasing the Instance.

Responses
200

Returns details about the claimed Instance.

default

General error response from the platform

post/v1/functions/{containerId}/claim
Request samples
application/json
{
  • "token": "string"
}
Response samples
application/json
{
  • "data": {
    }
}

Spawn Instance

Spawns a previously claimed Instance.

SecurityaccessKey
Request
path Parameters
containerId
required
string

The ID of the requested Container.

Request Body schema: application/json
required
token
required
string (ClaimToken) >= 5 characters

The claim token previously used to claim the Instance.

instance_id
required
string <objectid> (ID)

A 24 character hex string used to identify a unique resource.

object or null

Optional variables that affect the runtime of the container.

Responses
200

Returns details about the spawned Instance.

default

General error response from the platform

post/v1/functions/{containerId}/spawn
Request samples
application/json
{
  • "token": "string",
  • "instance_id": "651586fca6078e98982dbd90",
  • "runtime_variables": {
    }
}
Response samples
application/json
{
  • "data": {
    }
}

Release Instance

Releases a previously spawned Instance.

SecurityaccessKey
Request
path Parameters
containerId
required
string

The ID of the requested Container.

Request Body schema: application/json
required
token
required
string (ClaimToken) >= 5 characters

The claim token previously used to claim the Instance.

instance_id
required
string <objectid> (ID)

A 24 character hex string used to identify a unique resource.

Responses
200

Returns details about the released Instance.

default

General error response from the platform

post/v1/functions/{containerId}/release
Request samples
application/json
{
  • "token": "string",
  • "instance_id": "651586fca6078e98982dbd90"
}
Response samples
application/json
{
  • "data": {
    }
}

Get Active Instances

Retrieves instances of the function container that are currently running.

SecurityaccessKey
Request
path Parameters
containerId
required
string

The ID of the requested container.

Responses
200

Returns a map of active instances by ID.

default

General error response from the platform

get/v1/functions/{containerId}/active
Response samples
application/json
{
  • "data": {
    }
}