pub mod config;
pub mod node;
pub mod reader;
-mod subscription;
pub mod status;
pub mod types;
pub mod version;
("pull", &pull::ROUTER),
("reader", &reader::ROUTER),
("status", &status::ROUTER),
- ("subscription", &subscription::ROUTER),
("version", &version::ROUTER),
];
mod journal;
mod services;
mod status;
+mod subscription;
pub(crate) mod rrd;
pub mod disks;
("rrd", &rrd::ROUTER),
("services", &services::ROUTER),
("status", &status::ROUTER),
+ ("subscription", &subscription::ROUTER),
("syslog", &syslog::ROUTER),
("tasks", &tasks::ROUTER),
("time", &time::ROUTER),
--- /dev/null
+use anyhow::{Error};
+use serde_json::{json, Value};
+
+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: {
+ status: {
+ type: String,
+ description: "'NotFound', 'active' or 'inactive'."
+ },
+ message: {
+ type: String,
+ description: "Human readable problem description.",
+ },
+ serverid: {
+ type: String,
+ description: "The unique server ID.",
+ },
+ url: {
+ type: String,
+ description: "URL to Web Shop.",
+ },
+ },
+ },
+ access: {
+ permission: &Permission::Privilege(&[], PRIV_SYS_AUDIT, false),
+ },
+)]
+/// Read subscription info.
+fn get_subscription(_param: Value) -> Result<Value, Error> {
+
+ let url = "https://www.proxmox.com/en/proxmox-backup-server/pricing";
+ Ok(json!({
+ "status": "NotFound",
+ "message": "There is no subscription key",
+ "serverid": tools::get_hardware_address()?,
+ "url": url,
+ }))
+}
+
+pub const ROUTER: Router = Router::new()
+ .get(&API_METHOD_GET_SUBSCRIPTION);
+++ /dev/null
-use anyhow::{Error};
-use serde_json::{json, Value};
-
-use proxmox::api::{api, Router, Permission};
-
-use crate::tools;
-use crate::config::acl::PRIV_SYS_AUDIT;
-
-#[api(
- returns: {
- description: "Subscription status.",
- properties: {
- status: {
- type: String,
- description: "'NotFound', 'active' or 'inactive'."
- },
- message: {
- type: String,
- description: "Human readable problem description.",
- },
- serverid: {
- type: String,
- description: "The unique server ID.",
- },
- url: {
- type: String,
- description: "URL to Web Shop.",
- },
- },
- },
- access: {
- permission: &Permission::Privilege(&[], PRIV_SYS_AUDIT, false),
- },
-)]
-/// Read subscription info.
-fn get_subscription(_param: Value) -> Result<Value, Error> {
-
- let url = "https://www.proxmox.com/en/proxmox-backup-server/pricing";
- Ok(json!({
- "status": "NotFound",
- "message": "There is no subscription key",
- "serverid": tools::get_hardware_address()?,
- "url": url,
- }))
-}
-
-pub const ROUTER: Router = Router::new()
- .get(&API_METHOD_GET_SUBSCRIPTION);
autoDestroy: true,
proxy: {
type: 'proxmox',
- url: '/api2/json/subscription'
+ url: '/api2/json/nodes/localhost/subscription'
},
listeners: {
load: 'updateSubscription'
me.rstore.load();
};
- var baseurl = '/subscription';
+ var baseurl = '/nodes/localhost/subscription';
var render_status = function(value) {