use failure::*;
-use hyper::StatusCode;
use serde_json::{json, Value};
use proxmox::{sortable, identity};
digest_to_hex,
fs::file_set_contents,
};
+use proxmox::api::{RpcEnvironment, RpcEnvironmentType};
-use crate::api_schema::router::{RpcEnvironment, RpcEnvironmentType};
use crate::server::WorkerTask;
use crate::backup::*;
use crate::server::formatter::*;
use serde_json::{json, Value};
use proxmox::{sortable, identity};
+use proxmox::api::{ApiFuture, ApiHandler, ApiMethod, RpcEnvironment};
+use proxmox::api::schema::*;
use crate::api2::types::*;
-use crate::api_schema::*;
-use crate::api_schema::router::*;
use crate::backup::*;
use crate::tools;
-use failure::*;
-//use std::collections::HashMap;
+use std::path::PathBuf;
-use crate::api_schema::*;
-use crate::api_schema::router::*;
-use crate::backup::*;
+use failure::*;
use serde_json::{json, Value};
-use std::path::PathBuf;
+use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment};
+use proxmox::api::schema::*;
+
+use crate::backup::*;
use crate::config::datastore;
pub const GET: ApiMethod = ApiMethod::new(
+use std::sync::{Arc, Mutex};
+
use failure::*;
+use lazy_static::lazy_static;
+use openssl::sha;
+use regex::Regex;
+use serde_json::{json, Value};
use proxmox::{sortable, identity};
+use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment};
+use proxmox::api::schema::*;
use proxmox::tools::fs::{file_get_contents, file_set_contents};
use proxmox::tools::*; // required to use IPRE!() macro ???
-use crate::api2::*;
-use crate::api_schema::*;
-//use crate::api_schema::router::*;
use crate::api2::types::*;
-use lazy_static::lazy_static;
-
-use std::sync::{Arc, Mutex};
-use openssl::sha;
-use regex::Regex;
-
-use serde_json::{json, Value};
-
static RESOLV_CONF_FN: &str = "/etc/resolv.conf";
fn read_etc_resolv_conf() -> Result<Value, Error> {
use failure::*;
-
-//use crate::tools;
-use crate::api_schema::*;
-use crate::api_schema::router::*;
use serde_json::{json, Value};
+use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment};
+use proxmox::api::schema::ObjectSchema;
+
use crate::api2::types::*;
fn get_network_config(
+use std::process::{Command, Stdio};
+
use failure::*;
+use serde_json::{json, Value};
use proxmox::{sortable, identity};
+use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment};
+use proxmox::api::schema::*;
-use crate::api_schema::*;
-use crate::api_schema::router::*;
use crate::api2::types::*;
-use serde_json::{json, Value};
-use std::process::{Command, Stdio};
-
fn dump_journal(
start: Option<u64>,
limit: Option<u64>,
use serde_json::Value;
-use crate::api_schema::router::{RpcEnvironment, RpcEnvironmentType};
+use proxmox::api::{RpcEnvironment, RpcEnvironmentType};
+
use crate::server::WorkerTask;
use crate::backup::*;
use crate::server::formatter::*;
use failure::*;
-
-use crate::tools;
-use crate::api_schema::*;
-use crate::api_schema::router::*;
use serde_json::{json, Value};
+use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment};
+use proxmox::api::schema::ObjectSchema;
+
+use crate::tools;
fn get_subscription(
_param: Value,
use failure::*;
-
-use crate::api_schema::*;
-use crate::api_schema::router::*;
use serde_json::{json, Value};
+use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment};
+use proxmox::api::schema::ObjectSchema;
+
pub const PROXMOX_PKG_VERSION: &str =
concat!(
env!("CARGO_PKG_VERSION_MAJOR"),
pub use proxmox::api::schema::*;
pub use proxmox::api::*;
-
-pub mod router {
- pub use super::{ApiHandler, ApiMethod, HttpError, RpcEnvironment, RpcEnvironmentType};
- pub use proxmox::api::router::*;
-}
-use crate::api_schema::router::*;
-
use std::collections::HashMap;
use std::path::{PathBuf};
use hyper::Method;
+use proxmox::api::{ApiMethod, Router, RpcEnvironmentType};
+
pub struct ApiConfig {
basedir: PathBuf,
router: &'static Router,
use failure::*;
use std::io::Write;
-//use super::*;
-use super::router::*;
-use super::schema::*;
-//use super::api_handler::*;
+use proxmox::api::{ApiHandler, ApiMethod};
+use proxmox::api::router::{Router, SubRoute};
+use proxmox::api::schema::*;
#[derive(Copy, Clone)]
pub enum ParameterDisplayStyle {
use futures::*;
use proxmox::tools::try_block;
+use proxmox::api::RpcEnvironmentType;
//use proxmox_backup::tools;
-use proxmox_backup::api_schema::router::*;
use proxmox_backup::api_schema::config::*;
use proxmox_backup::server::rest::*;
use proxmox_backup::server;
+use std::sync::Arc;
+
+use failure::*;
+use futures::*;
+use hyper;
+use openssl::ssl::{SslMethod, SslAcceptor, SslFiletype};
+
+use proxmox::tools::try_block;
+use proxmox::api::RpcEnvironmentType;
+
use proxmox_backup::configdir;
use proxmox_backup::buildcfg;
use proxmox_backup::server;
use proxmox_backup::tools::daemon;
-use proxmox_backup::api_schema::router::*;
use proxmox_backup::api_schema::config::*;
use proxmox_backup::server::rest::*;
use proxmox_backup::auth_helpers::*;
-use failure::*;
-use proxmox::tools::try_block;
-
-use futures::*;
-
-use openssl::ssl::{SslMethod, SslAcceptor, SslFiletype};
-use std::sync::Arc;
-
-use hyper;
-
#[tokio::main]
async fn main() {
if let Err(err) = run().await {
use std::collections::{HashMap, HashSet};
-use crate::api_schema::*;
-use crate::api_schema::router::*;
+use proxmox::api::schema::*;
+use proxmox::api::{ApiHandler, ApiMethod};
+
use crate::api_schema::format::*;
-//use crate::api_schema::config::*;
use super::environment::CliEnvironment;
use super::getopts;
-use crate::api_schema::router::*;
-
use std::collections::HashMap;
use serde_json::Value;
+use proxmox::api::{RpcEnvironment, RpcEnvironmentType};
+
/// `RpcEnvironmet` implementation for command line tools
pub struct CliEnvironment {
result_attributes: HashMap<String, Value>,
-use crate::api_schema::router::*;
-
use std::collections::HashMap;
use serde_json::Value;
+use proxmox::api::{RpcEnvironment, RpcEnvironmentType};
+
/// Encapsulates information about the runtime environment
pub struct RestEnvironment {
env_type: RpcEnvironmentType,
use failure::*;
use serde_json::{json, Value};
-use crate::api_schema::router::{HttpError, RpcEnvironment};
-
use hyper::{Body, Response, StatusCode};
use hyper::header;
+use proxmox::api::{HttpError, RpcEnvironment};
+
/// Extension to set error message for server side logging
pub struct ErrorMessageExtension(pub String);
use futures::*;
use hyper::{Body, Request, Response, StatusCode};
-use proxmox::api::{http_err, ApiFuture};
+use proxmox::api::{http_err, ApiFuture, ApiHandler, HttpError, Router, RpcEnvironment};
use crate::tools;
-use crate::api_schema::router::*;
use crate::server::formatter::*;
use crate::server::WorkerTask;
use tokio::fs::File;
use url::form_urlencoded;
+use proxmox::api::http_err;
+use proxmox::api::{ApiFuture, ApiHandler, ApiMethod, HttpError};
+use proxmox::api::{RpcEnvironment, RpcEnvironmentType};
+use proxmox::api::schema::{parse_simple_value, verify_json_object, parse_parameter_strings};
+
use super::environment::RestEnvironment;
use super::formatter::*;
-use crate::api_schema::rpc_environment::*;
-use crate::api_schema::config::*;
-use crate::api_schema::router::*;
-use crate::api_schema::*;
use crate::auth_helpers::*;
+use crate::api_schema::config::ApiConfig;
use crate::tools;
extern "C" { fn tzset(); }