[pve-devel] [PATCH container 3/9] adapt config PUT to use 'revert' and 'force' parameters

Oguz Bektas o.bektas at proxmox.com
Thu Sep 5 16:11:15 CEST 2019


Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
 src/PVE/API2/LXC/Config.pm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/PVE/API2/LXC/Config.pm b/src/PVE/API2/LXC/Config.pm
index 6e67186..405a079 100644
--- a/src/PVE/API2/LXC/Config.pm
+++ b/src/PVE/API2/LXC/Config.pm
@@ -20,6 +20,8 @@ use PVE::JSONSchema qw(get_standard_option);
 
 use base qw(PVE::RESTHandler);
 
+my $opt_force_description = "Force physical removal. Without this, we simply remove the disk from the config file and create an additional configuration entry called 'unused[n]', which contains the volume ID. Unlink of unused[n] always results in physical removal.";
+
 __PACKAGE__->register_method({
     name => 'vm_config',
     path => '',
@@ -131,6 +133,17 @@ __PACKAGE__->register_method({
 		    description => "A list of settings you want to delete.",
 		    optional => 1,
 		},
+		revert => {
+		    type => 'string', format => 'pve-configid-list',
+		    description => "Revert a pending change.",
+		    optional => 1,
+		},
+		force => {
+		    type => 'boolean',
+		    description => $opt_force_description,
+		    optional => 1,
+		    requires => 'delete',
+		},
 		digest => {
 		    type => 'string',
 		    description => 'Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.',
-- 
2.20.1




More information about the pve-devel mailing list