virtual_machines
Creates, updates, deletes, gets or lists a virtual_machines
resource.
Overview
Name | virtual_machines |
Type | Resource |
Id | azure.nexus.virtual_machines |
Fields
The following fields are returned by SELECT
queries:
- get
- list_by_resource_group
- list_by_subscription
The resource has been successfully retrieved.
Name | Datatype | Description |
---|---|---|
extendedLocation | object | The extended location of the cluster associated with the resource. (title: ExtendedLocation represents the Azure custom location where the resource will be created.) |
location | string | The geo-location where the resource lives |
properties | object | The list of the resource properties. (title: VirtualMachineProperties represents the properties of the virtual machine.) |
tags | object | Resource tags. |
The resource list has been successfully retrieved.
Name | Datatype | Description |
---|---|---|
extendedLocation | object | The extended location of the cluster associated with the resource. (title: ExtendedLocation represents the Azure custom location where the resource will be created.) |
location | string | The geo-location where the resource lives |
properties | object | The list of the resource properties. (title: VirtualMachineProperties represents the properties of the virtual machine.) |
tags | object | Resource tags. |
The resource list has been successfully retrieved.
Name | Datatype | Description |
---|---|---|
extendedLocation | object | The extended location of the cluster associated with the resource. (title: ExtendedLocation represents the Azure custom location where the resource will be created.) |
location | string | The geo-location where the resource lives |
properties | object | The list of the resource properties. (title: VirtualMachineProperties represents the properties of the virtual machine.) |
tags | object | Resource tags. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | subscriptionId , resourceGroupName , virtualMachineName | Get properties of the provided virtual machine. | |
list_by_resource_group | select | subscriptionId , resourceGroupName | Get a list of virtual machines in the provided resource group. | |
list_by_subscription | select | subscriptionId | Get a list of virtual machines in the provided subscription. | |
create_or_update | insert | subscriptionId , resourceGroupName , virtualMachineName , data__extendedLocation , data__properties | Create a new virtual machine or update the properties of the existing virtual machine. | |
update | update | subscriptionId , resourceGroupName , virtualMachineName | Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties and tag updates can be done independently. | |
delete | delete | subscriptionId , resourceGroupName , virtualMachineName | Delete the provided virtual machine. | |
power_off | exec | subscriptionId , resourceGroupName , virtualMachineName | Power off the provided virtual machine. | |
reimage | exec | subscriptionId , resourceGroupName , virtualMachineName | Reimage the provided virtual machine. | |
restart | exec | subscriptionId , resourceGroupName , virtualMachineName | Restart the provided virtual machine. | |
start | exec | subscriptionId , resourceGroupName , virtualMachineName | Start the provided virtual machine. |
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.
Name | Datatype | Description |
---|---|---|
resourceGroupName | string | The name of the resource group. The name is case insensitive. |
subscriptionId | string (uuid) | The ID of the target subscription. The value must be an UUID. |
virtualMachineName | string | The name of the virtual machine. |
SELECT
examples
- get
- list_by_resource_group
- list_by_subscription
Get properties of the provided virtual machine.
SELECT
extendedLocation,
location,
properties,
tags
FROM azure.nexus.virtual_machines
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND virtualMachineName = '{{ virtualMachineName }}' -- required
;
Get a list of virtual machines in the provided resource group.
SELECT
extendedLocation,
location,
properties,
tags
FROM azure.nexus.virtual_machines
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
;
Get a list of virtual machines in the provided subscription.
SELECT
extendedLocation,
location,
properties,
tags
FROM azure.nexus.virtual_machines
WHERE subscriptionId = '{{ subscriptionId }}' -- required
;
INSERT
examples
- create_or_update
- Manifest
Create a new virtual machine or update the properties of the existing virtual machine.
INSERT INTO azure.nexus.virtual_machines (
data__extendedLocation,
data__properties,
data__tags,
data__location,
subscriptionId,
resourceGroupName,
virtualMachineName
)
SELECT
'{{ extendedLocation }}' /* required */,
'{{ properties }}' /* required */,
'{{ tags }}',
'{{ location }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ virtualMachineName }}'
RETURNING
extendedLocation,
location,
properties,
tags
;
# Description fields are for documentation purposes
- name: virtual_machines
props:
- name: subscriptionId
value: string (uuid)
description: Required parameter for the virtual_machines resource.
- name: resourceGroupName
value: string
description: Required parameter for the virtual_machines resource.
- name: virtualMachineName
value: string
description: Required parameter for the virtual_machines resource.
- name: extendedLocation
value: object
description: |
The extended location of the cluster associated with the resource.
- name: properties
value: object
description: |
The list of the resource properties.
- name: tags
value: object
description: |
Resource tags.
- name: location
value: string
description: |
The geo-location where the resource lives
UPDATE
examples
- update
Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties and tag updates can be done independently.
UPDATE azure.nexus.virtual_machines
SET
data__properties = '{{ properties }}',
data__tags = '{{ tags }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND virtualMachineName = '{{ virtualMachineName }}' --required
RETURNING
extendedLocation,
location,
properties,
tags;
DELETE
examples
- delete
Delete the provided virtual machine.
DELETE FROM azure.nexus.virtual_machines
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND virtualMachineName = '{{ virtualMachineName }}' --required
;
Lifecycle Methods
- power_off
- reimage
- restart
- start
Power off the provided virtual machine.
EXEC azure.nexus.virtual_machines.power_off
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@virtualMachineName='{{ virtualMachineName }}' --required
@@json=
'{
"skipShutdown": "{{ skipShutdown }}"
}'
;
Reimage the provided virtual machine.
EXEC azure.nexus.virtual_machines.reimage
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@virtualMachineName='{{ virtualMachineName }}' --required
;
Restart the provided virtual machine.
EXEC azure.nexus.virtual_machines.restart
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@virtualMachineName='{{ virtualMachineName }}' --required
;
Start the provided virtual machine.
EXEC azure.nexus.virtual_machines.start
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@virtualMachineName='{{ virtualMachineName }}' --required
;