Skip to main content

DistributedVirtualSwitchManager

Struct DistributedVirtualSwitchManager 

Source
pub struct DistributedVirtualSwitchManager { /* private fields */ }
Expand description

The DistributedVirtualSwitchManager provides methods that support the following operations:

  • Backup and restore operations for VmwareDistributedVirtualSwitch and associated DistributedVirtualPortgroup managed objects.
  • Query operations for information about portgroups and distributed virtual switches.
  • Distributed virtual switch configuration update operations.

Implementations§

Source§

impl DistributedVirtualSwitchManager

Source

pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self

Source

pub async fn query_dvs_check_compatibility( &self, host_container: &DistributedVirtualSwitchManagerHostContainer, dvs_product_spec: Option<&DistributedVirtualSwitchManagerDvsProductSpec>, host_filter_spec: Option<&[Box<dyn DistributedVirtualSwitchManagerHostDvsFilterSpecTrait>]>, ) -> Result<Option<Vec<DistributedVirtualSwitchManagerCompatibilityResult>>>

This operation returns a list of compatibility results.

Each compatibility result is an object that has a host property and optionally a fault which would be populated only if that host is not compatible with a given dvsProductSpec. All filters in hostFilerSpecs are ANDed to derive the intersection of hosts against which compatibility is checked. If caller did not have view privileges on the host entity in an element of the CompatibilityResult array, then that entire element would be removed from the CompatibilityResult array. Typical uses:

  • For the createDVS situation, hostFilterSpec is of type HostDvsFilterSpec and DvsProductSpec will have newSwitchProductSpec set.
  • For the Add-Host-To-DVS situation, you can use either HostDvsFilterSpec or HostDvsMembershipFilter with inclusive being false, and pass the DVS in DvsProductSpec.
  • For the Upgrade-DVS situation, you can use either HostDvsFilterSpec or HostDvsMembershipFilter with inclusive being true, and pass the new desired ProductSpec for DVS in newSwitchProductSpec.

Required privileges: System.View

§Parameters:
§host_container

The container of hosts on which we check the compatibility. This container can be a datacenter, folder, or computeResource. We can also include all the hosts in the hierarchy with container as root of the tree.

§dvs_product_spec

The productSpec of a DistributedVirtualSwitch. If not set, it is assumed to be the default one used for DistributedVirtualSwitch creation for current version.

§host_filter_spec

The hosts against which to check compatibility. This is a filterSpec and users can use this to specify all hosts in a container (datacenter, folder, or computeResource), an array of hosts, or hosts that might or might not be a DVS member.

Source

pub async fn dvs_manager_export_entity_task( &self, selection_set: &[Box<dyn SelectionSetTrait>], ) -> Result<ManagedObjectReference>

Export the configuration for entities specified in the selectionSet parameter.

You can use this method only for a VmwareDistributedVirtualSwitch and its associated DistributedVirtualPortgroup objects.

Use the DistributedVirtualSwitchManager.DVSManagerImportEntity_Task method to restore the entity to the state represented by the exported configuration. You can also use the exported configuration to create a new switch or portgroup.

§Parameters:
§selection_set

The selection criteria for a set of entities to export the configuration.

§Returns:

This method returns a Task object with which to monitor the operation. After successful completion, the Task.Task.info.TaskInfo.result property contains the EntityBackupConfig object.

Refers instance of Task.

§Errors:

NotFound: If entity in selectionSet doesn’t exist.

BackupBlobWriteFailure: if failed to create backup config blob.

Source

pub async fn dvs_manager_import_entity_task( &self, entity_backup: &[EntityBackupConfig], import_type: &str, ) -> Result<ManagedObjectReference>

Import the configuration of entities specified in EntityBackupConfig.

You can restore the existing configuration to the state represented by the backup configuration. You can also use the backup configuration to create a new switch or portgroup. See EntityImportType_enum.

§Parameters:
§entity_backup

Configuration of one or more entities to be imported. The entity backup configuration is returned by the DistributedVirtualSwitchManager.DVSManagerExportEntity_Task method.

