Skip to main content

EcsClient

Struct EcsClient 

Source
pub struct EcsClient<'a> { /* private fields */ }

Implementations§

Source§

impl EcsClient<'_>

Source

pub async fn get_clusters(&self) -> Result<EcsClustersResponse, Error>

List all ECS clusters across every account the server has seen. Deterministic, sorted by cluster ARN. Bypasses the ECS control-plane auth and pagination so tests can assert directly on raw state.

Source

pub async fn get_tasks( &self, cluster: Option<&str>, status: Option<&str>, ) -> Result<EcsTasksResponse, Error>

List every task the server has seen. Optional cluster / status filters restrict the dump when supplied.

Source

pub async fn get_task_logs( &self, task_id: &str, ) -> Result<EcsTaskLogsResponse, Error>

Tail stored container stdout/stderr for a single task. Works even when no awslogs driver is configured — fakecloud always captures docker stdout/stderr on exit and keeps it on the task.

Source

pub async fn force_stop_task(&self, task_id: &str) -> Result<EcsTask, Error>

Force the running container behind a task to stop.

Source

pub async fn mark_task_failed( &self, task_id: &str, req: &EcsMarkFailedRequest, ) -> Result<EcsTask, Error>

Flip the task to STOPPED without killing the underlying container — useful for simulating task failures in tests.

Source

pub async fn get_events(&self) -> Result<EcsEventsResponse, Error>

Replay the lifecycle event log.

Source

pub async fn get_metadata_by_arn(&self, task_arn: &str) -> Result<Value, Error>

Get the ECS task-metadata v4 dump keyed by full task ARN. Unlike the per-container /_fakecloud/ecs/v4/{task_id} endpoint, this is keyed by ARN for assertion-friendly use from tests that hold the RunTask response. Returned as raw JSON because the shape is the aggregated container-metadata document AWS surfaces at ECS_CONTAINER_METADATA_URI_V4.

Source

pub async fn task_credentials( &self, task_id: &str, ) -> Result<EcsTaskCredentialsResponse, Error>

Fetch the IAM task-role credentials that fakecloud hands out via AWS_CONTAINER_CREDENTIALS_RELATIVE_URI to the container. Fields use AWS’s native PascalCase (AccessKeyId, SecretAccessKey, Token, Expiration, RoleArn).

Source

pub async fn task_metadata_v3(&self, task_id: &str) -> Result<Value, Error>

Fetch the v3 ECS task metadata document for task_id. Returned as raw JSON (Cluster, TaskARN, Family, Revision, DesiredStatus, KnownStatus, Containers, Limits, Networks, …) so callers can pick the fields they need without dragging in the entire metadata schema.

Source

pub async fn task_metadata_v4(&self, task_id: &str) -> Result<Value, Error>

Fetch the v4 ECS task metadata document for task_id. Same pass-through shape as the v3 endpoint; v4 adds extra container runtime fields the server emits as-is.

Auto Trait Implementations§

§

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

§

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

§

impl<'a> Freeze for EcsClient<'a>

§

impl<'a> Send for EcsClient<'a>

§

impl<'a> Sync for EcsClient<'a>

§

impl<'a> Unpin for EcsClient<'a>

§

impl<'a> UnsafeUnpin for EcsClient<'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> ErasedDestructor for T
where T: 'static,

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, 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