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>
impl<'a> Fleet<'a>
Sourcepub fn agent_action_status(&self) -> AgentActionStatuses<'a>
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.
Sourcepub fn cancel_agent_action(&self, action_id: &str) -> CancelAgentAction<'a>
pub fn cancel_agent_action(&self, action_id: &str) -> CancelAgentAction<'a>
Kibana supports cancellation of upgrade and unenrollment actions only.
pub fn list_agent_uploads(&self, agent_id: &str) -> ListAgentUploads<'a>
Sourcepub fn download_agent_file(
&self,
file_id: &str,
file_name: &str,
) -> DownloadAgentFile<'a>
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>
impl<'a> Fleet<'a>
Sourcepub fn find_agent_policies(&self) -> FindAgentPolicies<'a>
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.
pub fn get_agent_policy(&self, id: &str) -> GetAgentPolicy<'a>
Sourcepub fn create_agent_policy<B: Serialize + ?Sized>(
&self,
policy: &B,
) -> CreateAgentPolicy<'a>
pub fn create_agent_policy<B: Serialize + ?Sized>( &self, policy: &B, ) -> CreateAgentPolicy<'a>
Creates a policy from a NewAgentPolicy or equivalent JSON.
Sourcepub fn update_agent_policy<B: Serialize + ?Sized>(
&self,
id: &str,
policy: &B,
) -> UpdateAgentPolicy<'a>
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.
Sourcepub fn edit_agent_policy(&self, edit: &AgentPolicyEdit) -> UpdateAgentPolicy<'a>
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.
pub fn delete_agent_policy(&self, id: &str) -> DeleteAgentPolicy<'a>
pub fn copy_agent_policy(&self, id: &str, name: &str) -> CopyAgentPolicy<'a>
Sourcepub fn download_agent_policy(&self, id: &str) -> DownloadAgentPolicy<'a>
pub fn download_agent_policy(&self, id: &str) -> DownloadAgentPolicy<'a>
The agent configuration as YAML.
Source§impl<'a> Fleet<'a>
impl<'a> Fleet<'a>
pub fn find_agents(&self) -> FindAgents<'a>
pub fn get_agent(&self, id: &str) -> GetAgent<'a>
Sourcepub fn agent_status(&self) -> AgentStatus<'a>
pub fn agent_status(&self) -> AgentStatus<'a>
Agent counts by status.
pub fn reassign_agent(&self, id: &str, policy_id: &str) -> ReassignAgent<'a>
pub fn unenroll_agent(&self, id: &str) -> UnenrollAgent<'a>
Sourcepub fn upgrade_agent(&self, id: &str, version: &str) -> UpgradeAgent<'a>
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.
Sourcepub fn request_agent_diagnostics(&self, id: &str) -> RequestAgentDiagnostics<'a>
pub fn request_agent_diagnostics(&self, id: &str) -> RequestAgentDiagnostics<'a>
Correlate the returned action ID with list_agent_uploads
or wait_for_upload.
pub fn bulk_reassign_agents( &self, agents: AgentSelection, policy_id: &str, ) -> BulkReassignAgents<'a>
pub fn bulk_unenroll_agents( &self, agents: AgentSelection, ) -> BulkUnenrollAgents<'a>
pub fn bulk_upgrade_agents( &self, agents: AgentSelection, version: &str, ) -> BulkUpgradeAgents<'a>
pub fn bulk_request_agent_diagnostics( &self, agents: AgentSelection, ) -> BulkRequestAgentDiagnostics<'a>
Source§impl<'a> Fleet<'a>
impl<'a> Fleet<'a>
pub fn find_enrollment_keys(&self) -> FindEnrollmentKeys<'a>
pub fn get_enrollment_key(&self, id: &str) -> GetEnrollmentKey<'a>
pub fn create_enrollment_key(&self, policy_id: &str) -> CreateEnrollmentKey<'a>
Sourcepub fn revoke_enrollment_key(&self, id: &str) -> RevokeEnrollmentKey<'a>
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>
impl<'a> Fleet<'a>
pub fn find_package_policies(&self) -> FindPackagePolicies<'a>
pub fn get_package_policy(&self, id: &str) -> GetPackagePolicy<'a>
Sourcepub fn create_package_policy<B: Serialize + ?Sized>(
&self,
policy: &B,
) -> CreatePackagePolicy<'a>
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.
Sourcepub fn update_package_policy<'p>(
&self,
update: impl Into<PackagePolicyUpdate<'p>>,
) -> UpdatePackagePolicy<'a>
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.
pub fn delete_package_policy(&self, id: &str) -> DeletePackagePolicy<'a>
Source§impl<'a> Fleet<'a>
impl<'a> Fleet<'a>
Sourcepub fn list_packages(&self) -> ListPackages<'a>
pub fn list_packages(&self) -> ListPackages<'a>
Packages available from the configured registry, with install status.
pub fn get_package(&self, name: &str, version: &str) -> GetPackage<'a>
Sourcepub fn install_package(&self, name: &str, version: &str) -> InstallPackage<'a>
pub fn install_package(&self, name: &str, version: &str) -> InstallPackage<'a>
Installs package assets such as index templates and dashboards.
pub fn uninstall_package( &self, name: &str, version: &str, ) -> UninstallPackage<'a>
Source§impl Fleet<'_>
impl Fleet<'_>
Sourcepub async fn wait_for_action(
&self,
action_id: &str,
options: PollOptions,
) -> Result<WaitOutcome<AgentActionStatus>>
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.
Sourcepub async fn wait_for_upload(
&self,
agent_id: &str,
action_id: &str,
options: PollOptions,
) -> Result<WaitOutcome<AgentUpload>>
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.
Sourcepub async fn wait_for_agent_policy(
&self,
agent_id: &str,
policy_id: &str,
revision: u64,
options: PollOptions,
) -> Result<WaitOutcome<Agent>>
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.