§import_type

Specifies whether to create a new configuration or restore a previous configuration. See EntityImportType_enum for valid values.

§Returns:

This method returns a Task object with which to monitor the operation.

Refers instance of Task.

§Errors:

NotFound: If entity in EntityBackupConfig.key doesn’t exist.

DvsFault: if operation fails on any host.

Source

pub async fn dvs_manager_lookup_dv_port_group( &self, switch_uuid: &str, portgroup_key: &str, ) -> Result<Option<ManagedObjectReference>>

Returns the portgroup identified by the key within the specified VDS identified by its UUID.

Required privileges: System.View

§Parameters:
§switch_uuid

The UUID of the DistributedVirtualSwitch.

§portgroup_key

The key that identifies a DistributedVirtualPortgroup.

§Returns:

Refers instance of DistributedVirtualPortgroup.

§Errors:

NotFound: If the portgroup for the specified inputs was not found.

NotSupported: If the operation is not supported.

Source

pub async fn query_compatible_host_for_existing_dvs( &self, container: &ManagedObjectReference, recursive: bool, dvs: &ManagedObjectReference, ) -> Result<Option<Vec<ManagedObjectReference>>>

This operation returns a list of hosts that are compatible with the given DistributedVirtualSwitch product specification.

Required privileges: System.View

§Parameters:
§container

Where to look for hosts. Supported types of objects for this parameter are Datacenter, ComputeResource and Folder.

Refers instance of ManagedEntity.

§recursive

Whether to search for hosts in the subfolders, if applicable. In the case when container is a Datacenter, the recursive flag is applied to its HostFolder.

§dvs

Search the host based on the specification published in the DVSCapability.compatibleHostComponentProductInfo of a DistributedVirtualSwitch. If not set, it is assumed to be the specification that a DistributedVirtualSwitch would have if it is created with the default DistributedVirtualSwitchProductSpec.

Refers instance of DistributedVirtualSwitch.

§Returns:

Refers instances of HostSystem.

Source

pub async fn query_compatible_host_for_new_dvs( &self, container: &ManagedObjectReference, recursive: bool, switch_product_spec: Option<&DistributedVirtualSwitchProductSpec>, ) -> Result<Option<Vec<ManagedObjectReference>>>

This operation returns a list of hosts that are compatible with the given DistributedVirtualSwitch product specification.

Required privileges: System.View

§Parameters:
§container

Where to look for hosts. Supported types of objects for this parameter are Datacenter, ComputeResource and Folder.

Refers instance of ManagedEntity.

§recursive

Whether to search for hosts in the subfolders, if applicable. In the case when container is a Datacenter, the recursive flag is applied to its HostFolder.

§switch_product_spec

The productSpec of a DistributedVirtualSwitch. If not set, it is assumed to be the default one used for DistributedVirtualSwitch creation.

§Returns:

Refers instances of HostSystem.

Source

pub async fn query_dvs_compatible_host_spec( &self, switch_product_spec: Option<&DistributedVirtualSwitchProductSpec>, ) -> Result<Option<Vec<DistributedVirtualSwitchHostProductSpec>>>

This operation returns a list of host product specifications that are compatible with the given DistributedVirtualSwitch product specification.

Required privileges: System.View

§Parameters:
§switch_product_spec

The productSpec of a DistributedVirtualSwitch. If not set, it is assumed to be the default one used for DistributedVirtualSwitch creation.

Source

pub async fn query_compatible_vmnics_from_hosts( &self, hosts: Option<&[ManagedObjectReference]>, dvs: &ManagedObjectReference, ) -> Result<Option<Vec<DvsManagerPhysicalNicsList>>>

This operation returns a list of vmnics which are compatible with the given DistributedVirtualSwitch product specification.

Since: vSphere API Release 8.0.0.1

Required privileges: System.View

§Parameters:
§hosts

The array of hosts on which the query is to be made to fetch valid PhysicalNics on each host.

Refers instances of HostSystem.

§dvs

The distributed virtual switch on which the query is to be made.

