chaosmonkey.attacks package

Submodules

chaosmonkey.attacks.attack module

class chaosmonkey.attacks.attack.Attack(attack_config)[source]

Bases: object

Base class for attacks. Every attack must extend from this class

example = None

dict example for using when calling add plan endpoint

ref = None

string Unique identifier for the attack. Must be module_name.AttackClass

run()[source]

This method is called by an executor to perform the actual attack. You can access the self.attack_config that holds the configuration used when calling the endpoint to plan the attacks.

schema = None

dict Valid jsonSchema to validate the attack attributes in the API

static to_dict()[source]

You should implement to_dict to return an Attack._to_dict(ref, schema, example) using the attack attributes

Example:

@staticmethod
def to_dict():
    return Attack._to_dict(
        TerminateEC2Instance.ref,
        TerminateEC2Instance.schema,
        TerminateEC2Instance.example
    )

chaosmonkey.attacks.executor module

chaosmonkey.attacks.executor.execute(attack_config=None, plan_id=None)[source]

This func is executed for every job stored in the scheduler. Receive in kwargs all attack configuration used when creating the executor that indicates which attack and configuration should be used to do the actual attack.

Parameters:
  • attack_configDict with attack configuration
  • plan_idString plan id for the plan containing the executor

Module contents