2020-04-17 12:11:25 +00:00
|
|
|
use anyhow::{Error};
|
2019-01-23 12:05:32 +00:00
|
|
|
use serde_json::{json, Value};
|
|
|
|
|
2020-04-16 08:01:59 +00:00
|
|
|
use proxmox::api::{api, Router, Permission};
|
2019-11-21 13:36:28 +00:00
|
|
|
|
2019-05-09 05:44:09 +00:00
|
|
|
use crate::api2::types::*;
|
2020-04-16 08:01:59 +00:00
|
|
|
use crate::config::acl::{PRIV_SYS_AUDIT};
|
2019-01-23 12:05:32 +00:00
|
|
|
|
2020-04-16 08:01:59 +00:00
|
|
|
#[api(
|
|
|
|
input: {
|
|
|
|
properties: {
|
|
|
|
node: {
|
|
|
|
schema: NODE_SCHEMA,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
returns: {
|
|
|
|
description: "The network configuration from /etc/network/interfaces.",
|
|
|
|
properties: {
|
|
|
|
// fixme
|
|
|
|
},
|
|
|
|
},
|
|
|
|
access: {
|
|
|
|
permission: &Permission::Privilege(&[], PRIV_SYS_AUDIT, false),
|
|
|
|
},
|
|
|
|
)]
|
|
|
|
/// Read network configuration.
|
2019-01-26 13:50:37 +00:00
|
|
|
fn get_network_config(
|
|
|
|
_param: Value,
|
|
|
|
) -> Result<Value, Error> {
|
2019-01-23 12:05:32 +00:00
|
|
|
|
|
|
|
Ok(json!({}))
|
|
|
|
}
|
|
|
|
|
2019-11-21 08:36:41 +00:00
|
|
|
pub const ROUTER: Router = Router::new()
|
2020-04-16 08:01:59 +00:00
|
|
|
.get(&API_METHOD_GET_NETWORK_CONFIG);
|
2019-11-21 08:36:41 +00:00
|
|
|
|