Skip to main content

Fleet

Struct Fleet 

Source
pub struct Fleet<'a>(/* private fields */);
Expand description

The Fleet API. Endpoints are grouped by resource in private modules and re-exported here.

Implementations§

Source§

impl<'a> Fleet<'a>

Source

pub fn agent_action_status(&self) -> AgentActionStatuses<'a>

Recent agent actions with completion and failure counts, newest first. Pages start at zero. There is no filter by action ID, and a short or empty page does not prove that older actions are absent.

Source

pub fn cancel_agent_action(&self, action_id: &str) -> CancelAgentAction<'a>

Kibana supports cancellation of upgrade and unenrollment actions only.

Source

pub fn list_agent_uploads(&self, agent_id: &str) -> ListAgentUploads<'a>

Source

pub fn download_agent_file( &self, file_id: &str, file_name: &str, ) -> DownloadAgentFile<'a>

Downloads an upload after it reports READY. Diagnostic archives can contain sensitive configuration.

Source§

impl<'a> Fleet<'a>

Source

pub fn find_agent_policies(&self) -> FindAgentPolicies<'a>

Requests full policies, which populate AgentPolicy::package_policies. Agent counts are opt-in through FindAgentPolicies::with_agent_count.

Source

pub fn get_agent_policy(&self, id: &str) -> GetAgentPolicy<'a>

Source

pub fn create_agent_policy<B: Serialize + ?Sized>( &self, policy: &B, ) -> CreateAgentPolicy<'a>

Creates a policy from a NewAgentPolicy or equivalent JSON.

Source

pub fn update_agent_policy<B: Serialize + ?Sized>( &self, id: &str, policy: &B, ) -> UpdateAgentPolicy<'a>

Updates submitted attributes and increments the policy’s revision. Name and namespace are required. Omitting inactivity_timeout resets it to the server’s default; prefer edit_agent_policy with a retrieved policy’s edit to retain it.

The body must be a JSON object. Its optional id must be a string matching the path argument; conflicts fail locally with Error::InvalidRequest. This generic body does not bind an edit’s captured ID or project writable fields; use edit_agent_policy for that.

Source

pub fn edit_agent_policy(&self, edit: &AgentPolicyEdit) -> UpdateAgentPolicy<'a>

Applies changes bound to a retrieved policy’s ID, retaining its timeout. Optional settings are changed only when their setter was called.

Source

pub fn delete_agent_policy(&self, id: &str) -> DeleteAgentPolicy<'a>

Source

pub fn copy_agent_policy(&self, id: &str, name: &str) -> CopyAgentPolicy<'a>

Source

pub fn download_agent_policy(&self, id: &str) -> DownloadAgentPolicy<'a>

The agent configuration as YAML.

Source§

impl<'a> Fleet<'a>

Source

pub fn find_agents(&self) -> FindAgents<'a>

Source

pub fn get_agent(&self, id: &str) -> GetAgent<'a>

Source

pub fn agent_status(&self) -> AgentStatus<'a>

Agent counts by status.

Source

pub fn reassign_agent(&self, id: &str, policy_id: &str) -> ReassignAgent<'a>

Source

pub fn unenroll_agent(&self, id: &str) -> UnenrollAgent<'a>

Source

pub fn upgrade_agent(&self, id: &str, version: &str) -> UpgradeAgent<'a>

Schedules an upgrade; the acknowledgment is not proof of completion. Container agents cannot perform Fleet-managed binary upgrades.

Source

pub fn request_agent_diagnostics(&self, id: &str) -> RequestAgentDiagnostics<'a>

Correlate the returned action ID with list_agent_uploads or wait_for_upload.

Source

pub fn bulk_reassign_agents( &self, agents: AgentSelection, policy_id: &str, ) -> BulkReassignAgents<'a>

Source

pub fn bulk_unenroll_agents( &self, agents: AgentSelection, ) -> BulkUnenrollAgents<'a>

Source

pub fn bulk_update_agent_tags( &self, agents: AgentSelection, ) -> BulkUpdateAgentTags<'a>

Source

pub fn bulk_upgrade_agents( &self, agents: AgentSelection, version: &str, ) -> BulkUpgradeAgents<'a>

Source

pub fn bulk_request_agent_diagnostics( &self, agents: AgentSelection, ) -> BulkRequestAgentDiagnostics<'a>

