[pmg-devel] [PATCH pmg-api 5/6] pmgcm: add trigger-update-fingerprint

Stoiko Ivanov s.ivanov at proxmox.com
Mon Mar 15 23:01:34 CET 2021


Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 src/PMG/CLI/pmgcm.pm | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/PMG/CLI/pmgcm.pm b/src/PMG/CLI/pmgcm.pm
index 59bdb06..e37398c 100644
--- a/src/PMG/CLI/pmgcm.pm
+++ b/src/PMG/CLI/pmgcm.pm
@@ -306,6 +306,26 @@ __PACKAGE__->register_method({
 	return undef;
     }});
 
+__PACKAGE__->register_method({
+    name => 'trigger_update_fp',
+    path => 'trigger-update-fingerprint',
+    method => 'POST',
+    description => "Notify master to refresh all certificate fingerprints",
+    parameters => {
+	additionalProperties => 0,
+	properties => {},
+    },
+    returns => { type => 'null' },
+    code => sub {
+	my ($param) = @_;
+
+	my $cinfo = PMG::ClusterConfig->new();
+
+	die "no cluster defined\n" if !scalar(keys %{$cinfo->{ids}});
+
+	PMG::Cluster::trigger_update_fingerprints($cinfo);
+    }});
+
 our $cmddef = {
     status => [ 'PMG::API2::Cluster', 'status', [], {}, $format_nodelist],
     create => [ 'PMG::API2::Cluster', 'create', [], {}, $upid_exit],
@@ -314,6 +334,7 @@ our $cmddef = {
     join_cmd => [ __PACKAGE__, 'join_cmd', []],
     sync => [ __PACKAGE__, 'sync', []],
     promote => [ __PACKAGE__, 'promote', []],
+    'trigger-update-fingerprint' => [ __PACKAGE__, 'trigger_update_fp'],
 };
 
 1;
-- 
2.20.1





More information about the pmg-devel mailing list