Commit Graph

64 Commits

Author SHA1 Message Date
Dietmar Maurer
772c679e64 avoid call to query_terminal_options
This is now called inside print_api_result.
2018-09-18 07:18:23 +02:00
Dietmar Maurer
4aba8d31fe fixes for changes in pve-common 2018-07-25 10:50:29 +02:00
Dietmar Maurer
59d3653b91 use new features from pve-common 2018-07-11 10:36:16 +02:00
Dietmar Maurer
633508aa89 config set: check digest 2018-07-04 10:16:14 +02:00
Dietmar Maurer
e42d9cfe59 config list: correctly return and format data 2018-07-04 10:12:04 +02:00
Dietmar Maurer
faa47c20e2 adopt code for changes in pve-common 2018-07-04 08:54:16 +02:00
Dietmar Maurer
5101e472b1 PVE::APIClient::Helpers::extract_even_elements - new helper 2018-07-02 10:05:45 +02:00
René Jochum
4e14c0d17b Remove timeout from the stop command (lxc doesn't support it) 2018-06-20 06:50:13 +02:00
René Jochum
2b267ba22e Add task log to 'lxc create' 2018-06-20 06:42:49 +02:00
René Jochum
b7db4587c1 Add create and destroy subcommands to the lxc command 2018-06-20 06:42:49 +02:00
René Jochum
aa66d1df95 Fix old none ::APIClient uses.
Signed-off-by: René Jochum <r.jochum@proxmox.com>
2018-06-20 06:42:49 +02:00
Dietmar Maurer
e346866631 remote.pm: use better command names (list, add, set, delete) 2018-06-19 07:50:35 +02:00
Dietmar Maurer
b400742534 implement config file locking 2018-06-15 12:28:05 +02:00
Dietmar Maurer
9305b2c986 make timeouts optional 2018-06-14 13:22:40 +02:00
René Jochum
42de9764b4 Add the remaining guest commands
Signed-off-by: René Jochum <r.jochum@proxmox.com>
2018-06-14 12:41:12 +02:00
Dietmar Maurer
b2123baa34 correctly use PVE::APIClient::PTY 2018-06-14 12:19:38 +02:00
Dietmar Maurer
b5aeedb062 rename defaut output format from 'table' to 'text' 2018-06-14 11:57:40 +02:00
Dietmar Maurer
cbfba90bd8 register stanadard option 'pveclient-output-format' 2018-06-14 09:36:54 +02:00
Dietmar Maurer
ef03892d0c list.pm: add missing use clauses 2018-06-14 09:31:53 +02:00
Dietmar Maurer
c9138c03bc use packages from PVE::APIClient 2018-06-14 09:16:02 +02:00
René Jochum
ca3269f4d8 Add update-pve-common make target to move code to PVE/APIClient. 2018-06-13 13:20:53 +02:00
René Jochum
4cedebf640 Add spice command 2018-06-13 10:50:24 +02:00
Dietmar Maurer
89335fb177 rename start.pm to GuestStatus.pm, implement stop command
Please note that we group similar commands inside a single command class.
Our CLIHandler then nicely groups this commands inside help.
2018-06-13 09:24:37 +02:00
Dietmar Maurer
654a262843 remove PVE/APIClient/Commands/help.pm
not needed anymore.
2018-06-13 08:57:53 +02:00
René Jochum
2f964a751c Add start command
I've added the logic to poll the task given by status/start until its
"stopped", this enables an usage like:

pveclient lxc create 999 && pveclient start 999 && pveclient enter 999

Signed-off-by: René Jochum <r.jochum@proxmox.com>
2018-06-13 08:39:51 +02:00
René Jochum
7acede2069 Use get_standard_option for vmid in enter
Signed-off-by: René Jochum <r.jochum@proxmox.com>
2018-06-13 08:26:01 +02:00
Dietmar Maurer
41d185e8ec add missing file PVE/APIClient/Commands/config.pm 2018-06-12 12:06:46 +02:00
Dietmar Maurer
a6dab5b8ed Config.pm: add new defaults sections
And implement a new command to setup defaults.
2018-06-12 11:17:45 +02:00
René Jochum
5b0908432b Add a simple implementation of list
Signed-off-by: René Jochum <r.jochum@proxmox.com>
2018-06-12 06:39:35 +02:00
Wolfgang Bumiller
83a7ab4c10 lxc enter: improve escape key handling
The escape key should not be passed through, this now only
happens when pressing the escape key twice (as it is with
tmux, screen, ssh, etc.).
Also prepared the code to handle a configurable escape key,
and restructured the handling to more easily allow adding
more keys. For instance we could add shortcuts for some
`pct` commands. Most of them are marginally useful, but
snapshot, migrate, shutdown or stop might still be
nice-to-have things.
The idea is also that if we reuse the code for serial
terminals for VMs we can add shortcuts to eg. paste the
current terminal size (probably the most useful one), or
to send sys-rqs or agent commands.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-06-12 06:30:39 +02:00
Dietmar Maurer
d956d61838 lxc enter: set STDOUT to non-blocking mode 2018-06-08 11:42:22 +02:00
Dietmar Maurer
bf705a1ef3 lxc enter: fix read from non-blocking web socket 2018-06-08 11:42:22 +02:00
Dietmar Maurer
48e35b780f lxc enter: switch back to non-blocking mode
regression was introcude in patch e9d848651d
2018-06-08 11:42:22 +02:00
Dietmar Maurer
8a58c00176 lxc enter: cleanup filehandle usage 2018-06-08 11:42:14 +02:00
Dietmar Maurer
032dc44cfe lxc console: limit output buffer size 2018-06-08 11:01:06 +02:00
Dietmar Maurer
1ec5788ca4 lxc enter: handle writes with select 2018-06-08 11:01:06 +02:00
Dietmar Maurer
e4c016351a lxc enter: use IO::Select->select 2018-06-08 11:01:06 +02:00
René Jochum
9657c731c7 Poll the size of the terminal and resize if needed
Signed-off-by: René Jochum <r.jochum@proxmox.com>
2018-06-08 06:37:41 +02:00
Dietmar Maurer
678b245c54 implemet and use full_write() 2018-06-07 11:30:47 +02:00
Dietmar Maurer
962d470acb websocket: set max_payload_size to 128*1024
Because our server sends larger frames up to 128KB.
2018-06-07 11:29:08 +02:00
Dietmar Maurer
e9d848651d lxc enter: simplify code and cleanups
- print error messages after reseting the terminal
- catch signals

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-06-06 14:59:03 +02:00
Dietmar Maurer
1334102e03 parse_web_socket_frame: use $wsbuf_ref directly, so that we really consume data
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-06-06 14:59:03 +02:00
Dietmar Maurer
9bfdc8faf6 fixup for previous commit: really set blocking mode 2018-06-06 08:24:57 +02:00
Dietmar Maurer
3226300c1b enter: on exit, switch back to blocking mode
Else later shell commands will fail!
2018-06-06 07:46:26 +02:00
Dietmar Maurer
8842464b81 allow to setup remotes without password
And query the password on demand.
2018-06-06 07:02:36 +02:00
Dietmar Maurer
a304c3d793 remote add: fix connection setup 2018-06-06 06:59:14 +02:00
René Jochum
95b87dd39f Add "lxc enter" from "pventer" without its deps.
This patch adds the functionality of "pventer" to "pveclient" without
its external dependecies, we solved them with our internal tools.

I tried to use IO::Select->select() but failed hard with it, so i
switched back to $select->can_(read|write).

Signed-off-by: René Jochum <r.jochum@proxmox.com>
2018-06-06 06:09:30 +02:00
René Jochum
6bb4301665 Fix the WebSocket client to work with none PVE servers.
For debugging I tested the WebSocket client with my Protocol::WebSocket
server (i have hexdumps in it), this patch is required to make it work
with it. I'm pretty sure we need it for Proxies too.
2018-06-06 06:09:26 +02:00
Dietmar Maurer
69aa81b396 use SectionConfig for PVE::APIClient::Config 2018-06-05 11:44:45 +02:00
Dietmar Maurer
aa9d64b341 help.pm: fix generate usage string (hide password option) 2018-06-05 10:37:41 +02:00