actionMachine

delete_machines

Delete virtual machines at random

Activity as code

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

Typeaction
Modulechaosazure.machine.actions
Namedelete_machines
ReturnNone

Usage

JSON

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

YAML

name: delete-machines
provider:
  func: delete_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.

Examples

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

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

Signature

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