List Environments

Request a list of environments

Requires the environments-view permission.

Parameters: token hubIdquery

query
  • include

    Accepted Values: creatorsstacks

  • meta

    Accepted Values: containerscontainers_countinstances_count

  • sort

    Sorts can be performed on any field - see sorting

  • filter

    Collections of resources can be filtered based on certain criteria - see filtering 

Returns

Returns a collection of environment resources, otherwise returns an Error.

GET /v1/environments

Example Request
curl https://api.cycle.io/v1/environments \
-H
"Authorization: Bearer API_KEY"
\
-H
"X-Hub-Id: HUB_ID"
Example Response
{
"data": [
{
"id": "5b9c2a77b6393d0001eb45fd",
"name": "Demo Name",
"cluster": "development",
"about": {
"description": "",
"favorite": false
},
"creator": {
"id": "5b9c2a77b6393d0001eb45fd",
"type": "account"
},
"hub_id": "5b9c2a77b6393d0001eb45fd",
"state": {
"current": "live",
"changed": "2022-09-14T21:39:03.096Z"
},
"events": {
"created": "2022-09-14T21:39:03.096Z",
"updated": "2022-09-14T21:39:03.096Z",
"deleted": "2022-09-14T21:39:03.096Z"
},
"features": {
"legacy_networking": false
},
"services": {
"discovery": {
"enable": true,
"container_id": "5b9c2a77b6393d0001eb45fd",
"high_availability": false,
"config": {}
},
"vpn": {
"enable": true,
"container_id": "5b9c2a77b6393d0001eb45fd",
"high_availability": false,
"config": {
"auth": {
"webhook": null,
"cycle_accounts": true,
"vpn_accounts": true
},
"allow_internet": true
}
},
"loadbalancer": {
"enable": true,
"container_id": "5b9c2a77b6393d0001eb45fd",
"high_availability": true,
"config": null
}
},
"private_network": {
"vxlan_tag": 6485,
"subnet": "21",
"legacy": null,
"ipv6": {
"ip": "fd00::21:0:0:0",
"cidr": "fd00::21:0:0:0/96"
}
},
"meta": {
"containers": [
{
"id": "5b9c2a77b6393d0001eb45fd",
"name": "Demo Name",
"state": {
"changed": "2020-12-29T07:42:30.378Z",
"current": "running",
"desired": "running"
},
"image": {
"id": "5b9c2a77b6393d0001eb45fd",
"service": null
},
"environment": {
"id": "5b9c2a77b6393d0001eb45fd",
"cluster": "production",
"container_subnet": "1234",
"ipv6": {
"ip": "fd00::ef1:1834:0:0",
"cidr": "fd00::ef1:1834:0:0/96"
},
"legacy": null
}
},
{
"id": "5b9c2a77b6393d0001eb45fd",
"name": "Demo Name",
"state": {
"changed": "2020-12-29T07:42:27.51Z",
"current": "running",
"desired": "running"
},
"image": {
"id": "5b9c2a77b6393d0001eb45fd",
"service": null
},
"environment": {
"id": "5b9c2a77b6393d0001eb45fd",
"cluster": "production",
"container_subnet": "1234",
"ipv6": {
"ip": "fd00::ef1:1834:0:0",
"cidr": "fd00::ef1:1834:0:0/96"
},
"legacy": null
}
}
],
"containers_count": {
"state": {
"new": 0,
"starting": 0,
"running": 8,
"stopping": 0,
"stopped": 3,
"deleting": 0,
"deleted": 0,
"reimaging": 0
},
"total": 11,
"available": 11
},
"instances_count": {
"state": {
"new": 0,
"starting": 0,
"reimaging": 0,
"running": 12,
"migrating": 0,
"stopping": 0,
"stopped": 7,
"failed": 0,
"deleting": 0,
"deleted": 0
},
"total": 19,
"available": 19
}
},
"includes": {
"creators": {
"accounts": {
"5b9c2a77b6393d0001eb45fd": {
"id": "5b9c2a77b6393d0001eb45fd",
"name": {
"first": "Demo",
"last": "User"
},
"email": {
"address": "demouser@gmail.com",
"added": "2022-09-14T21:39:03.096Z",
"verified": true
},
"events": {
"last_login": "2020-03-18T19:28:15.14Z"
}
}
}
}
}
}
]
}