airflow.providers.microsoft.azure.sensors.compute

Classes

AzureVirtualMachineStateSensor

Poll an Azure Virtual Machine until it reaches a target power state.

Module Contents

class airflow.providers.microsoft.azure.sensors.compute.AzureVirtualMachineStateSensor(*, resource_group_name, vm_name, target_state, azure_conn_id='azure_default', deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), **kwargs)[source]

Bases: airflow.providers.common.compat.sdk.BaseSensorOperator

Poll an Azure Virtual Machine until it reaches a target power state.

See also

For more information on how to use this sensor, take a look at the guide: AzureVirtualMachineStateSensor

Parameters:
  • resource_group_name (str) – Name of the Azure resource group.

  • vm_name (str) – Name of the virtual machine.

  • target_state (str) – Desired power state, e.g. running, deallocated.

  • azure_conn_id (str) – Azure connection id.

  • deferrable (bool) – If True, run in deferrable mode.

template_fields: collections.abc.Sequence[str] = ('resource_group_name', 'vm_name', 'target_state')[source]
ui_color = '#0078d4'[source]
ui_fgcolor = '#ffffff'[source]
VALID_STATES[source]
resource_group_name[source]
vm_name[source]
target_state[source]
azure_conn_id = 'azure_default'[source]
deferrable[source]
poke(context)[source]

Override when deriving this class.

execute(context)[source]

Poll for the VM power state.

In deferrable mode, the polling is deferred to the triggerer. Otherwise the sensor waits synchronously.

execute_complete(context, event)[source]

Handle callback from the trigger.

Relies on trigger to throw an exception, otherwise it assumes execution was successful.

Was this entry helpful?