public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH backup 1/2] move subscription API path to /nodes
@ 2020-07-21 11:41 Stefan Reiter
  2020-07-21 11:41 ` [pbs-devel] [PATCH v2 backup 2/2] add .../apt/update API call Stefan Reiter
  2020-07-21 17:36 ` [pbs-devel] applied: [PATCH backup 1/2] move subscription API path to /nodes Thomas Lamprecht
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Reiter @ 2020-07-21 11:41 UTC (permalink / raw)
  To: pbs-devel

This aligns it with PVE and allows the widget toolkit's update window
"refresh" to work without modifications once POST /apt/update is
implemented.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---

I believe it makes more sense here in general, it is certainly node specific.

 src/api2.rs                         | 2 --
 src/api2/node.rs                    | 2 ++
 src/api2/{ => node}/subscription.rs | 8 ++++++++
 www/Dashboard.js                    | 2 +-
 www/Subscription.js                 | 2 +-
 5 files changed, 12 insertions(+), 4 deletions(-)
 rename src/api2/{ => node}/subscription.rs (88%)

diff --git a/src/api2.rs b/src/api2.rs
index 178f3f45..85d29ed2 100644
--- a/src/api2.rs
+++ b/src/api2.rs
@@ -4,7 +4,6 @@ pub mod backup;
 pub mod config;
 pub mod node;
 pub mod reader;
-mod subscription;
 pub mod status;
 pub mod types;
 pub mod version;
@@ -26,7 +25,6 @@ pub const SUBDIRS: SubdirMap = &[
     ("pull", &pull::ROUTER),
     ("reader", &reader::ROUTER),
     ("status", &status::ROUTER),
-    ("subscription", &subscription::ROUTER),
     ("version", &version::ROUTER),
 ];
 
diff --git a/src/api2/node.rs b/src/api2/node.rs
index 13ff282c..e67cab4e 100644
--- a/src/api2/node.rs
+++ b/src/api2/node.rs
@@ -9,6 +9,7 @@ mod syslog;
 mod journal;
 mod services;
 mod status;
+mod subscription;
 pub(crate) mod rrd;
 pub mod disks;
 
@@ -20,6 +21,7 @@ pub const SUBDIRS: SubdirMap = &[
     ("rrd", &rrd::ROUTER),
     ("services", &services::ROUTER),
     ("status", &status::ROUTER),
+    ("subscription", &subscription::ROUTER),
     ("syslog", &syslog::ROUTER),
     ("tasks", &tasks::ROUTER),
     ("time", &time::ROUTER),
diff --git a/src/api2/subscription.rs b/src/api2/node/subscription.rs
similarity index 88%
rename from src/api2/subscription.rs
rename to src/api2/node/subscription.rs
index 7d1b0237..186019cb 100644
--- a/src/api2/subscription.rs
+++ b/src/api2/node/subscription.rs
@@ -5,8 +5,16 @@ use proxmox::api::{api, Router, Permission};
 
 use crate::tools;
 use crate::config::acl::PRIV_SYS_AUDIT;
+use crate::api2::types::NODE_SCHEMA;
 
 #[api(
+    input: {
+        properties: {
+            node: {
+                schema: NODE_SCHEMA,
+            },
+        },
+    },
     returns: {
         description: "Subscription status.",
         properties: {
diff --git a/www/Dashboard.js b/www/Dashboard.js
index 7f699d93..d6dc40d2 100644
--- a/www/Dashboard.js
+++ b/www/Dashboard.js
@@ -209,7 +209,7 @@ Ext.define('PBS.Dashboard', {
 		autoDestroy: true,
 		proxy: {
 		    type: 'proxmox',
-		    url: '/api2/json/subscription'
+		    url: '/api2/json/nodes/localhost/subscription'
 		},
 		listeners: {
 		    load: 'updateSubscription'
diff --git a/www/Subscription.js b/www/Subscription.js
index f5a64459..8746091f 100644
--- a/www/Subscription.js
+++ b/www/Subscription.js
@@ -37,7 +37,7 @@ Ext.define('PBS.Subscription', {
 	    me.rstore.load();
 	};
 
-	var baseurl = '/subscription';
+	var baseurl = '/nodes/localhost/subscription';
 
 	var render_status = function(value) {
 
-- 
2.20.1





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-23  8:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 11:41 [pbs-devel] [PATCH backup 1/2] move subscription API path to /nodes Stefan Reiter
2020-07-21 11:41 ` [pbs-devel] [PATCH v2 backup 2/2] add .../apt/update API call Stefan Reiter
2020-07-23  8:42   ` [pbs-devel] applied: " Thomas Lamprecht
2020-07-21 17:36 ` [pbs-devel] applied: [PATCH backup 1/2] move subscription API path to /nodes Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal