Cycle Internal API (1.0.0)

Download OpenAPI specification:Download

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

Inside every container running on Cycle, there is a Unix socket mounted at /var/run/cycle/api/api.sock. You can send HTTP requests over this socket to access information about the local environment, access secrets, and much more. The way this internal API functions is very similar to how Cycle's main API works, though the purpose is different. The internal API is primarily used by instances to learn about their environment, and dynamically update as deployments change. In the future, we expect you'll be able to use the internal API to register service containers and much more. The internal API returns identical JSON responses to the main API. There is also a websocket based API that you can tune into for streaming platform updates.

Environments

Get Environment

Gets the Environment that this instance is a part of.

SecuritytokenAuth
Responses
200

Returns an Environment.

default

General error response from the platform

get/v1/environment
Response samples
application/json
{
  • "data": {
    }
}

List Environment Containers

Lists all Containers that are part of the same Environment as this Instance.

SecuritytokenAuth
Responses
200

Returns a collection of container resources.

default

General error response from the platform

get/v1/environment/containers
Response samples
application/json
{
  • "data": [
    ]
}

List Environment Instances

Lists all Instances present in this Instance's Environment.

SecuritytokenAuth
Responses
200

Returns a list of Instances.

default

General error response from the platform

get/v1/environment/instances
Response samples
application/json
{
  • "data": [
    ]
}

List Environment IPs

Lists the IPs associated with this Instance's Environment.

SecuritytokenAuth
Responses
200

Returns a list of detailed IP objects.

default

General error response from the platform

get/v1/environment/ips
Response samples
application/json
{
  • "data": [
    ]
}

List Environment Services

Lists the services containers/instances that are in the same environment as this instance.

SecuritytokenAuth
Responses
200

Returns a list of environment services (a combination of container and instance details).

default

General error response from the platform

get/v1/environment/services
Response samples
application/json
{
  • "data": {
    }
}

Submit Environment Load Balancer Telemetry

Submit load balancer telemetry data.

SecuritytokenAuth
Request
Request Body schema: application/json
required
additional property
object (LoadBalancerTelemetrySnapshot)
Responses
200

Returns a list of Instances.

default

General error response from the platform

post/v1/environment/services/lb/telemetry/snapshots
Request samples
application/json
{
  • "property1": {
    },
  • "property2": {
    }
}
Response samples
application/json
{
  • "data": true
}

Get Environment Scoped Variables

Gets the scoped variables that are accessible to this instance via internal API.

SecuritytokenAuth
Responses
200

Returns a map of variable values, keyed by their identifier.

default

General error response from the platform

get/v1/environment/scoped-variables
Response samples
application/json
{
  • "data": {
    }
}

Validate VPN Login

Validates a username/password pair for logging into the VPN service of the environment of this instance. You must pass a basic Authorization header with the desired username/password combination to validate.

SecuritytokenAuth or basicAuth
Responses
200

Returns true on success

403

Returns false on verification failure

default

General error response from the platform

post/v1/vpn/login
Response samples
application/json
{
  • "data": true
}

List Network Environments

Lists all environments present in this instance's SDN networks.

SecuritytokenAuth
Responses
200

Returns a list of environments.

default

General error response from the platform

get/v1/sdn/networks/environments
Response samples
application/json
{
  • "data": [
    ]
}

Containers

List Environment Containers

Lists all Containers that are part of the same Environment as this Instance.

SecuritytokenAuth
Responses
200

Returns a collection of container resources.

default

General error response from the platform

get/v1/environment/containers
Response samples
application/json
{
  • "data": [
    ]
}

List Server Containers

Lists all containers present on the same server as this instance.

SecuritytokenAuth
Responses
200

Returns a list of containers.

default

General error response from the platform

get/v1/server/containers
Response samples
application/json
{
  • "data": [
    ]
}

List Server Images

Lists all images downloaded onto the server this instance is on.

SecuritytokenAuth
Responses
200

Returns a list of image details (id, time accessed).

default

General error response from the platform

get/v1/server/images
Response samples
application/json
{
  • "data": [
    ]
}

Get Container

