]> git.proxmox.com Git - proxmox-backup.git/blame - pbs-api-types/src/tape/device.rs
update to first proxmox crate split
[proxmox-backup.git] / pbs-api-types / src / tape / device.rs
CommitLineData
fa9c9be7
DM
1use ::serde::{Deserialize, Serialize};
2
6ef1b649 3use proxmox_schema::api;
fa9c9be7 4
b5b99a52
DM
5#[api()]
6#[derive(Serialize,Deserialize)]
7#[serde(rename_all = "kebab-case")]
8/// Optional Device Identification Attributes
9pub struct OptionalDeviceIdentification {
10 /// Vendor (autodetected)
11 #[serde(skip_serializing_if="Option::is_none")]
12 pub vendor: Option<String>,
13 /// Model (autodetected)
14 #[serde(skip_serializing_if="Option::is_none")]
15 pub model: Option<String>,
16 /// Serial number (autodetected)
17 #[serde(skip_serializing_if="Option::is_none")]
18 pub serial: Option<String>,
19}
20
fa9c9be7
DM
21#[api()]
22#[derive(Debug,Serialize,Deserialize)]
23#[serde(rename_all = "kebab-case")]
d1d74c43 24/// Kind of device
fa9c9be7
DM
25pub enum DeviceKind {
26 /// Tape changer (Autoloader, Robot)
27 Changer,
28 /// Normal SCSI tape device
29 Tape,
30}
31
32#[api(
33 properties: {
34 kind: {
35 type: DeviceKind,
36 },
37 },
38)]
39#[derive(Debug,Serialize,Deserialize)]
40/// Tape device information
41pub struct TapeDeviceInfo {
42 pub kind: DeviceKind,
43 /// Path to the linux device node
44 pub path: String,
45 /// Serial number (autodetected)
46 pub serial: String,
47 /// Vendor (autodetected)
48 pub vendor: String,
49 /// Model (autodetected)
50 pub model: String,
51 /// Device major number
52 pub major: u32,
53 /// Device minor number
54 pub minor: u32,
55}