airflow.providers.microsoft.azure.operators.compute

Classes

BaseAzureVirtualMachineOperator

Base operator for Azure Virtual Machine operations.

AzureVirtualMachineStartOperator

Start an Azure Virtual Machine.

AzureVirtualMachineStopOperator

Stop (deallocate) an Azure Virtual Machine.

AzureVirtualMachineRestartOperator

Restart an Azure Virtual Machine.

Module Contents

class airflow.providers.microsoft.azure.operators.compute.BaseAzureVirtualMachineOperator(*, resource_group_name, vm_name, wait_for_completion=True, azure_conn_id='azure_default', **kwargs)[source]

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

Base operator for Azure Virtual Machine operations.

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

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

  • wait_for_completion (bool) – Wait for the operation to complete. Default True.

  • azure_conn_id (str) – Azure connection id.

template_fields: collections.abc.Sequence[str] = ('resource_group_name', 'vm_name')[source]
ui_color = '#0078d4'[source]
ui_fgcolor = '#ffffff'[source]
resource_group_name[source]
vm_name[source]
wait_for_completion = True[source]
azure_conn_id = 'azure_default'[source]
property hook: airflow.providers.microsoft.azure.hooks.compute.AzureComputeHook[source]
abstract execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.microsoft.azure.operators.compute.AzureVirtualMachineStartOperator(*, resource_group_name, vm_name, wait_for_completion=True, azure_conn_id='azure_default', **kwargs)[source]

Bases: BaseAzureVirtualMachineOperator

Start an Azure Virtual Machine.

See also

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

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

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

  • wait_for_completion (bool) – Wait for the VM to reach ‘running’ state. Default True.

  • azure_conn_id (str) – Azure connection id.

execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.microsoft.azure.operators.compute.AzureVirtualMachineStopOperator(*, resource_group_name, vm_name, wait_for_completion=True, azure_conn_id='azure_default', **kwargs)[source]

Bases: BaseAzureVirtualMachineOperator

Stop (deallocate) an Azure Virtual Machine.

Uses begin_deallocate to release compute resources and stop billing.

See also

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

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

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

  • wait_for_completion (bool) – Wait for the VM to reach ‘deallocated’ state. Default True.

  • azure_conn_id (str) – Azure connection id.

execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.microsoft.azure.operators.compute.AzureVirtualMachineRestartOperator(*, resource_group_name, vm_name, wait_for_completion=True, azure_conn_id='azure_default', **kwargs)[source]

Bases: BaseAzureVirtualMachineOperator

Restart an Azure Virtual Machine.

See also

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

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

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

  • wait_for_completion (bool) – Wait for the VM to reach ‘running’ state. Default True.

  • azure_conn_id (str) – Azure connection id.

execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?