small nit inline On Mon, Dec 04, 2017 at 12:11:17PM +0100, Thomas Lamprecht wrote: > Returns all relevant information for joining this cluster securely > over the API. > > Signed-off-by: Thomas Lamprecht <t.lampre...@proxmox.com> > --- > data/PVE/API2/ClusterConfig.pm | 42 > ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 42 insertions(+) > > diff --git a/data/PVE/API2/ClusterConfig.pm b/data/PVE/API2/ClusterConfig.pm > index 9bbefaf..11005e6 100644 > --- a/data/PVE/API2/ClusterConfig.pm > +++ b/data/PVE/API2/ClusterConfig.pm > @@ -206,6 +206,48 @@ my $peer_can_use_api = sub { > }; > > __PACKAGE__->register_method ({ > + name => 'join_info', > + path => 'join', > + method => 'GET', > + description => "Returns the information needed to join this cluster.", > + parameters => { > + additionalProperties => 0, > + properties => { }, > + }, > + returns => { > + type => 'object', > + additionalProperties => 0, > + properties => { > + ip_addr => { type => 'string', format => 'ip' }, > + fingerprint => { > + type => 'string', > + pattern => '^(:?[A-Z0-9]{2}:){31}[A-Z0-9]{2}$',
might make sense to make this a proper format from the get-go - we'll need it once we re-start our multi-cluster-manager efforts anyway ;) > + }, > + totem => { type => 'object' }, > + config_digest => { type => 'string' }, > + }, > + }, > + code => sub { > + my ($param) = @_; > + > + my $nodename = PVE::INotify::nodename(); > + > + PVE::Cluster::cfs_update(1); > + my $conf = PVE::Cluster::cfs_read_file('corosync.conf'); > + my $totem_cfg = $conf->{main}->{totem} // {}; > + my $corosync_config_digest = $conf->{digest}; > + > + my $res = { > + fingerprint => PVE::Cluster::get_node_fingerprint($nodename), > + ip_addr => scalar(PVE::Cluster::remote_node_ip($nodename)), > + totem => $totem_cfg, > + config_digest => $corosync_config_digest, > + }; > + > + return $res; > + }}); > + > +__PACKAGE__->register_method ({ > name => 'join', > path => 'join', > method => 'POST', > -- > 2.11.0 > > > _______________________________________________ > pve-devel mailing list > pve-devel@pve.proxmox.com > https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel