GPU-Docker-API-Official
  1. Volume
GPU-Docker-API-Official
  • ReplicaSet
    • Run a container via replicaSet
      POST
    • Commit container as an image via replicaSet
      POST
    • Execute a command in the container via replicaSet
      POST
    • Patch a container via replicaSet
      PATCH
    • Rollback a container via replicaSet
      PATCH
    • Stop a container via replicaSet
      PATCH
    • Restart a container via replicaSet
      PATCH
    • Pause a replicaSet via replicaSet
      PATCH
    • Continue a replicaSet via replicaSet
      PATCH
    • Get version info about replicaSet
      GET
    • Get all version info about replicaSet
      GET
    • Delete a container via replicaSet
      DELETE
  • Volume
    • Create a volume
      POST
    • Patch a volume
      PATCH
    • Get version info about a volume
      GET
    • Get all version info about a volume
      GET
    • Delete a volume
      DELETE
  • Resource
    • Get gpu usage status
      GET
    • Get port usage status
      GET
  1. Volume

Patch a volume

PATCH
/api/v1/volumes/{name}/size
Patch the size of the latest version of an existing volume via create a new volume and copy the old volume data to the new volume.
Including expand and shrink of two operations, if the size is the same before and after the operation,it will be skipped.
If the size already used is larger than the size after shrink, then shrink operation will fail.
The old version volume will be deleted.
For example, if bar-1 calls the /api/v1/volumes/:name/size and create bar-2, bar-1 will be deleted.

Request

Path Params

Body Params application/json

Example
{
    "size": "50GB"
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PATCH 'http://127.0.0.1:2378/api/v1/volumes/bar/size' \
--header 'Content-Type: application/json' \
--data-raw '{
    "size": "50GB"
}'

Responses

🟢200OK
application/json
Body

Example
{
    "code": 200,
    "msg": "Success",
    "data": {
        "name": "bar-2",
        "size": "50GB"
    }
}
Modified at 2024-01-23 01:58:01
Previous
Create a volume
Next
Get version info about a volume
Built with