pve-client.git
18 months agofix copyright date master
Dietmar Maurer [Fri, 28 Sep 2018 05:50:44 +0000 (07:50 +0200)]
fix copyright date

18 months agoupdate pve-api-definition.dat
Dietmar Maurer [Tue, 18 Sep 2018 06:19:50 +0000 (08:19 +0200)]
update pve-api-definition.dat

18 months agoavoid call to query_terminal_options
Dietmar Maurer [Tue, 18 Sep 2018 05:18:23 +0000 (07:18 +0200)]
avoid call to query_terminal_options

This is now called inside print_api_result.

18 months agoupdate files from pve-common
Dietmar Maurer [Tue, 18 Sep 2018 05:17:52 +0000 (07:17 +0200)]
update files from pve-common

20 months agofixes for changes in pve-common
Dietmar Maurer [Wed, 25 Jul 2018 08:50:29 +0000 (10:50 +0200)]
fixes for changes in pve-common

20 months agocomplete_api_path: minimize completions
Dietmar Maurer [Tue, 24 Jul 2018 09:29:22 +0000 (11:29 +0200)]
complete_api_path: minimize completions

20 months agoupdate pve-api-definition.dat
Dietmar Maurer [Tue, 24 Jul 2018 08:02:20 +0000 (10:02 +0200)]
update pve-api-definition.dat

20 months agoextractapi.pl: correctly store regex as string
Dietmar Maurer [Tue, 24 Jul 2018 08:02:00 +0000 (10:02 +0200)]
extractapi.pl: correctly store regex as string

20 months agoupdate files from pve-common
Dietmar Maurer [Tue, 24 Jul 2018 07:31:55 +0000 (09:31 +0200)]
update files from pve-common

20 months agopve-api-definition.dat: update data
Dietmar Maurer [Wed, 11 Jul 2018 08:52:22 +0000 (10:52 +0200)]
pve-api-definition.dat: update data

20 months agouse new features from pve-common
Dietmar Maurer [Wed, 11 Jul 2018 08:36:16 +0000 (10:36 +0200)]
use new features from pve-common

20 months agoupdate files from pve-common
Dietmar Maurer [Wed, 11 Jul 2018 07:44:04 +0000 (09:44 +0200)]
update files from pve-common

20 months agoimplement pveclient api usage <path>
Dietmar Maurer [Fri, 6 Jul 2018 07:32:51 +0000 (09:32 +0200)]
implement pveclient api usage <path>

20 months agoupdate files from pve-common
Dietmar Maurer [Fri, 6 Jul 2018 07:32:16 +0000 (09:32 +0200)]
update files from pve-common

20 months agoupdate files from pve-common
Dietmar Maurer [Thu, 5 Jul 2018 07:46:40 +0000 (09:46 +0200)]
update files from pve-common

20 months agoconfig set: check digest
Dietmar Maurer [Wed, 4 Jul 2018 08:16:14 +0000 (10:16 +0200)]
config set: check digest

20 months agoconfig list: correctly return and format data
Dietmar Maurer [Wed, 4 Jul 2018 08:12:04 +0000 (10:12 +0200)]
config list: correctly return and format data

20 months agoPVE/APIClient/Helpers.pm - new helper print_result()
Dietmar Maurer [Wed, 4 Jul 2018 08:11:30 +0000 (10:11 +0200)]
PVE/APIClient/Helpers.pm - new helper print_result()

20 months agoadopt code for changes in pve-common
Dietmar Maurer [Wed, 4 Jul 2018 06:54:16 +0000 (08:54 +0200)]
adopt code for changes in pve-common

20 months agoupdate files from pve-common
Dietmar Maurer [Wed, 4 Jul 2018 06:53:36 +0000 (08:53 +0200)]
update files from pve-common

21 months agoMakefile: fix target 'clean' - do not fail if files does not exist
Dietmar Maurer [Mon, 2 Jul 2018 11:17:38 +0000 (13:17 +0200)]
Makefile: fix target 'clean' - do not fail if files does not exist

21 months agoPVE::APIClient::Helper::print_ordered_result - correctly declare local var
Dietmar Maurer [Mon, 2 Jul 2018 08:09:52 +0000 (10:09 +0200)]
PVE::APIClient::Helper::print_ordered_result - correctly declare local var

21 months agoPVE::APIClient::Helpers::extract_even_elements - new helper
Dietmar Maurer [Tue, 26 Jun 2018 11:46:50 +0000 (13:46 +0200)]
PVE::APIClient::Helpers::extract_even_elements - new helper

21 months agoupdate files from pve-common
Dietmar Maurer [Tue, 26 Jun 2018 11:44:42 +0000 (13:44 +0200)]
update files from pve-common

21 months agouse new PVE::APIClient::CLIHandler::print_api_result
Dietmar Maurer [Fri, 22 Jun 2018 07:54:21 +0000 (09:54 +0200)]
use new PVE::APIClient::CLIHandler::print_api_result

21 months agopve-api-definition.dat: add root index method
Dietmar Maurer [Fri, 22 Jun 2018 07:50:13 +0000 (09:50 +0200)]
pve-api-definition.dat: add root index method

21 months agoupdate files from pve-common
Dietmar Maurer [Fri, 22 Jun 2018 07:47:25 +0000 (09:47 +0200)]
update files from pve-common

21 months agopve-api-definition.dat: update
Dietmar Maurer [Fri, 22 Jun 2018 05:56:04 +0000 (07:56 +0200)]
pve-api-definition.dat: update

21 months agoHandle errors on tasks correctly with a die,
René Jochum [Wed, 20 Jun 2018 09:46:55 +0000 (11:46 +0200)]
Handle errors on tasks correctly with a die,

so we get the correct exit code on errors.

Signed-off-by: René Jochum <r.jochum@proxmox.com>
21 months agoupdate files from pve-common
Dietmar Maurer [Wed, 20 Jun 2018 05:03:48 +0000 (07:03 +0200)]
update files from pve-common

