Skip to main content

HostPatchManager

Struct HostPatchManager 

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

This managed object is the interface for scanning and patching an ESX server.

VMware publishes updates through its external website. A patch update is synonymous with a bulletin. An update may contain many individual patch binaries, but its installation and uninstallation are atomic.

Implementations§

Source§

impl HostPatchManager

Source

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

Source

pub async fn check_host_patch_task( &self, meta_urls: Option<&[String]>, bundle_urls: Option<&[String]>, spec: Option<&HostPatchManagerPatchManagerOperationSpec>, ) -> Result<ManagedObjectReference>

Deprecated as of vSphere 8.0u3, and there is no replacement available.

Check the list of metadata and returns the dependency, obsolete and conflict information The operation is cancelable through the returned Task object.

No integrity checks are performed on the metadata.

Required privileges: System.Read

§Parameters:
§meta_urls

a list of urls pointing to metadata.zip.

§bundle_urls

a list of urls pointing to an “offline” bundle. It is not supported in 5.0 or later.

§spec
§Returns:

This method returns a Task object with which to monitor the operation. The info.result property in the Task contains the HostPatchManagerStatus upon success.

Refers instance of Task.

§Errors:

RequestCanceled: if the operation is canceled.

InvalidState: if the feature cannot be supported on the platform, potentially because the hardware configuration does not support it.

TaskInProgress: if there is already a patch installation in progress.

PlatformConfigFault: if any error occurs during the operation. More detailed information will be returned within the payload of the exception as xml string.

Source

pub async fn install_host_patch_task( &self, repository: &HostPatchManagerLocator, update_id: &str, force: Option<bool>, ) -> Result<ManagedObjectReference>

Deprecated method is deprecated, use HostPatchManager.InstallHostPatchV2_Task instead.

Patch the host.

The operation is not cancelable. If the patch installation failed, an atomic rollback of the installation will be attempted. Manual rollback is required if the atomic rollback failed, see PatchInstallFailed for details.

Required privileges: Host.Config.Patch

§Parameters:
§repository

Location of the repository that contains the bulletin depot. The depot must be organized as a flat collection of bulletins with each one being a folder named after the bulletin ID. Each folder must contain both update metadata and required binaries.

§update_id

The update to be installed on the host.

§force

Specify whether to force reinstall an update. By default, installing an already-installed update would fail with the PatchAlreadyInstalled fault. If force is set to true, the update will be forcefully reinstalled, thus overwriting the already installed update.

§Returns:

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

Refers instance of Task.

§Errors:

PatchMetadataInvalid: if the required metadata is invalid - for example, it is not found in the repository, is corrupted and so on. Typically a more specific subclass of PatchMetadataInvalid is thrown.

PatchBinariesNotFound: if required update related binaries were not available.

PatchNotApplicable: if the patch is not applicable. Typically a more specific subclass of PatchNotApplicable is thrown to indicate a specific problem - for example, PatchSuperseded if the patch is superseded, MissingDependency if required patch or libraries are not installed, AlreadyInstalled if the patch is already installed.

NoDiskSpace: if the update can not be installed because there is insufficient disk space for the installation, including temporary space used for rollback.

PatchInstallFailed: if the installation failed, PlatformConfigFault.text has details of the failure. Automatic rollback might have succeeded or failed.

RebootRequired: if the update cannot be installed without restarting the host. This might occur on account of a prior update installation which needed to be installed separately from other updates.

InvalidState: if the host is not in maintenance mode but the patch install requires all virtual machines to be powered off.

TaskInProgress: if there is already a patch installation in progress.

Source

pub async fn install_host_patch_v_2_task( &self, meta_urls: Option<&[String]>, bundle_urls: Option<&[String]>, vib_urls: Option<&[String]>, spec: Option<&HostPatchManagerPatchManagerOperationSpec>, ) -> Result<ManagedObjectReference>

Deprecated as of vSphere 8.0u3, and there is no replacement available.

Patch the host.

The operation is not cancelable. If the patch installation failed, an atomic rollback of the installation will be attempted. Manual rollback is required if the atomic rollback failed, see PatchInstallFailed for details.

Required privileges: Host.Config.Patch

§Parameters:
§meta_urls

A list of urls pointing to metadata.zip.

§bundle_urls

a list of urls pointing to an “offline” bundle. It is not supported in 5.0 or later.

§vib_urls

The urls of update binary files to be installed.

§spec
§Returns:

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

Refers instance of Task.

§Errors:

RequestCanceled: if the operation is canceled.

InvalidState: if the feature cannot be supported on the platform, potentially because the hardware configuration does not support it.

TaskInProgress: if there is already a patch installation in progress.

PlatformConfigFault: if any error occurs during the operation. More detailed information will be returned within the payload of the exception as xml string.

Source

pub async fn query_host_patch_task( &self, spec: Option<&HostPatchManagerPatchManagerOperationSpec>, ) -> Result<ManagedObjectReference>

Deprecated as of vSphere 8.0u3, and there is no replacement available.

Query the host for installed bulletins.

Required privileges: System.Read

