tape: rename DRIVE_ID_SCHEMA to DRIVE_NAME_SCHEMA

This commit is contained in:
Dietmar Maurer 2020-12-13 09:18:16 +01:00
parent 6fe9aedd0b
commit 49c965a497
8 changed files with 38 additions and 38 deletions

View File

@ -8,7 +8,7 @@ use crate::{
config, config,
api2::types::{ api2::types::{
PROXMOX_CONFIG_DIGEST_SCHEMA, PROXMOX_CONFIG_DIGEST_SCHEMA,
DRIVE_ID_SCHEMA, DRIVE_NAME_SCHEMA,
CHANGER_ID_SCHEMA, CHANGER_ID_SCHEMA,
CHANGER_DRIVE_ID_SCHEMA, CHANGER_DRIVE_ID_SCHEMA,
LINUX_DRIVE_PATH_SCHEMA, LINUX_DRIVE_PATH_SCHEMA,
@ -28,7 +28,7 @@ use crate::{
input: { input: {
properties: { properties: {
name: { name: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
path: { path: {
schema: LINUX_DRIVE_PATH_SCHEMA, schema: LINUX_DRIVE_PATH_SCHEMA,
@ -72,7 +72,7 @@ pub fn create_drive(param: Value) -> Result<(), Error> {
input: { input: {
properties: { properties: {
name: { name: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
}, },
}, },
@ -161,7 +161,7 @@ pub enum DeletableProperty {
input: { input: {
properties: { properties: {
name: { name: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
path: { path: {
schema: LINUX_DRIVE_PATH_SCHEMA, schema: LINUX_DRIVE_PATH_SCHEMA,
@ -258,7 +258,7 @@ pub fn update_drive(
input: { input: {
properties: { properties: {
name: { name: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
}, },
}, },

View File

@ -11,7 +11,7 @@ use proxmox::{
use crate::{ use crate::{
api2::types::{ api2::types::{
DRIVE_ID_SCHEMA, DRIVE_NAME_SCHEMA,
MEDIA_POOL_NAME_SCHEMA, MEDIA_POOL_NAME_SCHEMA,
MEDIA_SET_NAMING_TEMPLATE_SCHEMA, MEDIA_SET_NAMING_TEMPLATE_SCHEMA,
MEDIA_SET_ALLOCATION_POLICY_SCHEMA, MEDIA_SET_ALLOCATION_POLICY_SCHEMA,
@ -33,7 +33,7 @@ use crate::{
schema: MEDIA_POOL_NAME_SCHEMA, schema: MEDIA_POOL_NAME_SCHEMA,
}, },
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
allocation: { allocation: {
schema: MEDIA_SET_ALLOCATION_POLICY_SCHEMA, schema: MEDIA_SET_ALLOCATION_POLICY_SCHEMA,
@ -150,7 +150,7 @@ pub enum DeletableProperty {
schema: MEDIA_POOL_NAME_SCHEMA, schema: MEDIA_POOL_NAME_SCHEMA,
}, },
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
optional: true, optional: true,
}, },
allocation: { allocation: {

View File

@ -25,7 +25,7 @@ use crate::{
}, },
api2::types::{ api2::types::{
UPID_SCHEMA, UPID_SCHEMA,
DRIVE_ID_SCHEMA, DRIVE_NAME_SCHEMA,
MEDIA_LABEL_SCHEMA, MEDIA_LABEL_SCHEMA,
MEDIA_POOL_NAME_SCHEMA, MEDIA_POOL_NAME_SCHEMA,
Authid, Authid,
@ -60,7 +60,7 @@ use crate::{
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
slot: { slot: {
description: "Source slot number", description: "Source slot number",
@ -95,7 +95,7 @@ pub async fn load_slot(
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
"changer-id": { "changer-id": {
schema: MEDIA_LABEL_SCHEMA, schema: MEDIA_LABEL_SCHEMA,
@ -120,7 +120,7 @@ pub async fn load_media(drive: String, changer_id: String) -> Result<(), Error>
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
slot: { slot: {
description: "Target slot number. If omitted, defaults to the slot that the drive was loaded from.", 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: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
fast: { fast: {
description: "Use fast erase.", description: "Use fast erase.",
@ -227,7 +227,7 @@ pub fn erase_media(
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
}, },
}, },
@ -266,7 +266,7 @@ pub fn rewind(
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
}, },
}, },
@ -292,7 +292,7 @@ pub async fn eject_media(drive: String) -> Result<(), Error> {
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
"changer-id": { "changer-id": {
schema: MEDIA_LABEL_SCHEMA, schema: MEDIA_LABEL_SCHEMA,
@ -432,7 +432,7 @@ fn write_media_label(
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
}, },
}, },
@ -482,7 +482,7 @@ pub async fn read_label(drive: String) -> Result<MediaLabelInfoFlat, Error> {
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
}, },
}, },
@ -550,7 +550,7 @@ pub async fn inventory(
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
"read-all-labels": { "read-all-labels": {
description: "Load all tapes and try read labels (even if already inventoried)", description: "Load all tapes and try read labels (even if already inventoried)",
@ -655,7 +655,7 @@ pub fn update_inventory(
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
pool: { pool: {
schema: MEDIA_POOL_NAME_SCHEMA, schema: MEDIA_POOL_NAME_SCHEMA,

View File

@ -9,7 +9,7 @@ use proxmox::api::{
use crate::api2::types::PROXMOX_SAFE_ID_FORMAT; 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) .format(&PROXMOX_SAFE_ID_FORMAT)
.min_length(3) .min_length(3)
.max_length(32) .max_length(32)
@ -45,7 +45,7 @@ pub const CHANGER_DRIVE_ID_SCHEMA: Schema = IntegerSchema::new(
#[api( #[api(
properties: { properties: {
name: { name: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
} }
} }
)] )]
@ -64,7 +64,7 @@ pub struct VirtualTapeDrive {
#[api( #[api(
properties: { properties: {
name: { name: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
path: { path: {
schema: LINUX_DRIVE_PATH_SCHEMA, schema: LINUX_DRIVE_PATH_SCHEMA,

View File

@ -21,7 +21,7 @@ use crate::{
parse_calendar_event, parse_calendar_event,
}, },
api2::types::{ api2::types::{
DRIVE_ID_SCHEMA, DRIVE_NAME_SCHEMA,
PROXMOX_SAFE_ID_FORMAT, PROXMOX_SAFE_ID_FORMAT,
SINGLE_LINE_COMMENT_FORMAT, SINGLE_LINE_COMMENT_FORMAT,
}, },
@ -116,7 +116,7 @@ impl std::str::FromStr for RetentionPolicy {
schema: MEDIA_POOL_NAME_SCHEMA, schema: MEDIA_POOL_NAME_SCHEMA,
}, },
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
allocation: { allocation: {
schema: MEDIA_SET_ALLOCATION_POLICY_SCHEMA, schema: MEDIA_SET_ALLOCATION_POLICY_SCHEMA,

View File

@ -20,7 +20,7 @@ use proxmox_backup::{
api2::{ api2::{
self, self,
types::{ types::{
DRIVE_ID_SCHEMA, DRIVE_NAME_SCHEMA,
MEDIA_LABEL_SCHEMA, MEDIA_LABEL_SCHEMA,
MEDIA_POOL_NAME_SCHEMA, MEDIA_POOL_NAME_SCHEMA,
}, },
@ -90,7 +90,7 @@ fn lookup_drive_name(
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
optional: true, optional: true,
}, },
fast: { fast: {
@ -128,7 +128,7 @@ async fn erase_media(
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
optional: true, optional: true,
}, },
}, },
@ -160,7 +160,7 @@ async fn rewind(
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
optional: true, optional: true,
}, },
}, },
@ -190,7 +190,7 @@ async fn eject_media(
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
optional: true, optional: true,
}, },
"changer-id": { "changer-id": {
@ -227,7 +227,7 @@ async fn load_media(
optional: true, optional: true,
}, },
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
optional: true, optional: true,
}, },
"changer-id": { "changer-id": {
@ -262,7 +262,7 @@ async fn label_media(
input: { input: {
properties: { properties: {
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
optional: true, optional: true,
}, },
"output-format": { "output-format": {
@ -311,7 +311,7 @@ async fn read_label(
optional: true, optional: true,
}, },
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
optional: true, optional: true,
}, },
"read-labels": { "read-labels": {
@ -383,7 +383,7 @@ async fn inventory(
optional: true, optional: true,
}, },
drive: { drive: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
optional: true, optional: true,
}, },
}, },

View File

@ -14,7 +14,7 @@ use proxmox_backup::{
api2::{ api2::{
self, self,
types::{ types::{
DRIVE_ID_SCHEMA, DRIVE_NAME_SCHEMA,
}, },
}, },
tape::{ tape::{
@ -157,7 +157,7 @@ fn scan_for_drives(
optional: true, optional: true,
}, },
name: { name: {
schema: DRIVE_ID_SCHEMA, schema: DRIVE_NAME_SCHEMA,
}, },
}, },
}, },

View File

@ -21,7 +21,7 @@ use proxmox::{
use crate::{ use crate::{
api2::types::{ api2::types::{
DRIVE_ID_SCHEMA, DRIVE_NAME_SCHEMA,
VirtualTapeDrive, VirtualTapeDrive,
LinuxTapeDrive, LinuxTapeDrive,
ScsiTapeChanger, ScsiTapeChanger,
@ -34,7 +34,7 @@ lazy_static! {
fn init() -> SectionConfig { 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 { let obj_schema = match VirtualTapeDrive::API_SCHEMA {
Schema::Object(ref obj_schema) => obj_schema, Schema::Object(ref obj_schema) => obj_schema,