Skip to main content

virtual_machine_scale_set_life_cycle_hook_events

Creates, updates, deletes, gets or lists a virtual_machine_scale_set_life_cycle_hook_events resource.

Overview

Namevirtual_machine_scale_set_life_cycle_hook_events
TypeResource
Idazure.compute.virtual_machine_scale_set_life_cycle_hook_events

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
additionalContextobjectAdditional key-value pairs set on the lifecycle hook event that gives customer some useful context/data. The keys in this dictionary are specific to the lifecycle hook type. Different lifecycle hook events can have different sets of keys in the additional context depending on the lifecycle hook type. For example, for a lifecycle hook event with UpgradeAutoOSScheduling type, the additional context can contain the key "priority" that helps customer identify the priority of the Auto OS Upgrade operation triggered on the virtual machine scale set.
defaultActionstringSpecify the action that will be applied on the a target resource in the virtual machine scale set lifecycle hook event if the platform does not get a response from the customer for the target resource before waitUntil. Known values are: "Approve" and "Reject". (Approve, Reject)
maxWaitUntilstringSpecifies the exact UTC timestamp in ISO 8601 format till when the customer can delay the lifecycle hook event. The customer will not be allowed to delay the event to a timestamp beyond this.
statestringSpecifies the state of the virtual machine scale set lifecycle hook event. Known values are: "Active" and "Completed". (Active, Completed)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
targetResourcesarrayList of target resources which are getting processed in the virtual machine scale set lifecycle hook event.
timeCreatedstringThe UTC timestamp in ISO 8601 format at which the platform creates the virtual machine scale set lifecycle hook event entity.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
waitUntilstringSpecifies the exact UTC timestamp in ISO 8601 format till which the event would remain in the current lifecycle state waiting for an action from the customer. Beyond this timestamp, the platform will apply the defaultAction for the event.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, vm_scale_set_name, lifecycle_hook_event_name, subscription_idGets a virtual machine scale set lifecycle hook event.
listselectresource_group_name, vm_scale_set_name, subscription_idGets a list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource.
updateupdateresource_group_name, vm_scale_set_name, lifecycle_hook_event_name, subscription_idThe operation to update a virtual machine scale set lifecycle hook event.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
lifecycle_hook_event_namestringThe name of the VMScaleSetLifecycleHookEvent. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
vm_scale_set_namestringThe name of the VM scale set. Required.

SELECT examples

Gets a virtual machine scale set lifecycle hook event.

SELECT
id,
name,
additionalContext,
defaultAction,
maxWaitUntil,
state,
systemData,
targetResources,
timeCreated,
type,
waitUntil
FROM azure.compute.virtual_machine_scale_set_life_cycle_hook_events
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND vm_scale_set_name = '{{ vm_scale_set_name }}' -- required
AND lifecycle_hook_event_name = '{{ lifecycle_hook_event_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

UPDATE examples

The operation to update a virtual machine scale set lifecycle hook event.

UPDATE azure.compute.virtual_machine_scale_set_life_cycle_hook_events
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND vm_scale_set_name = '{{ vm_scale_set_name }}' --required
AND lifecycle_hook_event_name = '{{ lifecycle_hook_event_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;