Refers instance of DistributedVirtualSwitch.

Source

pub async fn query_dvs_config_target( &self, host: Option<&ManagedObjectReference>, dvs: Option<&ManagedObjectReference>, ) -> Result<DvsManagerDvsConfigTarget>

This operation returns the DistributedVirtualSwitch or DistributedVirtualPortgroup configuration target on a host.

Required privileges: System.View

§Parameters:
§host

The host on which the query is to be made. If called directly on the host this parameter need not be specified.

Refers instance of HostSystem.

§dvs

The distributed virtual switch on which the query is to be made. If unspecified the config target will encompass all the distributed virtual switches available on the host.

Refers instance of DistributedVirtualSwitch.

Source

pub async fn query_dvs_feature_capability( &self, switch_product_spec: Option<&DistributedVirtualSwitchProductSpec>, ) -> Result<Option<Box<dyn DvsFeatureCapabilityTrait>>>

This operation indicates which version-specific DVS features are available for the given DistributedVirtualSwitch product specification.

Required privileges: System.View

§Parameters:
§switch_product_spec

The productSpec of a DistributedVirtualSwitch. If not set, it is assumed to be the default one used for DistributedVirtualSwitch creation.

Source

pub async fn query_supported_network_offload_spec( &self, switch_product_spec: &DistributedVirtualSwitchProductSpec, ) -> Result<Option<Vec<DistributedVirtualSwitchNetworkOffloadSpec>>>

This operation returns a list of network offload specifications that are compatible with the given DistributedVirtualSwitch product specification.

Since: vSphere API Release 8.0.0.1

Required privileges: System.View

§Parameters:
§switch_product_spec

The productSpec of a DistributedVirtualSwitch.

Source

pub async fn query_available_dvs_spec( &self, recommended: Option<bool>, ) -> Result<Option<Vec<DistributedVirtualSwitchProductSpec>>>

This operation returns a list of switch product specifications that are supported by the vCenter Server.

Required privileges: System.View

§Parameters:

If set to true, return only the recommended versions. If set to false, return only the not recommended versions. If unset, return all supported versions.

Source

pub async fn query_dvs_by_uuid( &self, uuid: &str, ) -> Result<Option<ManagedObjectReference>>

This operation returns a DistributedVirtualSwitch given a UUID.

Required privileges: System.View

§Parameters:
§uuid
§Returns:

Refers instance of DistributedVirtualSwitch.

§Errors:

NotFound: If a switch with the UUID doesn’t exist.

Source

pub async fn rectify_dvs_on_host_task( &self, hosts: &[ManagedObjectReference], ) -> Result<ManagedObjectReference>

Update the Distributed Switch configuration on the hosts to bring them in sync with the current configuration in vCenter Server.

Required privileges: System.Read

§Parameters:
§hosts

The hosts to be rectified.

Refers instances of HostSystem.

§Returns:

Returns a Task object with which to monitor the operation.

Refers instance of Task.

§Errors:

DvsFault: if operation fails on any host or if there are other update failures.

Trait Implementations§

Source§

impl Clone for DistributedVirtualSwitchManager

Source§

fn clone(&self) -> DistributedVirtualSwitchManager

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: 'static,

Source§

fn as_any_ref<'a>(&'a self) -> &'a (dyn Any + 'static)

Cast a reference to Any trait.

Source§

fn as_any_box(self: Box<T>) -> Box<dyn Any>

Cast to a boxed reference to Any trait.

Source§

fn type_id(&self) -> TypeId

Get the underlying type identifier.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<To, T> CastInto<To> for T
where To: CastFrom<T> + ?Sized, T: 'static + ?Sized,

Source§

fn into_ref<'a>(&'a self) -> Option<&'a To>

Casts a reference to a trait object. If the cast fails, std::option::Option::None is returned.
Source§

fn into_box(self: Box<T>) -> Result<Box<To>, Box<dyn Any>>

Casts a boxed trait object to another trait object. If the cast fails, the original boxed trait object is returned in std::result::Result::Err.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,