tape: rename DRIVE_ID_SCHEMA to DRIVE_NAME_SCHEMA
This commit is contained in:
parent
6fe9aedd0b
commit
49c965a497
@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -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: {
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
},
|
||||
},
|
||||
|
@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user