#[derive(Debug, Clone)]
pub struct IscsiClient<T> {
client: T,
path: String,
}
impl<T> IscsiClient<T>
where
T: crate::client::Client,
{
pub fn new(client: T, parent_path: &str) -> Self {
Self {
client,
path: format!("{}{}", parent_path, "/iscsi"),
}
}
}
impl<T> IscsiClient<T>
where
T: crate::client::Client,
{
#[doc = "Scan remote iSCSI server."]
#[doc = ""]
#[doc = "Permission check: perm(\"/storage\", [\"Datastore.Allocate\"])"]
pub async fn get(&self, params: GetParams) -> Result<Vec<GetOutputItems>, T::Error> {
let path = self.path.to_string();
let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, ¶ms).await?;
Ok(optional_vec.unwrap_or_default())
}
}
impl GetOutputItems {
pub fn new(portal: String, target: String) -> Self {
Self {
portal,
target,
additional_properties: ::std::default::Default::default(),
}
}
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct GetOutputItems {
#[doc = "The iSCSI portal name."]
#[doc = ""]
pub portal: String,
#[doc = "The iSCSI target name."]
#[doc = ""]
pub target: String,
#[serde(
flatten,
default,
skip_serializing_if = "::std::collections::HashMap::is_empty"
)]
pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl GetParams {
pub fn new(portal: String) -> Self {
Self {
portal,
additional_properties: ::std::default::Default::default(),
}
}
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct GetParams {
#[doc = "The iSCSI portal (IP or DNS name with optional port)."]
#[doc = ""]
pub portal: String,
#[serde(
flatten,
default,
skip_serializing_if = "::std::collections::HashMap::is_empty"
)]
pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}