proxmox_api/generated/nodes/node/hardware/
pci.rs

1pub mod pciid;
2pub struct PciClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> PciClient<T>
7where
8    T: crate::client::Client,
9{
10    pub fn new(client: T, parent_path: &str) -> Self {
11        Self {
12            client,
13            path: format!("{}{}", parent_path, "/pci"),
14        }
15    }
16}
17impl<T> PciClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "List local PCI devices."]
22    pub fn get(&self, params: GetParams) -> Result<Vec<GetOutputItems>, T::Error> {
23        let path = self.path.to_string();
24        self.client.get(&path, &params)
25    }
26}
27impl GetOutputItems {
28    pub fn new(class: String, device: String, id: String, iommugroup: u64, vendor: String) -> Self {
29        Self {
30            class,
31            device,
32            id,
33            iommugroup,
34            vendor,
35            device_name: Default::default(),
36            mdev: Default::default(),
37            subsystem_device: Default::default(),
38            subsystem_device_name: Default::default(),
39            subsystem_vendor: Default::default(),
40            subsystem_vendor_name: Default::default(),
41            vendor_name: Default::default(),
42            additional_properties: Default::default(),
43        }
44    }
45}
46#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
47pub struct GetOutputItems {
48    #[doc = "The PCI Class of the device."]
49    pub class: String,
50    #[doc = "The Device ID."]
51    pub device: String,
52    #[serde(skip_serializing_if = "Option::is_none", default)]
53    pub device_name: Option<String>,
54    #[doc = "The PCI ID."]
55    pub id: String,
56    #[serde(
57        serialize_with = "crate::types::serialize_int",
58        deserialize_with = "crate::types::deserialize_int"
59    )]
60    #[doc = "The IOMMU group in which the device is in. If no IOMMU group is detected, it is set to -1."]
61    pub iommugroup: u64,
62    #[serde(
63        serialize_with = "crate::types::serialize_bool_optional",
64        deserialize_with = "crate::types::deserialize_bool_optional"
65    )]
66    #[serde(skip_serializing_if = "Option::is_none", default)]
67    #[doc = "If set, marks that the device is capable of creating mediated devices."]
68    pub mdev: Option<bool>,
69    #[serde(skip_serializing_if = "Option::is_none", default)]
70    #[doc = "The Subsystem Device ID."]
71    pub subsystem_device: Option<String>,
72    #[serde(skip_serializing_if = "Option::is_none", default)]
73    pub subsystem_device_name: Option<String>,
74    #[serde(skip_serializing_if = "Option::is_none", default)]
75    #[doc = "The Subsystem Vendor ID."]
76    pub subsystem_vendor: Option<String>,
77    #[serde(skip_serializing_if = "Option::is_none", default)]
78    pub subsystem_vendor_name: Option<String>,
79    #[doc = "The Vendor ID."]
80    pub vendor: String,
81    #[serde(skip_serializing_if = "Option::is_none", default)]
82    pub vendor_name: Option<String>,
83    #[serde(
84        flatten,
85        default,
86        skip_serializing_if = "::std::collections::HashMap::is_empty"
87    )]
88    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
89}
90#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
91pub struct GetParams {
92    #[serde(rename = "pci-class-blacklist")]
93    #[serde(skip_serializing_if = "Option::is_none", default)]
94    #[doc = "A list of blacklisted PCI classes, which will not be returned. Following are filtered by default: Memory Controller (05), Bridge (06) and Processor (0b)."]
95    pub pci_class_blacklist: Option<String>,
96    #[serde(
97        serialize_with = "crate::types::serialize_bool_optional",
98        deserialize_with = "crate::types::deserialize_bool_optional"
99    )]
100    #[serde(skip_serializing_if = "Option::is_none", default)]
101    #[doc = "If disabled, does only print the PCI IDs. Otherwise, additional information like vendor and device will be returned."]
102    pub verbose: Option<bool>,
103    #[serde(
104        flatten,
105        default,
106        skip_serializing_if = "::std::collections::HashMap::is_empty"
107    )]
108    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
109}
110impl<T> PciClient<T>
111where
112    T: crate::client::Client,
113{
114    pub fn pciid(&self, pciid: &str) -> pciid::PciidClient<T> {
115        pciid::PciidClient::<T>::new(self.client.clone(), &self.path, pciid)
116    }
117}