Update a container
PUT
/container/{ocid}
const url = 'https://sylve.lan:8181/api/container/1';const options = { method: 'PUT', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"annotations":{"additionalProperty":"example"},"command":["example"],"entrypoint":["example"],"env":[{"name":"example","value":"example"}],"extraHosts":["example"],"hostname":"example","image":"example","ip":"example","mounts":[{"guid":"example","mode":"example","owner":"example","readOnly":true,"source":"example","target":"example","type":"volume"}],"name":"example","network":"example","os":"example","ports":[{"containerPort":1,"hostIp":"example","hostPort":1,"protocol":"example"}],"pullImage":true,"restart":"example","restartRetries":1,"shmSize":"example","stopTimeout":1,"user":"example","workDir":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://sylve.lan:8181/api/container/1 \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "annotations": { "additionalProperty": "example" }, "command": [ "example" ], "entrypoint": [ "example" ], "env": [ { "name": "example", "value": "example" } ], "extraHosts": [ "example" ], "hostname": "example", "image": "example", "ip": "example", "mounts": [ { "guid": "example", "mode": "example", "owner": "example", "readOnly": true, "source": "example", "target": "example", "type": "volume" } ], "name": "example", "network": "example", "os": "example", "ports": [ { "containerPort": 1, "hostIp": "example", "hostPort": 1, "protocol": "example" } ], "pullImage": true, "restart": "example", "restartRetries": 1, "shmSize": "example", "stopTimeout": 1, "user": "example", "workDir": "example" }'Queue recreation of a container from an edited spec, keeping its volumes
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ocid
required
integer
Container ID
Request Body
Section titled “Request Body”Spec
Media typeapplication/json
object
annotations
object
key
additional properties
string
command
Array<string>
entrypoint
Array<string>
env
Array<object>
object
name
string
value
string
extraHosts
Array<string>
hostname
string
image
string
ip
string
mounts
Array<object>
object
guid
string
mode
string
owner
string
readOnly
boolean
source
string
target
string
type
string
name
Name renames the container on update: its hostname and the name its network knows it by. CreateRequest’s own Name shadows it on create.
string
network
string
os
string
ports
Array<object>
object
containerPort
integer
hostIp
string
hostPort
integer
protocol
string
pullImage
boolean
restart
string
restartRetries
integer
shmSize
string
stopTimeout
integer
user
string
workDir
string
Responses
Section titled “Responses”Accepted
Media typeapplication/json
object
data
object
action
string
ocId
integer
outcome
string
taskId
integer
error
string
message
string
status
string
Examplegenerated
{ "data": { "action": "example", "ocId": 1, "outcome": "example", "taskId": 1 }, "error": "example", "message": "example", "status": "example"}