]> git.proxmox.com Git - pmg-api.git/commitdiff
pmgcm: add trigger-update-fingerprint
authorStoiko Ivanov <s.ivanov@proxmox.com>
Mon, 15 Mar 2021 22:01:34 +0000 (23:01 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 16 Mar 2021 18:13:11 +0000 (19:13 +0100)
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PMG/CLI/pmgcm.pm

index 59bdb06a77a99ef530658642a804d59bc286e4d4..e37398cb69fc24a37abb69d0c29d7d2f83612b6d 100644 (file)
@@ -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;