From 762bea6d936c3f4270e3b47cf484b1d53361d191 Mon Sep 17 00:00:00 2001 From: Tim Marx Date: Thu, 28 Mar 2019 12:16:06 +0100 Subject: [PATCH] api: ceph: ensure calls get proxied to correct node If calls aren't proxied to the selected node, which seems legit in some cases, this will cause some misleading errors while ceph is not installed on that node. Therefor the calls should now always get proxied. Signed-off-by: Tim Marx --- PVE/API2/Ceph.pm | 1 + PVE/API2/Ceph/FS.pm | 1 + www/manager6/ceph/FS.js | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm index 8211784ad..212532769 100644 --- a/PVE/API2/Ceph.pm +++ b/PVE/API2/Ceph.pm @@ -172,6 +172,7 @@ __PACKAGE__->register_method ({ name => 'config', path => 'config', method => 'GET', + proxyto => 'node', permissions => { check => ['perm', '/', [ 'Sys.Audit', 'Datastore.Audit' ], any => 1], }, diff --git a/PVE/API2/Ceph/FS.pm b/PVE/API2/Ceph/FS.pm index 3ede2128b..1806bba09 100644 --- a/PVE/API2/Ceph/FS.pm +++ b/PVE/API2/Ceph/FS.pm @@ -19,6 +19,7 @@ __PACKAGE__->register_method ({ name => 'index', path => '', method => 'GET', + proxyto => 'node', description => "Directory index.", permissions => { check => ['perm', '/', [ 'Sys.Audit', 'Datastore.Audit' ], any => 1], diff --git a/www/manager6/ceph/FS.js b/www/manager6/ceph/FS.js index 5947baadc..53261af87 100644 --- a/www/manager6/ceph/FS.js +++ b/www/manager6/ceph/FS.js @@ -152,6 +152,10 @@ Ext.define('PVE.NodeCephFSPanel', { interval: 5 * 1000, autoStart: true, storeid: 'pve-ceph-fs', + proxy: { + type: 'proxmox', + url: '/api2/json/nodes/' + view.nodename + '/ceph/fs' + }, model: 'pve-ceph-fs' }); view.setStore(Ext.create('Proxmox.data.DiffStore', { @@ -245,6 +249,10 @@ Ext.define('PVE.NodeCephFSPanel', { interval: 3 * 1000, autoStart: true, storeid: 'pve-ceph-mds', + proxy: { + type: 'proxmox', + url: '/api2/json/nodes/'+ view.nodename +'/ceph/mds' + }, model: 'pve-ceph-mds' }); view.setStore(Ext.create('Proxmox.data.DiffStore', {