21 months agoRemove timeout from the stop command (lxc doesn't support it)
René Jochum [Thu, 14 Jun 2018 11:48:20 +0000 (13:48 +0200)]
Remove timeout from the stop command (lxc doesn't support it)

21 months agoAdd task log to 'lxc create'
René Jochum [Tue, 19 Jun 2018 15:46:51 +0000 (17:46 +0200)]
Add task log to 'lxc create'

21 months agoAdd create and destroy subcommands to the lxc command
René Jochum [Tue, 19 Jun 2018 15:46:50 +0000 (17:46 +0200)]
Add create and destroy subcommands to the lxc command

21 months agoFix old none ::APIClient uses.
René Jochum [Tue, 19 Jun 2018 14:03:59 +0000 (16:03 +0200)]
Fix old none ::APIClient uses.

Signed-off-by: René Jochum <r.jochum@proxmox.com>
21 months agoUse a different path for the lock file
René Jochum [Tue, 19 Jun 2018 14:59:54 +0000 (16:59 +0200)]
Use a different path for the lock file

This prevents lock_file from creating the config file with wrong permissions.

21 months agoremote.pm: use better command names (list, add, set, delete)
Dietmar Maurer [Tue, 19 Jun 2018 05:50:35 +0000 (07:50 +0200)]
remote.pm: use better command names (list, add, set, delete)

21 months agofix parameter name inside description, minor cleanups
Dietmar Maurer [Tue, 19 Jun 2018 05:43:46 +0000 (07:43 +0200)]
fix parameter name inside description, minor cleanups

21 months agoHelpers.pm: remove unknown format definitions
Dietmar Maurer [Mon, 18 Jun 2018 11:06:41 +0000 (13:06 +0200)]
Helpers.pm: remove unknown format definitions

We do those checks at the server side anyways ...

21 months agoadd a manual page
Dietmar Maurer [Mon, 18 Jun 2018 08:32:14 +0000 (10:32 +0200)]
add a manual page

21 months agoremove $pve_api_path_hash - no longer used
Dietmar Maurer [Mon, 18 Jun 2018 07:52:59 +0000 (09:52 +0200)]
remove $pve_api_path_hash - no longer used

21 months agoHelpers.pm: new helper find_method_info()
Dietmar Maurer [Mon, 18 Jun 2018 06:24:17 +0000 (08:24 +0200)]
Helpers.pm: new helper find_method_info()

To lookup method info with extracted uri parameters.

21 months agocopy Tools.pm from pve-common
Dietmar Maurer [Fri, 15 Jun 2018 10:57:48 +0000 (12:57 +0200)]
copy Tools.pm from pve-common

21 months agoimplement config file locking
Dietmar Maurer [Fri, 15 Jun 2018 10:26:28 +0000 (12:26 +0200)]
implement config file locking

21 months agoremote_conn: try to cache tickets
Dietmar Maurer [Fri, 15 Jun 2018 07:15:34 +0000 (09:15 +0200)]
remote_conn: try to cache tickets

21 months agoadd helper to read/update a ticket cache file
Dietmar Maurer [Fri, 15 Jun 2018 06:09:21 +0000 (08:09 +0200)]
add helper to read/update a ticket cache file

21 months agochange configuration file name ~/.config/pveclient/config
Dietmar Maurer [Fri, 15 Jun 2018 05:34:37 +0000 (07:34 +0200)]
change configuration file name ~/.config/pveclient/config

21 months agoHelpers.pm: new helper configuration_directory
Dietmar Maurer [Fri, 15 Jun 2018 05:21:13 +0000 (07:21 +0200)]
Helpers.pm: new helper configuration_directory

Read configs from XDG_CONFIG_HOME/pveclient/ first.
if XDG_CONFIG_HOME is not set, then use $HOME/.config/pveclient/

21 months agoTools.pm: copied lock_file_full from pve-common
Dietmar Maurer [Fri, 15 Jun 2018 05:00:16 +0000 (07:00 +0200)]
Tools.pm: copied lock_file_full from pve-common

21 months agomake timeouts optional
Dietmar Maurer [Thu, 14 Jun 2018 11:22:40 +0000 (13:22 +0200)]
make timeouts optional

21 months agoAdd the remaining guest commands
René Jochum [Thu, 14 Jun 2018 10:15:38 +0000 (12:15 +0200)]
Add the remaining guest commands

Signed-off-by: René Jochum <r.jochum@proxmox.com>
21 months agocorrectly use PVE::APIClient::PTY
Dietmar Maurer [Thu, 14 Jun 2018 10:19:38 +0000 (12:19 +0200)]
correctly use PVE::APIClient::PTY

21 months agopveclient: add read_pasword handler
Dietmar Maurer [Thu, 14 Jun 2018 10:14:58 +0000 (12:14 +0200)]
pveclient: add read_pasword handler

Because this is the base CLIHandler class now.

21 months agorename defaut output format from 'table' to 'text'
Dietmar Maurer [Thu, 14 Jun 2018 09:57:40 +0000 (11:57 +0200)]
rename defaut output format from 'table' to 'text'

21 months agoadd new helper print_result
Dietmar Maurer [Thu, 14 Jun 2018 09:12:29 +0000 (11:12 +0200)]
add new helper print_result

21 months agofully implement api get/set/create/delete
Dietmar Maurer [Thu, 14 Jun 2018 08:18:10 +0000 (10:18 +0200)]
fully implement api get/set/create/delete

21 months agoConfig.pm: use PVE::APIClient::PTY
Dietmar Maurer [Thu, 14 Jun 2018 08:08:06 +0000 (10:08 +0200)]
Config.pm: use PVE::APIClient::PTY

21 months agoregister stanadard option 'pveclient-output-format'
Dietmar Maurer [Thu, 14 Jun 2018 07:36:54 +0000 (09:36 +0200)]
register stanadard option 'pveclient-output-format'

21 months agolist.pm: add missing use clauses
Dietmar Maurer [Thu, 14 Jun 2018 07:31:53 +0000 (09:31 +0200)]
list.pm: add missing use clauses

21 months agoimplement call_method
Dietmar Maurer [Thu, 14 Jun 2018 06:16:31 +0000 (08:16 +0200)]
implement call_method

21 months agoupdate files from pve-common
Dietmar Maurer [Thu, 14 Jun 2018 07:13:50 +0000 (09:13 +0200)]
update files from pve-common

Includes some changes which are still not applied.

21 months agouse packages from PVE::APIClient
Dietmar Maurer [Thu, 14 Jun 2018 06:54:17 +0000 (08:54 +0200)]
use packages from PVE::APIClient

21 months agoMakefile: cleanup - use a loop to install files
Dietmar Maurer [Wed, 13 Jun 2018 11:42:28 +0000 (13:42 +0200)]
Makefile: cleanup - use a loop to install files

21 months agoAdd update-pve-common make target to move code to PVE/APIClient.
René Jochum [Wed, 13 Jun 2018 10:04:17 +0000 (12:04 +0200)]
Add update-pve-common make target to move code to PVE/APIClient.

21 months agoAdd spice command
René Jochum [Wed, 13 Jun 2018 08:44:59 +0000 (10:44 +0200)]
Add spice command

21 months agoinstall missing files
Dietmar Maurer [Wed, 13 Jun 2018 08:15:52 +0000 (10:15 +0200)]
install missing files

21 months agorename start.pm to GuestStatus.pm, implement stop command
Dietmar Maurer [Wed, 13 Jun 2018 07:24:37 +0000 (09:24 +0200)]
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.

21 months agoremove PVE/APIClient/Commands/help.pm
Dietmar Maurer [Wed, 13 Jun 2018 06:57:53 +0000 (08:57 +0200)]
remove PVE/APIClient/Commands/help.pm

not needed anymore.

21 months agoAdd start command
René Jochum [Tue, 12 Jun 2018 11:49:01 +0000 (13:49 +0200)]
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>
21 months agoUse get_standard_option for vmid in enter
René Jochum [Tue, 12 Jun 2018 09:55:03 +0000 (11:55 +0200)]
Use get_standard_option for vmid in enter

Signed-off-by: René Jochum <r.jochum@proxmox.com>
21 months agogenerate_usage_str: do no generate help for unknown commands
Dietmar Maurer [Wed, 13 Jun 2018 05:54:33 +0000 (07:54 +0200)]
generate_usage_str: do no generate help for unknown commands

Before:

...
USAGE: pvesm aaa zfsscan

With this patch applied:

no such command 'aaa'

21 months agocleanup: use nested CLIHandler command definitions
Dietmar Maurer [Wed, 13 Jun 2018 05:25:56 +0000 (07:25 +0200)]
cleanup: use nested CLIHandler command definitions

21 months agoupdate copy of PVE/JSONSchema.pm
Dietmar Maurer [Wed, 13 Jun 2018 06:06:03 +0000 (08:06 +0200)]
update copy of PVE/JSONSchema.pm

21 months agoadd missing file PVE/APIClient/Commands/config.pm
Dietmar Maurer [Tue, 12 Jun 2018 10:06:46 +0000 (12:06 +0200)]
add missing file PVE/APIClient/Commands/config.pm

21 months agoConfig.pm: add new defaults sections
Dietmar Maurer [Tue, 12 Jun 2018 04:21:56 +0000 (06:21 +0200)]
Config.pm: add new defaults sections

And implement a new command to setup defaults.

21 months agouse binary format to store API definition efficently
Dietmar Maurer [Fri, 8 Jun 2018 13:47:10 +0000 (15:47 +0200)]
use binary format to store API definition efficently

Note: The previous file does not contains indexed parameters like -net\d+ (those
were converted to to -net[n]). But we need all those parameters for the command
line completion. The binary format is much smaller the json, because it can handle
references.

21 months agofix bash completion for simple command classes like 'list'.
Dietmar Maurer [Tue, 12 Jun 2018 06:07:50 +0000 (08:07 +0200)]
fix bash completion for simple command classes like 'list'.

21 months agoimplement bash completion for get/set/create/delete
Dietmar Maurer [Thu, 7 Jun 2018 11:34:11 +0000 (13:34 +0200)]
implement bash completion for get/set/create/delete

21 months agoadd more helper for bash completion
Dietmar Maurer [Thu, 7 Jun 2018 11:33:12 +0000 (13:33 +0200)]
add more helper for bash completion

21 months agoAdd a simple implementation of list
René Jochum [Mon, 11 Jun 2018 09:35:27 +0000 (11:35 +0200)]
Add a simple implementation of list

Signed-off-by: René Jochum <r.jochum@proxmox.com>
21 months agolxc enter: improve escape key handling
Wolfgang Bumiller [Mon, 11 Jun 2018 09:30:38 +0000 (11:30 +0200)]
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>
21 months agoconfig: typo fixup
Wolfgang Bumiller [Mon, 11 Jun 2018 09:30:36 +0000 (11:30 +0200)]
config: typo fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
21 months agolxc enter: set STDOUT to non-blocking mode
Dietmar Maurer [Fri, 8 Jun 2018 08:51:22 +0000 (10:51 +0200)]
lxc enter: set STDOUT to non-blocking mode

21 months agolxc enter: fix read from non-blocking web socket
Dietmar Maurer [Fri, 8 Jun 2018 08:20:21 +0000 (10:20 +0200)]
lxc enter: fix read from non-blocking web socket

21 months agolxc enter: switch back to non-blocking mode
Dietmar Maurer [Fri, 8 Jun 2018 07:57:09 +0000 (09:57 +0200)]
lxc enter: switch back to non-blocking mode

regression was introcude in patch e9d848651dd50d169a532d4428f47b0754e5ac9

21 months agolxc enter: cleanup filehandle usage
Dietmar Maurer [Fri, 8 Jun 2018 07:48:17 +0000 (09:48 +0200)]
lxc enter: cleanup filehandle usage

21 months agolxc console: limit output buffer size
Dietmar Maurer [Fri, 8 Jun 2018 06:48:07 +0000 (08:48 +0200)]
lxc console: limit output buffer size

21 months agolxc enter: handle writes with select
Dietmar Maurer [Fri, 8 Jun 2018 06:02:13 +0000 (08:02 +0200)]
lxc enter: handle writes with select

21 months agolxc enter: use IO::Select->select
Dietmar Maurer [Fri, 8 Jun 2018 05:06:37 +0000 (07:06 +0200)]
lxc enter: use IO::Select->select

21 months agoCLIHandler: copied updates from pve-common
Dietmar Maurer [Fri, 8 Jun 2018 04:36:47 +0000 (06:36 +0200)]
CLIHandler: copied updates from pve-common

21 months agoPoll the size of the terminal and resize if needed
René Jochum [Thu, 7 Jun 2018 12:29:26 +0000 (14:29 +0200)]
Poll the size of the terminal and resize if needed

Signed-off-by: René Jochum <r.jochum@proxmox.com>
21 months agoimplemet and use full_write()
Dietmar Maurer [Thu, 7 Jun 2018 09:28:10 +0000 (11:28 +0200)]
implemet and use full_write()

21 months agowebsocket: set max_payload_size to 128*1024
Dietmar Maurer [Thu, 7 Jun 2018 04:44:21 +0000 (06:44 +0200)]
websocket: set max_payload_size to 128*1024

Because our server sends larger frames up to 128KB.

21 months agolxc enter: simplify code and cleanups
Dietmar Maurer [Wed, 6 Jun 2018 09:30:13 +0000 (11:30 +0200)]
lxc enter: simplify code and cleanups

- print error messages after reseting the terminal
- catch signals

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
21 months agoparse_web_socket_frame: use $wsbuf_ref directly, so that we really consume data
Dietmar Maurer [Wed, 6 Jun 2018 09:30:12 +0000 (11:30 +0200)]
parse_web_socket_frame: use $wsbuf_ref directly, so that we really consume data

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
21 months agofixup for previous commit: really set blocking mode
Dietmar Maurer [Wed, 6 Jun 2018 06:24:57 +0000 (08:24 +0200)]
fixup for previous commit: really set blocking mode

21 months agoenter: on exit, switch back to blocking mode
Dietmar Maurer [Wed, 6 Jun 2018 05:46:26 +0000 (07:46 +0200)]
enter: on exit, switch back to blocking mode

Else later shell commands will fail!

21 months agoallow to setup remotes without password
Dietmar Maurer [Wed, 6 Jun 2018 05:02:36 +0000 (07:02 +0200)]
allow to setup remotes without password

And query the password on demand.

21 months agoremote add: fix connection setup
Dietmar Maurer [Wed, 6 Jun 2018 04:59:14 +0000 (06:59 +0200)]
remote add: fix connection setup

21 months agoJSONSchema: fix getopt when invoking without arguments
Dietmar Maurer [Wed, 6 Jun 2018 04:37:22 +0000 (06:37 +0200)]
JSONSchema: fix getopt when invoking without arguments

21 months agoAdd "lxc enter" from "pventer" without its deps.
René Jochum [Tue, 5 Jun 2018 16:03:42 +0000 (18:03 +0200)]
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>