Update a Container
Updates the name or annotations of a container.
Requires the containers-update permission.
Arguments
- namestringoptional
The name of the container.
- annotationsobjectoptional
A key value store of custom data for your container. Not used by the platform internally.
Returns
Returns a container resource (the one you just updated), otherwise returns an Error.
PATCH /v1/containers/5b9c2a77b6393d0001eb45fd
Example Request
$ curl https://api.cycle.io/v1/containers/5b9c2a77b6393d0001eb45fd \-H"Authorization: Bearer API_KEY"\-H"X-Hub-Id: HUB_ID"\-H 'Content-Type: application/json' \-d '{"name":"New Container Name"}' \-X PATCH
Example Response
{"data": {"id": "5b9c2a77b6393d0001eb45fd","name": "Demo Name","identifier": "demo-container","creator": {"id": "5b9c2a77b6393d0001eb45fd","type": "account"},"environment": {"id": "5b9c2a77b6393d0001eb45fd","cluster": "production","container_subnet": "01d6","ipv6": {"ip": "fd00::452a:d6:0:0","cidr": "fd00::452a:d6:0:0/96"},"legacy": {"subnet": 221,"ipv4": {"ip": "10.222.221.0","cidr": "10.222.221.0/16"}}},"hub_id": "5b9c2a77b6393d0001eb45fd","image": {"id": "5cf4c971b894940001b730a3","service": null},"config": {"network": {"public": "enable","hostname": "test-container","ports": ["9000:3000"]},"deploy": {"instances": 1,"constraints": {"node": {"tags": {"any": [],"all": []}},"secrets": [],"containers": []}},"integrations": {"lets_encrypt": {"enable": false}}},"instances": 1,"annotations": {},"stateful": false,"role": null,"deprecate": false,"state": {"changed": "2019-06-18T04:49:55.336Z","current": "running","desired": "running"},"events": {"created": "2019-06-03T07:17:20.411Z","updated": "0001-01-01T00:00:00Z","deleted": "0001-01-01T00:00:00Z","started": "0001-01-01T00:00:00Z"}}}