Skip to main content

Agent

Struct Agent 

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

Deprecated as of vSphere 9.0. Please refer to vLCM APIs.

An Agent is the vSphere ESX Agent Manager managed object responsible for deploying an Agency on a single host.

The Agent maintains the state of the current deployment in its runtime information (see Agent.runtime).

An Agent has the same goalState and status properties as an Agency, that are used in the same way:

  • goalState. The goal state describes the overall goal of this Agent. It can be enabled or uninstalled:
    • enabled. The Agent deploys its VIB, its agent virtual machine, and powers on the agent virtual machine. The Agent monitors in vCenter the status of the installation of the VIB (in case it is uninstalled outside of vSphere ESX Agent Manager) and of the agent virtual machine (in case an operation is performed on it outside of vSphere ESX Agent Manager).
    • uninstalled. The Agent uninstalls any installed VIB and power off and delete the deployed agent virtual machine.
  • status. The status of the Agent regarding the given goal state. Status can be either red, yellow or green:
    • red. An issue is preventing the Agent from reaching its desired goal state. See EamObjectRuntimeInfo.issue in Agent.runtime for the types of issues that can block this Agent.
    • yellow. The Agent is actively working to reach the desired goal state. For the enabled goal state, this means that this Agent is installing its VIB, deploying the agent virtual machine, and powering it on.
    • green. The Agent has reached the desired goal state. The Agent is no longer actively scheduling new tasks but is monitoring vCenter for changes that might conflict with this Agent’s goal state.

Implementations§

Source§

impl Agent

Source

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

Source

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

Mark this agent’s VM as available.

Used when the agency this agent belongs to has AgencyConfigInfo.manuallyMarkAgentVmAvailableAfterProvisioning or AgencyConfigInfo.manuallyMarkAgentVmAvailableAfterPowerOn set to true and AgentRuntimeInfo.vmHook is present. See AgentRuntimeInfo.vmHook

Source

pub async fn agent_query_config(&self) -> Result<AgentConfigInfo>

Deprecated use Agent.config instead.

The configuration of this Agent.

Source

pub async fn query_issue( &self, issue_key: Option<&[i32]>, ) -> Result<Option<Vec<Box<dyn IssueTrait>>>>

Current issues that have been detected for this entity.

Each issue can be remediated by invoking EamObject.Resolve or EamObject.ResolveAll.

Requires view privileges.

§Parameters:
§issue_key

An optional array of issue keys. If not set, all issues for this entity are returned.

§Returns:

A possibly empty array of issues that match the input issueKey array. Note that the returned array can be smaller than issueKey if one or more issue keys refers to issues that this entity does not have.

Source

pub async fn agent_query_runtime(&self) -> Result<AgentRuntimeInfo>

Deprecated use Agent.runtime instead.

Runtime information for the agent.

This includes important information about the current deployment of the agent’s VIB, virtual machine, and host.

Requires view privileges.

§Returns:

The Agent’s runtime information.

Source

pub async fn resolve(&self, issue_key: &[i32]) -> Result<Option<Vec<i32>>>

Resolves the issues specified in the input.

If an issue is remediable, ESX Agent Manager tries to resolve the misconfiguration that caused the issue. If it is not remediable, the offending issue is removed and ESX Agent Manager assumes that the issue has been resolved.

Requires modify privileges.

See also Issue.

§Parameters:
§issue_key

A non-empty array of issue keys.

§Returns:

A possibly empty array of issue keys for the issues that were not found on the entity. This can happen if resolve is called with issue keys that were resolved just prior to calling resolve or if an issue is currenly not resolvable.

Source

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

Resolve all outstanding issues.

The method calls EamObject.Resolve with all issues the EsxAgentManager, Agency, or Agent have encountered. It is the equivalent of calling the following methods:

  • agent.resolve(getIssueKeys(agent.getRuntime().getIssue())); for Agent objects
  • agency.resolve(getIssueKeys(agency.getRuntime().getIssue())); for Agency objects
  • esxAgentManager.resolve(getIssueKeys(esxAgentManager.getIssue())); for the EsxAgentManager object.

Requires modify privileges.

See also Issue.

Source

pub async fn config(&self) -> Result<AgentConfigInfo>

The configuration of this Agent.

Source

pub async fn runtime(&self) -> Result<AgentRuntimeInfo>

Runtime information for this agent.

This includes important information about the current deployment of the agent’s VIB, virtual machine, and host.

Requires view privileges.

§Returns:

This Agent’s runtime information.

Trait Implementations§

Source§

impl Clone for Agent

Source§

fn clone(&self) -> Agent

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§

§

impl Freeze for Agent

§

impl !RefUnwindSafe for Agent

§

impl Send for Agent

§

impl Sync for Agent

§

impl Unpin for Agent

§

impl UnsafeUnpin for Agent

§

impl !UnwindSafe for Agent

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,