Create Environment

Create a new environment

Requires the environments-create permission.

Parameters: token hubIdvalue

Value
  • name
    string

    A user defined name for the environment resource.

  • cluster
    string

    The cluster this environment is associated with.

  • about
    object

    Contains details regarding the environment.

    Show child fields
  • features
    object

    An object representing specialized features configured for this environment.

    Show child fields
  • stack
    object | null
    includable

    An object representing the associated stack.

    Show child fields

Returns

Returns an environment resource, otherwise returns an Error.

POST /v1/environments

Example Request
$ curl https://api.cycle.iohttps://api.cycle.io/v1/environments \
-H
'Authorization: Bearer API_KEY'
\
-H
'X-Hub-Id: HUB_ID'
\
-H 'Content-Type: application/json' \
-d '{"name":"Test Environment","cluster":"production","about":{"favorite":false,"description":"Testing creating an environment."},"features":{"legacy_networking":false}}' \
-X POST
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"
}
}
}
}