armvirtualmachineimagebuilder

package module
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 14 Imported by: 2

README

Azure Virtual Machine Image Builder Module for Go

PkgGoDev

The armvirtualmachineimagebuilder module provides operations for working with Azure Virtual Machine Image Builder.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Virtual Machine Image Builder module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Virtual Machine Image Builder. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Virtual Machine Image Builder module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewVirtualMachineImageTemplatesClient()

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Virtual Machine Image Builder label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFactory added in v1.2.0

type ClientFactory struct {
	// contains filtered or unexported fields
}

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory added in v1.2.0

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription Id forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewOperationsClient added in v1.2.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

func (*ClientFactory) NewVirtualMachineImageTemplatesClient added in v1.2.0

func (c *ClientFactory) NewVirtualMachineImageTemplatesClient() *VirtualMachineImageTemplatesClient

type ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties

type ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties struct {
	// READ-ONLY; The client id of user assigned identity.
	ClientID *string

	// READ-ONLY; The principal id of user assigned identity.
	PrincipalID *string
}

func (ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties) MarshalJSON added in v1.2.0

MarshalJSON implements the json.Marshaller interface for type ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties.

func (*ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties) UnmarshalJSON added in v1.2.0

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type ImageTemplate

type ImageTemplate struct {
	// REQUIRED; The identity of the image template, if configured.
	Identity *ImageTemplateIdentity

	// REQUIRED; The geo-location where the resource lives
	Location *string

	// The properties of the image template
	Properties *ImageTemplateProperties

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

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

func (ImageTemplate) MarshalJSON

func (i ImageTemplate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplate.

func (*ImageTemplate) UnmarshalJSON added in v1.2.0

func (i *ImageTemplate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplate.

type ImageTemplateCustomizer

type ImageTemplateCustomizer struct {
	// REQUIRED; The type of customization tool you want to use on the Image. For example, "Shell" can be shell customizer
	Type *string

	// Friendly Name to provide context on what this customization step does
	Name *string
}

ImageTemplateCustomizer - Describes a unit of image customization

func (*ImageTemplateCustomizer) GetImageTemplateCustomizer

func (i *ImageTemplateCustomizer) GetImageTemplateCustomizer() *ImageTemplateCustomizer

GetImageTemplateCustomizer implements the ImageTemplateCustomizerClassification interface for type ImageTemplateCustomizer.

func (ImageTemplateCustomizer) MarshalJSON added in v1.2.0

func (i ImageTemplateCustomizer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateCustomizer.

func (*ImageTemplateCustomizer) UnmarshalJSON

func (i *ImageTemplateCustomizer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateCustomizer.

type ImageTemplateCustomizerClassification

type ImageTemplateCustomizerClassification interface {
	// GetImageTemplateCustomizer returns the ImageTemplateCustomizer content of the underlying type.
	GetImageTemplateCustomizer() *ImageTemplateCustomizer
}

ImageTemplateCustomizerClassification provides polymorphic access to related types. Call the interface's GetImageTemplateCustomizer() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *ImageTemplateCustomizer, *ImageTemplateFileCustomizer, *ImageTemplatePowerShellCustomizer, *ImageTemplateRestartCustomizer, - *ImageTemplateShellCustomizer, *ImageTemplateWindowsUpdateCustomizer

type ImageTemplateDistributor

type ImageTemplateDistributor struct {
	// REQUIRED; The name to be used for the associated RunOutput.
	RunOutputName *string

	// REQUIRED; Type of distribution.
	Type *string

	// Tags that will be applied to the artifact once it has been created/updated by the distributor.
	ArtifactTags map[string]*string
}

ImageTemplateDistributor - Generic distribution object

func (*ImageTemplateDistributor) GetImageTemplateDistributor

func (i *ImageTemplateDistributor) GetImageTemplateDistributor() *ImageTemplateDistributor

GetImageTemplateDistributor implements the ImageTemplateDistributorClassification interface for type ImageTemplateDistributor.

func (ImageTemplateDistributor) MarshalJSON added in v0.2.0

func (i ImageTemplateDistributor) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateDistributor.

func (*ImageTemplateDistributor) UnmarshalJSON

func (i *ImageTemplateDistributor) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateDistributor.

type ImageTemplateDistributorClassification

type ImageTemplateDistributorClassification interface {
	// GetImageTemplateDistributor returns the ImageTemplateDistributor content of the underlying type.
	GetImageTemplateDistributor() *ImageTemplateDistributor
}

ImageTemplateDistributorClassification provides polymorphic access to related types. Call the interface's GetImageTemplateDistributor() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *ImageTemplateDistributor, *ImageTemplateManagedImageDistributor, *ImageTemplateSharedImageDistributor, *ImageTemplateVhdDistributor

type ImageTemplateFileCustomizer

type ImageTemplateFileCustomizer struct {
	// REQUIRED; The type of customization tool you want to use on the Image. For example, "Shell" can be shell customizer
	Type *string

	// The absolute path to a file (with nested directory structures already created) where the file (from sourceUri) will be
	// uploaded to in the VM
	Destination *string

	// Friendly Name to provide context on what this customization step does
	Name *string

	// SHA256 checksum of the file provided in the sourceUri field above
	SHA256Checksum *string

	// The URI of the file to be uploaded for customizing the VM. It can be a github link, SAS URI for Azure Storage, etc
	SourceURI *string
}

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

func (*ImageTemplateFileCustomizer) GetImageTemplateCustomizer added in v0.2.0

func (i *ImageTemplateFileCustomizer) GetImageTemplateCustomizer() *ImageTemplateCustomizer

GetImageTemplateCustomizer implements the ImageTemplateCustomizerClassification interface for type ImageTemplateFileCustomizer.

func (ImageTemplateFileCustomizer) MarshalJSON

func (i ImageTemplateFileCustomizer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateFileCustomizer.

func (*ImageTemplateFileCustomizer) UnmarshalJSON

func (i *ImageTemplateFileCustomizer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateFileCustomizer.

type ImageTemplateIdentity

type ImageTemplateIdentity struct {
	// The type of identity used for the image template. The type 'None' will remove any identities from the image template.
	Type *ResourceIdentityType

	// 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}'.
	UserAssignedIdentities map[string]*ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties
}

ImageTemplateIdentity - Identity for the image template.

func (ImageTemplateIdentity) MarshalJSON

func (i ImageTemplateIdentity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateIdentity.

func (*ImageTemplateIdentity) UnmarshalJSON added in v1.2.0

func (i *ImageTemplateIdentity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateIdentity.

type ImageTemplateInVMValidator added in v1.1.0

type ImageTemplateInVMValidator struct {
	// REQUIRED; The type of validation you want to use on the Image. For example, "Shell" can be shell validation
	Type *string

	// Friendly Name to provide context on what this validation step does
	Name *string
}

ImageTemplateInVMValidator - Describes a unit of in-VM validation of image

func (*ImageTemplateInVMValidator) GetImageTemplateInVMValidator added in v1.1.0

func (i *ImageTemplateInVMValidator) GetImageTemplateInVMValidator() *ImageTemplateInVMValidator

GetImageTemplateInVMValidator implements the ImageTemplateInVMValidatorClassification interface for type ImageTemplateInVMValidator.

func (ImageTemplateInVMValidator) MarshalJSON added in v1.2.0

func (i ImageTemplateInVMValidator) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateInVMValidator.

func (*ImageTemplateInVMValidator) UnmarshalJSON added in v1.2.0

func (i *ImageTemplateInVMValidator) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateInVMValidator.

type ImageTemplateInVMValidatorClassification added in v1.1.0

type ImageTemplateInVMValidatorClassification interface {
	// GetImageTemplateInVMValidator returns the ImageTemplateInVMValidator content of the underlying type.
	GetImageTemplateInVMValidator() *ImageTemplateInVMValidator
}

ImageTemplateInVMValidatorClassification provides polymorphic access to related types. Call the interface's GetImageTemplateInVMValidator() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *ImageTemplateInVMValidator, *ImageTemplatePowerShellValidator, *ImageTemplateShellValidator

type ImageTemplateLastRunStatus

type ImageTemplateLastRunStatus struct {
	// End time of the last run (UTC)
	EndTime *time.Time

	// Verbose information about the last run state
	Message *string

	// State of the last run
	RunState *RunState

	// Sub-state of the last run
	RunSubState *RunSubState

	// Start time of the last run (UTC)
	StartTime *time.Time
}

ImageTemplateLastRunStatus - Describes the latest status of running an image template

func (ImageTemplateLastRunStatus) MarshalJSON

func (i ImageTemplateLastRunStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateLastRunStatus.

func (*ImageTemplateLastRunStatus) UnmarshalJSON

func (i *ImageTemplateLastRunStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateLastRunStatus.

type ImageTemplateListResult

type ImageTemplateListResult struct {
	// The continuation token.
	NextLink *string

	// An array of image templates
	Value []*ImageTemplate
}

ImageTemplateListResult - The result of List image templates operation

func (ImageTemplateListResult) MarshalJSON

func (i ImageTemplateListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateListResult.

func (*ImageTemplateListResult) UnmarshalJSON added in v1.2.0

func (i *ImageTemplateListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateListResult.

type ImageTemplateManagedImageDistributor

type ImageTemplateManagedImageDistributor struct {
	// REQUIRED; Resource Id of the Managed Disk Image
	ImageID *string

	// REQUIRED; Azure location for the image, should match if image already exists
	Location *string

	// REQUIRED; The name to be used for the associated RunOutput.
	RunOutputName *string

	// REQUIRED; Type of distribution.
	Type *string

	// Tags that will be applied to the artifact once it has been created/updated by the distributor.
	ArtifactTags map[string]*string
}

ImageTemplateManagedImageDistributor - Distribute as a Managed Disk Image.

func (*ImageTemplateManagedImageDistributor) GetImageTemplateDistributor added in v0.2.0

func (i *ImageTemplateManagedImageDistributor) GetImageTemplateDistributor() *ImageTemplateDistributor

GetImageTemplateDistributor implements the ImageTemplateDistributorClassification interface for type ImageTemplateManagedImageDistributor.

func (ImageTemplateManagedImageDistributor) MarshalJSON

func (i ImageTemplateManagedImageDistributor) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateManagedImageDistributor.

func (*ImageTemplateManagedImageDistributor) UnmarshalJSON

func (i *ImageTemplateManagedImageDistributor) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateManagedImageDistributor.

type ImageTemplateManagedImageSource

type ImageTemplateManagedImageSource struct {
	// REQUIRED; ARM resource id of the managed image in customer subscription
	ImageID *string

	// REQUIRED; Specifies the type of source image you want to start with.
	Type *string
}

ImageTemplateManagedImageSource - 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.

func (*ImageTemplateManagedImageSource) GetImageTemplateSource added in v0.2.0

func (i *ImageTemplateManagedImageSource) GetImageTemplateSource() *ImageTemplateSource

GetImageTemplateSource implements the ImageTemplateSourceClassification interface for type ImageTemplateManagedImageSource.

func (ImageTemplateManagedImageSource) MarshalJSON

func (i ImageTemplateManagedImageSource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateManagedImageSource.

func (*ImageTemplateManagedImageSource) UnmarshalJSON

func (i *ImageTemplateManagedImageSource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateManagedImageSource.

type ImageTemplatePlatformImageSource

type ImageTemplatePlatformImageSource struct {
	// REQUIRED; Specifies the type of source image you want to start with.
	Type *string

	// Image offer from the Azure Gallery Images [https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages].
	Offer *string

	// Optional configuration of purchase plan for platform image.
	PlanInfo *PlatformImagePurchasePlan

	// Image Publisher in Azure Gallery Images [https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages].
	Publisher *string

	// Image sku from the Azure Gallery Images [https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages].
	SKU *string

	// Image version from the Azure Gallery Images [https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages]. If
	// 'latest' is specified here, the version is evaluated when the image build takes
	// place, not when the template is submitted.
	Version *string

	// READ-ONLY; Image version from the Azure Gallery Images [https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages].
	// This readonly field differs from 'version', only if the value specified in
	// 'version' field is 'latest'.
	ExactVersion *string
}

ImageTemplatePlatformImageSource - Describes an image source from Azure Gallery Images [https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages].

func (*ImageTemplatePlatformImageSource) GetImageTemplateSource added in v0.2.0

func (i *ImageTemplatePlatformImageSource) GetImageTemplateSource() *ImageTemplateSource

GetImageTemplateSource implements the ImageTemplateSourceClassification interface for type ImageTemplatePlatformImageSource.

func (ImageTemplatePlatformImageSource) MarshalJSON

func (i ImageTemplatePlatformImageSource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplatePlatformImageSource.

func (*ImageTemplatePlatformImageSource) UnmarshalJSON

func (i *ImageTemplatePlatformImageSource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplatePlatformImageSource.

type ImageTemplatePowerShellCustomizer

type ImageTemplatePowerShellCustomizer struct {
	// REQUIRED; The type of customization tool you want to use on the Image. For example, "Shell" can be shell customizer
	Type *string

	// Array of PowerShell commands to execute
	Inline []*string

	// Friendly Name to provide context on what this customization step does
	Name *string

	// 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.
	RunAsSystem *bool

	// If specified, the PowerShell script will be run with elevated privileges
	RunElevated *bool

	// SHA256 checksum of the power shell script provided in the scriptUri field above
	SHA256Checksum *string

	// URI of the PowerShell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc
	ScriptURI *string

	// Valid exit codes for the PowerShell script. [Default: 0]
	ValidExitCodes []*int32
}

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

func (*ImageTemplatePowerShellCustomizer) GetImageTemplateCustomizer added in v0.2.0

func (i *ImageTemplatePowerShellCustomizer) GetImageTemplateCustomizer() *ImageTemplateCustomizer

GetImageTemplateCustomizer implements the ImageTemplateCustomizerClassification interface for type ImageTemplatePowerShellCustomizer.

func (ImageTemplatePowerShellCustomizer) MarshalJSON

func (i ImageTemplatePowerShellCustomizer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplatePowerShellCustomizer.

func (*ImageTemplatePowerShellCustomizer) UnmarshalJSON

func (i *ImageTemplatePowerShellCustomizer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplatePowerShellCustomizer.

type ImageTemplatePowerShellValidator added in v1.1.0

type ImageTemplatePowerShellValidator struct {
	// REQUIRED; The type of validation you want to use on the Image. For example, "Shell" can be shell validation
	Type *string

	// Array of PowerShell commands to execute
	Inline []*string

	// Friendly Name to provide context on what this validation step does
	Name *string

	// 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.
	RunAsSystem *bool

	// If specified, the PowerShell script will be run with elevated privileges
	RunElevated *bool

	// SHA256 checksum of the power shell script provided in the scriptUri field above
	SHA256Checksum *string

	// URI of the PowerShell script to be run for validation. It can be a github link, Azure Storage URI, etc
	ScriptURI *string

	// Valid exit codes for the PowerShell script. [Default: 0]
	ValidExitCodes []*int32
}

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

func (*ImageTemplatePowerShellValidator) GetImageTemplateInVMValidator added in v1.1.0

func (i *ImageTemplatePowerShellValidator) GetImageTemplateInVMValidator() *ImageTemplateInVMValidator

GetImageTemplateInVMValidator implements the ImageTemplateInVMValidatorClassification interface for type ImageTemplatePowerShellValidator.

func (ImageTemplatePowerShellValidator) MarshalJSON added in v1.1.0

func (i ImageTemplatePowerShellValidator) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplatePowerShellValidator.

func (*ImageTemplatePowerShellValidator) UnmarshalJSON added in v1.1.0

func (i *ImageTemplatePowerShellValidator) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplatePowerShellValidator.

type ImageTemplateProperties

type ImageTemplateProperties struct {
	// REQUIRED; The distribution targets where the image output needs to go to.
	Distribute []ImageTemplateDistributorClassification

	// REQUIRED; Specifies the properties used to describe the source image.
	Source ImageTemplateSourceClassification

	// 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).
	BuildTimeoutInMinutes *int32

	// Specifies the properties used to describe the customization steps of the image, like Image source etc
	Customize []ImageTemplateCustomizerClassification

	// 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.
	StagingResourceGroup *string

	// Describes how virtual machine is set up to build images
	VMProfile *ImageTemplateVMProfile

	// Configuration options and list of validations to be performed on the resulting image.
	Validate *ImageTemplatePropertiesValidate

	// READ-ONLY; 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.
	ExactStagingResourceGroup *string

	// READ-ONLY; State of 'run' that is currently executing or was last executed.
	LastRunStatus *ImageTemplateLastRunStatus

	// READ-ONLY; Provisioning error, if any
	ProvisioningError *ProvisioningError

	// READ-ONLY; Provisioning state of the resource
	ProvisioningState *ProvisioningState
}

ImageTemplateProperties - Describes the properties of an image template

func (ImageTemplateProperties) MarshalJSON

func (i ImageTemplateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateProperties.

func (*ImageTemplateProperties) UnmarshalJSON

func (i *ImageTemplateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateProperties.

type ImageTemplatePropertiesValidate added in v1.1.0

type ImageTemplatePropertiesValidate struct {
	// 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.]
	ContinueDistributeOnFailure *bool

	// List of validations to be performed.
	InVMValidations []ImageTemplateInVMValidatorClassification

	// 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.
	SourceValidationOnly *bool
}

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

func (ImageTemplatePropertiesValidate) MarshalJSON added in v1.1.0

func (i ImageTemplatePropertiesValidate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplatePropertiesValidate.

func (*ImageTemplatePropertiesValidate) UnmarshalJSON added in v1.1.0

func (i *ImageTemplatePropertiesValidate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplatePropertiesValidate.

type ImageTemplateRestartCustomizer

type ImageTemplateRestartCustomizer struct {
	// REQUIRED; The type of customization tool you want to use on the Image. For example, "Shell" can be shell customizer
	Type *string

	// Friendly Name to provide context on what this customization step does
	Name *string

	// Command to check if restart succeeded [Default: ”]
	RestartCheckCommand *string

	// Command to execute the restart [Default: 'shutdown /r /f /t 0 /c "packer restart"']
	RestartCommand *string

	// Restart timeout specified as a string of magnitude and unit, e.g. '5m' (5 minutes) or '2h' (2 hours) [Default: '5m']
	RestartTimeout *string
}

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

func (*ImageTemplateRestartCustomizer) GetImageTemplateCustomizer added in v0.2.0

func (i *ImageTemplateRestartCustomizer) GetImageTemplateCustomizer() *ImageTemplateCustomizer

GetImageTemplateCustomizer implements the ImageTemplateCustomizerClassification interface for type ImageTemplateRestartCustomizer.

func (ImageTemplateRestartCustomizer) MarshalJSON

func (i ImageTemplateRestartCustomizer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateRestartCustomizer.

func (*ImageTemplateRestartCustomizer) UnmarshalJSON

func (i *ImageTemplateRestartCustomizer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateRestartCustomizer.

type ImageTemplateSharedImageDistributor

type ImageTemplateSharedImageDistributor struct {
	// REQUIRED; Resource Id of the Shared Image Gallery image
	GalleryImageID *string

	// REQUIRED; A list of regions that the image will be replicated to
	ReplicationRegions []*string

	// REQUIRED; The name to be used for the associated RunOutput.
	RunOutputName *string

	// REQUIRED; Type of distribution.
	Type *string

	// Tags that will be applied to the artifact once it has been created/updated by the distributor.
	ArtifactTags map[string]*string

	// Flag that indicates whether created image version should be excluded from latest. Omit to use the default (false).
	ExcludeFromLatest *bool

	// Storage account type to be used to store the shared image. Omit to use the default (Standard_LRS).
	StorageAccountType *SharedImageStorageAccountType
}

ImageTemplateSharedImageDistributor - Distribute via Shared Image Gallery.

func (*ImageTemplateSharedImageDistributor) GetImageTemplateDistributor added in v0.2.0

func (i *ImageTemplateSharedImageDistributor) GetImageTemplateDistributor() *ImageTemplateDistributor

GetImageTemplateDistributor implements the ImageTemplateDistributorClassification interface for type ImageTemplateSharedImageDistributor.

func (ImageTemplateSharedImageDistributor) MarshalJSON

func (i ImageTemplateSharedImageDistributor) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateSharedImageDistributor.

func (*ImageTemplateSharedImageDistributor) UnmarshalJSON

func (i *ImageTemplateSharedImageDistributor) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateSharedImageDistributor.

type ImageTemplateSharedImageVersionSource

type ImageTemplateSharedImageVersionSource struct {
	// REQUIRED; ARM resource id of the image version in the shared image gallery
	ImageVersionID *string

	// REQUIRED; Specifies the type of source image you want to start with.
	Type *string
}

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

func (*ImageTemplateSharedImageVersionSource) GetImageTemplateSource added in v0.2.0

func (i *ImageTemplateSharedImageVersionSource) GetImageTemplateSource() *ImageTemplateSource

GetImageTemplateSource implements the ImageTemplateSourceClassification interface for type ImageTemplateSharedImageVersionSource.

func (ImageTemplateSharedImageVersionSource) MarshalJSON

func (i ImageTemplateSharedImageVersionSource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateSharedImageVersionSource.

func (*ImageTemplateSharedImageVersionSource) UnmarshalJSON

func (i *ImageTemplateSharedImageVersionSource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateSharedImageVersionSource.

type ImageTemplateShellCustomizer

type ImageTemplateShellCustomizer struct {
	// REQUIRED; The type of customization tool you want to use on the Image. For example, "Shell" can be shell customizer
	Type *string

	// Array of shell commands to execute
	Inline []*string

	// Friendly Name to provide context on what this customization step does
	Name *string

	// SHA256 checksum of the shell script provided in the scriptUri field
	SHA256Checksum *string

	// URI of the shell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc
	ScriptURI *string
}

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

func (*ImageTemplateShellCustomizer) GetImageTemplateCustomizer added in v0.2.0

func (i *ImageTemplateShellCustomizer) GetImageTemplateCustomizer() *ImageTemplateCustomizer

GetImageTemplateCustomizer implements the ImageTemplateCustomizerClassification interface for type ImageTemplateShellCustomizer.

func (ImageTemplateShellCustomizer) MarshalJSON

func (i ImageTemplateShellCustomizer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateShellCustomizer.

func (*ImageTemplateShellCustomizer) UnmarshalJSON

func (i *ImageTemplateShellCustomizer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateShellCustomizer.

type ImageTemplateShellValidator added in v1.1.0

type ImageTemplateShellValidator struct {
	// REQUIRED; The type of validation you want to use on the Image. For example, "Shell" can be shell validation
	Type *string

	// Array of shell commands to execute
	Inline []*string

	// Friendly Name to provide context on what this validation step does
	Name *string

	// SHA256 checksum of the shell script provided in the scriptUri field
	SHA256Checksum *string

	// URI of the shell script to be run for validation. It can be a github link, Azure Storage URI, etc
	ScriptURI *string
}

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

func (*ImageTemplateShellValidator) GetImageTemplateInVMValidator added in v1.1.0

func (i *ImageTemplateShellValidator) GetImageTemplateInVMValidator() *ImageTemplateInVMValidator

GetImageTemplateInVMValidator implements the ImageTemplateInVMValidatorClassification interface for type ImageTemplateShellValidator.

func (ImageTemplateShellValidator) MarshalJSON added in v1.1.0

func (i ImageTemplateShellValidator) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateShellValidator.

func (*ImageTemplateShellValidator) UnmarshalJSON added in v1.1.0

func (i *ImageTemplateShellValidator) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateShellValidator.

type ImageTemplateSource

type ImageTemplateSource struct {
	// REQUIRED; Specifies the type of source image you want to start with.
	Type *string
}

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

func (*ImageTemplateSource) GetImageTemplateSource

func (i *ImageTemplateSource) GetImageTemplateSource() *ImageTemplateSource

GetImageTemplateSource implements the ImageTemplateSourceClassification interface for type ImageTemplateSource.

func (ImageTemplateSource) MarshalJSON added in v1.2.0

func (i ImageTemplateSource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateSource.

func (*ImageTemplateSource) UnmarshalJSON

func (i *ImageTemplateSource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateSource.

type ImageTemplateSourceClassification

type ImageTemplateSourceClassification interface {
	// GetImageTemplateSource returns the ImageTemplateSource content of the underlying type.
	GetImageTemplateSource() *ImageTemplateSource
}

ImageTemplateSourceClassification provides polymorphic access to related types. Call the interface's GetImageTemplateSource() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *ImageTemplateManagedImageSource, *ImageTemplatePlatformImageSource, *ImageTemplateSharedImageVersionSource, *ImageTemplateSource

type ImageTemplateUpdateParameters

type ImageTemplateUpdateParameters struct {
	// The identity of the image template, if configured.
	Identity *ImageTemplateIdentity

	// The user-specified tags associated with the image template.
	Tags map[string]*string
}

ImageTemplateUpdateParameters - Parameters for updating an image template.

func (ImageTemplateUpdateParameters) MarshalJSON

func (i ImageTemplateUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateUpdateParameters.

func (*ImageTemplateUpdateParameters) UnmarshalJSON added in v1.2.0

func (i *ImageTemplateUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateUpdateParameters.

type ImageTemplateVMProfile

type ImageTemplateVMProfile struct {
	// Size of the OS disk in GB. Omit or specify 0 to use Azure's default OS disk size.
	OSDiskSizeGB *int32

	// 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.
	UserAssignedIdentities []*string

	// Size of the virtual machine used to build, customize and capture images. Omit or specify empty string to use the default
	// (StandardD1v2 for Gen1 images and StandardD2dsv4 for Gen2 images).
	VMSize *string

	// 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.
	VnetConfig *VirtualNetworkConfig
}

ImageTemplateVMProfile - Describes the virtual machines used to build and validate images

func (ImageTemplateVMProfile) MarshalJSON

func (i ImageTemplateVMProfile) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateVMProfile.

func (*ImageTemplateVMProfile) UnmarshalJSON added in v1.2.0

func (i *ImageTemplateVMProfile) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateVMProfile.

type ImageTemplateVhdDistributor

type ImageTemplateVhdDistributor struct {
	// REQUIRED; The name to be used for the associated RunOutput.
	RunOutputName *string

	// REQUIRED; Type of distribution.
	Type *string

	// Tags that will be applied to the artifact once it has been created/updated by the distributor.
	ArtifactTags map[string]*string
}

ImageTemplateVhdDistributor - Distribute via VHD in a storage account.

func (*ImageTemplateVhdDistributor) GetImageTemplateDistributor added in v0.2.0

func (i *ImageTemplateVhdDistributor) GetImageTemplateDistributor() *ImageTemplateDistributor

GetImageTemplateDistributor implements the ImageTemplateDistributorClassification interface for type ImageTemplateVhdDistributor.

func (ImageTemplateVhdDistributor) MarshalJSON

func (i ImageTemplateVhdDistributor) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateVhdDistributor.

func (*ImageTemplateVhdDistributor) UnmarshalJSON added in v0.2.0

func (i *ImageTemplateVhdDistributor) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateVhdDistributor.

type ImageTemplateWindowsUpdateCustomizer

type ImageTemplateWindowsUpdateCustomizer struct {
	// REQUIRED; The type of customization tool you want to use on the Image. For example, "Shell" can be shell customizer
	Type *string

	// 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.
	Filters []*string

	// Friendly Name to provide context on what this customization step does
	Name *string

	// 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.
	SearchCriteria *string

	// Maximum number of updates to apply at a time. Omit or specify 0 to use the default (1000)
	UpdateLimit *int32
}

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

func (*ImageTemplateWindowsUpdateCustomizer) GetImageTemplateCustomizer added in v0.2.0

func (i *ImageTemplateWindowsUpdateCustomizer) GetImageTemplateCustomizer() *ImageTemplateCustomizer

GetImageTemplateCustomizer implements the ImageTemplateCustomizerClassification interface for type ImageTemplateWindowsUpdateCustomizer.

func (ImageTemplateWindowsUpdateCustomizer) MarshalJSON

func (i ImageTemplateWindowsUpdateCustomizer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageTemplateWindowsUpdateCustomizer.

func (*ImageTemplateWindowsUpdateCustomizer) UnmarshalJSON

func (i *ImageTemplateWindowsUpdateCustomizer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageTemplateWindowsUpdateCustomizer.

type Operation

type Operation struct {
	// The object that describes the operation.
	Display *OperationDisplay

	// The flag that indicates whether the operation applies to data plane.
	IsDataAction *bool

	// This is of the format {provider}/{resource}/{operation}
	Name *string

	// The intended executor of the operation.
	Origin *string

	// Properties of the operation.
	Properties any
}

Operation - A REST API operation

func (Operation) MarshalJSON added in v1.2.0

func (o Operation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v1.2.0

func (o *Operation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// The friendly name of the operation
	Description *string

	// For example: read, write, delete, or listKeys/action
	Operation *string

	// Friendly name of the resource provider.
	Provider *string

	// The resource type on which the operation is performed.
	Resource *string
}

OperationDisplay - The object that describes the operation.

func (OperationDisplay) MarshalJSON added in v1.2.0

func (o OperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v1.2.0

func (o *OperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// The URL to get the next set of operation list results if there are any.
	NextLink *string

	// The list of operations supported by the resource provider.
	Value []*Operation
}

OperationListResult - 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.

func (OperationListResult) MarshalJSON

func (o OperationListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON added in v1.2.0

func (o *OperationListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewListPager added in v0.4.0

NewListPager - Lists available operations for the Microsoft.VirtualMachineImages provider

Generated from API version 2022-02-14

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/078b90617e5e08137d0395963bd4119f4561a910/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/OperationsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.OperationListResult = armvirtualmachineimagebuilder.OperationListResult{
		// 	Value: []*armvirtualmachineimagebuilder.Operation{
		// 		{
		// 			Name: to.Ptr("Microsoft.VirtualMachineImages/register/action"),
		// 			Display: &armvirtualmachineimagebuilder.OperationDisplay{
		// 				Description: to.Ptr("Register Virtual Machine Image Builder RP"),
		// 				Operation: to.Ptr("Register Virtual Machine Image Builder RP"),
		// 				Provider: to.Ptr("Virtual Machine Image Builder"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.VirtualMachineImages/unregister/action"),
		// 			Display: &armvirtualmachineimagebuilder.OperationDisplay{
		// 				Description: to.Ptr("Unregister Virtual Machine Image Builder RP"),
		// 				Operation: to.Ptr("Unregister Virtual Machine Image Builder RP"),
		// 				Provider: to.Ptr("Virtual Machine Image Builder"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.VirtualMachineImages/imageTemplates/read"),
		// 			Display: &armvirtualmachineimagebuilder.OperationDisplay{
		// 				Description: to.Ptr("Get a VM image template instance resource"),
		// 				Operation: to.Ptr("Get a VM image template instance resource"),
		// 				Provider: to.Ptr("Virtual Machine Image Builder"),
		// 				Resource: to.Ptr("VM Image template"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.VirtualMachineImages/imageTemplates/write"),
		// 			Display: &armvirtualmachineimagebuilder.OperationDisplay{
		// 				Description: to.Ptr("Create or update a VM image template instance resource"),
		// 				Operation: to.Ptr("Create or update a VM image template instance resource"),
		// 				Provider: to.Ptr("Virtual Machine Image Builder"),
		// 				Resource: to.Ptr("VM Image template"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.VirtualMachineImages/imageTemplates/delete"),
		// 			Display: &armvirtualmachineimagebuilder.OperationDisplay{
		// 				Description: to.Ptr("Delete a VM image template instance resource"),
		// 				Operation: to.Ptr("Delete a VM image template instance resource"),
		// 				Provider: to.Ptr("Virtual Machine Image Builder"),
		// 				Resource: to.Ptr("VM Image template"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.VirtualMachineImages/imageTemplates/run/action"),
		// 			Display: &armvirtualmachineimagebuilder.OperationDisplay{
		// 				Description: to.Ptr("Execute a VM image template to produce its outputs"),
		// 				Operation: to.Ptr("Execute a VM image template to produce its outputs"),
		// 				Provider: to.Ptr("Virtual Machine Image Builder"),
		// 				Resource: to.Ptr("VM Image template"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.VirtualMachineImages/imageTemplates/runOutputs/read"),
		// 			Display: &armvirtualmachineimagebuilder.OperationDisplay{
		// 				Description: to.Ptr("Get a VM image template run output resource"),
		// 				Operation: to.Ptr("Get a VM image template run output resource"),
		// 				Provider: to.Ptr("Virtual Machine Image Builder"),
		// 				Resource: to.Ptr("VM Image template run output"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.VirtualMachineImages/operations/read"),
		// 			Display: &armvirtualmachineimagebuilder.OperationDisplay{
		// 				Description: to.Ptr("List available Virtual Machine Image Builder Operations"),
		// 				Operation: to.Ptr("List available Virtual Machine Image Builder Operations"),
		// 				Provider: to.Ptr("Virtual Machine Image Builder"),
		// 				Resource: to.Ptr("Operation"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.VirtualMachineImages/locations/operations/read"),
		// 			Display: &armvirtualmachineimagebuilder.OperationDisplay{
		// 				Description: to.Ptr("Get the status of an asynchronous operation"),
		// 				Operation: to.Ptr("Get the status of an asynchronous operation"),
		// 				Provider: to.Ptr("Virtual Machine Image Builder"),
		// 				Resource: to.Ptr("Asynchronous Operation"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.VirtualMachineImages/imageTemplates/cancel/action"),
		// 			Display: &armvirtualmachineimagebuilder.OperationDisplay{
		// 				Description: to.Ptr("Cancel a running image build"),
		// 				Operation: to.Ptr("Cancel a running image build"),
		// 				Provider: to.Ptr("Virtual Machine Image Builder"),
		// 				Resource: to.Ptr("VM Image template"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type PlatformImagePurchasePlan

type PlatformImagePurchasePlan struct {
	// REQUIRED; Name of the purchase plan.
	PlanName *string

	// REQUIRED; Product of the purchase plan.
	PlanProduct *string

	// REQUIRED; Publisher of the purchase plan.
	PlanPublisher *string
}

PlatformImagePurchasePlan - Purchase plan configuration for platform image.

func (PlatformImagePurchasePlan) MarshalJSON added in v1.2.0

func (p PlatformImagePurchasePlan) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PlatformImagePurchasePlan.

func (*PlatformImagePurchasePlan) UnmarshalJSON added in v1.2.0

func (p *PlatformImagePurchasePlan) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PlatformImagePurchasePlan.

type ProvisioningError

type ProvisioningError struct {
	// Verbose error message about the provisioning failure
	Message *string

	// Error code of the provisioning failure
	ProvisioningErrorCode *ProvisioningErrorCode
}

ProvisioningError - Describes the error happened when create or update an image template

func (ProvisioningError) MarshalJSON added in v1.2.0

func (p ProvisioningError) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ProvisioningError.

func (*ProvisioningError) UnmarshalJSON added in v1.2.0

func (p *ProvisioningError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningError.

type ProvisioningErrorCode

type ProvisioningErrorCode string

ProvisioningErrorCode - Error code of the provisioning failure

const (
	ProvisioningErrorCodeBadCustomizerType           ProvisioningErrorCode = "BadCustomizerType"
	ProvisioningErrorCodeBadDistributeType           ProvisioningErrorCode = "BadDistributeType"
	ProvisioningErrorCodeBadManagedImageSource       ProvisioningErrorCode = "BadManagedImageSource"
	ProvisioningErrorCodeBadPIRSource                ProvisioningErrorCode = "BadPIRSource"
	ProvisioningErrorCodeBadSharedImageDistribute    ProvisioningErrorCode = "BadSharedImageDistribute"
	ProvisioningErrorCodeBadSharedImageVersionSource ProvisioningErrorCode = "BadSharedImageVersionSource"
	ProvisioningErrorCodeBadSourceType               ProvisioningErrorCode = "BadSourceType"
	ProvisioningErrorCodeBadStagingResourceGroup     ProvisioningErrorCode = "BadStagingResourceGroup"
	ProvisioningErrorCodeBadValidatorType            ProvisioningErrorCode = "BadValidatorType"
	ProvisioningErrorCodeNoCustomizerScript          ProvisioningErrorCode = "NoCustomizerScript"
	ProvisioningErrorCodeNoValidatorScript           ProvisioningErrorCode = "NoValidatorScript"
	ProvisioningErrorCodeOther                       ProvisioningErrorCode = "Other"
	ProvisioningErrorCodeServerError                 ProvisioningErrorCode = "ServerError"
	ProvisioningErrorCodeUnsupportedCustomizerType   ProvisioningErrorCode = "UnsupportedCustomizerType"
	ProvisioningErrorCodeUnsupportedValidatorType    ProvisioningErrorCode = "UnsupportedValidatorType"
)

func PossibleProvisioningErrorCodeValues

func PossibleProvisioningErrorCodeValues() []ProvisioningErrorCode

PossibleProvisioningErrorCodeValues returns the possible values for the ProvisioningErrorCode const type.

type ProvisioningState

type ProvisioningState string

ProvisioningState - Provisioning state of the resource

const (
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type ProxyResource added in v1.1.0

type ProxyResource struct {
	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

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

func (ProxyResource) MarshalJSON added in v1.2.0

func (p ProxyResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ProxyResource.

func (*ProxyResource) UnmarshalJSON added in v1.2.0

func (p *ProxyResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.

type Resource

type Resource struct {
	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

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

func (Resource) MarshalJSON

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.2.0

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ResourceIdentityType

type ResourceIdentityType string

ResourceIdentityType - The type of identity used for the image template. The type 'None' will remove any identities from the image template.

const (
	ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned"
	ResourceIdentityTypeNone         ResourceIdentityType = "None"
)

func PossibleResourceIdentityTypeValues

func PossibleResourceIdentityTypeValues() []ResourceIdentityType

PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type.

type RunOutput

type RunOutput struct {
	// The properties of the run output
	Properties *RunOutputProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

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

func (RunOutput) MarshalJSON added in v1.2.0

func (r RunOutput) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RunOutput.

func (*RunOutput) UnmarshalJSON added in v1.2.0

func (r *RunOutput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RunOutput.

type RunOutputCollection

type RunOutputCollection struct {
	// The continuation token.
	NextLink *string

	// An array of run outputs
	Value []*RunOutput
}

RunOutputCollection - The result of List run outputs operation

func (RunOutputCollection) MarshalJSON

func (r RunOutputCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RunOutputCollection.

func (*RunOutputCollection) UnmarshalJSON added in v1.2.0

func (r *RunOutputCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RunOutputCollection.

type RunOutputProperties

type RunOutputProperties struct {
	// The resource id of the artifact.
	ArtifactID *string

	// The location URI of the artifact.
	ArtifactURI *string

	// READ-ONLY; Provisioning state of the resource
	ProvisioningState *ProvisioningState
}

RunOutputProperties - Describes the properties of a run output

func (RunOutputProperties) MarshalJSON added in v1.2.0

func (r RunOutputProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RunOutputProperties.

func (*RunOutputProperties) UnmarshalJSON added in v1.2.0

func (r *RunOutputProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RunOutputProperties.

type RunState

type RunState string

RunState - State of the last run

const (
	RunStateRunning            RunState = "Running"
	RunStateCanceling          RunState = "Canceling"
	RunStateSucceeded          RunState = "Succeeded"
	RunStatePartiallySucceeded RunState = "PartiallySucceeded"
	RunStateFailed             RunState = "Failed"
	RunStateCanceled           RunState = "Canceled"
)

func PossibleRunStateValues

func PossibleRunStateValues() []RunState

PossibleRunStateValues returns the possible values for the RunState const type.

type RunSubState

type RunSubState string

RunSubState - Sub-state of the last run

const (
	RunSubStateQueued       RunSubState = "Queued"
	RunSubStateBuilding     RunSubState = "Building"
	RunSubStateCustomizing  RunSubState = "Customizing"
	RunSubStateValidating   RunSubState = "Validating"
	RunSubStateDistributing RunSubState = "Distributing"
)

func PossibleRunSubStateValues

func PossibleRunSubStateValues() []RunSubState

PossibleRunSubStateValues returns the possible values for the RunSubState const type.

type SharedImageStorageAccountType

type SharedImageStorageAccountType string

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

const (
	SharedImageStorageAccountTypeStandardLRS SharedImageStorageAccountType = "Standard_LRS"
	SharedImageStorageAccountTypeStandardZRS SharedImageStorageAccountType = "Standard_ZRS"
)

func PossibleSharedImageStorageAccountTypeValues

func PossibleSharedImageStorageAccountTypeValues() []SharedImageStorageAccountType

PossibleSharedImageStorageAccountTypeValues returns the possible values for the SharedImageStorageAccountType const type.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

func (s SystemData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type TrackedResource

type TrackedResource struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'

func (TrackedResource) MarshalJSON

func (t TrackedResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

func (*TrackedResource) UnmarshalJSON added in v1.2.0

func (t *TrackedResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.

type VirtualMachineImageTemplatesClient

type VirtualMachineImageTemplatesClient struct {
	// contains filtered or unexported fields
}

VirtualMachineImageTemplatesClient contains the methods for the VirtualMachineImageTemplates group. Don't use this type directly, use NewVirtualMachineImageTemplatesClient() instead.

func NewVirtualMachineImageTemplatesClient

func NewVirtualMachineImageTemplatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineImageTemplatesClient, error)

NewVirtualMachineImageTemplatesClient creates a new instance of VirtualMachineImageTemplatesClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription Id forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*VirtualMachineImageTemplatesClient) BeginCancel

BeginCancel - Cancel the long running image build based on the image template If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-02-14

  • resourceGroupName - The name of the resource group.
  • imageTemplateName - The name of the image Template
  • options - VirtualMachineImageTemplatesClientBeginCancelOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.BeginCancel method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/078b90617e5e08137d0395963bd4119f4561a910/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/CancelImageBuild.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachineImageTemplatesClient().BeginCancel(ctx, "myResourceGroup", "myImageTemplate", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*VirtualMachineImageTemplatesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Create or update a virtual machine image template If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-02-14

  • resourceGroupName - The name of the resource group.
  • imageTemplateName - The name of the image Template
  • parameters - Parameters supplied to the CreateImageTemplate operation
  • options - VirtualMachineImageTemplatesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.BeginCreateOrUpdate method.
Example (CreateAnImageTemplateForLinux)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/078b90617e5e08137d0395963bd4119f4561a910/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/CreateImageTemplateLinux.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachineImageTemplatesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImageTemplate", armvirtualmachineimagebuilder.ImageTemplate{
		Location: to.Ptr("westus"),
		Tags: map[string]*string{
			"imagetemplate_tag1": to.Ptr("IT_T1"),
			"imagetemplate_tag2": to.Ptr("IT_T2"),
		},
		Identity: &armvirtualmachineimagebuilder.ImageTemplateIdentity{
			Type: to.Ptr(armvirtualmachineimagebuilder.ResourceIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
				"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity_1": {},
			},
		},
		Properties: &armvirtualmachineimagebuilder.ImageTemplateProperties{
			Customize: []armvirtualmachineimagebuilder.ImageTemplateCustomizerClassification{
				&armvirtualmachineimagebuilder.ImageTemplateShellCustomizer{
					Name:      to.Ptr("Shell Customizer Example"),
					Type:      to.Ptr("Shell"),
					ScriptURI: to.Ptr("https://example.com/path/to/script.sh"),
				}},
			Distribute: []armvirtualmachineimagebuilder.ImageTemplateDistributorClassification{
				&armvirtualmachineimagebuilder.ImageTemplateManagedImageDistributor{
					Type: to.Ptr("ManagedImage"),
					ArtifactTags: map[string]*string{
						"tagName": to.Ptr("value"),
					},
					RunOutputName: to.Ptr("image_it_pir_1"),
					ImageID:       to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1"),
					Location:      to.Ptr("1_location"),
				}},
			Source: &armvirtualmachineimagebuilder.ImageTemplateManagedImageSource{
				Type:    to.Ptr("ManagedImage"),
				ImageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/images/source_image"),
			},
			VMProfile: &armvirtualmachineimagebuilder.ImageTemplateVMProfile{
				OSDiskSizeGB: to.Ptr[int32](64),
				VMSize:       to.Ptr("Standard_D2s_v3"),
				VnetConfig: &armvirtualmachineimagebuilder.VirtualNetworkConfig{
					SubnetID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name"),
				},
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ImageTemplate = armvirtualmachineimagebuilder.ImageTemplate{
	// 	Name: to.Ptr("myImageTemplate"),
	// 	Type: to.Ptr("Microsoft.VirtualMachineImages/imageTemplate"),
	// 	ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate"),
	// 	Location: to.Ptr("westus"),
	// 	Identity: &armvirtualmachineimagebuilder.ImageTemplateIdentity{
	// 		Type: to.Ptr(armvirtualmachineimagebuilder.ResourceIdentityTypeUserAssigned),
	// 		UserAssignedIdentities: map[string]*armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
	// 			"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity_1": &armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
	// 				ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 				PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			},
	// 		},
	// 	},
	// 	Properties: &armvirtualmachineimagebuilder.ImageTemplateProperties{
	// 		Customize: []armvirtualmachineimagebuilder.ImageTemplateCustomizerClassification{
	// 			&armvirtualmachineimagebuilder.ImageTemplateShellCustomizer{
	// 				Name: to.Ptr("Shell Customizer Example"),
	// 				Type: to.Ptr("Shell"),
	// 				ScriptURI: to.Ptr("https://example.com/path/to/script.sh"),
	// 		}},
	// 		Distribute: []armvirtualmachineimagebuilder.ImageTemplateDistributorClassification{
	// 			&armvirtualmachineimagebuilder.ImageTemplateManagedImageDistributor{
	// 				Type: to.Ptr("ManagedImage"),
	// 				ArtifactTags: map[string]*string{
	// 					"tagName": to.Ptr("value"),
	// 				},
	// 				RunOutputName: to.Ptr("image_it_pir_1"),
	// 				ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1"),
	// 				Location: to.Ptr("1_location"),
	// 		}},
	// 		Source: &armvirtualmachineimagebuilder.ImageTemplateManagedImageSource{
	// 			Type: to.Ptr("ManagedImage"),
	// 			ImageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/images/source_image"),
	// 		},
	// 		VMProfile: &armvirtualmachineimagebuilder.ImageTemplateVMProfile{
	// 			OSDiskSizeGB: to.Ptr[int32](64),
	// 			VMSize: to.Ptr("Standard_D2s_v3"),
	// 		},
	// 	},
	// }
}
Output:

Example (CreateAnImageTemplateForWindows)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/078b90617e5e08137d0395963bd4119f4561a910/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/CreateImageTemplateWindows.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachineImageTemplatesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImageTemplate", armvirtualmachineimagebuilder.ImageTemplate{
		Location: to.Ptr("westus"),
		Tags: map[string]*string{
			"imagetemplate_tag1": to.Ptr("IT_T1"),
			"imagetemplate_tag2": to.Ptr("IT_T2"),
		},
		Identity: &armvirtualmachineimagebuilder.ImageTemplateIdentity{
			Type: to.Ptr(armvirtualmachineimagebuilder.ResourceIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
				"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity_1": {},
			},
		},
		Properties: &armvirtualmachineimagebuilder.ImageTemplateProperties{
			Customize: []armvirtualmachineimagebuilder.ImageTemplateCustomizerClassification{
				&armvirtualmachineimagebuilder.ImageTemplatePowerShellCustomizer{
					Name: to.Ptr("PowerShell (inline) Customizer Example"),
					Type: to.Ptr("PowerShell"),
					Inline: []*string{
						to.Ptr("Powershell command-1"),
						to.Ptr("Powershell command-2"),
						to.Ptr("Powershell command-3")},
				},
				&armvirtualmachineimagebuilder.ImageTemplatePowerShellCustomizer{
					Name: to.Ptr("PowerShell (inline) Customizer Elevated user Example"),
					Type: to.Ptr("PowerShell"),
					Inline: []*string{
						to.Ptr("Powershell command-1"),
						to.Ptr("Powershell command-2"),
						to.Ptr("Powershell command-3")},
					RunElevated: to.Ptr(true),
				},
				&armvirtualmachineimagebuilder.ImageTemplatePowerShellCustomizer{
					Name: to.Ptr("PowerShell (inline) Customizer Elevated Local System user Example"),
					Type: to.Ptr("PowerShell"),
					Inline: []*string{
						to.Ptr("Powershell command-1"),
						to.Ptr("Powershell command-2"),
						to.Ptr("Powershell command-3")},
					RunAsSystem: to.Ptr(true),
					RunElevated: to.Ptr(true),
				},
				&armvirtualmachineimagebuilder.ImageTemplatePowerShellCustomizer{
					Name:      to.Ptr("PowerShell (script) Customizer Example"),
					Type:      to.Ptr("PowerShell"),
					ScriptURI: to.Ptr("https://example.com/path/to/script.ps1"),
					ValidExitCodes: []*int32{
						to.Ptr[int32](0),
						to.Ptr[int32](1)},
				},
				&armvirtualmachineimagebuilder.ImageTemplatePowerShellCustomizer{
					Name:        to.Ptr("PowerShell (script) Customizer Elevated Local System user Example"),
					Type:        to.Ptr("PowerShell"),
					RunElevated: to.Ptr(true),
					ScriptURI:   to.Ptr("https://example.com/path/to/script.ps1"),
					ValidExitCodes: []*int32{
						to.Ptr[int32](0),
						to.Ptr[int32](1)},
				},
				&armvirtualmachineimagebuilder.ImageTemplatePowerShellCustomizer{
					Name:        to.Ptr("PowerShell (script) Customizer Elevated Local System user Example"),
					Type:        to.Ptr("PowerShell"),
					RunAsSystem: to.Ptr(true),
					RunElevated: to.Ptr(true),
					ScriptURI:   to.Ptr("https://example.com/path/to/script.ps1"),
					ValidExitCodes: []*int32{
						to.Ptr[int32](0),
						to.Ptr[int32](1)},
				},
				&armvirtualmachineimagebuilder.ImageTemplateRestartCustomizer{
					Name:                to.Ptr("Restart Customizer Example"),
					Type:                to.Ptr("WindowsRestart"),
					RestartCheckCommand: to.Ptr("powershell -command \"& {Write-Output 'restarted.'}\""),
					RestartCommand:      to.Ptr("shutdown /f /r /t 0 /c \"packer restart\""),
					RestartTimeout:      to.Ptr("10m"),
				},
				&armvirtualmachineimagebuilder.ImageTemplateWindowsUpdateCustomizer{
					Name: to.Ptr("Windows Update Customizer Example"),
					Type: to.Ptr("WindowsUpdate"),
					Filters: []*string{
						to.Ptr("$_.BrowseOnly")},
					SearchCriteria: to.Ptr("BrowseOnly=0 and IsInstalled=0"),
					UpdateLimit:    to.Ptr[int32](100),
				}},
			Distribute: []armvirtualmachineimagebuilder.ImageTemplateDistributorClassification{
				&armvirtualmachineimagebuilder.ImageTemplateManagedImageDistributor{
					Type: to.Ptr("ManagedImage"),
					ArtifactTags: map[string]*string{
						"tagName": to.Ptr("value"),
					},
					RunOutputName: to.Ptr("image_it_pir_1"),
					ImageID:       to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1"),
					Location:      to.Ptr("1_location"),
				}},
			Source: &armvirtualmachineimagebuilder.ImageTemplateManagedImageSource{
				Type:    to.Ptr("ManagedImage"),
				ImageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/images/source_image"),
			},
			VMProfile: &armvirtualmachineimagebuilder.ImageTemplateVMProfile{
				OSDiskSizeGB: to.Ptr[int32](64),
				VMSize:       to.Ptr("Standard_D2s_v3"),
				VnetConfig: &armvirtualmachineimagebuilder.VirtualNetworkConfig{
					SubnetID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name"),
				},
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ImageTemplate = armvirtualmachineimagebuilder.ImageTemplate{
	// 	Name: to.Ptr("myImageTemplate"),
	// 	Type: to.Ptr("Microsoft.VirtualMachineImages/imageTemplate"),
	// 	ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate"),
	// 	Location: to.Ptr("westus"),
	// 	Identity: &armvirtualmachineimagebuilder.ImageTemplateIdentity{
	// 		Type: to.Ptr(armvirtualmachineimagebuilder.ResourceIdentityTypeUserAssigned),
	// 		UserAssignedIdentities: map[string]*armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
	// 			"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity_1": &armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
	// 				ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 				PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			},
	// 		},
	// 	},
	// 	Properties: &armvirtualmachineimagebuilder.ImageTemplateProperties{
	// 		Customize: []armvirtualmachineimagebuilder.ImageTemplateCustomizerClassification{
	// 			&armvirtualmachineimagebuilder.ImageTemplatePowerShellCustomizer{
	// 				Name: to.Ptr("PowerShell (inline) Customizer Example"),
	// 				Type: to.Ptr("PowerShell"),
	// 				Inline: []*string{
	// 					to.Ptr("Powershell command-1"),
	// 					to.Ptr("Powershell command-2"),
	// 					to.Ptr("Powershell command-3")},
	// 					RunAsSystem: to.Ptr(false),
	// 					RunElevated: to.Ptr(false),
	// 				},
	// 				&armvirtualmachineimagebuilder.ImageTemplatePowerShellCustomizer{
	// 					Name: to.Ptr("PowerShell (inline) Customizer Elevated user Example"),
	// 					Type: to.Ptr("PowerShell"),
	// 					Inline: []*string{
	// 						to.Ptr("Powershell command-1"),
	// 						to.Ptr("Powershell command-2"),
	// 						to.Ptr("Powershell command-3")},
	// 						RunAsSystem: to.Ptr(false),
	// 						RunElevated: to.Ptr(true),
	// 					},
	// 					&armvirtualmachineimagebuilder.ImageTemplatePowerShellCustomizer{
	// 						Name: to.Ptr("PowerShell (inline) Customizer Elevated Local System user Example"),
	// 						Type: to.Ptr("PowerShell"),
	// 						Inline: []*string{
	// 							to.Ptr("Powershell command-1"),
	// 							to.Ptr("Powershell command-2"),
	// 							to.Ptr("Powershell command-3")},
	// 							RunAsSystem: to.Ptr(true),
	// 							RunElevated: to.Ptr(true),
	// 						},
	// 						&armvirtualmachineimagebuilder.ImageTemplatePowerShellCustomizer{
	// 							Name: to.Ptr("PowerShell (script) Customizer Example"),
	// 							Type: to.Ptr("PowerShell"),
	// 							RunAsSystem: to.Ptr(false),
	// 							RunElevated: to.Ptr(false),
	// 							ScriptURI: to.Ptr("https://example.com/path/to/script.ps1"),
	// 							ValidExitCodes: []*int32{
	// 								to.Ptr[int32](0),
	// 								to.Ptr[int32](1)},
	// 							},
	// 							&armvirtualmachineimagebuilder.ImageTemplatePowerShellCustomizer{
	// 								Name: to.Ptr("PowerShell (script) Customizer Elevated Local System user Example"),
	// 								Type: to.Ptr("PowerShell"),
	// 								RunAsSystem: to.Ptr(false),
	// 								RunElevated: to.Ptr(true),
	// 								ScriptURI: to.Ptr("https://example.com/path/to/script.ps1"),
	// 								ValidExitCodes: []*int32{
	// 									to.Ptr[int32](0),
	// 									to.Ptr[int32](1)},
	// 								},
	// 								&armvirtualmachineimagebuilder.ImageTemplatePowerShellCustomizer{
	// 									Name: to.Ptr("PowerShell (script) Customizer Elevated Local System user Example"),
	// 									Type: to.Ptr("PowerShell"),
	// 									RunAsSystem: to.Ptr(true),
	// 									RunElevated: to.Ptr(true),
	// 									ScriptURI: to.Ptr("https://example.com/path/to/script.ps1"),
	// 									ValidExitCodes: []*int32{
	// 										to.Ptr[int32](0),
	// 										to.Ptr[int32](1)},
	// 									},
	// 									&armvirtualmachineimagebuilder.ImageTemplateRestartCustomizer{
	// 										Name: to.Ptr("Restart Customizer Example"),
	// 										Type: to.Ptr("WindowsRestart"),
	// 										RestartCheckCommand: to.Ptr("powershell -command \"& {Write-Output 'restarted.'}\""),
	// 										RestartCommand: to.Ptr("shutdown /f /r /t 0 /c \"packer restart\""),
	// 										RestartTimeout: to.Ptr("10m"),
	// 									},
	// 									&armvirtualmachineimagebuilder.ImageTemplateWindowsUpdateCustomizer{
	// 										Name: to.Ptr("Windows Update Customizer Example"),
	// 										Type: to.Ptr("WindowsUpdate"),
	// 										Filters: []*string{
	// 											to.Ptr("$_.BrowseOnly")},
	// 											SearchCriteria: to.Ptr("BrowseOnly=0 and IsInstalled=0"),
	// 											UpdateLimit: to.Ptr[int32](100),
	// 									}},
	// 									Distribute: []armvirtualmachineimagebuilder.ImageTemplateDistributorClassification{
	// 										&armvirtualmachineimagebuilder.ImageTemplateManagedImageDistributor{
	// 											Type: to.Ptr("ManagedImage"),
	// 											ArtifactTags: map[string]*string{
	// 												"tagName": to.Ptr("value"),
	// 											},
	// 											RunOutputName: to.Ptr("image_it_pir_1"),
	// 											ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1"),
	// 											Location: to.Ptr("1_location"),
	// 									}},
	// 									Source: &armvirtualmachineimagebuilder.ImageTemplateManagedImageSource{
	// 										Type: to.Ptr("ManagedImage"),
	// 										ImageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/images/source_image"),
	// 									},
	// 									VMProfile: &armvirtualmachineimagebuilder.ImageTemplateVMProfile{
	// 										OSDiskSizeGB: to.Ptr[int32](64),
	// 										VMSize: to.Ptr("Standard_D2s_v3"),
	// 									},
	// 								},
	// 							}
}
Output:

func (*VirtualMachineImageTemplatesClient) BeginDelete

BeginDelete - Delete a virtual machine image template If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-02-14

  • resourceGroupName - The name of the resource group.
  • imageTemplateName - The name of the image Template
  • options - VirtualMachineImageTemplatesClientBeginDeleteOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/078b90617e5e08137d0395963bd4119f4561a910/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/DeleteImageTemplate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachineImageTemplatesClient().BeginDelete(ctx, "myResourceGroup", "myImageTemplate", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*VirtualMachineImageTemplatesClient) BeginRun

BeginRun - Create artifacts from a existing image template If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-02-14

  • resourceGroupName - The name of the resource group.
  • imageTemplateName - The name of the image Template
  • options - VirtualMachineImageTemplatesClientBeginRunOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.BeginRun method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/078b90617e5e08137d0395963bd4119f4561a910/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/RunImageTemplate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachineImageTemplatesClient().BeginRun(ctx, "myResourceGroup", "myImageTemplate", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*VirtualMachineImageTemplatesClient) BeginUpdate

BeginUpdate - Update the tags for this Virtual Machine Image Template If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-02-14

  • resourceGroupName - The name of the resource group.
  • imageTemplateName - The name of the image Template
  • parameters - Additional parameters for Image Template update.
  • options - VirtualMachineImageTemplatesClientBeginUpdateOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.BeginUpdate method.
Example (RemoveIdentitiesForAnImageTemplate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/078b90617e5e08137d0395963bd4119f4561a910/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/UpdateImageTemplateToRemoveIdentities.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachineImageTemplatesClient().BeginUpdate(ctx, "myResourceGroup", "myImageTemplate", armvirtualmachineimagebuilder.ImageTemplateUpdateParameters{
		Identity: &armvirtualmachineimagebuilder.ImageTemplateIdentity{
			Type: to.Ptr(armvirtualmachineimagebuilder.ResourceIdentityTypeNone),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ImageTemplate = armvirtualmachineimagebuilder.ImageTemplate{
	// 	Name: to.Ptr("myImageTemplate"),
	// 	Type: to.Ptr("Microsoft.VirtualMachineImages/imageTemplate"),
	// 	ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"new-tag": to.Ptr("new-value"),
	// 	},
	// 	Identity: &armvirtualmachineimagebuilder.ImageTemplateIdentity{
	// 		Type: to.Ptr(armvirtualmachineimagebuilder.ResourceIdentityTypeNone),
	// 	},
	// 	Properties: &armvirtualmachineimagebuilder.ImageTemplateProperties{
	// 		Customize: []armvirtualmachineimagebuilder.ImageTemplateCustomizerClassification{
	// 			&armvirtualmachineimagebuilder.ImageTemplateShellCustomizer{
	// 				Name: to.Ptr("Shell customization example"),
	// 				Type: to.Ptr("Shell"),
	// 				ScriptURI: to.Ptr("https://example.com/path/to/script.sh"),
	// 		}},
	// 		Distribute: []armvirtualmachineimagebuilder.ImageTemplateDistributorClassification{
	// 			&armvirtualmachineimagebuilder.ImageTemplateManagedImageDistributor{
	// 				Type: to.Ptr("ManagedImage"),
	// 				ArtifactTags: map[string]*string{
	// 					"tagName": to.Ptr("value"),
	// 				},
	// 				RunOutputName: to.Ptr("image_it_pir_1"),
	// 				ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1"),
	// 				Location: to.Ptr("1_location"),
	// 		}},
	// 		Source: &armvirtualmachineimagebuilder.ImageTemplateManagedImageSource{
	// 			Type: to.Ptr("ManagedImage"),
	// 			ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/source_rg/providers/Microsoft.Compute/images/source_image"),
	// 		},
	// 		VMProfile: &armvirtualmachineimagebuilder.ImageTemplateVMProfile{
	// 			OSDiskSizeGB: to.Ptr[int32](64),
	// 			VMSize: to.Ptr("Standard_D2s_v3"),
	// 		},
	// 	},
	// }
}
Output:

Example (UpdateTheTagsForAnImageTemplate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/078b90617e5e08137d0395963bd4119f4561a910/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/UpdateImageTemplateTags.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachineImageTemplatesClient().BeginUpdate(ctx, "myResourceGroup", "myImageTemplate", armvirtualmachineimagebuilder.ImageTemplateUpdateParameters{
		Tags: map[string]*string{
			"new-tag": to.Ptr("new-value"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ImageTemplate = armvirtualmachineimagebuilder.ImageTemplate{
	// 	Name: to.Ptr("myImageTemplate"),
	// 	Type: to.Ptr("Microsoft.VirtualMachineImages/imageTemplate"),
	// 	ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"new-tag": to.Ptr("new-value"),
	// 	},
	// 	Identity: &armvirtualmachineimagebuilder.ImageTemplateIdentity{
	// 		Type: to.Ptr(armvirtualmachineimagebuilder.ResourceIdentityTypeUserAssigned),
	// 		UserAssignedIdentities: map[string]*armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
	// 			"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity_1": &armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
	// 				ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 				PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			},
	// 		},
	// 	},
	// 	Properties: &armvirtualmachineimagebuilder.ImageTemplateProperties{
	// 		Customize: []armvirtualmachineimagebuilder.ImageTemplateCustomizerClassification{
	// 			&armvirtualmachineimagebuilder.ImageTemplateShellCustomizer{
	// 				Name: to.Ptr("Shell customization example"),
	// 				Type: to.Ptr("Shell"),
	// 				ScriptURI: to.Ptr("https://example.com/path/to/script.sh"),
	// 		}},
	// 		Distribute: []armvirtualmachineimagebuilder.ImageTemplateDistributorClassification{
	// 			&armvirtualmachineimagebuilder.ImageTemplateManagedImageDistributor{
	// 				Type: to.Ptr("ManagedImage"),
	// 				ArtifactTags: map[string]*string{
	// 					"tagName": to.Ptr("value"),
	// 				},
	// 				RunOutputName: to.Ptr("image_it_pir_1"),
	// 				ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1"),
	// 				Location: to.Ptr("1_location"),
	// 		}},
	// 		Source: &armvirtualmachineimagebuilder.ImageTemplateManagedImageSource{
	// 			Type: to.Ptr("ManagedImage"),
	// 			ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/source_rg/providers/Microsoft.Compute/images/source_image"),
	// 		},
	// 		VMProfile: &armvirtualmachineimagebuilder.ImageTemplateVMProfile{
	// 			OSDiskSizeGB: to.Ptr[int32](64),
	// 			VMSize: to.Ptr("Standard_D2s_v3"),
	// 		},
	// 	},
	// }
}
Output:

func (*VirtualMachineImageTemplatesClient) Get

Get - Get information about a virtual machine image template If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-02-14

  • resourceGroupName - The name of the resource group.
  • imageTemplateName - The name of the image Template
  • options - VirtualMachineImageTemplatesClientGetOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/078b90617e5e08137d0395963bd4119f4561a910/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/GetImageTemplate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualMachineImageTemplatesClient().Get(ctx, "myResourceGroup", "myImageTemplate", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ImageTemplate = armvirtualmachineimagebuilder.ImageTemplate{
	// 	Name: to.Ptr("myImageTemplate"),
	// 	Type: to.Ptr("Microsoft.VirtualMachineImages/imageTemplate"),
	// 	ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate"),
	// 	Location: to.Ptr("westus"),
	// 	Identity: &armvirtualmachineimagebuilder.ImageTemplateIdentity{
	// 		Type: to.Ptr(armvirtualmachineimagebuilder.ResourceIdentityTypeUserAssigned),
	// 		UserAssignedIdentities: map[string]*armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
	// 			"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity_1": &armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
	// 				ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 				PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			},
	// 		},
	// 	},
	// 	Properties: &armvirtualmachineimagebuilder.ImageTemplateProperties{
	// 		Customize: []armvirtualmachineimagebuilder.ImageTemplateCustomizerClassification{
	// 			&armvirtualmachineimagebuilder.ImageTemplateShellCustomizer{
	// 				Name: to.Ptr("Shell Customizer Example"),
	// 				Type: to.Ptr("Shell"),
	// 				ScriptURI: to.Ptr("https://example.com/path/to/script.sh"),
	// 		}},
	// 		Distribute: []armvirtualmachineimagebuilder.ImageTemplateDistributorClassification{
	// 			&armvirtualmachineimagebuilder.ImageTemplateManagedImageDistributor{
	// 				Type: to.Ptr("ManagedImage"),
	// 				ArtifactTags: map[string]*string{
	// 					"tagName": to.Ptr("value"),
	// 				},
	// 				RunOutputName: to.Ptr("image_it_pir_1"),
	// 				ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1"),
	// 				Location: to.Ptr("1_location"),
	// 		}},
	// 		Source: &armvirtualmachineimagebuilder.ImageTemplateManagedImageSource{
	// 			Type: to.Ptr("ManagedImage"),
	// 			ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/source_rg/providers/Microsoft.Compute/images/source_image"),
	// 		},
	// 		VMProfile: &armvirtualmachineimagebuilder.ImageTemplateVMProfile{
	// 			OSDiskSizeGB: to.Ptr[int32](64),
	// 			VMSize: to.Ptr("Standard_D2s_v3"),
	// 		},
	// 	},
	// }
}
Output:

func (*VirtualMachineImageTemplatesClient) GetRunOutput

GetRunOutput - Get the specified run output for the specified image template resource If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-02-14

  • resourceGroupName - The name of the resource group.
  • imageTemplateName - The name of the image Template
  • runOutputName - The name of the run output
  • options - VirtualMachineImageTemplatesClientGetRunOutputOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.GetRunOutput method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/078b90617e5e08137d0395963bd4119f4561a910/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/GetRunOutput.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualMachineImageTemplatesClient().GetRunOutput(ctx, "myResourceGroup", "myImageTemplate", "myManagedImageOutput", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.RunOutput = armvirtualmachineimagebuilder.RunOutput{
	// 	Name: to.Ptr("myManagedImageOutput"),
	// 	Type: to.Ptr("Microsoft.VirtualMachineImages/imageTemplates/runOutputs"),
	// 	ID: to.Ptr("/subscriptions/{subscription-id}/resourcegroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate/runOutputs/myManagedImageOutput"),
	// 	Properties: &armvirtualmachineimagebuilder.RunOutputProperties{
	// 		ArtifactID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/output_managed_image"),
	// 		ProvisioningState: to.Ptr(armvirtualmachineimagebuilder.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*VirtualMachineImageTemplatesClient) NewListByResourceGroupPager added in v0.4.0

NewListByResourceGroupPager - Gets information about the VM image templates associated with the specified resource group.

Generated from API version 2022-02-14

  • resourceGroupName - The name of the resource group.
  • options - VirtualMachineImageTemplatesClientListByResourceGroupOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/078b90617e5e08137d0395963bd4119f4561a910/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/ListImageTemplatesByRg.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualMachineImageTemplatesClient().NewListByResourceGroupPager("myResourceGroup", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ImageTemplateListResult = armvirtualmachineimagebuilder.ImageTemplateListResult{
		// 	Value: []*armvirtualmachineimagebuilder.ImageTemplate{
		// 		{
		// 			Name: to.Ptr("myImageTemplate"),
		// 			Type: to.Ptr("Microsoft.VirtualMachineImages/imageTemplate"),
		// 			ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate"),
		// 			Location: to.Ptr("westus"),
		// 			Identity: &armvirtualmachineimagebuilder.ImageTemplateIdentity{
		// 				Type: to.Ptr(armvirtualmachineimagebuilder.ResourceIdentityTypeUserAssigned),
		// 				UserAssignedIdentities: map[string]*armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
		// 					"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity_1": &armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
		// 						ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 						PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					},
		// 				},
		// 			},
		// 			Properties: &armvirtualmachineimagebuilder.ImageTemplateProperties{
		// 				Customize: []armvirtualmachineimagebuilder.ImageTemplateCustomizerClassification{
		// 					&armvirtualmachineimagebuilder.ImageTemplateShellCustomizer{
		// 						Name: to.Ptr("Shell customization example"),
		// 						Type: to.Ptr("Shell"),
		// 						ScriptURI: to.Ptr("https://example.com/path/to/script.sh"),
		// 				}},
		// 				Distribute: []armvirtualmachineimagebuilder.ImageTemplateDistributorClassification{
		// 					&armvirtualmachineimagebuilder.ImageTemplateManagedImageDistributor{
		// 						Type: to.Ptr("ManagedImage"),
		// 						ArtifactTags: map[string]*string{
		// 							"tagName": to.Ptr("value"),
		// 						},
		// 						RunOutputName: to.Ptr("image_it_pir_1"),
		// 						ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1"),
		// 						Location: to.Ptr("1_location"),
		// 				}},
		// 				Source: &armvirtualmachineimagebuilder.ImageTemplateManagedImageSource{
		// 					Type: to.Ptr("ManagedImage"),
		// 					ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/source_rg/providers/Microsoft.Compute/images/source_image"),
		// 				},
		// 				VMProfile: &armvirtualmachineimagebuilder.ImageTemplateVMProfile{
		// 					OSDiskSizeGB: to.Ptr[int32](64),
		// 					VMSize: to.Ptr("Standard_D2s_v3"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("myOtherImageTemplate"),
		// 			Type: to.Ptr("Microsoft.VirtualMachineImages/imageTemplate"),
		// 			ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myOtherImageTemplate"),
		// 			Location: to.Ptr("eastus"),
		// 			Identity: &armvirtualmachineimagebuilder.ImageTemplateIdentity{
		// 				Type: to.Ptr(armvirtualmachineimagebuilder.ResourceIdentityTypeUserAssigned),
		// 				UserAssignedIdentities: map[string]*armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
		// 					"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity_1": &armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
		// 						ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 						PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					},
		// 				},
		// 			},
		// 			Properties: &armvirtualmachineimagebuilder.ImageTemplateProperties{
		// 				Customize: []armvirtualmachineimagebuilder.ImageTemplateCustomizerClassification{
		// 					&armvirtualmachineimagebuilder.ImageTemplateShellCustomizer{
		// 						Name: to.Ptr("Shell customization example"),
		// 						Type: to.Ptr("Shell"),
		// 						ScriptURI: to.Ptr("https://example.com/path/to/script.sh"),
		// 				}},
		// 				Distribute: []armvirtualmachineimagebuilder.ImageTemplateDistributorClassification{
		// 					&armvirtualmachineimagebuilder.ImageTemplateManagedImageDistributor{
		// 						Type: to.Ptr("ManagedImage"),
		// 						RunOutputName: to.Ptr("singleImage"),
		// 						ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/baseimage-cus"),
		// 						Location: to.Ptr("centralus"),
		// 					},
		// 					&armvirtualmachineimagebuilder.ImageTemplateSharedImageDistributor{
		// 						Type: to.Ptr("SharedImage"),
		// 						RunOutputName: to.Ptr("gallery"),
		// 						ExcludeFromLatest: to.Ptr(true),
		// 						GalleryImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/gallery/baseimages/images/baseimage"),
		// 						ReplicationRegions: []*string{
		// 							to.Ptr("eastus"),
		// 							to.Ptr("westus")},
		// 							StorageAccountType: to.Ptr(armvirtualmachineimagebuilder.SharedImageStorageAccountTypeStandardLRS),
		// 					}},
		// 					Source: &armvirtualmachineimagebuilder.ImageTemplatePlatformImageSource{
		// 						Type: to.Ptr("PlatformImage"),
		// 						Offer: to.Ptr("UbuntuServer"),
		// 						PlanInfo: &armvirtualmachineimagebuilder.PlatformImagePurchasePlan{
		// 							PlanName: to.Ptr("example_plan_name"),
		// 							PlanProduct: to.Ptr("example_plan_product"),
		// 							PlanPublisher: to.Ptr("example_plan_publisher"),
		// 						},
		// 						Publisher: to.Ptr("Canonical"),
		// 						SKU: to.Ptr("18.04-LTS"),
		// 						Version: to.Ptr("18.04.201902121"),
		// 					},
		// 					VMProfile: &armvirtualmachineimagebuilder.ImageTemplateVMProfile{
		// 						OSDiskSizeGB: to.Ptr[int32](64),
		// 						VMSize: to.Ptr("Standard_D8s_v3"),
		// 					},
		// 				},
		// 		}},
		// 	}
	}
}
Output:

func (*VirtualMachineImageTemplatesClient) NewListPager added in v0.4.0

NewListPager - Gets information about the VM image templates associated with the subscription.

Generated from API version 2022-02-14

  • options - VirtualMachineImageTemplatesClientListOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/078b90617e5e08137d0395963bd4119f4561a910/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/ListImageTemplates.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualMachineImageTemplatesClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ImageTemplateListResult = armvirtualmachineimagebuilder.ImageTemplateListResult{
		// 	Value: []*armvirtualmachineimagebuilder.ImageTemplate{
		// 		{
		// 			Name: to.Ptr("myImageTemplate"),
		// 			Type: to.Ptr("Microsoft.VirtualMachineImages/imageTemplate"),
		// 			ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate"),
		// 			Location: to.Ptr("westus"),
		// 			Identity: &armvirtualmachineimagebuilder.ImageTemplateIdentity{
		// 				Type: to.Ptr(armvirtualmachineimagebuilder.ResourceIdentityTypeUserAssigned),
		// 				UserAssignedIdentities: map[string]*armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
		// 					"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity_1": &armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
		// 						ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 						PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					},
		// 				},
		// 			},
		// 			Properties: &armvirtualmachineimagebuilder.ImageTemplateProperties{
		// 				Customize: []armvirtualmachineimagebuilder.ImageTemplateCustomizerClassification{
		// 					&armvirtualmachineimagebuilder.ImageTemplateShellCustomizer{
		// 						Name: to.Ptr("Shell customization example"),
		// 						Type: to.Ptr("Shell"),
		// 						ScriptURI: to.Ptr("https://example.com/path/to/script.sh"),
		// 				}},
		// 				Distribute: []armvirtualmachineimagebuilder.ImageTemplateDistributorClassification{
		// 					&armvirtualmachineimagebuilder.ImageTemplateManagedImageDistributor{
		// 						Type: to.Ptr("ManagedImage"),
		// 						ArtifactTags: map[string]*string{
		// 							"tagName": to.Ptr("value"),
		// 						},
		// 						RunOutputName: to.Ptr("image_it_pir_1"),
		// 						ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/image_it_1"),
		// 						Location: to.Ptr("1_location"),
		// 				}},
		// 				Source: &armvirtualmachineimagebuilder.ImageTemplateManagedImageSource{
		// 					Type: to.Ptr("ManagedImage"),
		// 					ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/source_rg/providers/Microsoft.Compute/images/source_image"),
		// 				},
		// 				VMProfile: &armvirtualmachineimagebuilder.ImageTemplateVMProfile{
		// 					OSDiskSizeGB: to.Ptr[int32](64),
		// 					VMSize: to.Ptr("Standard_D2s_v3"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("mySecondImageTemplate"),
		// 			Type: to.Ptr("Microsoft.VirtualMachineImages/imageTemplate"),
		// 			ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myOtherResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/mySecondImageTemplate"),
		// 			Location: to.Ptr("westus"),
		// 			Identity: &armvirtualmachineimagebuilder.ImageTemplateIdentity{
		// 				Type: to.Ptr(armvirtualmachineimagebuilder.ResourceIdentityTypeUserAssigned),
		// 				UserAssignedIdentities: map[string]*armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
		// 					"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity_1": &armvirtualmachineimagebuilder.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties{
		// 						ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 						PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					},
		// 				},
		// 			},
		// 			Properties: &armvirtualmachineimagebuilder.ImageTemplateProperties{
		// 				Customize: []armvirtualmachineimagebuilder.ImageTemplateCustomizerClassification{
		// 					&armvirtualmachineimagebuilder.ImageTemplateShellCustomizer{
		// 						Name: to.Ptr("Shell customization example"),
		// 						Type: to.Ptr("Shell"),
		// 						ScriptURI: to.Ptr("https://example.com/path/to/script.sh"),
		// 				}},
		// 				Distribute: []armvirtualmachineimagebuilder.ImageTemplateDistributorClassification{
		// 					&armvirtualmachineimagebuilder.ImageTemplateManagedImageDistributor{
		// 						Type: to.Ptr("ManagedImage"),
		// 						ArtifactTags: map[string]*string{
		// 							"stage": to.Ptr("development"),
		// 						},
		// 						RunOutputName: to.Ptr("eus"),
		// 						ImageID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/mySecondImage-eus"),
		// 						Location: to.Ptr("eastus"),
		// 				}},
		// 				Source: &armvirtualmachineimagebuilder.ImageTemplatePlatformImageSource{
		// 					Type: to.Ptr("PlatformImage"),
		// 					Offer: to.Ptr("UbuntuServer"),
		// 					PlanInfo: &armvirtualmachineimagebuilder.PlatformImagePurchasePlan{
		// 						PlanName: to.Ptr("example_plan_name"),
		// 						PlanProduct: to.Ptr("example_plan_product"),
		// 						PlanPublisher: to.Ptr("example_plan_publisher"),
		// 					},
		// 					Publisher: to.Ptr("Canonical"),
		// 					SKU: to.Ptr("18.04-LTS"),
		// 					Version: to.Ptr("18.04.201902121"),
		// 				},
		// 				VMProfile: &armvirtualmachineimagebuilder.ImageTemplateVMProfile{
		// 					OSDiskSizeGB: to.Ptr[int32](32),
		// 					VMSize: to.Ptr("Standard_D8s_v3"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*VirtualMachineImageTemplatesClient) NewListRunOutputsPager added in v0.4.0

NewListRunOutputsPager - List all run outputs for the specified Image Template resource

Generated from API version 2022-02-14

  • resourceGroupName - The name of the resource group.
  • imageTemplateName - The name of the image Template
  • options - VirtualMachineImageTemplatesClientListRunOutputsOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.NewListRunOutputsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/078b90617e5e08137d0395963bd4119f4561a910/specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/ListRunOutputs.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armvirtualmachineimagebuilder.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualMachineImageTemplatesClient().NewListRunOutputsPager("myResourceGroup", "myImageTemplate", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.RunOutputCollection = armvirtualmachineimagebuilder.RunOutputCollection{
		// 	Value: []*armvirtualmachineimagebuilder.RunOutput{
		// 		{
		// 			Name: to.Ptr("myManagedImageOutput"),
		// 			Type: to.Ptr("Microsoft.VirtualMachineImages/imageTemplates/runOutputs"),
		// 			ID: to.Ptr("/subscriptions/{subscription-id}/resourcegroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate/runOutputs/myManagedImageOutput"),
		// 			Properties: &armvirtualmachineimagebuilder.RunOutputProperties{
		// 				ArtifactID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/images/output_managed_image"),
		// 				ProvisioningState: to.Ptr(armvirtualmachineimagebuilder.ProvisioningStateSucceeded),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("mySharedImageOutput"),
		// 			Type: to.Ptr("Microsoft.VirtualMachineImages/imageTemplates/runOutputs"),
		// 			ID: to.Ptr("/subscriptions/{subscription-id}/resourcegroups/myResourceGroup/providers/Microsoft.VirtualMachineImages/imageTemplates/myImageTemplate/runOutputs/mySharedImageOutput"),
		// 			Properties: &armvirtualmachineimagebuilder.RunOutputProperties{
		// 				ArtifactID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rg1/providers/Microsoft.Compute/galleries/Gallery1/images/SharedImageOutput/imageversions/1.2.3"),
		// 				ProvisioningState: to.Ptr(armvirtualmachineimagebuilder.ProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

type VirtualMachineImageTemplatesClientBeginCancelOptions added in v0.2.0

type VirtualMachineImageTemplatesClientBeginCancelOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachineImageTemplatesClientBeginCancelOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.BeginCancel method.

type VirtualMachineImageTemplatesClientBeginCreateOrUpdateOptions added in v0.2.0

type VirtualMachineImageTemplatesClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachineImageTemplatesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.BeginCreateOrUpdate method.

type VirtualMachineImageTemplatesClientBeginDeleteOptions added in v0.2.0

type VirtualMachineImageTemplatesClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachineImageTemplatesClientBeginDeleteOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.BeginDelete method.

type VirtualMachineImageTemplatesClientBeginRunOptions added in v0.2.0

type VirtualMachineImageTemplatesClientBeginRunOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachineImageTemplatesClientBeginRunOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.BeginRun method.

type VirtualMachineImageTemplatesClientBeginUpdateOptions added in v0.2.0

type VirtualMachineImageTemplatesClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachineImageTemplatesClientBeginUpdateOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.BeginUpdate method.

type VirtualMachineImageTemplatesClientCancelResponse added in v0.2.0

type VirtualMachineImageTemplatesClientCancelResponse struct {
}

VirtualMachineImageTemplatesClientCancelResponse contains the response from method VirtualMachineImageTemplatesClient.BeginCancel.

type VirtualMachineImageTemplatesClientCreateOrUpdateResponse added in v0.2.0

type VirtualMachineImageTemplatesClientCreateOrUpdateResponse struct {
	ImageTemplate
}

VirtualMachineImageTemplatesClientCreateOrUpdateResponse contains the response from method VirtualMachineImageTemplatesClient.BeginCreateOrUpdate.

type VirtualMachineImageTemplatesClientDeleteResponse added in v0.2.0

type VirtualMachineImageTemplatesClientDeleteResponse struct {
}

VirtualMachineImageTemplatesClientDeleteResponse contains the response from method VirtualMachineImageTemplatesClient.BeginDelete.

type VirtualMachineImageTemplatesClientGetOptions added in v0.2.0

type VirtualMachineImageTemplatesClientGetOptions struct {
}

VirtualMachineImageTemplatesClientGetOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.Get method.

type VirtualMachineImageTemplatesClientGetResponse added in v0.2.0

type VirtualMachineImageTemplatesClientGetResponse struct {
	ImageTemplate
}

VirtualMachineImageTemplatesClientGetResponse contains the response from method VirtualMachineImageTemplatesClient.Get.

type VirtualMachineImageTemplatesClientGetRunOutputOptions added in v0.2.0

type VirtualMachineImageTemplatesClientGetRunOutputOptions struct {
}

VirtualMachineImageTemplatesClientGetRunOutputOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.GetRunOutput method.

type VirtualMachineImageTemplatesClientGetRunOutputResponse added in v0.2.0

type VirtualMachineImageTemplatesClientGetRunOutputResponse struct {
	RunOutput
}

VirtualMachineImageTemplatesClientGetRunOutputResponse contains the response from method VirtualMachineImageTemplatesClient.GetRunOutput.

type VirtualMachineImageTemplatesClientListByResourceGroupOptions added in v0.2.0

type VirtualMachineImageTemplatesClientListByResourceGroupOptions struct {
}

VirtualMachineImageTemplatesClientListByResourceGroupOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.NewListByResourceGroupPager method.

type VirtualMachineImageTemplatesClientListByResourceGroupResponse added in v0.2.0

type VirtualMachineImageTemplatesClientListByResourceGroupResponse struct {
	ImageTemplateListResult
}

VirtualMachineImageTemplatesClientListByResourceGroupResponse contains the response from method VirtualMachineImageTemplatesClient.NewListByResourceGroupPager.

type VirtualMachineImageTemplatesClientListOptions added in v0.2.0

type VirtualMachineImageTemplatesClientListOptions struct {
}

VirtualMachineImageTemplatesClientListOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.NewListPager method.

type VirtualMachineImageTemplatesClientListResponse added in v0.2.0

type VirtualMachineImageTemplatesClientListResponse struct {
	ImageTemplateListResult
}

VirtualMachineImageTemplatesClientListResponse contains the response from method VirtualMachineImageTemplatesClient.NewListPager.

type VirtualMachineImageTemplatesClientListRunOutputsOptions added in v0.2.0

type VirtualMachineImageTemplatesClientListRunOutputsOptions struct {
}

VirtualMachineImageTemplatesClientListRunOutputsOptions contains the optional parameters for the VirtualMachineImageTemplatesClient.NewListRunOutputsPager method.

type VirtualMachineImageTemplatesClientListRunOutputsResponse added in v0.2.0

type VirtualMachineImageTemplatesClientListRunOutputsResponse struct {
	RunOutputCollection
}

VirtualMachineImageTemplatesClientListRunOutputsResponse contains the response from method VirtualMachineImageTemplatesClient.NewListRunOutputsPager.

type VirtualMachineImageTemplatesClientRunResponse added in v0.2.0

type VirtualMachineImageTemplatesClientRunResponse struct {
}

VirtualMachineImageTemplatesClientRunResponse contains the response from method VirtualMachineImageTemplatesClient.BeginRun.

type VirtualMachineImageTemplatesClientUpdateResponse added in v0.2.0

type VirtualMachineImageTemplatesClientUpdateResponse struct {
	ImageTemplate
}

VirtualMachineImageTemplatesClientUpdateResponse contains the response from method VirtualMachineImageTemplatesClient.BeginUpdate.

type VirtualNetworkConfig

type VirtualNetworkConfig struct {
	// 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 (StandardA1v2).
	ProxyVMSize *string

	// Resource id of a pre-existing subnet.
	SubnetID *string
}

VirtualNetworkConfig - Virtual Network configuration.

func (VirtualNetworkConfig) MarshalJSON added in v1.2.0

func (v VirtualNetworkConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkConfig.

func (*VirtualNetworkConfig) UnmarshalJSON added in v1.2.0

func (v *VirtualNetworkConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkConfig.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL