]> git.proxmox.com Git - proxmox-backup.git/commitdiff
tape: rename DRIVE_ID_SCHEMA to DRIVE_NAME_SCHEMA
authorDietmar Maurer <dietmar@proxmox.com>
Sun, 13 Dec 2020 08:18:16 +0000 (09:18 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Sun, 13 Dec 2020 08:18:16 +0000 (09:18 +0100)
src/api2/config/drive.rs
src/api2/config/media_pool.rs
src/api2/tape/drive.rs
src/api2/types/tape/drive.rs
src/api2/types/tape/media_pool.rs
src/bin/proxmox-tape.rs
src/bin/proxmox_tape/drive.rs
src/config/drive.rs

index a99d94cb5811edd025febcbb99e02d74a457a479..4aade02783c72e0fa66a1fd043290c0904038601 100644 (file)
@@ -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,
             },
         },
     },
index 86a42157488ac54e1d3bd9d13c130b33278f65ca..a80c6df2be43d59e386a62851decc02f3030a714 100644 (file)
@@ -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: {
index 0e641869c5e6cdcb2205edfc318e2d3bb4e8d260..39024d63162b64902ea83001810ba68964d207fd 100644 (file)
@@ -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<Vec<TapeDeviceInfo>, 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<MediaLabelInfoFlat, Error> {
     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,
index 11fa99147e002cdd67bc6aa1688e97d344c72fea..82552fb1a4317008dbde38228db7b68d296777d4 100644 (file)
@@ -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,
index f65d5cc1d84ff80ed5ccf1881c872ec6b7072c62..328f35914daef33f2f1d18bca066d36008e07806 100644 (file)
@@ -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,
index cae2af1cc4c083a012e67ce75afcff53b37b6697..dc087ff6d85b2799f3c3f35216558a44cc1292c7 100644 (file)
@@ -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,
             },
         },
index 6a181641f5ae3679a1f55d756235035d52d03d0d..0949d450478238e1bd018d8a38c1656d19f5afe9 100644 (file)
@@ -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,
             },
         },
     },
index c56bd36ac3eef69b0c23451b791e6a1ec5f5073e..72bc05af538e607f6330dc9591bac1ef23483ef3 100644 (file)
@@ -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,