[pve-devel] [PATCH manager 1/6] ceph: add flag hash

Dominik Csapak d.csapak at proxmox.com
Mon Jul 22 16:08:47 CEST 2019


this is used to generate the paramters for the set/unset api call
and will be used for the parameters of the upcoming 'set multiple flags' call

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/Ceph.pm | 66 +++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 62 insertions(+), 4 deletions(-)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index 5a48e2d0..ff7d67a9 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -766,6 +766,64 @@ __PACKAGE__->register_method ({
 	return $rpcenv->fork_worker('cephcreatepool', $pool,  $user, $worker);
     }});
 
+my $possible_flags = {
+    pause => {
+	description => 'Pauses read and writes.',
+	type => 'boolean',
+	optional=> 1,
+    },
+    noup => {
+	description => 'OSDs are not allowed to start.',
+	type => 'boolean',
+	optional=> 1,
+    },
+    nodown => {
+	description => 'OSD failure reports are being ignored, such that the monitors will not mark OSDs down.',
+	type => 'boolean',
+	optional=> 1,
+    },
+    noout => {
+	description => 'OSDs will not automatically be marked out after the configured interval.',
+	type => 'boolean',
+	optional=> 1,
+    },
+    noin => {
+	description => 'OSDs that were previously marked out will not be marked back in when they start.',
+	type => 'boolean',
+	optional=> 1,
+    },
+    nobackfill => {
+	description => 'Backfilling of PGs is suspended.',
+	type => 'boolean',
+	optional=> 1,
+    },
+    norebalance => {
+	description => 'Rebalancing of PGs is suspended.',
+	type => 'boolean',
+	optional=> 1,
+    },
+    norecover => {
+	description => 'Recovery of PGs is suspended.',
+	type => 'boolean',
+	optional=> 1,
+    },
+    noscrub => {
+	description => 'Scrubbing is disabled.',
+	type => 'boolean',
+	optional=> 1,
+    },
+    'nodeep-scrub' => {
+	description => 'Deep Scrubbing is disabled.',
+	type => 'boolean',
+	optional=> 1,
+    },
+    notieragent => {
+	description => 'Cache tiering activity is suspended.',
+	type => 'boolean',
+	optional=> 1,
+    },
+};
+
 __PACKAGE__->register_method ({
     name => 'get_flags',
     path => 'flags',
@@ -815,9 +873,9 @@ __PACKAGE__->register_method ({
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    flag => {
-		description => 'The ceph flag to set/unset',
+		description => 'The ceph flag to set',
 		type => 'string',
-		enum => [ 'full', 'pause', 'noup', 'nodown', 'noout', 'noin', 'nobackfill', 'norebalance', 'norecover', 'noscrub', 'nodeep-scrub', 'notieragent'],
+		enum => [sort keys %$possible_flags],
 	    },
 	},
     },
@@ -858,9 +916,9 @@ __PACKAGE__->register_method ({
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    flag => {
-		description => 'The ceph flag to set/unset',
+		description => 'The ceph flag to unset',
 		type => 'string',
-		enum => [ 'full', 'pause', 'noup', 'nodown', 'noout', 'noin', 'nobackfill', 'norebalance', 'norecover', 'noscrub', 'nodeep-scrub', 'notieragent'],
+		enum => [sort keys %$possible_flags],
 	    },
 	},
     },
-- 
2.20.1





More information about the pve-devel mailing list