Hi,
I tried to run a command via the new qemu command api endpoint via pvesh, but do not know how to format this correctly. I haven't found any hints or usage examples in the usual places.
Now with arguments:
I tried to run a command via the new qemu command api endpoint via pvesh, but do not know how to format this correctly. I haven't found any hints or usage examples in the usual places.
Code:
root@proxmox ~ > pvesh create /nodes/proxmox/qemu/109/agent/exec -command id
┌─────┬───────┐
│ key │ value │
├─────┼───────┤
│ pid │ 1708 │
└─────┴───────┘
root@proxmox ~ > pvesh get /nodes/proxmox/qemu/109/agent/exec-status -pid 1708
┌──────────┬────────────────────────────────────────┐
│ key │ value │
├──────────┼────────────────────────────────────────┤
│ exitcode │ 0 │
├──────────┼────────────────────────────────────────┤
│ exited │ 1 │
├──────────┼────────────────────────────────────────┤
│ out-data │ uid=0(root) gid=0(root) groups=0(root) │
└──────────┴────────────────────────────────────────┘
Now with arguments:
Code:
root@proxmox ~ > pvesh create /nodes/proxmox/qemu/109/agent/exec -command id 0
400 too many arguments
pvesh create <api_path> --command <string> [OPTIONS] [FORMAT_OPTIONS]
root@proxmox ~ > pvesh create /nodes/proxmox/qemu/109/agent/exec -command "id 0"
Agent error: Guest agent command failed, error was 'Failed to execute child process "id 0" (No such file or directory)'
root@proxmox ~ > pvesh create /nodes/proxmox/qemu/109/agent/exec -command "id,0"
Agent error: Guest agent command failed, error was 'Failed to execute child process "id,0" (No such file or directory)'
root@proxmox ~ > pvesh create /nodes/proxmox/qemu/109/agent/exec -command "'id','0'"
Agent error: Guest agent command failed, error was 'Failed to execute child process "'id','0'" (No such file or directory)'
root@proxmox ~ > pvesh create /nodes/proxmox/qemu/109/agent/exec -command "['id','0']"
Agent error: Guest agent command failed, error was 'Failed to execute child process "['id','0']" (No such file or directory)'
root@proxmox ~ > pvesh create /nodes/proxmox/qemu/109/agent/exec -command "{['id','0']}"
Agent error: Guest agent command failed, error was 'Failed to execute child process "{['id','0']}" (No such file or directory)'
root@proxmox ~ > pvesh create /nodes/proxmox/qemu/109/agent/exec -command '{["id","0"]}'
Agent error: Guest agent command failed, error was 'Failed to execute child process "{["id","0"]}" (No such file or directory)'
root@proxmox ~ > pvesh create /nodes/proxmox/qemu/109/agent/exec -command '{"data" => ["id","0"]}'
Agent error: Guest agent command failed, error was 'Failed to execute child process "{"data" => ["id","0"]}" (No such file or directory)'
root@proxmox ~ > pvesh create /nodes/proxmox/qemu/109/agent/exec -command '{"data" => ["id","0"]}'