Source§

impl<'a> Fleet<'a>

Source

pub fn find_enrollment_keys(&self) -> FindEnrollmentKeys<'a>

Source

pub fn get_enrollment_key(&self, id: &str) -> GetEnrollmentKey<'a>

Source

pub fn create_enrollment_key(&self, policy_id: &str) -> CreateEnrollmentKey<'a>

Source

pub fn revoke_enrollment_key(&self, id: &str) -> RevokeEnrollmentKey<'a>

Revokes future enrollment. Already enrolled agents keep their own credentials.

Source§

impl<'a> Fleet<'a>

Source

pub fn find_package_policies(&self) -> FindPackagePolicies<'a>

Source

pub fn get_package_policy(&self, id: &str) -> GetPackagePolicy<'a>

Source

pub fn create_package_policy<B: Serialize + ?Sized>( &self, policy: &B, ) -> CreatePackagePolicy<'a>

Creates a package policy from a NewPackagePolicy or equivalent JSON in the simplified format. The response is also simplified; fetch it with get_package_policy before editing it.

Source

pub fn update_package_policy<'p>( &self, update: impl Into<PackagePolicyUpdate<'p>>, ) -> UpdatePackagePolicy<'a>

Replaces a package policy, either with a PackagePolicyEdit of a retrieved policy, sent in the full format with its concurrency token, or with a simplified definition from NewPackagePolicy::replacing. Edits with simplified inputs or a missing/empty concurrency token fail locally with crate::Error::InvalidRequest.

Source

pub fn delete_package_policy(&self, id: &str) -> DeletePackagePolicy<'a>

Source§

impl<'a> Fleet<'a>

Source

pub fn list_packages(&self) -> ListPackages<'a>

Packages available from the configured registry, with install status.

Source

pub fn get_package(&self, name: &str, version: &str) -> GetPackage<'a>

Source

pub fn install_package(&self, name: &str, version: &str) -> InstallPackage<'a>

Installs package assets such as index templates and dashboards.

Source

pub fn uninstall_package( &self, name: &str, version: &str, ) -> UninstallPackage<'a>

Source§

impl Fleet<'_>

Source

pub async fn wait_for_action( &self, action_id: &str, options: PollOptions, ) -> Result<WaitOutcome<AgentActionStatus>>

Waits until an agent action finishes.

Kibana has no lookup by action ID, so each check searches progressively larger history windows, up to 10,000 action documents, within the deadline. Bulk actions can occupy multiple documents. An action that was seen and then can no longer be found, for example because newer actions pushed it out of that window, ends the wait as WaitOutcome::Vanished with its last state.

A finished action can contain failed agents. Unknown action statuses also end the wait for inspection; check the status, failure count and errors on the returned AgentActionStatus.

Source

pub async fn wait_for_upload( &self, agent_id: &str, action_id: &str, options: PollOptions, ) -> Result<WaitOutcome<AgentUpload>>

Waits until the upload created by a diagnostics action finishes. Download it with download_agent_file once it is Ready. An upload that was seen and then disappears ends the wait as WaitOutcome::Vanished.

Source

pub async fn wait_for_agent_policy( &self, agent_id: &str, policy_id: &str, revision: u64, options: PollOptions, ) -> Result<WaitOutcome<Agent>>

Waits until the agent is online and reports policy_id at revision or later. An agent that has not reported a revision has not acknowledged it.

Source§

impl<'a> Fleet<'a>

Source

pub fn setup(&self) -> Setup<'a>

Initializes Fleet in the current space. Safe to repeat.

Source

pub fn list_outputs(&self) -> ListOutputs<'a>

Trait Implementations§

Source§

impl<'a> Clone for Fleet<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for Fleet<'a>

Source§

impl<'a> Debug for Fleet<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Fleet<'a>

§

impl<'a> !UnwindSafe for Fleet<'a>

§

impl<'a> Freeze for Fleet<'a>

§

impl<'a> Send for Fleet<'a>

§

impl<'a> Sync for Fleet<'a>

§

impl<'a> Unpin for Fleet<'a>

§

impl<'a> UnsafeUnpin for Fleet<'a>

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> 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<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: Sized + 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: Sized + 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 = !

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

fn try_from(value: U) -> Result<T, !>

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