api2/node/dns.rs: improve dns api

This commit is contained in:
Dietmar Maurer
2019-01-25 10:15:32 +01:00
parent 332dcc2277
commit 46b79b9ee5
5 changed files with 86 additions and 19 deletions

View File

@ -3,6 +3,7 @@ use failure::*;
use crate::api::schema::*;
use crate::api::router::*;
use serde_json::{json, Value};
use std::sync::Arc;
pub mod config;
pub mod admin;
@ -10,6 +11,19 @@ pub mod node;
mod version;
mod subscription;
use lazy_static::lazy_static;
use crate::tools::common_regex;
// common schema definitions
lazy_static! {
pub static ref IP_FORMAT: Arc<ApiStringFormat> = ApiStringFormat::Pattern(&common_regex::IP_REGEX).into();
}
fn test_sync_api_handler(param: Value, _info: &ApiMethod) -> Result<Value, Error> {
println!("This is a test {}", param);