rename src/api to src/api_schema
This commit is contained in:
parent
5ddf8cb10a
commit
dc9a007b11
|
@ -1,7 +1,7 @@
|
||||||
//use failure::*;
|
//use failure::*;
|
||||||
|
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
use serde_json::{json};
|
use serde_json::{json};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
|
|
||||||
use crate::tools;
|
use crate::tools;
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
use crate::tools::ticket::*;
|
use crate::tools::ticket::*;
|
||||||
use crate::auth_helpers::*;
|
use crate::auth_helpers::*;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
use serde_json::{json};
|
use serde_json::{json};
|
||||||
|
|
||||||
pub mod datastore;
|
pub mod datastore;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
|
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
//use crate::server::rest::*;
|
//use crate::server::rest::*;
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ use crate::tools;
|
||||||
use crate::tools::wrapped_reader_stream::*;
|
use crate::tools::wrapped_reader_stream::*;
|
||||||
use crate::backup::*;
|
use crate::backup::*;
|
||||||
//use crate::server::rest::*;
|
//use crate::server::rest::*;
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
|
|
||||||
use chrono::{Utc, TimeZone};
|
use chrono::{Utc, TimeZone};
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
//use failure::*;
|
//use failure::*;
|
||||||
//use std::collections::HashMap;
|
//use std::collections::HashMap;
|
||||||
|
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
use serde_json::{json};
|
use serde_json::{json};
|
||||||
|
|
||||||
pub mod datastore;
|
pub mod datastore;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
//use std::collections::HashMap;
|
//use std::collections::HashMap;
|
||||||
|
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
use crate::backup::*;
|
use crate::backup::*;
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
use serde_json::{json};
|
use serde_json::{json};
|
||||||
|
|
||||||
mod time;
|
mod time;
|
||||||
|
|
|
@ -3,8 +3,8 @@ use failure::*;
|
||||||
|
|
||||||
use crate::tools;
|
use crate::tools;
|
||||||
use crate::api2::*;
|
use crate::api2::*;
|
||||||
//use crate::api::schema::*;
|
//use crate::api_schema::schema::*;
|
||||||
//use crate::api::router::*;
|
//use crate::api_schema::router::*;
|
||||||
|
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
|
|
||||||
//use crate::tools;
|
//use crate::tools;
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
|
|
||||||
use crate::tools;
|
use crate::tools;
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
|
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
|
|
||||||
use crate::tools;
|
use crate::tools;
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
|
|
||||||
use chrono::prelude::*;
|
use chrono::prelude::*;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
|
|
||||||
use crate::tools;
|
use crate::tools;
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
|
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
|
|
||||||
const PROXMOX_PKG_VERSION: &'static str = env!("PROXMOX_PKG_VERSION");
|
const PROXMOX_PKG_VERSION: &'static str = env!("PROXMOX_PKG_VERSION");
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
//! API definition helper
|
||||||
|
//!
|
||||||
|
//! This module contains helper classes to define REST APIs. Method
|
||||||
|
//! parameters and return types are described using a
|
||||||
|
//! [Schema](schema/enum.Schema.html).
|
||||||
|
//!
|
||||||
|
//! The [Router](router/struct.Router.html) is used to define a
|
||||||
|
//! hierarchy of API entries, and provides ways to find an API
|
||||||
|
//! definition by path.
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
pub mod schema;
|
||||||
|
pub mod registry;
|
||||||
|
#[macro_use]
|
||||||
|
pub mod router;
|
||||||
|
pub mod config;
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::path::{PathBuf};
|
use std::path::{PathBuf};
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
|
|
||||||
use failure::*;
|
use failure::*;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
|
@ -1,6 +1,6 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
|
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use serde_json::{Value};
|
use serde_json::{Value};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
|
@ -4,8 +4,8 @@ use failure::*;
|
||||||
|
|
||||||
use proxmox_backup::tools;
|
use proxmox_backup::tools;
|
||||||
use proxmox_backup::cli::command::*;
|
use proxmox_backup::cli::command::*;
|
||||||
use proxmox_backup::api::schema::*;
|
use proxmox_backup::api_schema::schema::*;
|
||||||
use proxmox_backup::api::router::*;
|
use proxmox_backup::api_schema::router::*;
|
||||||
|
|
||||||
use serde_json::{Value};
|
use serde_json::{Value};
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
extern crate proxmox_backup;
|
extern crate proxmox_backup;
|
||||||
|
|
||||||
//use proxmox_backup::tools;
|
//use proxmox_backup::tools;
|
||||||
use proxmox_backup::api::router::*;
|
use proxmox_backup::api_schema::router::*;
|
||||||
use proxmox_backup::api::config::*;
|
use proxmox_backup::api_schema::config::*;
|
||||||
use proxmox_backup::server::rest::*;
|
use proxmox_backup::server::rest::*;
|
||||||
use proxmox_backup::auth_helpers::*;
|
use proxmox_backup::auth_helpers::*;
|
||||||
use proxmox_backup::config;
|
use proxmox_backup::config;
|
||||||
|
|
|
@ -5,8 +5,8 @@ use failure::*;
|
||||||
|
|
||||||
use proxmox_backup::tools;
|
use proxmox_backup::tools;
|
||||||
use proxmox_backup::cli::command::*;
|
use proxmox_backup::cli::command::*;
|
||||||
use proxmox_backup::api::schema::*;
|
use proxmox_backup::api_schema::schema::*;
|
||||||
use proxmox_backup::api::router::*;
|
use proxmox_backup::api_schema::router::*;
|
||||||
use proxmox_backup::client::*;
|
use proxmox_backup::client::*;
|
||||||
//use proxmox_backup::backup::chunk_store::*;
|
//use proxmox_backup::backup::chunk_store::*;
|
||||||
//use proxmox_backup::backup::image_index::*;
|
//use proxmox_backup::backup::image_index::*;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
extern crate proxmox_backup;
|
extern crate proxmox_backup;
|
||||||
|
|
||||||
use proxmox_backup::tools;
|
use proxmox_backup::tools;
|
||||||
use proxmox_backup::api::router::*;
|
use proxmox_backup::api_schema::router::*;
|
||||||
use proxmox_backup::api::config::*;
|
use proxmox_backup::api_schema::config::*;
|
||||||
use proxmox_backup::server::rest::*;
|
use proxmox_backup::server::rest::*;
|
||||||
use proxmox_backup::auth_helpers::*;
|
use proxmox_backup::auth_helpers::*;
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ use std::collections::HashSet;
|
||||||
|
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
//use crate::api::config::*;
|
//use crate::api_schema::config::*;
|
||||||
use super::environment::CliEnvironment;
|
use super::environment::CliEnvironment;
|
||||||
|
|
||||||
use crate::getopts;
|
use crate::getopts;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
|
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
|
|
|
@ -5,7 +5,7 @@ use std::io::Read;
|
||||||
|
|
||||||
//use std::sync::Arc;
|
//use std::sync::Arc;
|
||||||
use crate::tools;
|
use crate::tools;
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
|
|
||||||
use crate::section_config::*;
|
use crate::section_config::*;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
|
|
||||||
use failure::*;
|
use failure::*;
|
||||||
|
|
||||||
|
|
20
src/lib.rs
20
src/lib.rs
|
@ -4,26 +4,8 @@ pub mod buildcfg;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
pub mod tools;
|
pub mod tools;
|
||||||
|
|
||||||
/// API definition helper
|
|
||||||
///
|
|
||||||
/// This module contains helper classes to define REST APIs. Method
|
|
||||||
/// parameters and return types are described using a
|
|
||||||
/// [Schema](schema/enum.Schema.html).
|
|
||||||
///
|
|
||||||
/// The [Router](router/struct.Router.html) is used to define a
|
|
||||||
/// hierarchy of API entries, and provides ways to find an API
|
|
||||||
/// definition by path.
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
pub mod api {
|
pub mod api_schema;
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
pub mod schema;
|
|
||||||
pub mod registry;
|
|
||||||
#[macro_use]
|
|
||||||
pub mod router;
|
|
||||||
pub mod config;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
pub mod server {
|
pub mod server {
|
||||||
|
|
|
@ -7,7 +7,7 @@ use std::collections::VecDeque;
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
|
|
||||||
pub struct SectionConfigPlugin {
|
pub struct SectionConfigPlugin {
|
||||||
type_name: String,
|
type_name: String,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
|
|
||||||
use crate::api::router::RpcEnvironment;
|
use crate::api_schema::router::RpcEnvironment;
|
||||||
|
|
||||||
use hyper::{Body, Response, StatusCode};
|
use hyper::{Body, Response, StatusCode};
|
||||||
use hyper::header;
|
use hyper::header;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::tools;
|
use crate::tools;
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::api::router::*;
|
use crate::api_schema::router::*;
|
||||||
use crate::api::config::*;
|
use crate::api_schema::config::*;
|
||||||
use crate::auth_helpers::*;
|
use crate::auth_helpers::*;
|
||||||
use super::environment::RestEnvironment;
|
use super::environment::RestEnvironment;
|
||||||
use super::formatter::*;
|
use super::formatter::*;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
|
|
||||||
use crate::api::schema::*;
|
use crate::api_schema::schema::*;
|
||||||
use crate::section_config::*;
|
use crate::section_config::*;
|
||||||
|
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
|
|
Loading…
Reference in New Issue