From f3bd890d98d9216220c393ef2c1cd0c4829ab453 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 1 Oct 2015 07:42:37 +0200 Subject: [PATCH] add missing completion hooks --- PVE/API2/Storage/Config.pm | 4 +++- PVE/API2/Storage/Content.pm | 22 ++++++++++++++-------- PVE/API2/Storage/Status.pm | 11 ++++++----- PVE/CLI/pvesm.pm | 1 + 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/PVE/API2/Storage/Config.pm b/PVE/API2/Storage/Config.pm index e5c57ee..b9fdc0e 100755 --- a/PVE/API2/Storage/Config.pm +++ b/PVE/API2/Storage/Config.pm @@ -229,7 +229,9 @@ __PACKAGE__->register_method ({ parameters => { additionalProperties => 0, properties => { - storage => get_standard_option('pve-storage-id'), + storage => get_standard_option('pve-storage-id', { + completion => \&PVE::Storage::complete_storage, + }), }, }, returns => { type => 'null' }, diff --git a/PVE/API2/Storage/Content.pm b/PVE/API2/Storage/Content.pm index e33888e..03f9b26 100644 --- a/PVE/API2/Storage/Content.pm +++ b/PVE/API2/Storage/Content.pm @@ -29,18 +29,20 @@ __PACKAGE__->register_method ({ additionalProperties => 0, properties => { node => get_standard_option('pve-node'), - storage => get_standard_option('pve-storage-id'), + storage => get_standard_option('pve-storage-id', { + completion => \&PVE::Storage::complete_storage_enabled, + }), content => { description => "Only list content of this type.", type => 'string', format => 'pve-storage-content', optional => 1, completion => \&PVE::Storage::complete_content_type, }, - vmid => get_standard_option - ('pve-vmid', { - description => "Only list images for this VM", - optional => 1, - }), + vmid => get_standard_option('pve-vmid', { + description => "Only list images for this VM", + optional => 1, + completion => \&PVE::Cluster::complete_vmid, + }), }, }, returns => { @@ -247,10 +249,14 @@ __PACKAGE__->register_method ({ additionalProperties => 0, properties => { node => get_standard_option('pve-node'), - storage => get_standard_option('pve-storage-id', { optional => 1}), + storage => get_standard_option('pve-storage-id', { + optional => 1, + completion => \&PVE::Storage::complete_storage, + }), volume => { description => "Volume identifier", - type => 'string', + type => 'string', + completion => \&PVE::Storage::complete_volume, }, }, }, diff --git a/PVE/API2/Storage/Status.pm b/PVE/API2/Storage/Status.pm index b00aa67..49bb58c 100644 --- a/PVE/API2/Storage/Status.pm +++ b/PVE/API2/Storage/Status.pm @@ -40,11 +40,11 @@ __PACKAGE__->register_method ({ additionalProperties => 0, properties => { node => get_standard_option('pve-node'), - storage => get_standard_option - ('pve-storage-id', { - description => "Only list status for specified storage", - optional => 1, - }), + storage => get_standard_option('pve-storage-id', { + description => "Only list status for specified storage", + optional => 1, + completion => \&PVE::Storage::complete_storage_enabled, + }), content => { description => "Only list stores which support this content type.", type => 'string', format => 'pve-storage-content-list', @@ -61,6 +61,7 @@ __PACKAGE__->register_method ({ description => "If target is different to 'node', we only lists shared storages which " . "content is accessible on this 'node' and the specified 'target' node.", optional => 1, + completion => \&PVE::Cluster::get_nodelist, }), }, }, diff --git a/PVE/CLI/pvesm.pm b/PVE/CLI/pvesm.pm index bb122ce..0724eaa 100755 --- a/PVE/CLI/pvesm.pm +++ b/PVE/CLI/pvesm.pm @@ -34,6 +34,7 @@ __PACKAGE__->register_method ({ volume => { description => "Volume identifier", type => 'string', format => 'pve-volume-id', + completion => \&PVE::Storage::complete_volume, }, }, }, -- 2.39.2