use proxmox::api::{api, ApiMethod, Router, RpcEnvironment};
+use crate::api2::types::*;
use crate::config::remotes;
#[api(
input: {
properties: {
name: {
- schema: remotes::REMOTE_ID_SCHEMA,
+ schema: REMOTE_ID_SCHEMA,
},
comment: {
optional: true,
input: {
properties: {
name: {
- schema: remotes::REMOTE_ID_SCHEMA,
+ schema: REMOTE_ID_SCHEMA,
},
},
},
.max_length(32)
.schema();
+pub const REMOTE_ID_SCHEMA: Schema = StringSchema::new("Remote ID.")
+ .format(&PROXMOX_SAFE_ID_FORMAT)
+ .min_length(3)
+ .max_length(32)
+ .schema();
+
// Complex type definitions
schema: DATASTORE_SCHEMA,
},
remote: {
- schema: crate::config::remotes::REMOTE_ID_SCHEMA,
+ schema: REMOTE_ID_SCHEMA,
},
"remote-store": {
schema: DATASTORE_SCHEMA,
use proxmox::tools::{fs::replace_file, fs::CreateOptions};
+use crate::api2::types::*;
use crate::section_config::{SectionConfig, SectionConfigData, SectionConfigPlugin};
lazy_static! {
// fixme: define better schemas
-pub const REMOTE_ID_SCHEMA: Schema = StringSchema::new("Remote ID.")
- .min_length(3)
- .schema();
-
pub const COMMENT_SCHEMA: Schema = StringSchema::new("Comment").schema();
pub const REMOTE_HOST_SCHEMA: Schema = StringSchema::new("Host IP address or DNS name.").schema();
pub const REMOTE_USERID_SCHEMA: Schema = StringSchema::new("User ID").schema();