- ReplicaSet
- Run a container via replicaSetPOST
- Commit container as an image via replicaSetPOST
- Execute a command in the container via replicaSetPOST
- Patch a container via replicaSetPATCH
- Rollback a container via replicaSetPATCH
- Stop a container via replicaSetPATCH
- Restart a container via replicaSetPATCH
- Pause a replicaSet via replicaSetPATCH
- Continue a replicaSet via replicaSetPATCH
- Get version info about replicaSetGET
- Get all version info about replicaSetGET
- Delete a container via replicaSetDELETE
- Volume
- Resource
Execute a command in the container via replicaSet
POST
/api/v1/replicaSet/{name}/execute
Request
Path Params
name
string
required
Example:
foo
Body Params application/json
cmd
array[string]
required
Example
{
"cmd": [
"nvidia-smi"
]
}
Request 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 POST 'http://127.0.0.1:2378/api/v1/replicaSet/foo/execute' \
--header 'Content-Type: application/json' \
--data-raw '{
"cmd": ["nvidia-smi"]
}'
Responses
🟢200OK
application/json
Body
code
integer
required
msg
string
required
data
object
required
stdout
string
required
Example
{
"code": 200,
"msg": "Success",
"data": {
"stdout": "Mon Jan 22 03:01:02 2024 \n+-----------------------------------------------------------------------------+\n| NVIDIA-SMI 525.85.12 Driver Version: 525.85.12 CUDA Version: 12.0 |\n|-------------------------------+----------------------+----------------------+\n| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |\n| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |\n| | | MIG M. |\n|===============================+======================+======================|\n| 0 NVIDIA A100 80G... On | 00000000:36:00.0 Off | 0 |\n| N/A 42C P0 65W / 300W | 51827MiB / 81920MiB | 0% Default |\n| | | Enabled* |\n+-------------------------------+----------------------+----------------------+\n| 1 NVIDIA A100 80G... On | 00000000:89:00.0 Off | 0 |\n| N/A 47C P0 70W / 300W | 12481MiB / 81920MiB | 0% Default |\n| | | Enabled* |\n+-------------------------------+----------------------+----------------------+\n| 2 NVIDIA A100 80G... On | 00000000:8A:00.0 Off | 0 |\n| N/A 39C P0 45W / 300W | 0MiB / 81920MiB | 0% Default |\n| | | Enabled* |\n+-------------------------------+----------------------+----------------------+\n \n+-----------------------------------------------------------------------------+\n| Processes: |\n| GPU GI CI PID Type Process name GPU Memory |\n| ID ID Usage |\n|=============================================================================|\n+-----------------------------------------------------------------------------+\n"
}
}
Modified at 2024-01-22 07:53:45