actionMachine

stop_machines

Stop virtual machines at random

Activity as code

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

Typeaction
Modulechaosazure.machine.actions
Namestop_machines
ReturnNone

Usage

JSON

{
  "name": "stop-machines",
  "type": "action",
  "provider": {
    "type": "python",
    "module": "chaosazure.machine.actions",
    "func": "stop_machines"
  }
}

YAML

name: stop-machines
provider:
  func: stop_machines
  module: chaosazure.machine.actions
  type: python
type: action

Arguments

NameTypeDefaultRequiredTitleDescription
filterstringnullNoFilterTarget filter selector

If the filter is omitted all machines in the subscription will be selected as potential chaos candidates.

Thought of as a rollback action.

Examples

Some calling examples. Deep dive into the filter syntax: https://docs.microsoft.com/en-us/azure/kusto/query/

# Stop all machines from the group 'rg'
> stop_machines("where resourceGroup=='rg'", c, s)
# Stop the machine from the group 'mygroup' having the name 'myname'
> stop_machines("where resourceGroup=='mygroup' and name='myname'", c, s)
# Stop two machines at random from the group 'mygroup'
> stop_machines("where resourceGroup=='mygroup' | sample 2", c, s)

Signature

def stop_machines(filter: str = None,
                  configuration: Dict[str, Dict[str, str]] = None,
                  secrets: Dict[str, Dict[str, str]] = None):
    pass