Skip to main content

HostActiveDirectoryAuthentication

Struct HostActiveDirectoryAuthentication 

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

The HostActiveDirectoryAuthentication managed object indicates domain membership status and provides methods for adding a host to and removing a host from a domain.

Implementations§

Source§

impl HostActiveDirectoryAuthentication

Source

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

Source

pub async fn disable_smart_card_authentication(&self) -> Result<()>

Deprecated as of vSphere API 8.0U3, and there is no replacement for it.

Disables console authentication using a local smart card and reader.

Required privileges: Host.Config.AuthenticationStore

§Errors:

ActiveDirectoryFault: if the active directory client could not be reconfigured.

HostConfigFault: if the host configuration prevents smart card authentication from being disabled.

Source

pub async fn enable_smart_card_authentication(&self) -> Result<()>

Deprecated as of vSphere API 8.0U3, and there is no replacement for it.

Enables console authentication using a local smart card and reader.

To take effect this feature requires an active domain membership to a domain with users configured to authenticate using smart cards.

Required privileges: Host.Config.AuthenticationStore

§Errors:

ActiveDirectoryFault: if the active directory client could not be reconfigured.

HostConfigFault: if the host configuration prevents smart card authentication from being enabled.

Source

pub async fn import_certificate_for_cam_task( &self, cert_path: &str, cam_server: &str, ) -> Result<ManagedObjectReference>

Import the CAM server’s certificate to the local store of vmwauth.

The certificate should have already been uploaded to ESXi file system.

Required privileges: Host.Config.AuthenticationStore

§Parameters:
§cert_path

full path of the certificate on ESXi

§cam_server

IP of server providing the CAM service.

§Returns:

Refers instance of Task.

§Errors:

FileNotFound: if the certificate file does not exist

InvalidCAMServer: if camServer is not a valid IP address

ActiveDirectoryFault: for any problem that is not handled with a more specific fault.

Source

pub async fn install_smart_card_trust_anchor(&self, cert: &str) -> Result<()>

Deprecated as of vSphere API 8.0U3, and there is no replacement for it.

Install a trust anchor certificate for smart card authentication.

Required privileges: Host.Config.AuthenticationStore

§Parameters:
§cert

SSL certificate in PEM format

§Errors:

HostConfigFault: if the host configuration prevents the certificate from being installed.

Source

pub async fn join_domain_task( &self, domain_name: &str, user_name: &str, password: &str, ) -> Result<ManagedObjectReference>

Adds the host to an Active Directory domain.

If the HostAuthenticationStoreInfo.HostAuthenticationStoreInfo.enabled property is True (accessed through the info property), the host has joined a domain. The vSphere API will throw the InvalidState fault if you try to add a host to a domain when the host has already joined a domain.

Required privileges: Host.Config.AuthenticationStore

§Parameters:
§domain_name

Name of the domain to be joined.

§user_name

Name for an Active Directory account that has the authority to add hosts to the domain.

§password

Password for the userName account.

§Returns:

Refers instance of Task.

§Errors:

InvalidState: if the host has already joined a domain.

BlockedByFirewall: if ports needed by the join operation are blocked by the firewall.

HostConfigFault: if the host configuration prevents the join operation from succeeding.

InvalidLogin: if userName and password are not valid user credentials.

DomainNotFound: if the domain controller for domainName cannot be reached.

NoPermissionOnAD: if userName has no right to add hosts to the domain.

InvalidHostName: if the domain part of the host’s FQDN doesn’t match the domain being joined.

ClockSkew: if the clocks of the host and the domain controller differ by more than the allowed amount of time.

ActiveDirectoryFault: for any problem that is not handled with a more specific fault.

TaskInProgress: if the HostActiveDirectoryAuthentication object is busy.

Source

pub async fn join_domain_with_cam_task( &self, domain_name: &str, cam_server: &str, ) -> Result<ManagedObjectReference>

Adds the host to an Active Directory domain through CAM service.

If the HostAuthenticationStoreInfo.HostAuthenticationStoreInfo.enabled property is True (accessed through the info property), the host has joined a domain. The vSphere API will throw the InvalidState fault if you try to add a host to a domain when the host has already joined a domain.

Required privileges: Host.Config.AuthenticationStore

§Parameters:
§domain_name

Name of the domain to be joined.

§cam_server

Name of server providing the CAM service.

