azure.mgmt.imagebuilder.models module

class azure.mgmt.imagebuilder.models.CloudErrorBody(*, code: Optional[str] = None, message: Optional[str] = None, target: Optional[str] = None, details: Optional[List[_models.CloudErrorBody]] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

An error response from the Azure VM Image Builder service.

Variables
  • code (str) – An identifier for the error. Codes are invariant and are intended to be consumed programmatically.

  • message (str) – A message describing the error, intended to be suitable for display in a user interface.

  • target (str) – The target of the particular error. For example, the name of the property in error.

  • details (list[CloudErrorBody]) – A list of additional details about the error.

Keyword Arguments
  • code (str) – An identifier for the error. Codes are invariant and are intended to be consumed programmatically.

  • message (str) – A message describing the error, intended to be suitable for display in a user interface.

  • target (str) – The target of the particular error. For example, the name of the property in error.

  • details (list[CloudErrorBody]) – A list of additional details about the error.

class azure.mgmt.imagebuilder.models.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties(**kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • principal_id (str) – The principal id of user assigned identity.

  • client_id (str) – The client id of user assigned identity.

class azure.mgmt.imagebuilder.models.CreatedByType(value)[source]

Bases: str, enum.Enum

The type of identity that created the resource.

APPLICATION = 'Application'
KEY = 'Key'
MANAGED_IDENTITY = 'ManagedIdentity'
USER = 'User'
class azure.mgmt.imagebuilder.models.ImageTemplate(*, location: str, identity: _models.ImageTemplateIdentity, tags: Optional[Dict[str, str]] = None, source: Optional[_models.ImageTemplateSource] = None, customize: Optional[List[_models.ImageTemplateCustomizer]] = None, validate: Optional[_models.ImageTemplatePropertiesValidate] = None, distribute: Optional[List[_models.ImageTemplateDistributor]] = None, build_timeout_in_minutes: int = 0, vm_profile: Optional[_models.ImageTemplateVmProfile] = None, staging_resource_group: Optional[str] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.TrackedResource

Image template is an ARM resource managed by Microsoft.VirtualMachineImages provider.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Variables
  • id (str) – Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.

  • name (str) – The name of the resource.

  • type (str) – The type of the resource. E.g. “Microsoft.Compute/virtualMachines” or “Microsoft.Storage/storageAccounts”.

  • system_data (SystemData) – Azure Resource Manager metadata containing createdBy and modifiedBy information.

  • tags (dict[str, str]) – Resource tags.

  • location (str) – The geo-location where the resource lives. Required.

  • identity (ImageTemplateIdentity) – The identity of the image template, if configured. Required.

  • source (ImageTemplateSource) – Specifies the properties used to describe the source image.

  • customize (list[ImageTemplateCustomizer]) – Specifies the properties used to describe the customization steps of the image, like Image source etc.

  • validate (ImageTemplatePropertiesValidate) – Configuration options and list of validations to be performed on the resulting image.

  • distribute (list[ImageTemplateDistributor]) – The distribution targets where the image output needs to go to.

  • provisioning_state (str or ProvisioningState) – Provisioning state of the resource. Known values are: “Creating”, “Updating”, “Succeeded”, “Failed”, and “Deleting”.

  • provisioning_error (ProvisioningError) – Provisioning error, if any.

  • last_run_status (ImageTemplateLastRunStatus) – State of ‘run’ that is currently executing or was last executed.

  • build_timeout_in_minutes (int) – Maximum duration to wait while building the image template (includes all customizations, validations, and distributions). Omit or specify 0 to use the default (4 hours).

  • vm_profile (ImageTemplateVmProfile) – Describes how virtual machine is set up to build images.

  • staging_resource_group (str) – The staging resource group id in the same subscription as the image template that will be used to build the image. If this field is empty, a resource group with a random name will be created. If the resource group specified in this field doesn’t exist, it will be created with the same name. If the resource group specified exists, it must be empty and in the same region as the image template. The resource group created will be deleted during template deletion if this field is empty or the resource group specified doesn’t exist, but if the resource group specified exists the resources created in the resource group will be deleted during template deletion and the resource group itself will remain.

  • exact_staging_resource_group (str) – The staging resource group id in the same subscription as the image template that will be used to build the image. This read-only field differs from ‘stagingResourceGroup’ only if the value specified in the ‘stagingResourceGroup’ field is empty.

Keyword Arguments
  • tags (dict[str, str]) – Resource tags.

  • location (str) – The geo-location where the resource lives. Required.

  • identity (ImageTemplateIdentity) – The identity of the image template, if configured. Required.

  • source (ImageTemplateSource) – Specifies the properties used to describe the source image.

  • customize (list[ImageTemplateCustomizer]) – Specifies the properties used to describe the customization steps of the image, like Image source etc.

  • validate (ImageTemplatePropertiesValidate) – Configuration options and list of validations to be performed on the resulting image.

  • distribute (list[ImageTemplateDistributor]) – The distribution targets where the image output needs to go to.

  • build_timeout_in_minutes (int) – Maximum duration to wait while building the image template (includes all customizations, validations, and distributions). Omit or specify 0 to use the default (4 hours).

  • vm_profile (ImageTemplateVmProfile) – Describes how virtual machine is set up to build images.

  • staging_resource_group (str) – The staging resource group id in the same subscription as the image template that will be used to build the image. If this field is empty, a resource group with a random name will be created. If the resource group specified in this field doesn’t exist, it will be created with the same name. If the resource group specified exists, it must be empty and in the same region as the image template. The resource group created will be deleted during template deletion if this field is empty or the resource group specified doesn’t exist, but if the resource group specified exists the resources created in the resource group will be deleted during template deletion and the resource group itself will remain.

class azure.mgmt.imagebuilder.models.ImageTemplateCustomizer(*, name: Optional[str] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Describes a unit of image customization.

You probably want to use the sub-classes and not this class directly. Known sub-classes are: ImageTemplateFileCustomizer, ImageTemplatePowerShellCustomizer, ImageTemplateShellCustomizer, ImageTemplateRestartCustomizer, ImageTemplateWindowsUpdateCustomizer

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – The type of customization tool you want to use on the Image. For example, “Shell” can be shell customizer. Required.

  • name (str) – Friendly Name to provide context on what this customization step does.

Keyword Arguments

name (str) – Friendly Name to provide context on what this customization step does.

class azure.mgmt.imagebuilder.models.ImageTemplateDistributor(*, run_output_name: str, artifact_tags: Optional[Dict[str, str]] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Generic distribution object.

You probably want to use the sub-classes and not this class directly. Known sub-classes are: ImageTemplateManagedImageDistributor, ImageTemplateSharedImageDistributor, ImageTemplateVhdDistributor

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – Type of distribution. Required.

  • run_output_name (str) – The name to be used for the associated RunOutput. Required.

  • artifact_tags (dict[str, str]) – Tags that will be applied to the artifact once it has been created/updated by the distributor.

Keyword Arguments
  • run_output_name (str) – The name to be used for the associated RunOutput. Required.

  • artifact_tags (dict[str, str]) – Tags that will be applied to the artifact once it has been created/updated by the distributor.

class azure.mgmt.imagebuilder.models.ImageTemplateFileCustomizer(*, name: Optional[str] = None, source_uri: Optional[str] = None, sha256_checksum: str = '', destination: Optional[str] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ImageTemplateCustomizer

Uploads files to VMs (Linux, Windows). Corresponds to Packer file provisioner.

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – The type of customization tool you want to use on the Image. For example, “Shell” can be shell customizer. Required.

  • name (str) – Friendly Name to provide context on what this customization step does.

  • source_uri (str) – The URI of the file to be uploaded for customizing the VM. It can be a github link, SAS URI for Azure Storage, etc.

  • sha256_checksum (str) – SHA256 checksum of the file provided in the sourceUri field above.

  • destination (str) – The absolute path to a file (with nested directory structures already created) where the file (from sourceUri) will be uploaded to in the VM.

Keyword Arguments
  • name (str) – Friendly Name to provide context on what this customization step does.

  • source_uri (str) – The URI of the file to be uploaded for customizing the VM. It can be a github link, SAS URI for Azure Storage, etc.

  • sha256_checksum (str) – SHA256 checksum of the file provided in the sourceUri field above.

  • destination (str) – The absolute path to a file (with nested directory structures already created) where the file (from sourceUri) will be uploaded to in the VM.

class azure.mgmt.imagebuilder.models.ImageTemplateIdentity(*, type: Optional[Union[str, _models.ResourceIdentityType]] = None, user_assigned_identities: Optional[Dict[str, _models.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties]] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Identity for the image template.

Variables
Keyword Arguments
  • type (str or ResourceIdentityType) – The type of identity used for the image template. The type ‘None’ will remove any identities from the image template. Known values are: “UserAssigned” and “None”.

  • user_assigned_identities (dict[str, ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties]) – The list of user identities associated with the image template. The user identity dictionary key references will be ARM resource ids in the form: ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}’.

class azure.mgmt.imagebuilder.models.ImageTemplateInVMValidator(*, name: Optional[str] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Describes a unit of in-VM validation of image.

You probably want to use the sub-classes and not this class directly. Known sub-classes are: ImageTemplatePowerShellValidator, ImageTemplateShellValidator

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – The type of validation you want to use on the Image. For example, “Shell” can be shell validation. Required.

  • name (str) – Friendly Name to provide context on what this validation step does.

Keyword Arguments

name (str) – Friendly Name to provide context on what this validation step does.

class azure.mgmt.imagebuilder.models.ImageTemplateLastRunStatus(*, start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, run_state: Optional[Union[str, _models.RunState]] = None, run_sub_state: Optional[Union[str, _models.RunSubState]] = None, message: Optional[str] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Describes the latest status of running an image template.

Variables
  • start_time (datetime) – Start time of the last run (UTC).

  • end_time (datetime) – End time of the last run (UTC).

  • run_state (str or RunState) – State of the last run. Known values are: “Running”, “Canceling”, “Succeeded”, “PartiallySucceeded”, “Failed”, and “Canceled”.

  • run_sub_state (str or RunSubState) – Sub-state of the last run. Known values are: “Queued”, “Building”, “Customizing”, “Validating”, and “Distributing”.

  • message (str) – Verbose information about the last run state.

Keyword Arguments
  • start_time (datetime) – Start time of the last run (UTC).

  • end_time (datetime) – End time of the last run (UTC).

  • run_state (str or RunState) – State of the last run. Known values are: “Running”, “Canceling”, “Succeeded”, “PartiallySucceeded”, “Failed”, and “Canceled”.

  • run_sub_state (str or RunSubState) – Sub-state of the last run. Known values are: “Queued”, “Building”, “Customizing”, “Validating”, and “Distributing”.

  • message (str) – Verbose information about the last run state.

class azure.mgmt.imagebuilder.models.ImageTemplateListResult(*, value: Optional[List[_models.ImageTemplate]] = None, next_link: Optional[str] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

The result of List image templates operation.

Variables
  • value (list[ImageTemplate]) – An array of image templates.

  • next_link (str) – The continuation token.

Keyword Arguments
  • value (list[ImageTemplate]) – An array of image templates.

  • next_link (str) – The continuation token.

class azure.mgmt.imagebuilder.models.ImageTemplateManagedImageDistributor(*, run_output_name: str, image_id: str, location: str, artifact_tags: Optional[Dict[str, str]] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ImageTemplateDistributor

Distribute as a Managed Disk Image.

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – Type of distribution. Required.

  • run_output_name (str) – The name to be used for the associated RunOutput. Required.

  • artifact_tags (dict[str, str]) – Tags that will be applied to the artifact once it has been created/updated by the distributor.

  • image_id (str) – Resource Id of the Managed Disk Image. Required.

  • location (str) – Azure location for the image, should match if image already exists. Required.

Keyword Arguments
  • run_output_name (str) – The name to be used for the associated RunOutput. Required.

  • artifact_tags (dict[str, str]) – Tags that will be applied to the artifact once it has been created/updated by the distributor.

  • image_id (str) – Resource Id of the Managed Disk Image. Required.

  • location (str) – Azure location for the image, should match if image already exists. Required.

class azure.mgmt.imagebuilder.models.ImageTemplateManagedImageSource(*, image_id: str, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ImageTemplateSource

Describes an image source that is a managed image in customer subscription. This image must reside in the same subscription and region as the Image Builder template.

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – Specifies the type of source image you want to start with. Required.

  • image_id (str) – ARM resource id of the managed image in customer subscription. Required.

Keyword Arguments

image_id (str) – ARM resource id of the managed image in customer subscription. Required.

class azure.mgmt.imagebuilder.models.ImageTemplatePlatformImageSource(*, publisher: Optional[str] = None, offer: Optional[str] = None, sku: Optional[str] = None, version: Optional[str] = None, plan_info: Optional[_models.PlatformImagePurchasePlan] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ImageTemplateSource

Describes an image source from Azure Gallery Images.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – Specifies the type of source image you want to start with. Required.

  • publisher (str) –

    Image Publisher in Azure Gallery Images.

  • offer (str) –

    Image offer from the Azure Gallery Images.

  • sku (str) –

    Image sku from the Azure Gallery Images.

  • version (str) –

    Image version from the Azure Gallery Images. If ‘latest’ is specified here, the version is evaluated when the image build takes place, not when the template is submitted.

  • exact_version (str) –

    Image version from the Azure Gallery Images. This readonly field differs from ‘version’, only if the value specified in ‘version’ field is ‘latest’.

  • plan_info (PlatformImagePurchasePlan) – Optional configuration of purchase plan for platform image.

Keyword Arguments
class azure.mgmt.imagebuilder.models.ImageTemplatePowerShellCustomizer(*, name: Optional[str] = None, script_uri: Optional[str] = None, sha256_checksum: str = '', inline: Optional[List[str]] = None, run_elevated: bool = False, run_as_system: bool = False, valid_exit_codes: Optional[List[int]] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ImageTemplateCustomizer

Runs the specified PowerShell on the VM (Windows). Corresponds to Packer powershell provisioner. Exactly one of ‘scriptUri’ or ‘inline’ can be specified.

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – The type of customization tool you want to use on the Image. For example, “Shell” can be shell customizer. Required.

  • name (str) – Friendly Name to provide context on what this customization step does.

  • script_uri (str) – URI of the PowerShell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc.

  • sha256_checksum (str) – SHA256 checksum of the power shell script provided in the scriptUri field above.

  • inline (list[str]) – Array of PowerShell commands to execute.

  • run_elevated (bool) – If specified, the PowerShell script will be run with elevated privileges.

  • run_as_system (bool) – If specified, the PowerShell script will be run with elevated privileges using the Local System user. Can only be true when the runElevated field above is set to true.

  • valid_exit_codes (list[int]) – Valid exit codes for the PowerShell script. [Default: 0].

Keyword Arguments
  • name (str) – Friendly Name to provide context on what this customization step does.

  • script_uri (str) – URI of the PowerShell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc.

  • sha256_checksum (str) – SHA256 checksum of the power shell script provided in the scriptUri field above.

  • inline (list[str]) – Array of PowerShell commands to execute.

  • run_elevated (bool) – If specified, the PowerShell script will be run with elevated privileges.

  • run_as_system (bool) – If specified, the PowerShell script will be run with elevated privileges using the Local System user. Can only be true when the runElevated field above is set to true.

  • valid_exit_codes (list[int]) – Valid exit codes for the PowerShell script. [Default: 0].

class azure.mgmt.imagebuilder.models.ImageTemplatePowerShellValidator(*, name: Optional[str] = None, script_uri: Optional[str] = None, sha256_checksum: str = '', inline: Optional[List[str]] = None, run_elevated: bool = False, run_as_system: bool = False, valid_exit_codes: Optional[List[int]] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ImageTemplateInVMValidator

Runs the specified PowerShell script during the validation phase (Windows). Corresponds to Packer powershell provisioner. Exactly one of ‘scriptUri’ or ‘inline’ can be specified.

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – The type of validation you want to use on the Image. For example, “Shell” can be shell validation. Required.

  • name (str) – Friendly Name to provide context on what this validation step does.

  • script_uri (str) – URI of the PowerShell script to be run for validation. It can be a github link, Azure Storage URI, etc.

  • sha256_checksum (str) – SHA256 checksum of the power shell script provided in the scriptUri field above.

  • inline (list[str]) – Array of PowerShell commands to execute.

  • run_elevated (bool) – If specified, the PowerShell script will be run with elevated privileges.

  • run_as_system (bool) – If specified, the PowerShell script will be run with elevated privileges using the Local System user. Can only be true when the runElevated field above is set to true.

  • valid_exit_codes (list[int]) – Valid exit codes for the PowerShell script. [Default: 0].

Keyword Arguments
  • name (str) – Friendly Name to provide context on what this validation step does.

  • script_uri (str) – URI of the PowerShell script to be run for validation. It can be a github link, Azure Storage URI, etc.

  • sha256_checksum (str) – SHA256 checksum of the power shell script provided in the scriptUri field above.

  • inline (list[str]) – Array of PowerShell commands to execute.

  • run_elevated (bool) – If specified, the PowerShell script will be run with elevated privileges.

  • run_as_system (bool) – If specified, the PowerShell script will be run with elevated privileges using the Local System user. Can only be true when the runElevated field above is set to true.

  • valid_exit_codes (list[int]) – Valid exit codes for the PowerShell script. [Default: 0].

class azure.mgmt.imagebuilder.models.ImageTemplatePropertiesValidate(*, continue_distribute_on_failure: bool = False, source_validation_only: bool = False, in_vm_validations: Optional[List[_models.ImageTemplateInVMValidator]] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Configuration options and list of validations to be performed on the resulting image.

Variables
  • continue_distribute_on_failure (bool) – If validation fails and this field is set to false, output image(s) will not be distributed. This is the default behavior. If validation fails and this field is set to true, output image(s) will still be distributed. Please use this option with caution as it may result in bad images being distributed for use. In either case (true or false), the end to end image run will be reported as having failed in case of a validation failure. [Note: This field has no effect if validation succeeds.].

  • source_validation_only (bool) – If this field is set to true, the image specified in the ‘source’ section will directly be validated. No separate build will be run to generate and then validate a customized image.

  • in_vm_validations (list[ImageTemplateInVMValidator]) – List of validations to be performed.

Keyword Arguments
  • continue_distribute_on_failure (bool) – If validation fails and this field is set to false, output image(s) will not be distributed. This is the default behavior. If validation fails and this field is set to true, output image(s) will still be distributed. Please use this option with caution as it may result in bad images being distributed for use. In either case (true or false), the end to end image run will be reported as having failed in case of a validation failure. [Note: This field has no effect if validation succeeds.].

  • source_validation_only (bool) – If this field is set to true, the image specified in the ‘source’ section will directly be validated. No separate build will be run to generate and then validate a customized image.

  • in_vm_validations (list[ImageTemplateInVMValidator]) – List of validations to be performed.

class azure.mgmt.imagebuilder.models.ImageTemplateRestartCustomizer(*, name: Optional[str] = None, restart_command: Optional[str] = None, restart_check_command: Optional[str] = None, restart_timeout: Optional[str] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ImageTemplateCustomizer

Reboots a VM and waits for it to come back online (Windows). Corresponds to Packer windows-restart provisioner.

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – The type of customization tool you want to use on the Image. For example, “Shell” can be shell customizer. Required.

  • name (str) – Friendly Name to provide context on what this customization step does.

  • restart_command (str) – Command to execute the restart [Default: ‘shutdown /r /f /t 0 /c “packer restart”’].

  • restart_check_command (str) – Command to check if restart succeeded [Default: ‘’].

  • restart_timeout (str) – Restart timeout specified as a string of magnitude and unit, e.g. ‘5m’ (5 minutes) or ‘2h’ (2 hours) [Default: ‘5m’].

Keyword Arguments
  • name (str) – Friendly Name to provide context on what this customization step does.

  • restart_command (str) – Command to execute the restart [Default: ‘shutdown /r /f /t 0 /c “packer restart”’].

  • restart_check_command (str) – Command to check if restart succeeded [Default: ‘’].

  • restart_timeout (str) – Restart timeout specified as a string of magnitude and unit, e.g. ‘5m’ (5 minutes) or ‘2h’ (2 hours) [Default: ‘5m’].

class azure.mgmt.imagebuilder.models.ImageTemplateSharedImageDistributor(*, run_output_name: str, gallery_image_id: str, replication_regions: List[str], artifact_tags: Optional[Dict[str, str]] = None, exclude_from_latest: bool = False, storage_account_type: Optional[Union[str, _models.SharedImageStorageAccountType]] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ImageTemplateDistributor

Distribute via Shared Image Gallery.

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – Type of distribution. Required.

  • run_output_name (str) – The name to be used for the associated RunOutput. Required.

  • artifact_tags (dict[str, str]) – Tags that will be applied to the artifact once it has been created/updated by the distributor.

  • gallery_image_id (str) – Resource Id of the Shared Image Gallery image. Required.

  • replication_regions (list[str]) – A list of regions that the image will be replicated to. Required.

  • exclude_from_latest (bool) – Flag that indicates whether created image version should be excluded from latest. Omit to use the default (false).

  • storage_account_type (str or SharedImageStorageAccountType) – Storage account type to be used to store the shared image. Omit to use the default (Standard_LRS). Known values are: “Standard_LRS” and “Standard_ZRS”.

Keyword Arguments
  • run_output_name (str) – The name to be used for the associated RunOutput. Required.

  • artifact_tags (dict[str, str]) – Tags that will be applied to the artifact once it has been created/updated by the distributor.

  • gallery_image_id (str) – Resource Id of the Shared Image Gallery image. Required.

  • replication_regions (list[str]) – A list of regions that the image will be replicated to. Required.

  • exclude_from_latest (bool) – Flag that indicates whether created image version should be excluded from latest. Omit to use the default (false).

  • storage_account_type (str or SharedImageStorageAccountType) – Storage account type to be used to store the shared image. Omit to use the default (Standard_LRS). Known values are: “Standard_LRS” and “Standard_ZRS”.

class azure.mgmt.imagebuilder.models.ImageTemplateSharedImageVersionSource(*, image_version_id: str, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ImageTemplateSource

Describes an image source that is an image version in a shared image gallery.

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – Specifies the type of source image you want to start with. Required.

  • image_version_id (str) – ARM resource id of the image version in the shared image gallery. Required.

Keyword Arguments

image_version_id (str) – ARM resource id of the image version in the shared image gallery. Required.

class azure.mgmt.imagebuilder.models.ImageTemplateShellCustomizer(*, name: Optional[str] = None, script_uri: Optional[str] = None, sha256_checksum: str = '', inline: Optional[List[str]] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ImageTemplateCustomizer

Runs a shell script during the customization phase (Linux). Corresponds to Packer shell provisioner. Exactly one of ‘scriptUri’ or ‘inline’ can be specified.

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – The type of customization tool you want to use on the Image. For example, “Shell” can be shell customizer. Required.

  • name (str) – Friendly Name to provide context on what this customization step does.

  • script_uri (str) – URI of the shell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc.

  • sha256_checksum (str) – SHA256 checksum of the shell script provided in the scriptUri field.

  • inline (list[str]) – Array of shell commands to execute.

Keyword Arguments
  • name (str) – Friendly Name to provide context on what this customization step does.

  • script_uri (str) – URI of the shell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc.

  • sha256_checksum (str) – SHA256 checksum of the shell script provided in the scriptUri field.

  • inline (list[str]) – Array of shell commands to execute.

class azure.mgmt.imagebuilder.models.ImageTemplateShellValidator(*, name: Optional[str] = None, script_uri: Optional[str] = None, sha256_checksum: str = '', inline: Optional[List[str]] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ImageTemplateInVMValidator

Runs the specified shell script during the validation phase (Linux). Corresponds to Packer shell provisioner. Exactly one of ‘scriptUri’ or ‘inline’ can be specified.

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – The type of validation you want to use on the Image. For example, “Shell” can be shell validation. Required.

  • name (str) – Friendly Name to provide context on what this validation step does.

  • script_uri (str) – URI of the shell script to be run for validation. It can be a github link, Azure Storage URI, etc.

  • sha256_checksum (str) – SHA256 checksum of the shell script provided in the scriptUri field.

  • inline (list[str]) – Array of shell commands to execute.

Keyword Arguments
  • name (str) – Friendly Name to provide context on what this validation step does.

  • script_uri (str) – URI of the shell script to be run for validation. It can be a github link, Azure Storage URI, etc.

  • sha256_checksum (str) – SHA256 checksum of the shell script provided in the scriptUri field.

  • inline (list[str]) – Array of shell commands to execute.

class azure.mgmt.imagebuilder.models.ImageTemplateSource(**kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Describes a virtual machine image source for building, customizing and distributing.

You probably want to use the sub-classes and not this class directly. Known sub-classes are: ImageTemplateManagedImageSource, ImageTemplatePlatformImageSource, ImageTemplateSharedImageVersionSource

All required parameters must be populated in order to send to Azure.

Variables

type (str) – Specifies the type of source image you want to start with. Required.

class azure.mgmt.imagebuilder.models.ImageTemplateUpdateParameters(*, identity: Optional[_models.ImageTemplateIdentity] = None, tags: Optional[Dict[str, str]] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Parameters for updating an image template.

Variables
  • identity (ImageTemplateIdentity) – The identity of the image template, if configured.

  • tags (dict[str, str]) – The user-specified tags associated with the image template.

Keyword Arguments
  • identity (ImageTemplateIdentity) – The identity of the image template, if configured.

  • tags (dict[str, str]) – The user-specified tags associated with the image template.

class azure.mgmt.imagebuilder.models.ImageTemplateVhdDistributor(*, run_output_name: str, artifact_tags: Optional[Dict[str, str]] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ImageTemplateDistributor

Distribute via VHD in a storage account.

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – Type of distribution. Required.

  • run_output_name (str) – The name to be used for the associated RunOutput. Required.

  • artifact_tags (dict[str, str]) – Tags that will be applied to the artifact once it has been created/updated by the distributor.

Keyword Arguments
  • run_output_name (str) – The name to be used for the associated RunOutput. Required.

  • artifact_tags (dict[str, str]) – Tags that will be applied to the artifact once it has been created/updated by the distributor.

class azure.mgmt.imagebuilder.models.ImageTemplateVmProfile(*, vm_size: str = '', os_disk_size_gb: int = 0, user_assigned_identities: Optional[List[str]] = None, vnet_config: Optional[_models.VirtualNetworkConfig] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Describes the virtual machines used to build and validate images.

Variables
  • vm_size (str) – Size of the virtual machine used to build, customize and capture images. Omit or specify empty string to use the default (Standard_D1_v2 for Gen1 images and Standard_D2ds_v4 for Gen2 images).

  • os_disk_size_gb (int) – Size of the OS disk in GB. Omit or specify 0 to use Azure’s default OS disk size.

  • user_assigned_identities (list[str]) – Optional array of resource IDs of user assigned managed identities to be configured on the build VM and validation VM. This may include the identity of the image template.

  • vnet_config (VirtualNetworkConfig) – Optional configuration of the virtual network to use to deploy the build VM and validation VM in. Omit if no specific virtual network needs to be used.

Keyword Arguments
  • vm_size (str) – Size of the virtual machine used to build, customize and capture images. Omit or specify empty string to use the default (Standard_D1_v2 for Gen1 images and Standard_D2ds_v4 for Gen2 images).

  • os_disk_size_gb (int) – Size of the OS disk in GB. Omit or specify 0 to use Azure’s default OS disk size.

  • user_assigned_identities (list[str]) – Optional array of resource IDs of user assigned managed identities to be configured on the build VM and validation VM. This may include the identity of the image template.

  • vnet_config (VirtualNetworkConfig) – Optional configuration of the virtual network to use to deploy the build VM and validation VM in. Omit if no specific virtual network needs to be used.

class azure.mgmt.imagebuilder.models.ImageTemplateWindowsUpdateCustomizer(*, name: Optional[str] = None, search_criteria: Optional[str] = None, filters: Optional[List[str]] = None, update_limit: Optional[int] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ImageTemplateCustomizer

Installs Windows Updates. Corresponds to Packer Windows Update Provisioner (https://github.com/rgl/packer-provisioner-windows-update).

All required parameters must be populated in order to send to Azure.

Variables
  • type (str) – The type of customization tool you want to use on the Image. For example, “Shell” can be shell customizer. Required.

  • name (str) – Friendly Name to provide context on what this customization step does.

  • search_criteria (str) – Criteria to search updates. Omit or specify empty string to use the default (search all). Refer to above link for examples and detailed description of this field.

  • filters (list[str]) – Array of filters to select updates to apply. Omit or specify empty array to use the default (no filter). Refer to above link for examples and detailed description of this field.

  • update_limit (int) – Maximum number of updates to apply at a time. Omit or specify 0 to use the default (1000).

Keyword Arguments
  • name (str) – Friendly Name to provide context on what this customization step does.

  • search_criteria (str) – Criteria to search updates. Omit or specify empty string to use the default (search all). Refer to above link for examples and detailed description of this field.

  • filters (list[str]) – Array of filters to select updates to apply. Omit or specify empty array to use the default (no filter). Refer to above link for examples and detailed description of this field.

  • update_limit (int) – Maximum number of updates to apply at a time. Omit or specify 0 to use the default (1000).

class azure.mgmt.imagebuilder.models.Operation(*, name: Optional[str] = None, display: Optional[_models.OperationDisplay] = None, origin: Optional[str] = None, properties: Optional[collections.abc.MutableMapping[str, Any]] = None, is_data_action: Optional[bool] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

A REST API operation.

Variables
  • name (str) – This is of the format {provider}/{resource}/{operation}.

  • display (OperationDisplay) – The object that describes the operation.

  • origin (str) – The intended executor of the operation.

  • properties (JSON) – Properties of the operation.

  • is_data_action (bool) – The flag that indicates whether the operation applies to data plane.

Keyword Arguments
  • name (str) – This is of the format {provider}/{resource}/{operation}.

  • display (OperationDisplay) – The object that describes the operation.

  • origin (str) – The intended executor of the operation.

  • properties (JSON) – Properties of the operation.

  • is_data_action (bool) – The flag that indicates whether the operation applies to data plane.

class azure.mgmt.imagebuilder.models.OperationDisplay(*, provider: Optional[str] = None, operation: Optional[str] = None, resource: Optional[str] = None, description: Optional[str] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

The object that describes the operation.

Variables
  • provider (str) – Friendly name of the resource provider.

  • operation (str) – For example: read, write, delete, or listKeys/action.

  • resource (str) – The resource type on which the operation is performed.

  • description (str) – The friendly name of the operation.

Keyword Arguments
  • provider (str) – Friendly name of the resource provider.

  • operation (str) – For example: read, write, delete, or listKeys/action.

  • resource (str) – The resource type on which the operation is performed.

  • description (str) – The friendly name of the operation.

class azure.mgmt.imagebuilder.models.OperationListResult(*, value: Optional[List[_models.Operation]] = None, next_link: Optional[str] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next set of results.

Variables
  • value (list[Operation]) – The list of operations supported by the resource provider.

  • next_link (str) – The URL to get the next set of operation list results if there are any.

Keyword Arguments
  • value (list[Operation]) – The list of operations supported by the resource provider.

  • next_link (str) – The URL to get the next set of operation list results if there are any.

class azure.mgmt.imagebuilder.models.PlatformImagePurchasePlan(*, plan_name: str, plan_product: str, plan_publisher: str, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Purchase plan configuration for platform image.

All required parameters must be populated in order to send to Azure.

Variables
  • plan_name (str) – Name of the purchase plan. Required.

  • plan_product (str) – Product of the purchase plan. Required.

  • plan_publisher (str) – Publisher of the purchase plan. Required.

Keyword Arguments
  • plan_name (str) – Name of the purchase plan. Required.

  • plan_product (str) – Product of the purchase plan. Required.

  • plan_publisher (str) – Publisher of the purchase plan. Required.

class azure.mgmt.imagebuilder.models.ProvisioningError(*, provisioning_error_code: Optional[Union[str, _models.ProvisioningErrorCode]] = None, message: Optional[str] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Describes the error happened when create or update an image template.

Variables
  • provisioning_error_code (str or ProvisioningErrorCode) – Error code of the provisioning failure. Known values are: “BadSourceType”, “BadPIRSource”, “BadManagedImageSource”, “BadSharedImageVersionSource”, “BadCustomizerType”, “UnsupportedCustomizerType”, “NoCustomizerScript”, “BadValidatorType”, “UnsupportedValidatorType”, “NoValidatorScript”, “BadDistributeType”, “BadSharedImageDistribute”, “BadStagingResourceGroup”, “ServerError”, and “Other”.

  • message (str) – Verbose error message about the provisioning failure.

Keyword Arguments
  • provisioning_error_code (str or ProvisioningErrorCode) – Error code of the provisioning failure. Known values are: “BadSourceType”, “BadPIRSource”, “BadManagedImageSource”, “BadSharedImageVersionSource”, “BadCustomizerType”, “UnsupportedCustomizerType”, “NoCustomizerScript”, “BadValidatorType”, “UnsupportedValidatorType”, “NoValidatorScript”, “BadDistributeType”, “BadSharedImageDistribute”, “BadStagingResourceGroup”, “ServerError”, and “Other”.

  • message (str) – Verbose error message about the provisioning failure.

class azure.mgmt.imagebuilder.models.ProvisioningErrorCode(value)[source]

Bases: str, enum.Enum

Error code of the provisioning failure.

BAD_CUSTOMIZER_TYPE = 'BadCustomizerType'
BAD_DISTRIBUTE_TYPE = 'BadDistributeType'
BAD_MANAGED_IMAGE_SOURCE = 'BadManagedImageSource'
BAD_PIR_SOURCE = 'BadPIRSource'
BAD_SHARED_IMAGE_DISTRIBUTE = 'BadSharedImageDistribute'
BAD_SHARED_IMAGE_VERSION_SOURCE = 'BadSharedImageVersionSource'
BAD_SOURCE_TYPE = 'BadSourceType'
BAD_STAGING_RESOURCE_GROUP = 'BadStagingResourceGroup'
BAD_VALIDATOR_TYPE = 'BadValidatorType'
NO_CUSTOMIZER_SCRIPT = 'NoCustomizerScript'
NO_VALIDATOR_SCRIPT = 'NoValidatorScript'
OTHER = 'Other'
SERVER_ERROR = 'ServerError'
UNSUPPORTED_CUSTOMIZER_TYPE = 'UnsupportedCustomizerType'
UNSUPPORTED_VALIDATOR_TYPE = 'UnsupportedValidatorType'
class azure.mgmt.imagebuilder.models.ProvisioningState(value)[source]

Bases: str, enum.Enum

Provisioning state of the resource.

CREATING = 'Creating'
DELETING = 'Deleting'
FAILED = 'Failed'
SUCCEEDED = 'Succeeded'
UPDATING = 'Updating'
class azure.mgmt.imagebuilder.models.ProxyResource(**kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.Resource

The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • id (str) – Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.

  • name (str) – The name of the resource.

  • type (str) – The type of the resource. E.g. “Microsoft.Compute/virtualMachines” or “Microsoft.Storage/storageAccounts”.

  • system_data (SystemData) – Azure Resource Manager metadata containing createdBy and modifiedBy information.

class azure.mgmt.imagebuilder.models.Resource(**kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Common fields that are returned in the response for all Azure Resource Manager resources.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • id (str) – Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.

  • name (str) – The name of the resource.

  • type (str) – The type of the resource. E.g. “Microsoft.Compute/virtualMachines” or “Microsoft.Storage/storageAccounts”.

  • system_data (SystemData) – Azure Resource Manager metadata containing createdBy and modifiedBy information.

class azure.mgmt.imagebuilder.models.ResourceIdentityType(value)[source]

Bases: str, enum.Enum

The type of identity used for the image template. The type ‘None’ will remove any identities from the image template.

NONE = 'None'
USER_ASSIGNED = 'UserAssigned'
class azure.mgmt.imagebuilder.models.RunOutput(*, artifact_id: Optional[str] = None, artifact_uri: Optional[str] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.ProxyResource

Represents an output that was created by running an image template.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • id (str) – Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.

  • name (str) – The name of the resource.

  • type (str) – The type of the resource. E.g. “Microsoft.Compute/virtualMachines” or “Microsoft.Storage/storageAccounts”.

  • system_data (SystemData) – Azure Resource Manager metadata containing createdBy and modifiedBy information.

  • artifact_id (str) – The resource id of the artifact.

  • artifact_uri (str) – The location URI of the artifact.

  • provisioning_state (str or ProvisioningState) – Provisioning state of the resource. Known values are: “Creating”, “Updating”, “Succeeded”, “Failed”, and “Deleting”.

Keyword Arguments
  • artifact_id (str) – The resource id of the artifact.

  • artifact_uri (str) – The location URI of the artifact.

class azure.mgmt.imagebuilder.models.RunOutputCollection(*, value: Optional[List[_models.RunOutput]] = None, next_link: Optional[str] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

The result of List run outputs operation.

Variables
  • value (list[RunOutput]) – An array of run outputs.

  • next_link (str) – The continuation token.

Keyword Arguments
  • value (list[RunOutput]) – An array of run outputs.

  • next_link (str) – The continuation token.

class azure.mgmt.imagebuilder.models.RunState(value)[source]

Bases: str, enum.Enum

State of the last run.

CANCELED = 'Canceled'
CANCELING = 'Canceling'
FAILED = 'Failed'
PARTIALLY_SUCCEEDED = 'PartiallySucceeded'
RUNNING = 'Running'
SUCCEEDED = 'Succeeded'
class azure.mgmt.imagebuilder.models.RunSubState(value)[source]

Bases: str, enum.Enum

Sub-state of the last run.

BUILDING = 'Building'
CUSTOMIZING = 'Customizing'
DISTRIBUTING = 'Distributing'
QUEUED = 'Queued'
VALIDATING = 'Validating'
class azure.mgmt.imagebuilder.models.SharedImageStorageAccountType(value)[source]

Bases: str, enum.Enum

Storage account type to be used to store the shared image. Omit to use the default (Standard_LRS).

STANDARD_LRS = 'Standard_LRS'
STANDARD_ZRS = 'Standard_ZRS'
class azure.mgmt.imagebuilder.models.SystemData(*, created_by: Optional[str] = None, created_by_type: Optional[Union[str, _models.CreatedByType]] = None, created_at: Optional[datetime.datetime] = None, last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, _models.CreatedByType]] = None, last_modified_at: Optional[datetime.datetime] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Metadata pertaining to creation and last modification of the resource.

Variables
  • created_by (str) – The identity that created the resource.

  • created_by_type (str or CreatedByType) – The type of identity that created the resource. Known values are: “User”, “Application”, “ManagedIdentity”, and “Key”.

  • created_at (datetime) – The timestamp of resource creation (UTC).

  • last_modified_by (str) – The identity that last modified the resource.

  • last_modified_by_type (str or CreatedByType) – The type of identity that last modified the resource. Known values are: “User”, “Application”, “ManagedIdentity”, and “Key”.

  • last_modified_at (datetime) – The timestamp of resource last modification (UTC).

Keyword Arguments
  • created_by (str) – The identity that created the resource.

  • created_by_type (str or CreatedByType) – The type of identity that created the resource. Known values are: “User”, “Application”, “ManagedIdentity”, and “Key”.

  • created_at (datetime) – The timestamp of resource creation (UTC).

  • last_modified_by (str) – The identity that last modified the resource.

  • last_modified_by_type (str or CreatedByType) – The type of identity that last modified the resource. Known values are: “User”, “Application”, “ManagedIdentity”, and “Key”.

  • last_modified_at (datetime) – The timestamp of resource last modification (UTC).

class azure.mgmt.imagebuilder.models.TrackedResource(*, location: str, tags: Optional[Dict[str, str]] = None, **kwargs)[source]

Bases: azure.mgmt.imagebuilder.models._models_py3.Resource

The resource model definition for an Azure Resource Manager tracked top level resource which has ‘tags’ and a ‘location’.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Variables
  • id (str) – Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.

  • name (str) – The name of the resource.

  • type (str) – The type of the resource. E.g. “Microsoft.Compute/virtualMachines” or “Microsoft.Storage/storageAccounts”.

  • system_data (SystemData) – Azure Resource Manager metadata containing createdBy and modifiedBy information.

  • tags (dict[str, str]) – Resource tags.

  • location (str) – The geo-location where the resource lives. Required.

Keyword Arguments
  • tags (dict[str, str]) – Resource tags.

  • location (str) – The geo-location where the resource lives. Required.

class azure.mgmt.imagebuilder.models.VirtualNetworkConfig(*, subnet_id: Optional[str] = None, proxy_vm_size: str = '', **kwargs)[source]

Bases: azure.mgmt.imagebuilder._serialization.Model

Virtual Network configuration.

Variables
  • subnet_id (str) – Resource id of a pre-existing subnet.

  • proxy_vm_size (str) – Size of the proxy virtual machine used to pass traffic to the build VM and validation VM. Omit or specify empty string to use the default (Standard_A1_v2).

Keyword Arguments
  • subnet_id (str) – Resource id of a pre-existing subnet.

  • proxy_vm_size (str) – Size of the proxy virtual machine used to pass traffic to the build VM and validation VM. Omit or specify empty string to use the default (Standard_A1_v2).