images
Creates, updates, deletes, gets or lists an images resource.
Overview
| Name | images |
| Type | Resource |
| Id | azure.compute.images |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_resource_group
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
extendedLocation | object | The extended location of the Image. |
hyperVGeneration | string | Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed resource. Known values are: "V1" and "V2". (V1, V2) |
location | string | The geo-location where the resource lives. Required. |
provisioningState | string | The provisioning state. |
sourceVirtualMachine | object | SubResource. |
storageProfile | object | Specifies the storage settings for the virtual machine disks. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
extendedLocation | object | The extended location of the Image. |
hyperVGeneration | string | Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed resource. Known values are: "V1" and "V2". (V1, V2) |
location | string | The geo-location where the resource lives. Required. |
provisioningState | string | The provisioning state. |
sourceVirtualMachine | object | SubResource. |
storageProfile | object | Specifies the storage settings for the virtual machine disks. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
extendedLocation | object | The extended location of the Image. |
hyperVGeneration | string | Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed resource. Known values are: "V1" and "V2". (V1, V2) |
location | string | The geo-location where the resource lives. Required. |
provisioningState | string | The provisioning state. |
sourceVirtualMachine | object | SubResource. |
storageProfile | object | Specifies the storage settings for the virtual machine disks. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, image_name, subscription_id | $expand | Gets an image. |
list_by_resource_group | select | resource_group_name, subscription_id | Gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. | |
list | select | subscription_id | Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. | |
create_or_update | insert | resource_group_name, image_name, subscription_id, location | Create or update an image. | |
update | update | resource_group_name, image_name, subscription_id | Update an image. | |
create_or_update | replace | resource_group_name, image_name, subscription_id, location | Create or update an image. | |
delete | delete | resource_group_name, image_name, subscription_id | Deletes an Image. |
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 |
|---|---|---|
image_name | string | The name of the image. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
$expand | string | The expand expression to apply on the operation. Default value is None. |
SELECT examples
- get
- list_by_resource_group
- list
Gets an image.
SELECT
id,
name,
extendedLocation,
hyperVGeneration,
location,
provisioningState,
sourceVirtualMachine,
storageProfile,
systemData,
tags,
type
FROM azure.compute.images
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND image_name = '{{ image_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;
Gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images.
SELECT
id,
name,
extendedLocation,
hyperVGeneration,
location,
provisioningState,
sourceVirtualMachine,
storageProfile,
systemData,
tags,
type
FROM azure.compute.images
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images.
SELECT
id,
name,
extendedLocation,
hyperVGeneration,
location,
provisioningState,
sourceVirtualMachine,
storageProfile,
systemData,
tags,
type
FROM azure.compute.images
WHERE subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Create or update an image.
INSERT INTO azure.compute.images (
tags,
location,
properties,
extendedLocation,
resource_group_name,
image_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ extendedLocation }}',
'{{ resource_group_name }}',
'{{ image_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
extendedLocation,
location,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: images
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the images resource.
- name: image_name
value: "{{ image_name }}"
description: Required parameter for the images resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the images resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
Describes the properties of an Image.
value:
sourceVirtualMachine:
id: "{{ id }}"
storageProfile:
osDisk:
snapshot:
id: "{{ id }}"
managedDisk:
id: "{{ id }}"
blobUri: "{{ blobUri }}"
caching: "{{ caching }}"
diskSizeGB: {{ diskSizeGB }}
storageAccountType: "{{ storageAccountType }}"
diskEncryptionSet:
id: "{{ id }}"
osType: "{{ osType }}"
osState: "{{ osState }}"
dataDisks:
- snapshot:
id: "{{ id }}"
managedDisk:
id: "{{ id }}"
blobUri: "{{ blobUri }}"
caching: "{{ caching }}"
diskSizeGB: {{ diskSizeGB }}
storageAccountType: "{{ storageAccountType }}"
diskEncryptionSet:
id: "{{ id }}"
lun: {{ lun }}
zoneResilient: {{ zoneResilient }}
provisioningState: "{{ provisioningState }}"
hyperVGeneration: "{{ hyperVGeneration }}"
- name: extendedLocation
description: |
The extended location of the Image.
value:
name: "{{ name }}"
type: "{{ type }}"
UPDATE examples
- update
Update an image.
UPDATE azure.compute.images
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND image_name = '{{ image_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
extendedLocation,
location,
properties,
systemData,
tags,
type;
REPLACE examples
- create_or_update
Create or update an image.
REPLACE azure.compute.images
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
extendedLocation = '{{ extendedLocation }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND image_name = '{{ image_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
extendedLocation,
location,
properties,
systemData,
tags,
type;
DELETE examples
- delete
Deletes an Image.
DELETE FROM azure.compute.images
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND image_name = '{{ image_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;