§Returns:

Refers instance of Task.

§Errors:

InvalidState: if the host has already joined a domain.

BlockedByFirewall: if ports needed by the join operation are blocked by the firewall.

HostConfigFault: if the host configuration prevents the join operation from succeeding.

DomainNotFound: if the domain controller for domainName cannot be reached.

InvalidHostName: if the domain part of the host’s FQDN doesn’t match the domain being joined.

ClockSkew: if the clocks of the host and the domain controller differ by more than the allowed amount of time.

InvalidCAMServer: if camServer is not a valid IP address, or if camServer is not accessible.

InvalidCAMCertificate: if the certificate of the given CAM server cannot be verified.

CAMServerRefusedConnection: if the specified CAM server is not reachable, or if the server denied access.

ActiveDirectoryFault: for any problem that is not handled with a more specific fault.

TaskInProgress: if the HostActiveDirectoryAuthentication object is busy.

Source

pub async fn leave_current_domain_task( &self, force: bool, ) -> Result<ManagedObjectReference>

Removes the host from the Active Directory domain to which it belongs.

Required privileges: Host.Config.AuthenticationStore

§Parameters:
§force

If True, any existing permissions on managed entities for Active Directory users will be deleted. If False and such permissions exist, the operation will fail.

§Returns:

Refers instance of Task.

§Errors:

InvalidState: if the host is not in a domain or there are active permissions for Active Directory users.

NonADUserRequired: only non Active Directory users can initiate the leave domain operation.

AuthMinimumAdminPermission: if this change would leave the system with no Administrator permission on the root node.

ActiveDirectoryFault: for any problem that is not handled with a specific fault.

TaskInProgress: if the ActiveDirectoryAuthentication object is busy.

Source

pub async fn list_smart_card_trust_anchors(&self) -> Result<Option<Vec<String>>>

Deprecated as of vSphere API 8.0U3, and there is no replacement for it.

Lists installed trust anchor certificates for smart card authentication.

Required privileges: Host.Config.AuthenticationStore

§Returns:

SSL certificates of trusted CAs in PEM format.

§Errors:

HostConfigFault: if the host configuration prevents the certificates from being listed.

Source

pub async fn remove_smart_card_trust_anchor( &self, issuer: &str, serial: &str, ) -> Result<()>

Deprecated please remove by fingerprint/digest instead.

Remove a smart card trust anchor certificate from the system.

Required privileges: Host.Config.AuthenticationStore

§Parameters:
§issuer

Certificate issuer

§serial

Certificate serial number (decimal integer)

§Errors:

HostConfigFault: if the host configuration prevents the certificate from being removed.

Source

pub async fn remove_smart_card_trust_anchor_by_fingerprint( &self, fingerprint: &str, digest: &str, ) -> Result<()>

Deprecated as of vSphere API 8.0U3, and there is no replacement for it.

Remove a smart card trust anchor certificate from the system by fingerprint.

Required privileges: Host.Config.AuthenticationStore

§Parameters:
§fingerprint

Certificate fingerprint

§digest

Digest function used to compute fingerprint. One of HostActiveDirectoryAuthenticationCertificateDigest_enum.

§Errors:

HostConfigFault: if the host configuration prevents the certificate from being removed.

Source

pub async fn remove_smart_card_trust_anchor_certificate( &self, certificate: &str, ) -> Result<()>

Remove a smart card trust anchor certificate from the system

Since: vSphere API Release 9.0.0.0

Required privileges: Host.Config.AuthenticationStore

§Parameters:
§certificate

PEM encoded certificate to remove

§Errors:

HostConfigFault: if the host configuration prevents the certificate from being removed.

Source

pub async fn replace_smart_card_trust_anchors( &self, certs: Option<&[String]>, ) -> Result<()>

Deprecated as of vSphere API 8.0U3, and there is no replacement for it.

Replace the trust anchor certificates for smart card authentication.

Required privileges: Host.Config.AuthenticationStore

§Parameters:
§certs

List of trusted CA certificates in PEM format. If empty then all existing trust anchors are removed.

Source

pub async fn info(&self) -> Result<Box<dyn HostAuthenticationStoreInfoTrait>>

Information about the authentication store.

Trait Implementations§

Source§

impl Clone for HostActiveDirectoryAuthentication

Source§

fn clone(&self) -> HostActiveDirectoryAuthentication

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,