Update an Environment
Updates the specificed environment, setting the values of the parameters passed. If any parameters are omitted, they will be left unchanged.
Requires the environments-update permission.
Parameters: token hubIdenvironment IDvalue
Value
- namestring
A user defined name for the environment resource.
- aboutobject
Contains details regarding the environment.
Show child fields
Returns
Returns an environment resource, otherwise returns an Error.
PATCH /v1/environments/5b9c2a77b6393d0001eb45fd
Example Request
$ curl https://api.cycle.io/v1/environments/5b9c2a77b6393d0001eb45fd \-H'Authorization: Bearer API_KEY'\-H'X-Hub-Id: HUB_ID'\-H 'Content-Type: application/json' \-d '{"name":"Demo Name","about":{"description":"Updated Description"}}' \-X PATCH
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}}}}