use std::sync::Arc;
use crate::core::client::{VimClient, Result};
#[derive(Clone)]
pub struct HostVsanHealthSystem {
client: Arc<dyn VimClient>,
mo_id: String,
}
impl HostVsanHealthSystem {
pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self {
Self {
client,
mo_id: mo_id.to_string(),
}
}
pub async fn vsan_host_clomd_liveness(&self) -> Result<bool> {
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostClomdLiveness", None).await?;
let result: bool = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_cleanup_vmdk_load_test(&self, runname: &str, specs: Option<&[crate::types::structs::VsanVmdkLoadTestSpec]>) -> Result<String> {
let input = VsanHostCleanupVmdkLoadTestRequestType {runname, specs, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostCleanupVmdkLoadTest", Some(&input)).await?;
let result: String = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_create_vm_health_test(&self, timeout: i32) -> Result<crate::types::structs::VsanHostCreateVmHealthTestResult> {
let input = VsanHostCreateVmHealthTestRequestType {timeout, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostCreateVmHealthTest", Some(&input)).await?;
let result: crate::types::structs::VsanHostCreateVmHealthTestResult = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_flash_scsi_controller_firmware_task(&self, spec: &crate::types::structs::VsanHclFirmwareUpdateSpec) -> Result<crate::types::structs::ManagedObjectReference> {
let input = VsanFlashScsiControllerFirmwareRequestType {spec, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanFlashScsiControllerFirmware_Task", Some(&input)).await?;
let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_get_hcl_info(&self, include_vendor_info: Option<bool>, vsan_esa_eligible_disks_only: Option<bool>) -> Result<crate::types::structs::VsanHostHclInfo> {
let input = VsanGetHclInfoRequestType {include_vendor_info, vsan_esa_eligible_disks_only, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanGetHclInfo", Some(&input)).await?;
let result: crate::types::structs::VsanHostHclInfo = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_get_network_diagnostics_health_info(&self) -> Result<crate::types::structs::VsanNetworkDiagnosticsHealthInfo> {
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanGetNetworkDiagnosticsHealthInfo", None).await?;
let result: crate::types::structs::VsanNetworkDiagnosticsHealthInfo = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_get_proactive_rebalance_info(&self) -> Result<crate::types::structs::VsanProactiveRebalanceInfoEx> {
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanGetProactiveRebalanceInfo", None).await?;
let result: crate::types::structs::VsanProactiveRebalanceInfoEx = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_prepare_vmdk_load_test(&self, runname: &str, specs: &[crate::types::structs::VsanVmdkLoadTestSpec]) -> Result<String> {
let input = VsanHostPrepareVmdkLoadTestRequestType {runname, specs, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostPrepareVmdkLoadTest", Some(&input)).await?;
let result: String = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_query_adv_cfg(&self, options: &[String], include_all_adv_options: Option<bool>, non_default_only: Option<bool>) -> Result<Option<Vec<Box<dyn crate::types::traits::OptionValueTrait>>>> {
let input = VsanHostQueryAdvCfgRequestType {options, include_all_adv_options, non_default_only, };
let bytes_opt = self.client.invoke_optional("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostQueryAdvCfg", Some(&input)).await?;
match bytes_opt {
Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
None => Ok(None),
}
}
pub async fn vsan_host_query_check_limits(&self, spec: Option<&crate::types::structs::VsanHostQueryCheckLimitsSpec>) -> Result<crate::types::structs::VsanLimitHealthResult> {
let input = VsanHostQueryCheckLimitsRequestType {spec, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostQueryCheckLimits", Some(&input)).await?;
let result: crate::types::structs::VsanLimitHealthResult = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_query_encryption_health_summary(&self) -> Result<crate::types::structs::VsanEncryptionHealthSummary> {
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostQueryEncryptionHealthSummary", None).await?;
let result: crate::types::structs::VsanEncryptionHealthSummary = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_query_file_service_health_summary(&self) -> Result<crate::types::structs::VsanFileServiceHealthSummary> {
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostQueryFileServiceHealthSummary", None).await?;
let result: crate::types::structs::VsanFileServiceHealthSummary = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_query_host_emm_state(&self) -> Result<crate::types::structs::VsanHostEmmSummary> {
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanQueryHostEMMState", None).await?;
let result: crate::types::structs::VsanHostEmmSummary = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_query_host_info_by_uuids(&self, uuids: &[String]) -> Result<Vec<crate::types::structs::VsanQueryResultHostInfo>> {
let input = VsanHostQueryHostInfoByUuidsRequestType {uuids, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostQueryHostInfoByUuids", Some(&input)).await?;
let result: Vec<crate::types::structs::VsanQueryResultHostInfo> = crate::core::client::unmarshal_array(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_query_object_health_summary(&self, obj_uuids: Option<&[String]>, include_obj_uuids: Option<bool>, local_host_only: Option<bool>, include_non_compliance_obj_detail: Option<bool>, spec: Option<&crate::types::structs::VsanHealthQuerySpec>) -> Result<crate::types::structs::VsanObjectOverallHealth> {
let input = VsanHostQueryObjectHealthSummaryRequestType {obj_uuids, include_obj_uuids, local_host_only, include_non_compliance_obj_detail, spec, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostQueryObjectHealthSummary", Some(&input)).await?;
let result: crate::types::structs::VsanObjectOverallHealth = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_query_physical_disk_health_summary(&self) -> Result<crate::types::structs::VsanPhysicalDiskHealthSummary> {
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostQueryPhysicalDiskHealthSummary", None).await?;
let result: crate::types::structs::VsanPhysicalDiskHealthSummary = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_query_run_iperf_client(&self, multicast: bool, server_ip: &str, duration_sec: Option<i32>, spec: Option<&crate::types::structs::VsanIperfClientSpec>) -> Result<crate::types::structs::VsanNetworkLoadTestResult> {
let input = VsanHostQueryRunIperfClientRequestType {multicast, server_ip, duration_sec, spec, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostQueryRunIperfClient", Some(&input)).await?;
let result: crate::types::structs::VsanNetworkLoadTestResult = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_query_run_iperf_server(&self, multicast: bool, server_ip: Option<&str>, duration_sec: Option<i32>) -> Result<crate::types::structs::VsanNetworkLoadTestResult> {
let input = VsanHostQueryRunIperfServerRequestType {multicast, server_ip, duration_sec, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostQueryRunIperfServer", Some(&input)).await?;
let result: crate::types::structs::VsanNetworkLoadTestResult = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_query_smart_stats(&self, disks: Option<&[String]>, include_all_disks: Option<bool>) -> Result<crate::types::structs::VsanSmartStatsHostSummary> {
let input = VsanHostQuerySmartStatsRequestType {disks, include_all_disks, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostQuerySmartStats", Some(&input)).await?;
let result: crate::types::structs::VsanSmartStatsHostSummary = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_query_verify_network_settings(&self, peers: Option<&[String]>, robo_stretched_cluster_witnesses: Option<&[String]>, v_motion_peers: Option<&[String]>, spec: Option<&crate::types::structs::VsanHealthQuerySpec>) -> Result<crate::types::structs::VsanNetworkHealthResult> {
let input = VsanHostQueryVerifyNetworkSettingsRequestType {peers, robo_stretched_cluster_witnesses, v_motion_peers, spec, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostQueryVerifyNetworkSettings", Some(&input)).await?;
let result: crate::types::structs::VsanNetworkHealthResult = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_query_health_system_version(&self, display_version: Option<bool>) -> Result<String> {
let input = VsanHostQueryHealthSystemVersionRequestType {display_version, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostQueryHealthSystemVersion", Some(&input)).await?;
let result: String = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_repair_immediate_objects(&self, uuids: Option<&[String]>, repair_type: Option<&str>) -> Result<crate::types::structs::VsanRepairObjectsResult> {
let input = VsanHostRepairImmediateObjectsRequestType {uuids, repair_type, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostRepairImmediateObjects", Some(&input)).await?;
let result: crate::types::structs::VsanRepairObjectsResult = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_host_run_vmdk_load_test(&self, runname: &str, duration_sec: i32, specs: &[crate::types::structs::VsanVmdkLoadTestSpec]) -> Result<Vec<crate::types::structs::VsanVmdkLoadTestResult>> {
let input = VsanHostRunVmdkLoadTestRequestType {runname, duration_sec, specs, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanHostRunVmdkLoadTest", Some(&input)).await?;
let result: Vec<crate::types::structs::VsanVmdkLoadTestResult> = crate::core::client::unmarshal_array(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_start_proactive_rebalance(&self, time_span: Option<i32>, variance_threshold: Option<f32>, time_threshold: Option<i32>, rate_threshold: Option<i32>) -> Result<bool> {
let input = VsanStartProactiveRebalanceRequestType {time_span, variance_threshold, time_threshold, rate_threshold, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanStartProactiveRebalance", Some(&input)).await?;
let result: bool = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_stop_proactive_rebalance(&self) -> Result<bool> {
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanStopProactiveRebalance", None).await?;
let result: bool = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn vsan_wait_for_vsan_health_generation_id_change(&self, timeout: i32) -> Result<bool> {
let input = VsanWaitForVsanHealthGenerationIdChangeRequestType {timeout, };
let bytes = self.client.invoke("vsan", "HostVsanHealthSystem", &self.mo_id, "VsanWaitForVsanHealthGenerationIdChange", Some(&input)).await?;
let result: bool = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
}
struct VsanHostCleanupVmdkLoadTestRequestType<'a> {
runname: &'a str,
specs: Option<&'a [crate::types::structs::VsanVmdkLoadTestSpec]>,
}
impl<'a> miniserde::Serialize for VsanHostCleanupVmdkLoadTestRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostCleanupVmdkLoadTestRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostCleanupVmdkLoadTestRequestTypeSer<'b, 'a> {
data: &'b VsanHostCleanupVmdkLoadTestRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for VsanHostCleanupVmdkLoadTestRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostCleanupVmdkLoadTestRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("runname"), &self.data.runname as &dyn miniserde::Serialize)),
2 => {
let Some(ref val) = self.data.specs else { continue; };
return Some((std::borrow::Cow::Borrowed("specs"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct VsanHostCreateVmHealthTestRequestType {
timeout: i32,
}
impl miniserde::Serialize for VsanHostCreateVmHealthTestRequestType {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostCreateVmHealthTestRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostCreateVmHealthTestRequestTypeSer<'b> {
data: &'b VsanHostCreateVmHealthTestRequestType,
seq: usize,
}
impl<'b> miniserde::ser::Map for VsanHostCreateVmHealthTestRequestTypeSer<'b> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostCreateVmHealthTestRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("timeout"), &self.data.timeout as &dyn miniserde::Serialize)),
_ => return None,
}
}
}
struct VsanFlashScsiControllerFirmwareRequestType<'a> {
spec: &'a crate::types::structs::VsanHclFirmwareUpdateSpec,
}
impl<'a> miniserde::Serialize for VsanFlashScsiControllerFirmwareRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanFlashScsiControllerFirmwareRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanFlashScsiControllerFirmwareRequestTypeSer<'b, 'a> {
data: &'b VsanFlashScsiControllerFirmwareRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for VsanFlashScsiControllerFirmwareRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanFlashScsiControllerFirmwareRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("spec"), &self.data.spec as &dyn miniserde::Serialize)),
_ => return None,
}
}
}
struct VsanGetHclInfoRequestType {
include_vendor_info: Option<bool>,
vsan_esa_eligible_disks_only: Option<bool>,
}
impl miniserde::Serialize for VsanGetHclInfoRequestType {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanGetHclInfoRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanGetHclInfoRequestTypeSer<'b> {
data: &'b VsanGetHclInfoRequestType,
seq: usize,
}
impl<'b> miniserde::ser::Map for VsanGetHclInfoRequestTypeSer<'b> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanGetHclInfoRequestType")),
1 => {
let Some(ref val) = self.data.include_vendor_info else { continue; };
return Some((std::borrow::Cow::Borrowed("includeVendorInfo"), val as &dyn miniserde::Serialize));
}
2 => {
let Some(ref val) = self.data.vsan_esa_eligible_disks_only else { continue; };
return Some((std::borrow::Cow::Borrowed("vsanEsaEligibleDisksOnly"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct VsanHostPrepareVmdkLoadTestRequestType<'a> {
runname: &'a str,
specs: &'a [crate::types::structs::VsanVmdkLoadTestSpec],
}
impl<'a> miniserde::Serialize for VsanHostPrepareVmdkLoadTestRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostPrepareVmdkLoadTestRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostPrepareVmdkLoadTestRequestTypeSer<'b, 'a> {
data: &'b VsanHostPrepareVmdkLoadTestRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for VsanHostPrepareVmdkLoadTestRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostPrepareVmdkLoadTestRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("runname"), &self.data.runname as &dyn miniserde::Serialize)),
2 => return Some((std::borrow::Cow::Borrowed("specs"), &self.data.specs as &dyn miniserde::Serialize)),
_ => return None,
}
}
}
struct VsanHostQueryAdvCfgRequestType<'a> {
options: &'a [String],
include_all_adv_options: Option<bool>,
non_default_only: Option<bool>,
}
impl<'a> miniserde::Serialize for VsanHostQueryAdvCfgRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostQueryAdvCfgRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostQueryAdvCfgRequestTypeSer<'b, 'a> {
data: &'b VsanHostQueryAdvCfgRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for VsanHostQueryAdvCfgRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostQueryAdvCfgRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("options"), &self.data.options as &dyn miniserde::Serialize)),
2 => {
let Some(ref val) = self.data.include_all_adv_options else { continue; };
return Some((std::borrow::Cow::Borrowed("includeAllAdvOptions"), val as &dyn miniserde::Serialize));
}
3 => {
let Some(ref val) = self.data.non_default_only else { continue; };
return Some((std::borrow::Cow::Borrowed("nonDefaultOnly"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct VsanHostQueryCheckLimitsRequestType<'a> {
spec: Option<&'a crate::types::structs::VsanHostQueryCheckLimitsSpec>,
}
impl<'a> miniserde::Serialize for VsanHostQueryCheckLimitsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostQueryCheckLimitsRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostQueryCheckLimitsRequestTypeSer<'b, 'a> {
data: &'b VsanHostQueryCheckLimitsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for VsanHostQueryCheckLimitsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostQueryCheckLimitsRequestType")),
1 => {
let Some(ref val) = self.data.spec else { continue; };
return Some((std::borrow::Cow::Borrowed("spec"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct VsanHostQueryHostInfoByUuidsRequestType<'a> {
uuids: &'a [String],
}
impl<'a> miniserde::Serialize for VsanHostQueryHostInfoByUuidsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostQueryHostInfoByUuidsRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostQueryHostInfoByUuidsRequestTypeSer<'b, 'a> {
data: &'b VsanHostQueryHostInfoByUuidsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for VsanHostQueryHostInfoByUuidsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostQueryHostInfoByUuidsRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("uuids"), &self.data.uuids as &dyn miniserde::Serialize)),
_ => return None,
}
}
}
struct VsanHostQueryObjectHealthSummaryRequestType<'a> {
obj_uuids: Option<&'a [String]>,
include_obj_uuids: Option<bool>,
local_host_only: Option<bool>,
include_non_compliance_obj_detail: Option<bool>,
spec: Option<&'a crate::types::structs::VsanHealthQuerySpec>,
}
impl<'a> miniserde::Serialize for VsanHostQueryObjectHealthSummaryRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostQueryObjectHealthSummaryRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostQueryObjectHealthSummaryRequestTypeSer<'b, 'a> {
data: &'b VsanHostQueryObjectHealthSummaryRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for VsanHostQueryObjectHealthSummaryRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostQueryObjectHealthSummaryRequestType")),
1 => {
let Some(ref val) = self.data.obj_uuids else { continue; };
return Some((std::borrow::Cow::Borrowed("objUuids"), val as &dyn miniserde::Serialize));
}
2 => {
let Some(ref val) = self.data.include_obj_uuids else { continue; };
return Some((std::borrow::Cow::Borrowed("includeObjUuids"), val as &dyn miniserde::Serialize));
}
3 => {
let Some(ref val) = self.data.local_host_only else { continue; };
return Some((std::borrow::Cow::Borrowed("localHostOnly"), val as &dyn miniserde::Serialize));
}
4 => {
let Some(ref val) = self.data.include_non_compliance_obj_detail else { continue; };
return Some((std::borrow::Cow::Borrowed("includeNonComplianceObjDetail"), val as &dyn miniserde::Serialize));
}
5 => {
let Some(ref val) = self.data.spec else { continue; };
return Some((std::borrow::Cow::Borrowed("spec"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct VsanHostQueryRunIperfClientRequestType<'a> {
multicast: bool,
server_ip: &'a str,
duration_sec: Option<i32>,
spec: Option<&'a crate::types::structs::VsanIperfClientSpec>,
}
impl<'a> miniserde::Serialize for VsanHostQueryRunIperfClientRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostQueryRunIperfClientRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostQueryRunIperfClientRequestTypeSer<'b, 'a> {
data: &'b VsanHostQueryRunIperfClientRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for VsanHostQueryRunIperfClientRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostQueryRunIperfClientRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("multicast"), &self.data.multicast as &dyn miniserde::Serialize)),
2 => return Some((std::borrow::Cow::Borrowed("serverIp"), &self.data.server_ip as &dyn miniserde::Serialize)),
3 => {
let Some(ref val) = self.data.duration_sec else { continue; };
return Some((std::borrow::Cow::Borrowed("durationSec"), val as &dyn miniserde::Serialize));
}
4 => {
let Some(ref val) = self.data.spec else { continue; };
return Some((std::borrow::Cow::Borrowed("spec"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct VsanHostQueryRunIperfServerRequestType<'a> {
multicast: bool,
server_ip: Option<&'a str>,
duration_sec: Option<i32>,
}
impl<'a> miniserde::Serialize for VsanHostQueryRunIperfServerRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostQueryRunIperfServerRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostQueryRunIperfServerRequestTypeSer<'b, 'a> {
data: &'b VsanHostQueryRunIperfServerRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for VsanHostQueryRunIperfServerRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostQueryRunIperfServerRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("multicast"), &self.data.multicast as &dyn miniserde::Serialize)),
2 => {
let Some(ref val) = self.data.server_ip else { continue; };
return Some((std::borrow::Cow::Borrowed("serverIp"), val as &dyn miniserde::Serialize));
}
3 => {
let Some(ref val) = self.data.duration_sec else { continue; };
return Some((std::borrow::Cow::Borrowed("durationSec"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct VsanHostQuerySmartStatsRequestType<'a> {
disks: Option<&'a [String]>,
include_all_disks: Option<bool>,
}
impl<'a> miniserde::Serialize for VsanHostQuerySmartStatsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostQuerySmartStatsRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostQuerySmartStatsRequestTypeSer<'b, 'a> {
data: &'b VsanHostQuerySmartStatsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for VsanHostQuerySmartStatsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostQuerySmartStatsRequestType")),
1 => {
let Some(ref val) = self.data.disks else { continue; };
return Some((std::borrow::Cow::Borrowed("disks"), val as &dyn miniserde::Serialize));
}
2 => {
let Some(ref val) = self.data.include_all_disks else { continue; };
return Some((std::borrow::Cow::Borrowed("includeAllDisks"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct VsanHostQueryVerifyNetworkSettingsRequestType<'a> {
peers: Option<&'a [String]>,
robo_stretched_cluster_witnesses: Option<&'a [String]>,
v_motion_peers: Option<&'a [String]>,
spec: Option<&'a crate::types::structs::VsanHealthQuerySpec>,
}
impl<'a> miniserde::Serialize for VsanHostQueryVerifyNetworkSettingsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostQueryVerifyNetworkSettingsRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostQueryVerifyNetworkSettingsRequestTypeSer<'b, 'a> {
data: &'b VsanHostQueryVerifyNetworkSettingsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for VsanHostQueryVerifyNetworkSettingsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostQueryVerifyNetworkSettingsRequestType")),
1 => {
let Some(ref val) = self.data.peers else { continue; };
return Some((std::borrow::Cow::Borrowed("peers"), val as &dyn miniserde::Serialize));
}
2 => {
let Some(ref val) = self.data.robo_stretched_cluster_witnesses else { continue; };
return Some((std::borrow::Cow::Borrowed("ROBOStretchedClusterWitnesses"), val as &dyn miniserde::Serialize));
}
3 => {
let Some(ref val) = self.data.v_motion_peers else { continue; };
return Some((std::borrow::Cow::Borrowed("vMotionPeers"), val as &dyn miniserde::Serialize));
}
4 => {
let Some(ref val) = self.data.spec else { continue; };
return Some((std::borrow::Cow::Borrowed("spec"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct VsanHostQueryHealthSystemVersionRequestType {
display_version: Option<bool>,
}
impl miniserde::Serialize for VsanHostQueryHealthSystemVersionRequestType {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostQueryHealthSystemVersionRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostQueryHealthSystemVersionRequestTypeSer<'b> {
data: &'b VsanHostQueryHealthSystemVersionRequestType,
seq: usize,
}
impl<'b> miniserde::ser::Map for VsanHostQueryHealthSystemVersionRequestTypeSer<'b> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostQueryHealthSystemVersionRequestType")),
1 => {
let Some(ref val) = self.data.display_version else { continue; };
return Some((std::borrow::Cow::Borrowed("displayVersion"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct VsanHostRepairImmediateObjectsRequestType<'a> {
uuids: Option<&'a [String]>,
repair_type: Option<&'a str>,
}
impl<'a> miniserde::Serialize for VsanHostRepairImmediateObjectsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostRepairImmediateObjectsRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostRepairImmediateObjectsRequestTypeSer<'b, 'a> {
data: &'b VsanHostRepairImmediateObjectsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for VsanHostRepairImmediateObjectsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostRepairImmediateObjectsRequestType")),
1 => {
let Some(ref val) = self.data.uuids else { continue; };
return Some((std::borrow::Cow::Borrowed("uuids"), val as &dyn miniserde::Serialize));
}
2 => {
let Some(ref val) = self.data.repair_type else { continue; };
return Some((std::borrow::Cow::Borrowed("repairType"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct VsanHostRunVmdkLoadTestRequestType<'a> {
runname: &'a str,
duration_sec: i32,
specs: &'a [crate::types::structs::VsanVmdkLoadTestSpec],
}
impl<'a> miniserde::Serialize for VsanHostRunVmdkLoadTestRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanHostRunVmdkLoadTestRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanHostRunVmdkLoadTestRequestTypeSer<'b, 'a> {
data: &'b VsanHostRunVmdkLoadTestRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for VsanHostRunVmdkLoadTestRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanHostRunVmdkLoadTestRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("runname"), &self.data.runname as &dyn miniserde::Serialize)),
2 => return Some((std::borrow::Cow::Borrowed("durationSec"), &self.data.duration_sec as &dyn miniserde::Serialize)),
3 => return Some((std::borrow::Cow::Borrowed("specs"), &self.data.specs as &dyn miniserde::Serialize)),
_ => return None,
}
}
}
struct VsanStartProactiveRebalanceRequestType {
time_span: Option<i32>,
variance_threshold: Option<f32>,
time_threshold: Option<i32>,
rate_threshold: Option<i32>,
}
impl miniserde::Serialize for VsanStartProactiveRebalanceRequestType {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanStartProactiveRebalanceRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanStartProactiveRebalanceRequestTypeSer<'b> {
data: &'b VsanStartProactiveRebalanceRequestType,
seq: usize,
}
impl<'b> miniserde::ser::Map for VsanStartProactiveRebalanceRequestTypeSer<'b> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanStartProactiveRebalanceRequestType")),
1 => {
let Some(ref val) = self.data.time_span else { continue; };
return Some((std::borrow::Cow::Borrowed("timeSpan"), val as &dyn miniserde::Serialize));
}
2 => {
let Some(ref val) = self.data.variance_threshold else { continue; };
return Some((std::borrow::Cow::Borrowed("varianceThreshold"), val as &dyn miniserde::Serialize));
}
3 => {
let Some(ref val) = self.data.time_threshold else { continue; };
return Some((std::borrow::Cow::Borrowed("timeThreshold"), val as &dyn miniserde::Serialize));
}
4 => {
let Some(ref val) = self.data.rate_threshold else { continue; };
return Some((std::borrow::Cow::Borrowed("rateThreshold"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct VsanWaitForVsanHealthGenerationIdChangeRequestType {
timeout: i32,
}
impl miniserde::Serialize for VsanWaitForVsanHealthGenerationIdChangeRequestType {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(VsanWaitForVsanHealthGenerationIdChangeRequestTypeSer { data: self, seq: 0 }))
}
}
struct VsanWaitForVsanHealthGenerationIdChangeRequestTypeSer<'b> {
data: &'b VsanWaitForVsanHealthGenerationIdChangeRequestType,
seq: usize,
}
impl<'b> miniserde::ser::Map for VsanWaitForVsanHealthGenerationIdChangeRequestTypeSer<'b> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanWaitForVsanHealthGenerationIdChangeRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("timeout"), &self.data.timeout as &dyn miniserde::Serialize)),
_ => return None,
}
}
}