Skip to main content

virtual_machines

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

Overview

Namevirtual_machines
TypeResource
Idazure.nexus.virtual_machines

Fields

NameDatatypeDescription
admin_usernametextfield from the properties object
availability_zonetextfield from the properties object
bare_metal_machine_idtextfield from the properties object
boot_methodtextfield from the properties object
cloud_services_network_attachmenttextfield from the properties object
cluster_idtextfield from the properties object
cpu_corestextfield from the properties object
detailed_statustextfield from the properties object
detailed_status_messagetextfield from the properties object
extended_locationtextfield from the properties object
isolate_emulator_threadtextfield from the properties object
locationtextThe geo-location where the resource lives
memory_size_gbtextfield from the properties object
network_attachmentstextfield from the properties object
network_datatextfield from the properties object
placement_hintstextfield from the properties object
power_statetextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
ssh_public_keystextfield from the properties object
storage_profiletextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextResource tags.
user_datatextfield from the properties object
virtio_interfacetextfield from the properties object
virtualMachineNametextfield from the properties object
vm_device_modeltextfield from the properties object
vm_imagetextfield from the properties object
vm_image_repository_credentialstextfield from the properties object
volumestextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, subscriptionId, virtualMachineNameGet properties of the provided virtual machine.
list_by_resource_groupSELECTresourceGroupName, subscriptionIdGet a list of virtual machines in the provided resource group.
list_by_subscriptionSELECTsubscriptionIdGet a list of virtual machines in the provided subscription.
create_or_updateINSERTresourceGroupName, subscriptionId, virtualMachineName, data__extendedLocation, data__propertiesCreate a new virtual machine or update the properties of the existing virtual machine.
deleteDELETEresourceGroupName, subscriptionId, virtualMachineNameDelete the provided virtual machine.
updateUPDATEresourceGroupName, subscriptionId, virtualMachineNamePatch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties and tag updates can be done independently.
power_offEXECresourceGroupName, subscriptionId, virtualMachineNamePower off the provided virtual machine.
reimageEXECresourceGroupName, subscriptionId, virtualMachineNameReimage the provided virtual machine.
restartEXECresourceGroupName, subscriptionId, virtualMachineNameRestart the provided virtual machine.
startEXECresourceGroupName, subscriptionId, virtualMachineNameStart the provided virtual machine.

SELECT examples

Get a list of virtual machines in the provided subscription.

SELECT
admin_username,
availability_zone,
bare_metal_machine_id,
boot_method,
cloud_services_network_attachment,
cluster_id,
cpu_cores,
detailed_status,
detailed_status_message,
extended_location,
isolate_emulator_thread,
location,
memory_size_gb,
network_attachments,
network_data,
placement_hints,
power_state,
provisioning_state,
resourceGroupName,
ssh_public_keys,
storage_profile,
subscriptionId,
tags,
user_data,
virtio_interface,
virtualMachineName,
vm_device_model,
vm_image,
vm_image_repository_credentials,
volumes
FROM azure.nexus.vw_virtual_machines
WHERE subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new virtual_machines resource.

/*+ create */
INSERT INTO azure.nexus.virtual_machines (
resourceGroupName,
subscriptionId,
virtualMachineName,
data__extendedLocation,
data__properties,
extendedLocation,
properties,
tags,
location
)
SELECT
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ virtualMachineName }}',
'{{ data__extendedLocation }}',
'{{ data__properties }}',
'{{ extendedLocation }}',
'{{ properties }}',
'{{ tags }}',
'{{ location }}'
;

UPDATE example

Updates a virtual_machines resource.

/*+ update */
UPDATE azure.nexus.virtual_machines
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND virtualMachineName = '{{ virtualMachineName }}';

DELETE example

Deletes the specified virtual_machines resource.

/*+ delete */
DELETE FROM azure.nexus.virtual_machines
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND virtualMachineName = '{{ virtualMachineName }}';