[pve-devel] [PATCH manager 4/4] api: ceph: ensure calls get proxied to correct node
Tim Marx
t.marx at proxmox.com
Thu Mar 28 12:16:06 CET 2019
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 <t.marx at proxmox.com>
---
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 8211784a..21253276 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 3ede2128..1806bba0 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 5947baad..53261af8 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', {
--
2.11.0
More information about the pve-devel
mailing list