actionProxy

create_toxic

Create any of the supported types of toxics with their attributes

Activity as code

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

Typeaction
Modulechaostoxi.toxic.actions
Namecreate_toxic
Returnboolean

Usage

JSON

{
  "name": "create-toxic",
  "type": "action",
  "provider": {
    "type": "python",
    "module": "chaostoxi.toxic.actions",
    "func": "create_toxic",
    "arguments": {
      "for_proxy": "",
      "toxic_name": "",
      "toxic_type": ""
    }
  }
}

YAML

name: create-toxic
provider:
  arguments:
    for_proxy: ""
    toxic_name: ""
    toxic_type: ""
  func: create_toxic
  module: chaostoxi.toxic.actions
  type: python
type: action

Arguments

NameTypeDefaultRequiredTitleDescription
for_proxystringYesTarget ProxyProxy to add toxic to
toxic_namestringYesToxic NameName of the toxic to add
toxic_typestringYesToxic TypeType of the toxic to add
streamstring“downstream”NoStream DirectionDirection on which the toxic should apply: downstream, upstream
toxicitynumber1.0NoToxicity LevelLevel of toxicity (0.0 - 1.0) to apply
attributesmappingnullNoAttributesToxic attributes

Signature

def create_toxic(for_proxy: str,
                 toxic_name: str,
                 toxic_type: str,
                 stream: str = 'downstream',
                 toxicity: float = 1.0,
                 attributes: Dict[str, Any] = None,
                 configuration: Dict[str, Dict[str, str]] = None) -> bool:
    pass