From 8abd398b8af7fa2481077fbeec7643049ea98daa Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 10 Sep 2012 08:55:04 +0200 Subject: [PATCH] register standard option for snapshot name --- PVE/API2/Qemu.pm | 24 ++++-------------------- PVE/QemuServer.pm | 6 ++++++ 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 82df382..84db770 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -1939,11 +1939,7 @@ __PACKAGE__->register_method({ properties => { node => get_standard_option('pve-node'), vmid => get_standard_option('pve-vmid'), - snapname => { - type => 'string', - description => "The name of the snapshot", - maxLength => 40, - }, + snapname => get_standard_option('pve-snapshot-name'), vmstate => { optional => 1, type => 'boolean', @@ -2002,11 +1998,7 @@ __PACKAGE__->register_method({ properties => { vmid => get_standard_option('pve-vmid'), node => get_standard_option('pve-node'), - snapname => { - type => 'string', - description => "The name of the snapshot", - maxLength => 40, - }, + snapname => get_standard_option('pve-snapshot-name'), }, }, returns => { @@ -2042,11 +2034,7 @@ __PACKAGE__->register_method({ properties => { node => get_standard_option('pve-node'), vmid => get_standard_option('pve-vmid'), - snapname => { - type => 'string', - description => "The name of the snapshot", - maxLength => 40, - }, + snapname => get_standard_option('pve-snapshot-name'), }, }, returns => { @@ -2091,11 +2079,7 @@ __PACKAGE__->register_method({ properties => { node => get_standard_option('pve-node'), vmid => get_standard_option('pve-vmid'), - snapname => { - type => 'string', - description => "The name of the snapshot", - maxLength => 40, - }, + snapname => get_standard_option('pve-snapshot-name'), }, }, returns => { diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 8ee0dac..e0be68f 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -54,6 +54,12 @@ PVE::JSONSchema::register_standard_option('pve-qm-stateuri', { optional => 1, }); +PVE::JSONSchema::register_standard_option('pve-snapshot-name', { + description => "The name of the snapshot.", + type => 'string', format => 'pve-configid', + maxLength => 40, +}); + #no warnings 'redefine'; unless(defined(&_VZSYSCALLS_H_)) { -- 2.39.2