pub struct EcsClient<'a> { /* private fields */ }Implementations§
Source§impl EcsClient<'_>
impl EcsClient<'_>
Sourcepub async fn get_clusters(&self) -> Result<EcsClustersResponse, Error>
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.
Sourcepub async fn get_tasks(
&self,
cluster: Option<&str>,
status: Option<&str>,
) -> Result<EcsTasksResponse, Error>
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.
Sourcepub async fn get_task_logs(
&self,
task_id: &str,
) -> Result<EcsTaskLogsResponse, Error>
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.
Sourcepub async fn force_stop_task(&self, task_id: &str) -> Result<EcsTask, Error>
pub async fn force_stop_task(&self, task_id: &str) -> Result<EcsTask, Error>
Force the running container behind a task to stop.
Sourcepub async fn mark_task_failed(
&self,
task_id: &str,
req: &EcsMarkFailedRequest,
) -> Result<EcsTask, Error>
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.
Sourcepub async fn get_events(&self) -> Result<EcsEventsResponse, Error>
pub async fn get_events(&self) -> Result<EcsEventsResponse, Error>
Replay the lifecycle event log.
Sourcepub async fn get_metadata_by_arn(&self, task_arn: &str) -> Result<Value, Error>
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.
Sourcepub async fn task_credentials(
&self,
task_id: &str,
) -> Result<EcsTaskCredentialsResponse, Error>
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).
Sourcepub async fn task_metadata_v3(&self, task_id: &str) -> Result<Value, Error>
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.