v1

latestSwagger 2.02026-07-175684145.0 KB
Container

Update the configurations of a container

post/containers/{id}/update

Path parameters

idstring required

ID or name of the container

Request body

CgroupParentstring

Path to cgroups under which the container's cgroup is created. If the path is not absolute, the path is considered to be relative to the cgroups path of the init process. Cgroups are created if they do not already exist.

BlkioWeightinteger

Block IO weight (relative weight), need CFQ IO Scheduler enable.

CpuSharesinteger

An integer value representing this container's relative CPU weight versus other containers.

CpuPeriodinteger

CPU CFS (Completely Fair Scheduler) period. The length of a CPU period in microseconds.

CpuQuotainteger

CPU CFS (Completely Fair Scheduler) quota. Microseconds of CPU time that the container can get in a CPU period."

CpuRealtimePeriodinteger

The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks.

CpuRealtimeRuntimeinteger

The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks.

CpusetCpusstring

CPUs in which to allow execution (e.g., 0-3, 0,1)

CpusetMemsstring

Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.

DeviceCgroupRulesstring[]

a list of cgroup rules to apply to the container

KernelMemoryinteger

Kernel memory limit in bytes.

Memoryinteger

Memory limit in bytes.

MemoryReservationinteger

Memory soft limit in bytes.

MemorySwapinteger

Total memory limit (memory + swap). Set as -1 to enable unlimited swap.

MemorySwappinessinteger

Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. -1 is also accepted, as a legacy alias of 0.

NanoCpusinteger

CPU quota in units of 10<sup>-9</sup> CPUs.

OomKillDisableboolean nullable

Disable OOM Killer for the container.

PidsLimitinteger

Tune a container's pids limit. Set -1 for unlimited. Only on Linux 4.4 does this parameter support.

CpuCountinteger

The number of usable CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is CPUCount first, then CPUShares, and CPUPercent last.

CpuPercentinteger

The usable percentage of the available CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is CPUCount first, then CPUShares, and CPUPercent last.

IOMaximumIOpsinteger

Maximum IOps for the container system drive (Windows only)

IOMaximumBandwidthinteger

Maximum IO in bytes per second for the container system drive (Windows only)

IntelRdtL3Cbmstring

IntelRdtL3Cbm specifies settings for Intel RDT/CAT group that the container is placed into to limit the resources (e.g., L3 cache) the container has available.

ScheLatSwitchinteger

ScheLatSwitch enables scheduler latency count in cpuacct

MemoryWmarkRatiointeger nullable

MemoryWmarkRatio is an integer value representing this container's memory low water mark percentage. The value of memory low water mark is memory.limit_in_bytes * MemoryWmarkRatio.

MemoryExtrainteger nullable

MemoryExtra is an integer value representing memory extra in bytes

MemoryForceEmptyCtlinteger

MemoryForceEmptyCtl represents whether to reclaim the page cache when deleting cgroup.

Envstring[]

A list of environment variables to set inside the container in the form ["VAR=value", ...]. A variable like "A=" means updating env A in container to be empty value. A variable without = is removed from the environment, rather than to have an empty value.

Labelstring[]

List of labels set to container.

DiskQuotaobject nullable

update disk quota for container

SpecAnnotationobject nullable

update specAnnotation for container

Example request

{
  "CpusetCpus": "0-3",
  "Devices": [
    {
      "PathOnHost": "/dev/deviceName",
      "PathInContainer": "/dev/deviceName",
      "CgroupPermissions": "mrw"
    }
  ],
  "DeviceCgroupRules": [
    "c 13:* rwm"
  ],
  "NvidiaConfig": {
    "NvidiaVisibleDevices": "Possible values.\n0,1,2, GPU-fef8089b …: a comma-separated list of GPU UUID(s) or index(es).\nall: all GPUs will be accessible, this is the default value in our container images.\nnone: no GPU will be accessible, but driver capabilities will be enabled.\n",
    "NvidiaDriverCapabilities": "Possible values\ncompute,video, graphics,utility …: a comma-separated list of driver features the container needs.\nall: enable all available driver capabilities.\n"
  }
}

Response

no error