]> git.proxmox.com Git - proxmox-backup.git/blob - pbs-api-types/src/tape/device.rs
368a00152329086b342dc4f52b7bdf069c953c0a
[proxmox-backup.git] / pbs-api-types / src / tape / device.rs
1 use ::serde::{Deserialize, Serialize};
2
3 use proxmox::api::api;
4
5 #[api()]
6 #[derive(Serialize,Deserialize)]
7 #[serde(rename_all = "kebab-case")]
8 /// Optional Device Identification Attributes
9 pub 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
21 #[api()]
22 #[derive(Debug,Serialize,Deserialize)]
23 #[serde(rename_all = "kebab-case")]
24 /// Kind of device
25 pub 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
41 pub 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 }