proxmox-backup/src/api2/subscription.rs

31 lines
698 B
Rust
Raw Normal View History

use failure::*;
use crate::tools;
2019-02-17 09:16:33 +00:00
use crate::api_schema::*;
2019-02-17 08:59:20 +00:00
use crate::api_schema::router::*;
use serde_json::{json, Value};
fn get_subscription(
_param: Value,
_info: &ApiMethod,
_rpcenv: &mut dyn RpcEnvironment,
) -> 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,
}))
}
2019-11-21 08:36:41 +00:00
pub const ROUTER: Router = Router::new()
.get(
&ApiMethod::new(
&ApiHandler::Sync(&get_subscription),
&ObjectSchema::new("Read subscription info.", &[])
)
);