§Parameters:
§spec
§Returns:

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

Refers instance of Task.

§Errors:

RequestCanceled: if the operation is canceled.

InvalidState: if the bulletin ID did not exist.

TaskInProgress: if there is already a patch installation in progress.

PlatformConfigFault: if any error occurs during the operation. More detailed information will be returned within the payload of the exception as xml string.

Source

pub async fn scan_host_patch_task( &self, repository: &HostPatchManagerLocator, update_id: Option<&[String]>, ) -> Result<ManagedObjectReference>

Deprecated as of VI API 4.0, use HostPatchManager.ScanHostPatchV2_Task.

Scan the host for the patch status.

The operation is cancelable through the returned Task object. Integrity checks are performed on the metadata only during the scan operation.

Required privileges: System.Read

§Parameters:
§repository

Location of the repository that contains the bulletin depot. The depot must be organized as a flat collection of bulletins with each one being a folder named after the bulletin ID. Each folder must contain the full update metadata.

§update_id

The updates to scan. Wildcards can be used to specify the update IDs. The wildcards will be expanded to include all updates whose IDs match the specified wildcard and whose metadata is available in the repository. Specifying no update is equivalent to a wildcard “*”. In this case all updates available in the repository will be scanned.

§Returns:

This method returns a Task object with which to monitor the operation. The info.result property in the Task contains the HostPatchManagerStatus upon success.

Refers instance of Task.

§Errors:

RequestCanceled: if the operation is canceled.

PatchMetadataInvalid: if query required metadata is invalid - for example, it is not found in the repository, is corrupted and so on. Typically a more specific subclass of PatchMetadataInvalid is thrown.

PlatformConfigFault: if there is any error in the repository access, metadata download, repository level integrity check, or reading the metadata. See PlatformConfigFault.text for specific details.

Source

pub async fn scan_host_patch_v_2_task( &self, meta_urls: Option<&[String]>, bundle_urls: Option<&[String]>, spec: Option<&HostPatchManagerPatchManagerOperationSpec>, ) -> Result<ManagedObjectReference>

Deprecated as of vSphere 8.0u3, and there is no replacement available.

Scan the host for the patch status.

The operation is cancelable through the returned Task object. Integrity checks are performed on the metadata only during the scan operation.

Required privileges: System.Read

§Parameters:
§meta_urls

a list of urls pointing to metadata.zip.

§bundle_urls

a list of urls pointing to an “offline” bundle. It is not supported in 5.0 or later.

§spec
§Returns:

This method returns a Task object with which to monitor the operation. The info.result property in the Task contains the HostPatchManagerStatus upon success.

Refers instance of Task.

§Errors:

RequestCanceled: if the operation is canceled.

InvalidState: if the feature cannot be supported on the platform, potentially because the hardware configuration does not support it.

TaskInProgress: if there is already a patch installation in progress.

PlatformConfigFault: if there is any error in the repository access, metadata download, repository level integrity check, or reading the metadata. See PlatformConfigFault.text for specific details.

Source

pub async fn stage_host_patch_task( &self, meta_urls: Option<&[String]>, bundle_urls: Option<&[String]>, vib_urls: Option<&[String]>, spec: Option<&HostPatchManagerPatchManagerOperationSpec>, ) -> Result<ManagedObjectReference>

Deprecated as of vSphere 8.0u3, and there is no replacement available.

Stage the vib files to esx local location and possibly do some run time check.

Required privileges: Host.Config.Patch

§Parameters:
§meta_urls

A list of urls pointing to metadata.zip.

§bundle_urls

a list of urls pointing to an “offline” bundle. It is not supported in 5.0 or later.

§vib_urls

The urls of update binary files to be staged.

§spec
§Returns:

This method returns a Task object with which to monitor the operation. The info.result property in the Task contains the HostPatchManagerStatus upon success.

Refers instance of Task.

§Errors:

RequestCanceled: if the operation is canceled.

InvalidState: if the feature cannot be supported on the platform, potentially because the hardware configuration does not support it.

TaskInProgress: if there is already a patch installation in progress.

PlatformConfigFault: if any error occurs during the operation. More detailed information will be returned within the payload of the exception as xml string.

Source

pub async fn uninstall_host_patch_task( &self, bulletin_ids: Option<&[String]>, spec: Option<&HostPatchManagerPatchManagerOperationSpec>, ) -> Result<ManagedObjectReference>

Deprecated as of vSphere 8.0u3, and there is no replacement available.

Uninstall patch from the host.

The operation is not cancelable.

Required privileges: Host.Config.Patch

§Parameters:
§bulletin_ids

A list of bulletin IDs to be removed.

§spec
§Returns:

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

Refers instance of Task.

§Errors:

InvalidState: if the feature cannot be supported on the platform, potentially because the hardware configuration does not support it.

TaskInProgress: if there is already a patch installation in progress.

PlatformConfigFault: if any error occurs during the operation. More detailed information will be returned within the payload of the exception as xml string.

Trait Implementations§

Source§

impl Clone for HostPatchManager

Source§

fn clone(&self) -> HostPatchManager

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,