actionECS

stop_random_tasks

Stop a random number of tasks based on given task_count or task_percent

Activity as code

Below are the details and signature of the activity Python module.

Typeaction
Modulechaosaws.ecs.actions
Namestop_random_tasks
Returnlist

Usage

JSON

{
  "name": "stop-random-tasks",
  "type": "action",
  "provider": {
    "type": "python",
    "module": "chaosaws.ecs.actions",
    "func": "stop_random_tasks",
    "arguments": {
      "cluster": ""
    }
  }
}

YAML

name: stop-random-tasks
provider:
  arguments:
    cluster: ""
  func: stop_random_tasks
  module: chaosaws.ecs.actions
  type: python
type: action

Arguments

NameTypeDefaultRequiredTitleDescription
clusterstringYesClusterName of the target ECS cluster
servicestringnullNoServiceName of the target service
task_countintegernullNoTask CountNumber of tasks to stop
task_percentintegernullNoTask PercentVolume of tasks (0-100) to stop
reasonstring“Reliably Planned Experiment”NoReasonReason why stopping the tasks

Signature

def stop_random_tasks(
        cluster: str,
        task_count: int = None,
        task_percent: int = None,
        service: str = None,
        reason: str = 'Chaos Testing',
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> List[Dict[str, Any]]:
    pass