From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id E4C9564E9F for ; Tue, 21 Jul 2020 13:41:15 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D7B7B17E09 for ; Tue, 21 Jul 2020 13:41:15 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 3403217E01 for ; Tue, 21 Jul 2020 13:41:15 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 02F7D432FB for ; Tue, 21 Jul 2020 13:41:15 +0200 (CEST) From: Stefan Reiter To: pbs-devel@lists.proxmox.com Date: Tue, 21 Jul 2020 13:41:06 +0200 Message-Id: <20200721114108.11603-1-s.reiter@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.022 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [api2.rs, node.rs, subscription.rs] Subject: [pbs-devel] [PATCH backup 1/2] move subscription API path to /nodes X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2020 11:41:16 -0000 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 --- 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