[pve-devel] [PATCH V5 pve-container] Move option 'pve-lxc-snapshot-name' to PVE::JSONSchema.

Wolfgang Link w.link at proxmox.com
Mon Sep 18 11:52:47 CEST 2017


Rename pve-lxc-snapshot-name to pve-snapshotname to have a unified name schema.
---
 src/PVE/API2/LXC.pm          |  4 ++--
 src/PVE/API2/LXC/Snapshot.pm | 12 ++++++------
 src/PVE/LXC/Config.pm        |  6 ------
 3 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index 0397224..2de925a 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -982,7 +982,7 @@ __PACKAGE__->register_method({
                 type => 'string',
                 enum => [ 'snapshot' ],
             },
-            snapname => get_standard_option('pve-lxc-snapshot-name', {
+            snapname => get_standard_option('pve-snapshotname', {
                 optional => 1,
             }),
 	},
@@ -1138,7 +1138,7 @@ __PACKAGE__->register_method({
 		type => 'string', format => 'pve-poolid',
 		description => "Add the new CT to the specified pool.",
 	    },
-	    snapname => get_standard_option('pve-lxc-snapshot-name', {
+	    snapname => get_standard_option('pve-snapshotname', {
 		optional => 1,
             }),
 	    storage => get_standard_option('pve-storage-id', {
diff --git a/src/PVE/API2/LXC/Snapshot.pm b/src/PVE/API2/LXC/Snapshot.pm
index 6ba6fb3..26691ee 100644
--- a/src/PVE/API2/LXC/Snapshot.pm
+++ b/src/PVE/API2/LXC/Snapshot.pm
@@ -90,7 +90,7 @@ __PACKAGE__->register_method({
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    vmid => get_standard_option('pve-vmid', { completion => \&PVE::LXC::complete_ctid }),
-	    snapname => get_standard_option('pve-lxc-snapshot-name'),
+	    snapname => get_standard_option('pve-snapshotname'),
 #	    vmstate => {
 #		optional => 1,
 #		type => 'boolean',
@@ -149,7 +149,7 @@ __PACKAGE__->register_method({
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    vmid => get_standard_option('pve-vmid'),
-	    snapname => get_standard_option('pve-lxc-snapshot-name'),
+	    snapname => get_standard_option('pve-snapshotname'),
 	    force => {
 		optional => 1,
 		type => 'boolean',
@@ -195,7 +195,7 @@ __PACKAGE__->register_method({
 	properties => {
 	    vmid => get_standard_option('pve-vmid'),
 	    node => get_standard_option('pve-node'),
-	    snapname => get_standard_option('pve-lxc-snapshot-name'),
+	    snapname => get_standard_option('pve-snapshotname'),
 	},
     },
     returns => {
@@ -232,7 +232,7 @@ __PACKAGE__->register_method({
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    vmid => get_standard_option('pve-vmid'),
-	    snapname => get_standard_option('pve-lxc-snapshot-name'),
+	    snapname => get_standard_option('pve-snapshotname'),
 	},
     },
     returns => {
@@ -280,7 +280,7 @@ __PACKAGE__->register_method({
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    vmid => get_standard_option('pve-vmid'),
-	    snapname => get_standard_option('pve-lxc-snapshot-name'),
+	    snapname => get_standard_option('pve-snapshotname'),
 	    description => {
 		optional => 1,
 		type => 'string',
@@ -335,7 +335,7 @@ __PACKAGE__->register_method({
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    vmid => get_standard_option('pve-vmid'),
-	    snapname => get_standard_option('pve-lxc-snapshot-name'),
+	    snapname => get_standard_option('pve-snapshotname'),
 	},
     },
     returns => { type => "object" },
diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index 1481958..1b40665 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -266,12 +266,6 @@ PVE::JSONSchema::register_standard_option('pve-ct-rootfs', {
     optional => 1,
 });
 
-PVE::JSONSchema::register_standard_option('pve-lxc-snapshot-name', {
-    description => "The name of the snapshot.",
-    type => 'string', format => 'pve-configid',
-    maxLength => 40,
-});
-
 my $confdesc = {
     lock => {
 	optional => 1,
-- 
2.11.0





More information about the pve-devel mailing list