Gets a container. By default will grab the container of this instance, but a `container-id`` parameter can be passed to grab any other container in the same environment.

SecuritytokenAuth
Request
query Parameters
container-id
string

Specify which container to fetch. If not provided, will use the container of the current instance.

Responses
200

Returns a container.

default

General error response from the platform

get/v1/container
Response samples
application/json
{
  • "data": {
    }
}

Get Container Instances

Gets the instances of a container. By default will grab the instances of the same container, but a `container-id`` parameter can be passed to grab any other container instances in the same environment.

SecuritytokenAuth
Request
query Parameters
container-id
string

Specify which container to fetch instances of. If not provided, will use the container of the current instance.

Responses
200

Returns a list of instances.

default

General error response from the platform

get/v1/container/instances
Response samples
application/json
{
  • "data": [
    ]
}

List Container Certificates

Get the TLS certificates associated with the domains pointed at this container.

SecuritytokenAuth
Request
query Parameters
container-id
string

Specify which container to get certificates for. If not provided, will use the container of the current instance.

Responses
200

Returns a list of TLS certificates.

default

General error response from the platform

get/v1/containers/certificates
Response samples
application/json
{
  • "data": [
    ]
}

List Container Domains

Get the domains pointed at a container.

SecuritytokenAuth
Request
query Parameters
container-id
string

Specify which container to get domains for. If not provided, will use the container of the current instance.

Responses
200

Returns a list of domains.

default

General error response from the platform

get/v1/containers/domains
Response samples
application/json
{
  • "data": [
    ]
}

Create Instance Job

Used to perform different actions on a given instance.

SecuritytokenAuth
Request
Request Body schema: application/json
required
action
required
string
required
object
Responses
200

Returns nothing on success.

default

General error response from the platform

post/v1/conductor/tasks
Request samples
application/json
{
  • "action": "container.instance.start",
  • "contents": {
    }
}
Response samples
application/json
{ }

Instances

List Environment Instances

Lists all Instances present in this Instance's Environment.

SecuritytokenAuth
Responses
200

Returns a list of Instances.

default

General error response from the platform

get/v1/environment/instances
Response samples
application/json
{
  • "data": [
    ]
}

Get Server Instances

Gets a list of instances that are on the same server as this instance.

SecuritytokenAuth
Responses
200

Returns a list of instances.

default

General error response from the platform

get/v1/server/instances
Response samples
application/json
{
  • "data": [
    ]
}

Get Server Instances Telemetry

Gets resource telemetry for this instance.

SecuritytokenAuth
Responses
200

Returns a list of resource telemetry snapshots.

default

General error response from the platform

get/v1/server/instances/telemetry
Response samples
application/json
{
  • "data": [
    ]
}

Get Container Instances

