api/compat: drop more compat imports from api_schema.rs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
		@ -1,6 +1,5 @@
 | 
			
		||||
use failure::*;
 | 
			
		||||
 | 
			
		||||
use hyper::StatusCode;
 | 
			
		||||
use serde_json::{json, Value};
 | 
			
		||||
 | 
			
		||||
use proxmox::{sortable, identity};
 | 
			
		||||
 | 
			
		||||
@ -8,8 +8,8 @@ use proxmox::tools::{
 | 
			
		||||
    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::*;
 | 
			
		||||
 | 
			
		||||
@ -9,10 +9,10 @@ use hyper::http::request::Parts;
 | 
			
		||||
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;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,12 +1,12 @@
 | 
			
		||||
use failure::*;
 | 
			
		||||
//use std::collections::HashMap;
 | 
			
		||||
 | 
			
		||||
use crate::api_schema::*;
 | 
			
		||||
use crate::api_schema::router::*;
 | 
			
		||||
use crate::backup::*;
 | 
			
		||||
use serde_json::{json, Value};
 | 
			
		||||
use std::path::PathBuf;
 | 
			
		||||
 | 
			
		||||
use failure::*;
 | 
			
		||||
use serde_json::{json, Value};
 | 
			
		||||
 | 
			
		||||
use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment};
 | 
			
		||||
use proxmox::api::schema::*;
 | 
			
		||||
 | 
			
		||||
use crate::backup::*;
 | 
			
		||||
use crate::config::datastore;
 | 
			
		||||
 | 
			
		||||
pub const GET: ApiMethod = ApiMethod::new(
 | 
			
		||||
 | 
			
		||||
@ -1,22 +1,19 @@
 | 
			
		||||
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> {
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,9 @@
 | 
			
		||||
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(
 | 
			
		||||
 | 
			
		||||
@ -1,14 +1,14 @@
 | 
			
		||||
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>,
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,8 @@ use std::collections::HashMap;
 | 
			
		||||
 | 
			
		||||
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::*;
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,10 @@
 | 
			
		||||
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,
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
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"),
 | 
			
		||||
 | 
			
		||||
@ -21,8 +21,3 @@ pub mod format;
 | 
			
		||||
 | 
			
		||||
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::*;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,10 @@
 | 
			
		||||
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,
 | 
			
		||||
 | 
			
		||||
@ -1,11 +1,10 @@
 | 
			
		||||
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 {
 | 
			
		||||
 | 
			
		||||
@ -2,9 +2,9 @@ use failure::*;
 | 
			
		||||
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;
 | 
			
		||||
 | 
			
		||||
@ -1,22 +1,21 @@
 | 
			
		||||
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 {
 | 
			
		||||
 | 
			
		||||
@ -3,10 +3,10 @@ use serde_json::Value;
 | 
			
		||||
 | 
			
		||||
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;
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
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>,
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
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,
 | 
			
		||||
 | 
			
		||||
@ -1,11 +1,11 @@
 | 
			
		||||
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);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -7,10 +7,9 @@ use std::task::{Context, Poll};
 | 
			
		||||
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;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -16,13 +16,15 @@ use serde_json::{json, Value};
 | 
			
		||||
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(); }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user