diff --git a/src/api2/config/drive.rs b/src/api2/config/drive.rs index a99d94cb..4aade027 100644 --- a/src/api2/config/drive.rs +++ b/src/api2/config/drive.rs @@ -8,7 +8,7 @@ use crate::{ config, api2::types::{ PROXMOX_CONFIG_DIGEST_SCHEMA, - DRIVE_ID_SCHEMA, + DRIVE_NAME_SCHEMA, CHANGER_ID_SCHEMA, CHANGER_DRIVE_ID_SCHEMA, LINUX_DRIVE_PATH_SCHEMA, @@ -28,7 +28,7 @@ use crate::{ input: { properties: { name: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, path: { schema: LINUX_DRIVE_PATH_SCHEMA, @@ -72,7 +72,7 @@ pub fn create_drive(param: Value) -> Result<(), Error> { input: { properties: { name: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, }, }, @@ -161,7 +161,7 @@ pub enum DeletableProperty { input: { properties: { name: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, path: { schema: LINUX_DRIVE_PATH_SCHEMA, @@ -258,7 +258,7 @@ pub fn update_drive( input: { properties: { name: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, }, }, diff --git a/src/api2/config/media_pool.rs b/src/api2/config/media_pool.rs index 86a42157..a80c6df2 100644 --- a/src/api2/config/media_pool.rs +++ b/src/api2/config/media_pool.rs @@ -11,7 +11,7 @@ use proxmox::{ use crate::{ api2::types::{ - DRIVE_ID_SCHEMA, + DRIVE_NAME_SCHEMA, MEDIA_POOL_NAME_SCHEMA, MEDIA_SET_NAMING_TEMPLATE_SCHEMA, MEDIA_SET_ALLOCATION_POLICY_SCHEMA, @@ -33,7 +33,7 @@ use crate::{ schema: MEDIA_POOL_NAME_SCHEMA, }, drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, allocation: { schema: MEDIA_SET_ALLOCATION_POLICY_SCHEMA, @@ -150,7 +150,7 @@ pub enum DeletableProperty { schema: MEDIA_POOL_NAME_SCHEMA, }, drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, optional: true, }, allocation: { diff --git a/src/api2/tape/drive.rs b/src/api2/tape/drive.rs index 0e641869..39024d63 100644 --- a/src/api2/tape/drive.rs +++ b/src/api2/tape/drive.rs @@ -25,7 +25,7 @@ use crate::{ }, api2::types::{ UPID_SCHEMA, - DRIVE_ID_SCHEMA, + DRIVE_NAME_SCHEMA, MEDIA_LABEL_SCHEMA, MEDIA_POOL_NAME_SCHEMA, Authid, @@ -60,7 +60,7 @@ use crate::{ input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, slot: { description: "Source slot number", @@ -95,7 +95,7 @@ pub async fn load_slot( input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, "changer-id": { schema: MEDIA_LABEL_SCHEMA, @@ -120,7 +120,7 @@ pub async fn load_media(drive: String, changer_id: String) -> Result<(), Error> input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, slot: { description: "Target slot number. If omitted, defaults to the slot that the drive was loaded from.", @@ -181,7 +181,7 @@ pub fn scan_drives(_param: Value) -> Result, Error> { input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, fast: { description: "Use fast erase.", @@ -227,7 +227,7 @@ pub fn erase_media( input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, }, }, @@ -266,7 +266,7 @@ pub fn rewind( input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, }, }, @@ -292,7 +292,7 @@ pub async fn eject_media(drive: String) -> Result<(), Error> { input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, "changer-id": { schema: MEDIA_LABEL_SCHEMA, @@ -432,7 +432,7 @@ fn write_media_label( input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, }, }, @@ -482,7 +482,7 @@ pub async fn read_label(drive: String) -> Result { input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, }, }, @@ -550,7 +550,7 @@ pub async fn inventory( input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, "read-all-labels": { description: "Load all tapes and try read labels (even if already inventoried)", @@ -655,7 +655,7 @@ pub fn update_inventory( input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, pool: { schema: MEDIA_POOL_NAME_SCHEMA, diff --git a/src/api2/types/tape/drive.rs b/src/api2/types/tape/drive.rs index 11fa9914..82552fb1 100644 --- a/src/api2/types/tape/drive.rs +++ b/src/api2/types/tape/drive.rs @@ -9,7 +9,7 @@ use proxmox::api::{ use crate::api2::types::PROXMOX_SAFE_ID_FORMAT; -pub const DRIVE_ID_SCHEMA: Schema = StringSchema::new("Drive Identifier.") +pub const DRIVE_NAME_SCHEMA: Schema = StringSchema::new("Drive Identifier.") .format(&PROXMOX_SAFE_ID_FORMAT) .min_length(3) .max_length(32) @@ -45,7 +45,7 @@ pub const CHANGER_DRIVE_ID_SCHEMA: Schema = IntegerSchema::new( #[api( properties: { name: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, } } )] @@ -64,7 +64,7 @@ pub struct VirtualTapeDrive { #[api( properties: { name: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, path: { schema: LINUX_DRIVE_PATH_SCHEMA, diff --git a/src/api2/types/tape/media_pool.rs b/src/api2/types/tape/media_pool.rs index f65d5cc1..328f3591 100644 --- a/src/api2/types/tape/media_pool.rs +++ b/src/api2/types/tape/media_pool.rs @@ -21,7 +21,7 @@ use crate::{ parse_calendar_event, }, api2::types::{ - DRIVE_ID_SCHEMA, + DRIVE_NAME_SCHEMA, PROXMOX_SAFE_ID_FORMAT, SINGLE_LINE_COMMENT_FORMAT, }, @@ -116,7 +116,7 @@ impl std::str::FromStr for RetentionPolicy { schema: MEDIA_POOL_NAME_SCHEMA, }, drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, allocation: { schema: MEDIA_SET_ALLOCATION_POLICY_SCHEMA, diff --git a/src/bin/proxmox-tape.rs b/src/bin/proxmox-tape.rs index cae2af1c..dc087ff6 100644 --- a/src/bin/proxmox-tape.rs +++ b/src/bin/proxmox-tape.rs @@ -20,7 +20,7 @@ use proxmox_backup::{ api2::{ self, types::{ - DRIVE_ID_SCHEMA, + DRIVE_NAME_SCHEMA, MEDIA_LABEL_SCHEMA, MEDIA_POOL_NAME_SCHEMA, }, @@ -90,7 +90,7 @@ fn lookup_drive_name( input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, optional: true, }, fast: { @@ -128,7 +128,7 @@ async fn erase_media( input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, optional: true, }, }, @@ -160,7 +160,7 @@ async fn rewind( input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, optional: true, }, }, @@ -190,7 +190,7 @@ async fn eject_media( input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, optional: true, }, "changer-id": { @@ -227,7 +227,7 @@ async fn load_media( optional: true, }, drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, optional: true, }, "changer-id": { @@ -262,7 +262,7 @@ async fn label_media( input: { properties: { drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, optional: true, }, "output-format": { @@ -311,7 +311,7 @@ async fn read_label( optional: true, }, drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, optional: true, }, "read-labels": { @@ -383,7 +383,7 @@ async fn inventory( optional: true, }, drive: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, optional: true, }, }, diff --git a/src/bin/proxmox_tape/drive.rs b/src/bin/proxmox_tape/drive.rs index 6a181641..0949d450 100644 --- a/src/bin/proxmox_tape/drive.rs +++ b/src/bin/proxmox_tape/drive.rs @@ -14,7 +14,7 @@ use proxmox_backup::{ api2::{ self, types::{ - DRIVE_ID_SCHEMA, + DRIVE_NAME_SCHEMA, }, }, tape::{ @@ -157,7 +157,7 @@ fn scan_for_drives( optional: true, }, name: { - schema: DRIVE_ID_SCHEMA, + schema: DRIVE_NAME_SCHEMA, }, }, }, diff --git a/src/config/drive.rs b/src/config/drive.rs index c56bd36a..72bc05af 100644 --- a/src/config/drive.rs +++ b/src/config/drive.rs @@ -21,7 +21,7 @@ use proxmox::{ use crate::{ api2::types::{ - DRIVE_ID_SCHEMA, + DRIVE_NAME_SCHEMA, VirtualTapeDrive, LinuxTapeDrive, ScsiTapeChanger, @@ -34,7 +34,7 @@ lazy_static! { fn init() -> SectionConfig { - let mut config = SectionConfig::new(&DRIVE_ID_SCHEMA); + let mut config = SectionConfig::new(&DRIVE_NAME_SCHEMA); let obj_schema = match VirtualTapeDrive::API_SCHEMA { Schema::Object(ref obj_schema) => obj_schema,