Gets the instances of a container. By default will grab the instances of the same container, but a `container-id`` parameter can be passed to grab any other container instances in the same environment.

SecuritytokenAuth
Request
query Parameters
container-id
string

Specify which container to fetch instances of. If not provided, will use the container of the current instance.

Responses
200

Returns a list of instances.

default

General error response from the platform

get/v1/container/instances
Response samples
application/json
{
  • "data": [
    ]
}

Create Instance Job

Used to perform different actions on a given instance.

SecuritytokenAuth
Request
Request Body schema: application/json
required
action
required
string
required
object
Responses
200

Returns nothing on success.

default

General error response from the platform

post/v1/conductor/tasks
Request samples
application/json
{
  • "action": "container.instance.start",
  • "contents": {
    }
}
Response samples
application/json
{ }

List Network Instances

Lists all instances present in this instance's SDN networks.

SecuritytokenAuth
Responses
200

Returns a list of instances.

default

General error response from the platform

get/v1/sdn/networks/instances
Response samples
application/json
{
  • "data": [
    ]
}

Scoped Variables

Get Environment Scoped Variables

Gets the scoped variables that are accessible to this instance via internal API.

SecuritytokenAuth
Responses
200

Returns a map of variable values, keyed by their identifier.

default

General error response from the platform

get/v1/environment/scoped-variables
Response samples
application/json
{
  • "data": {
    }
}

Hubs

Get Hub

Gets the hub that this instance is a member of.

SecuritytokenAuth
Responses
200

Returns a hub.

default

General error response from the platform

get/v1/hub
Response samples
application/json
{
  • "data": {
    }
}

Get Hub Integration

Gets an integration based on a provided identifier or vendor query parameter. At least one of these must be provided.

SecuritytokenAuth
Request
query Parameters
identifier
string

An integration identifier.

vendor
string

An integration vendor.

Responses
200

Returns a hub integration.

default

General error response from the platform

get/v1/hub/integrations
Response samples
application/json
{
  • "data": {
    }
}

Servers

Get Server

Gets the server this instance is running on.

SecuritytokenAuth
Responses
200

Returns a server.

default

General error response from the platform

get/v1/server
Response samples
application/json
{
  • "data": {
    }
}

Get Server Instances

Gets a list of instances that are on the same server as this instance.

SecuritytokenAuth
Responses
200

Returns a list of instances.

default

General error response from the platform

get/v1/server/instances
Response samples
application/json
{
  • "data": [
    ]
}

Get Server Instances Telemetry

Gets resource telemetry for this instance.

SecuritytokenAuth
Responses
200

Returns a list of resource telemetry snapshots.

default

General error response from the platform

get/v1/server/instances/telemetry
Response samples
application/json
{
  • "data": [
    ]
}

List Server Containers

Lists all containers present on the same server as this instance.

SecuritytokenAuth
Responses
200

Returns a list of containers.

default

General error response from the platform

get/v1/server/containers
Response samples
application/json
{
  • "data": [
    ]
}

List Server Images

Lists all images downloaded onto the server this instance is on.

SecuritytokenAuth
Responses
200

Returns a list of image details (id, time accessed).

default

General error response from the platform

get/v1/server/images
Response samples
application/json
{
  • "data": [
    ]
}

Download Image

Downloads the specified image to the server.

SecuritytokenAuth
Request
Request Body schema: application/json
required
image_id
required
string <objectid> (ID)

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

Responses
200

Returns the details of the downloaded image.

default

General error response from the platform

post/v1/server/images/download
Request samples
application/json
{
  • "image_id": "651586fca6078e98982dbd90"
}
Response samples
application/json
{
  • "data": [
    ]
}

Images

Download Image

Downloads the specified image to the server.

SecuritytokenAuth
Request
Request Body schema: application/json
required
image_id
required
string <objectid> (ID)

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

Responses
200

Returns the details of the downloaded image.

default

General error response from the platform

post/v1/server/images/download
Request samples
application/json
{
  • "image_id": "651586fca6078e98982dbd90"
}
Response samples
application/json
{
  • "data": [
    ]
}

Monitoring

Post Metric

Post data to Cycle's monitoring system.

SecuritytokenAuth
Request
Request Body schema: application/json
required
Array
metric
required
string

The title of the metric this data point refers to.

type
required
string

The type of metric

Enum: "gauge" "count" "counter" "rate" "histogram" "distribution" "set"
object

Any associated labels for the data, which can be used in querying.

tags
Array of strings

Additional tags for the data point.

Array of objects
Responses
200

Returns true on success

default

General error response from the platform

post/v1/monitoring/metrics
Request samples
application/json
[
  • {
    }
]
Response samples
application/json
{
  • "data": true
}

VPN

Validate VPN Login

Validates a username/password pair for logging into the VPN service of the environment of this instance. You must pass a basic Authorization header with the desired username/password combination to validate.

SecuritytokenAuth or basicAuth
Responses
200

Returns true on success

403

Returns false on verification failure

default

General error response from the platform

post/v1/vpn/login
Response samples
application/json
{
  • "data": true
}

SDN

List Networks

Lists all networks attached to this instance.

SecuritytokenAuth
Responses
200

Returns a list of networks.

default

General error response from the platform

get/v1/sdn/networks
Response samples
application/json
{
  • "data": [
    ]
}

List Network Instances

Lists all instances present in this instance's SDN networks.

SecuritytokenAuth
Responses
200

Returns a list of instances.

default

General error response from the platform

get/v1/sdn/networks/instances
Response samples
application/json
{
  • "data": [
    ]
}

List Network Environments

Lists all environments present in this instance's SDN networks.

SecuritytokenAuth
Responses
200

Returns a list of environments.

default

General error response from the platform

get/v1/sdn/networks/environments
Response samples
application/json
{
  • "data": [
    ]
}