diff --git a/services/compute/mgmt/2020-06-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2020-06-01/compute/computeapi/interfaces.go index 65d094972ce6..a1e05e160ca2 100644 --- a/services/compute/mgmt/2020-06-01/compute/computeapi/interfaces.go +++ b/services/compute/mgmt/2020-06-01/compute/computeapi/interfaces.go @@ -146,7 +146,7 @@ type VirtualMachinesClientAPI interface { ConvertToManagedDisks(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesConvertToManagedDisksFuture, err error) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachine) (result compute.VirtualMachinesCreateOrUpdateFuture, err error) Deallocate(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesDeallocateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesDeleteFuture, err error) + Delete(ctx context.Context, resourceGroupName string, VMName string, forceDeletion *bool) (result compute.VirtualMachinesDeleteFuture, err error) Generalize(ctx context.Context, resourceGroupName string, VMName string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroupName string, VMName string, expand compute.InstanceViewTypes) (result compute.VirtualMachine, err error) InstanceView(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachineInstanceView, err error) @@ -249,11 +249,11 @@ var _ VirtualMachineScaleSetRollingUpgradesClientAPI = (*compute.VirtualMachineS // VirtualMachineScaleSetVMExtensionsClientAPI contains the set of methods on the VirtualMachineScaleSetVMExtensionsClient type. type VirtualMachineScaleSetVMExtensionsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters compute.VirtualMachineExtension) (result compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters compute.VirtualMachineScaleSetVMExtension) (result compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (result compute.VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (result compute.VirtualMachineExtension, err error) - List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result compute.VirtualMachineExtensionsListResult, err error) - Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters compute.VirtualMachineExtensionUpdate) (result compute.VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) + Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (result compute.VirtualMachineScaleSetVMExtension, err error) + List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result compute.VirtualMachineScaleSetVMExtensionsListResult, err error) + Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters compute.VirtualMachineScaleSetVMExtensionUpdate) (result compute.VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) } var _ VirtualMachineScaleSetVMExtensionsClientAPI = (*compute.VirtualMachineScaleSetVMExtensionsClient)(nil) @@ -291,13 +291,31 @@ var _ LogAnalyticsClientAPI = (*compute.LogAnalyticsClient)(nil) // VirtualMachineRunCommandsClientAPI contains the set of methods on the VirtualMachineRunCommandsClient type. type VirtualMachineRunCommandsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand compute.VirtualMachineRunCommand) (result compute.VirtualMachineRunCommandsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, VMName string, runCommandName string) (result compute.VirtualMachineRunCommandsDeleteFuture, err error) Get(ctx context.Context, location string, commandID string) (result compute.RunCommandDocument, err error) + GetByVirtualMachine(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, expand string) (result compute.VirtualMachineRunCommand, err error) List(ctx context.Context, location string) (result compute.RunCommandListResultPage, err error) ListComplete(ctx context.Context, location string) (result compute.RunCommandListResultIterator, err error) + ListByVirtualMachine(ctx context.Context, resourceGroupName string, VMName string, expand string) (result compute.VirtualMachineRunCommandsListResultPage, err error) + ListByVirtualMachineComplete(ctx context.Context, resourceGroupName string, VMName string, expand string) (result compute.VirtualMachineRunCommandsListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand compute.VirtualMachineRunCommandUpdate) (result compute.VirtualMachineRunCommandsUpdateFuture, err error) } var _ VirtualMachineRunCommandsClientAPI = (*compute.VirtualMachineRunCommandsClient)(nil) +// VirtualMachineScaleSetVMRunCommandsClientAPI contains the set of methods on the VirtualMachineScaleSetVMRunCommandsClient type. +type VirtualMachineScaleSetVMRunCommandsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand compute.VirtualMachineRunCommand) (result compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string) (result compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, expand string) (result compute.VirtualMachineRunCommand, err error) + List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result compute.VirtualMachineRunCommandsListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result compute.VirtualMachineRunCommandsListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand compute.VirtualMachineRunCommandUpdate) (result compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture, err error) +} + +var _ VirtualMachineScaleSetVMRunCommandsClientAPI = (*compute.VirtualMachineScaleSetVMRunCommandsClient)(nil) + // ResourceSkusClientAPI contains the set of methods on the ResourceSkusClient type. type ResourceSkusClientAPI interface { List(ctx context.Context, filter string) (result compute.ResourceSkusResultPage, err error) diff --git a/services/compute/mgmt/2020-06-01/compute/enums.go b/services/compute/mgmt/2020-06-01/compute/enums.go index 558aade42519..34ca493fdb5b 100644 --- a/services/compute/mgmt/2020-06-01/compute/enums.go +++ b/services/compute/mgmt/2020-06-01/compute/enums.go @@ -392,6 +392,31 @@ func PossibleEncryptionTypeValues() []EncryptionType { return []EncryptionType{EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys, EncryptionAtRestWithPlatformKey} } +// ExecutionState enumerates the values for execution state. +type ExecutionState string + +const ( + // ExecutionStateCanceled ... + ExecutionStateCanceled ExecutionState = "Canceled" + // ExecutionStateFailed ... + ExecutionStateFailed ExecutionState = "Failed" + // ExecutionStatePending ... + ExecutionStatePending ExecutionState = "Pending" + // ExecutionStateRunning ... + ExecutionStateRunning ExecutionState = "Running" + // ExecutionStateSucceeded ... + ExecutionStateSucceeded ExecutionState = "Succeeded" + // ExecutionStateTimedOut ... + ExecutionStateTimedOut ExecutionState = "TimedOut" + // ExecutionStateUnknown ... + ExecutionStateUnknown ExecutionState = "Unknown" +) + +// PossibleExecutionStateValues returns an array of possible values for the ExecutionState const type. +func PossibleExecutionStateValues() []ExecutionState { + return []ExecutionState{ExecutionStateCanceled, ExecutionStateFailed, ExecutionStatePending, ExecutionStateRunning, ExecutionStateSucceeded, ExecutionStateTimedOut, ExecutionStateUnknown} +} + // HostCaching enumerates the values for host caching. type HostCaching string diff --git a/services/compute/mgmt/2020-06-01/compute/models.go b/services/compute/mgmt/2020-06-01/compute/models.go index 4047da39acda..07836058e273 100644 --- a/services/compute/mgmt/2020-06-01/compute/models.go +++ b/services/compute/mgmt/2020-06-01/compute/models.go @@ -38,15 +38,16 @@ type AccessURI struct { AccessSAS *string `json:"accessSAS,omitempty"` } -// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale set. +// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale +// set. type AdditionalCapabilities struct { // UltraSSDEnabled - The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` } // AdditionalUnattendContent specifies additional XML formatted information that can be included in the -// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, and -// the pass in which the content is applied. +// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, +// and the pass in which the content is applied. type AdditionalUnattendContent struct { // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem' PassName PassNames `json:"passName,omitempty"` @@ -102,8 +103,8 @@ type AutomaticOSUpgradeProperties struct { AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` } -// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual machine -// scale set. +// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual +// machine scale set. type AutomaticRepairsPolicy struct { // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. Enabled *bool `json:"enabled,omitempty"` @@ -111,14 +112,16 @@ type AutomaticRepairsPolicy struct { GracePeriod *string `json:"gracePeriod,omitempty"` } -// AvailabilitySet specifies information about the availability set that the virtual machine should be assigned -// to. Virtual machines specified in the same availability set are allocated to different nodes to maximize -// availability. For more information about availability sets, see [Manage the availability of virtual +// AvailabilitySet specifies information about the availability set that the virtual machine should be +// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to +// maximize availability. For more information about availability sets, see [Manage the availability of +// virtual // machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). -//

For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in +//

For more information on Azure planned maintenance, see [Planned maintenance for virtual +// machines in // Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) -//

Currently, a VM can only be added to availability set at creation time. An existing VM cannot be -// added to an availability set. +//

Currently, a VM can only be added to availability set at creation time. An existing VM cannot +// be added to an availability set. type AvailabilitySet struct { autorest.Response `json:"-"` *AvailabilitySetProperties `json:"properties,omitempty"` @@ -384,8 +387,11 @@ func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { } // Creates a new instance of the AvailabilitySetListResultPage type. -func NewAvailabilitySetListResultPage(getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { - return AvailabilitySetListResultPage{fn: getNextPage} +func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { + return AvailabilitySetListResultPage{ + fn: getNextPage, + aslr: cur, + } } // AvailabilitySetProperties the instance view of a resource. @@ -420,8 +426,8 @@ func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should be -// assigned to. Only tags may be updated. +// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should +// be assigned to. Only tags may be updated. type AvailabilitySetUpdate struct { *AvailabilitySetProperties `json:"properties,omitempty"` // Sku - Sku of the availability set @@ -844,8 +850,11 @@ func (page ContainerServiceListResultPage) Values() []ContainerService { } // Creates a new instance of the ContainerServiceListResultPage type. -func NewContainerServiceListResultPage(getNextPage func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error)) ContainerServiceListResultPage { - return ContainerServiceListResultPage{fn: getNextPage} +func NewContainerServiceListResultPage(cur ContainerServiceListResult, getNextPage func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error)) ContainerServiceListResultPage { + return ContainerServiceListResultPage{ + fn: getNextPage, + cslr: cur, + } } // ContainerServiceMasterProfile profile for the container service master. @@ -980,8 +989,8 @@ func (future *ContainerServicesDeleteFuture) Result(client ContainerServicesClie return } -// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster to -// use for manipulating Azure APIs. +// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster +// to use for manipulating Azure APIs. type ContainerServiceServicePrincipalProfile struct { // ClientID - The ID for the service principal. ClientID *string `json:"clientId,omitempty"` @@ -1265,7 +1274,8 @@ func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { return nil } -// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM size. +// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM +// size. type DedicatedHostAllocatableVM struct { // VMSize - VM size in terms of which the unutilized capacity is represented. VMSize *string `json:"vmSize,omitempty"` @@ -1279,9 +1289,9 @@ type DedicatedHostAvailableCapacity struct { AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` } -// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should be -// assigned to.

Currently, a dedicated host can only be added to a dedicated host group at creation -// time. An existing dedicated host cannot be added to another dedicated host group. +// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should +// be assigned to.

Currently, a dedicated host can only be added to a dedicated host group at +// creation time. An existing dedicated host cannot be added to another dedicated host group. type DedicatedHostGroup struct { autorest.Response `json:"-"` *DedicatedHostGroupProperties `json:"properties,omitempty"` @@ -1553,8 +1563,11 @@ func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { } // Creates a new instance of the DedicatedHostGroupListResultPage type. -func NewDedicatedHostGroupListResultPage(getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { - return DedicatedHostGroupListResultPage{fn: getNextPage} +func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { + return DedicatedHostGroupListResultPage{ + fn: getNextPage, + dhglr: cur, + } } // DedicatedHostGroupProperties dedicated Host Group Properties. @@ -1581,8 +1594,8 @@ func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host should -// be assigned to. Only tags may be updated. +// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host +// should be assigned to. Only tags may be updated. type DedicatedHostGroupUpdate struct { *DedicatedHostGroupProperties `json:"properties,omitempty"` // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. @@ -1847,8 +1860,11 @@ func (page DedicatedHostListResultPage) Values() []DedicatedHost { } // Creates a new instance of the DedicatedHostListResultPage type. -func NewDedicatedHostListResultPage(getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { - return DedicatedHostListResultPage{fn: getNextPage} +func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { + return DedicatedHostListResultPage{ + fn: getNextPage, + dhlr: cur, + } } // DedicatedHostProperties properties of the dedicated host. @@ -2020,7 +2036,8 @@ func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { return nil } -// DiagnosticsProfile specifies the boot diagnostic settings state.

Minimum api-version: 2015-06-15. +// DiagnosticsProfile specifies the boot diagnostic settings state.

Minimum api-version: +// 2015-06-15. type DiagnosticsProfile struct { // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

You can easily view the output of your console log.

Azure also enables you to see a screenshot of the VM from the hypervisor. BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` @@ -2296,8 +2313,8 @@ func (da *DiskAccess) UnmarshalJSON(body []byte) error { return nil } -// DiskAccessesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// DiskAccessesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type DiskAccessesCreateOrUpdateFuture struct { azure.Future } @@ -2529,8 +2546,11 @@ func (page DiskAccessListPage) Values() []DiskAccess { } // Creates a new instance of the DiskAccessListPage type. -func NewDiskAccessListPage(getNextPage func(context.Context, DiskAccessList) (DiskAccessList, error)) DiskAccessListPage { - return DiskAccessListPage{fn: getNextPage} +func NewDiskAccessListPage(cur DiskAccessList, getNextPage func(context.Context, DiskAccessList) (DiskAccessList, error)) DiskAccessListPage { + return DiskAccessListPage{ + fn: getNextPage, + dal: cur, + } } // DiskAccessProperties ... @@ -2823,13 +2843,16 @@ func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { } // Creates a new instance of the DiskEncryptionSetListPage type. -func NewDiskEncryptionSetListPage(getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { - return DiskEncryptionSetListPage{fn: getNextPage} +func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { + return DiskEncryptionSetListPage{ + fn: getNextPage, + desl: cur, + } } -// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id that -// can be specified for disk.

NOTE: The disk encryption set resource id can only be specified for -// managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. +// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id +// that can be specified for disk.

NOTE: The disk encryption set resource id can only be specified +// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. type DiskEncryptionSetParameters struct { // ID - Resource Id ID *string `json:"id,omitempty"` @@ -2864,8 +2887,8 @@ func (future *DiskEncryptionSetsCreateOrUpdateFuture) Result(client DiskEncrypti return } -// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type DiskEncryptionSetsDeleteFuture struct { azure.Future } @@ -2887,8 +2910,8 @@ func (future *DiskEncryptionSetsDeleteFuture) Result(client DiskEncryptionSetsCl return } -// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type DiskEncryptionSetsUpdateFuture struct { azure.Future } @@ -3153,8 +3176,11 @@ func (page DiskListPage) Values() []Disk { } // Creates a new instance of the DiskListPage type. -func NewDiskListPage(getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { - return DiskListPage{fn: getNextPage} +func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { + return DiskListPage{ + fn: getNextPage, + dl: cur, + } } // DiskProperties disk resource properties. @@ -3295,7 +3321,8 @@ func (future *DisksDeleteFuture) Result(client DisksClient) (ar autorest.Respons return } -// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DisksGrantAccessFuture struct { azure.Future } @@ -3498,8 +3525,8 @@ type EncryptionImages struct { DataDiskImages *[]DataDiskImageEncryption `json:"dataDiskImages,omitempty"` } -// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on the -// key vault before it can be used to encrypt disks. +// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on +// the key vault before it can be used to encrypt disks. type EncryptionSetIdentity struct { // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. Possible values include: 'SystemAssigned' Type DiskEncryptionSetIdentityType `json:"type,omitempty"` @@ -3589,7 +3616,8 @@ func (future *GalleriesCreateOrUpdateFuture) Result(client GalleriesClient) (g G return } -// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type GalleriesDeleteFuture struct { azure.Future } @@ -3611,7 +3639,8 @@ func (future *GalleriesDeleteFuture) Result(client GalleriesClient) (ar autorest return } -// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type GalleriesUpdateFuture struct { azure.Future } @@ -3739,8 +3768,8 @@ func (g *Gallery) UnmarshalJSON(body []byte) error { return nil } -// GalleryApplication specifies information about the gallery Application Definition that you want to create or -// update. +// GalleryApplication specifies information about the gallery Application Definition that you want to +// create or update. type GalleryApplication struct { autorest.Response `json:"-"` *GalleryApplicationProperties `json:"properties,omitempty"` @@ -3992,8 +4021,11 @@ func (page GalleryApplicationListPage) Values() []GalleryApplication { } // Creates a new instance of the GalleryApplicationListPage type. -func NewGalleryApplicationListPage(getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { - return GalleryApplicationListPage{fn: getNextPage} +func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { + return GalleryApplicationListPage{ + fn: getNextPage, + gal: cur, + } } // GalleryApplicationProperties describes the properties of a gallery Application Definition. @@ -4041,8 +4073,8 @@ func (future *GalleryApplicationsCreateOrUpdateFuture) Result(client GalleryAppl return } -// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type GalleryApplicationsDeleteFuture struct { azure.Future } @@ -4064,8 +4096,8 @@ func (future *GalleryApplicationsDeleteFuture) Result(client GalleryApplications return } -// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type GalleryApplicationsUpdateFuture struct { azure.Future } @@ -4433,8 +4465,11 @@ func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersi } // Creates a new instance of the GalleryApplicationVersionListPage type. -func NewGalleryApplicationVersionListPage(getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { - return GalleryApplicationVersionListPage{fn: getNextPage} +func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { + return GalleryApplicationVersionListPage{ + fn: getNextPage, + gavl: cur, + } } // GalleryApplicationVersionProperties describes the properties of a gallery Image Version. @@ -4506,8 +4541,8 @@ func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, e return json.Marshal(objectMap) } -// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type GalleryApplicationVersionsCreateOrUpdateFuture struct { azure.Future } @@ -4587,8 +4622,8 @@ func (future *GalleryApplicationVersionsUpdateFuture) Result(client GalleryAppli return } -// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you want to -// update. +// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you +// want to update. type GalleryApplicationVersionUpdate struct { *GalleryApplicationVersionProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id @@ -5036,8 +5071,11 @@ func (page GalleryImageListPage) Values() []GalleryImage { } // Creates a new instance of the GalleryImageListPage type. -func NewGalleryImageListPage(getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { - return GalleryImageListPage{fn: getNextPage} +func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { + return GalleryImageListPage{ + fn: getNextPage, + gil: cur, + } } // GalleryImageProperties describes the properties of a gallery Image Definition. @@ -5108,8 +5146,8 @@ func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type GalleryImagesCreateOrUpdateFuture struct { azure.Future } @@ -5274,7 +5312,8 @@ func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { return nil } -// GalleryImageVersion specifies information about the gallery Image Version that you want to create or update. +// GalleryImageVersion specifies information about the gallery Image Version that you want to create or +// update. type GalleryImageVersion struct { autorest.Response `json:"-"` *GalleryImageVersionProperties `json:"properties,omitempty"` @@ -5526,8 +5565,11 @@ func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { } // Creates a new instance of the GalleryImageVersionListPage type. -func NewGalleryImageVersionListPage(getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { - return GalleryImageVersionListPage{fn: getNextPage} +func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { + return GalleryImageVersionListPage{ + fn: getNextPage, + givl: cur, + } } // GalleryImageVersionProperties describes the properties of a gallery Image Version. @@ -5618,8 +5660,8 @@ func (future *GalleryImageVersionsCreateOrUpdateFuture) Result(client GalleryIma return } -// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type GalleryImageVersionsDeleteFuture struct { azure.Future } @@ -5649,8 +5691,8 @@ type GalleryImageVersionStorageProfile struct { DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` } -// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type GalleryImageVersionsUpdateFuture struct { azure.Future } @@ -5915,8 +5957,11 @@ func (page GalleryListPage) Values() []Gallery { } // Creates a new instance of the GalleryListPage type. -func NewGalleryListPage(getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { - return GalleryListPage{fn: getNextPage} +func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { + return GalleryListPage{ + fn: getNextPage, + gl: cur, + } } // GalleryOSDiskImage this is the OS disk image. @@ -6060,8 +6105,9 @@ type HardwareProfile struct { VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` } -// Image the source user image virtual hard disk. The virtual hard disk will be copied before being attached to -// the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. +// Image the source user image virtual hard disk. The virtual hard disk will be copied before being +// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not +// exist. type Image struct { autorest.Response `json:"-"` *ImageProperties `json:"properties,omitempty"` @@ -6359,8 +6405,11 @@ func (page ImageListResultPage) Values() []Image { } // Creates a new instance of the ImageListResultPage type. -func NewImageListResultPage(getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { - return ImageListResultPage{fn: getNextPage} +func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { + return ImageListResultPage{ + fn: getNextPage, + ilr: cur, + } } // ImageOSDisk describes an Operating System disk. @@ -6412,7 +6461,8 @@ func (IP ImageProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace images. +// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace +// images. type ImagePurchasePlan struct { // Name - The plan ID. Name *string `json:"name,omitempty"` @@ -6424,8 +6474,8 @@ type ImagePurchasePlan struct { // ImageReference specifies information about the image to use. You can specify information about platform // images, marketplace images, or virtual machine images. This element is required when you want to use a -// platform image, marketplace image, or virtual machine image, but is not used in other creation operations. -// NOTE: Image reference publisher and offer can only be set when you create the scale set. +// platform image, marketplace image, or virtual machine image, but is not used in other creation +// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. type ImageReference struct { // Publisher - The image publisher. Publisher *string `json:"publisher,omitempty"` @@ -6625,8 +6675,8 @@ type InstanceViewStatus struct { Time *date.Time `json:"time,omitempty"` } -// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to -// unwrap the encryptionKey +// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used +// to unwrap the encryptionKey type KeyVaultAndKeyReference struct { // SourceVault - Resource id of the KeyVault containing the key or secret SourceVault *SourceVault `json:"sourceVault,omitempty"` @@ -6688,8 +6738,8 @@ type LastPatchInstallationSummary struct { Error *APIError `json:"error,omitempty"` } -// LinuxConfiguration specifies the Linux operating system settings on the virtual machine.

For a list -// of supported Linux distributions, see [Linux on Azure-Endorsed +// LinuxConfiguration specifies the Linux operating system settings on the virtual machine.

For a +// list of supported Linux distributions, see [Linux on Azure-Endorsed // Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) //

For running non-endorsed distributions, see [Information for Non-Endorsed // Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). @@ -6854,8 +6904,11 @@ func (page ListUsagesResultPage) Values() []Usage { } // Creates a new instance of the ListUsagesResultPage type. -func NewListUsagesResultPage(getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { - return ListUsagesResultPage{fn: getNextPage} +func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { + return ListUsagesResultPage{ + fn: getNextPage, + lur: cur, + } } // ListVirtualMachineExtensionImage ... @@ -6870,8 +6923,8 @@ type ListVirtualMachineImageResource struct { Value *[]VirtualMachineImageResource `json:"value,omitempty"` } -// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type LogAnalyticsExportRequestRateByIntervalFuture struct { azure.Future } @@ -7150,8 +7203,8 @@ type OrchestrationServiceSummary struct { ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` } -// OSDisk specifies information about the operating system disk used by the virtual machine.

For more -// information about disks, see [About disks and VHDs for Azure virtual +// OSDisk specifies information about the operating system disk used by the virtual machine.

For +// more information about disks, see [About disks and VHDs for Azure virtual // machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). type OSDisk struct { // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.

Possible values are:

**Windows**

**Linux**. Possible values include: 'Windows', 'Linux' @@ -7190,8 +7243,8 @@ type OSDiskImageEncryption struct { DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` } -// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot be -// changed once VM is provisioned. +// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot +// be changed once VM is provisioned. type OSProfile struct { // ComputerName - Specifies the host OS name of the virtual machine.

This name cannot be updated after the VM is created.

**Max-length (Windows):** 15 characters

**Max-length (Linux):** 64 characters.

For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). ComputerName *string `json:"computerName,omitempty"` @@ -7219,11 +7272,11 @@ type PatchSettings struct { PatchMode InGuestPatchMode `json:"patchMode,omitempty"` } -// Plan specifies information about the marketplace image used to create the virtual machine. This element is -// only used for marketplace images. Before you can use a marketplace image from an API, you must enable the -// image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then -// click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click -// **Save**. +// Plan specifies information about the marketplace image used to create the virtual machine. This element +// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable +// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use +// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and +// then click **Save**. type Plan struct { // Name - The plan ID. Name *string `json:"name,omitempty"` @@ -7542,8 +7595,8 @@ type ProximityPlacementGroupListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// ProximityPlacementGroupListResultIterator provides access to a complete listing of ProximityPlacementGroup -// values. +// ProximityPlacementGroupListResultIterator provides access to a complete listing of +// ProximityPlacementGroup values. type ProximityPlacementGroupListResultIterator struct { i int page ProximityPlacementGroupListResultPage @@ -7686,8 +7739,11 @@ func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementG } // Creates a new instance of the ProximityPlacementGroupListResultPage type. -func NewProximityPlacementGroupListResultPage(getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { - return ProximityPlacementGroupListResultPage{fn: getNextPage} +func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { + return ProximityPlacementGroupListResultPage{ + fn: getNextPage, + ppglr: cur, + } } // ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. @@ -7741,8 +7797,8 @@ type PurchasePlan struct { Product *string `json:"product,omitempty"` } -// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this Image -// Definition. These properties are updatable. +// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this +// Image Definition. These properties are updatable. type RecommendedMachineConfiguration struct { VCPUs *ResourceRange `json:"vCPUs,omitempty"` Memory *ResourceRange `json:"memory,omitempty"` @@ -8071,8 +8127,11 @@ func (page ResourceSkusResultPage) Values() []ResourceSku { } // Creates a new instance of the ResourceSkusResultPage type. -func NewResourceSkusResultPage(getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { - return ResourceSkusResultPage{fn: getNextPage} +func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { + return ResourceSkusResultPage{ + fn: getNextPage, + rsr: cur, + } } // ResourceSkuZoneDetails describes The zonal capabilities of a SKU. @@ -8114,7 +8173,8 @@ type RollingUpgradePolicy struct { PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` } -// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade state. +// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade +// state. type RollingUpgradeProgressInfo struct { // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` @@ -8453,8 +8513,11 @@ func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { } // Creates a new instance of the RunCommandListResultPage type. -func NewRunCommandListResultPage(getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { - return RunCommandListResultPage{fn: getNextPage} +func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { + return RunCommandListResultPage{ + fn: getNextPage, + rclr: cur, + } } // RunCommandParameterDefinition describes the properties of a run command parameter. @@ -8501,8 +8564,9 @@ type ShareInfoElement struct { VMURI *string `json:"vmUri,omitempty"` } -// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the -// scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name. +// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware +// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU +// name. type Sku struct { // Name - The sku name. Name *string `json:"name,omitempty"` @@ -8788,8 +8852,11 @@ func (page SnapshotListPage) Values() []Snapshot { } // Creates a new instance of the SnapshotListPage type. -func NewSnapshotListPage(getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { - return SnapshotListPage{fn: getNextPage} +func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { + return SnapshotListPage{ + fn: getNextPage, + sl: cur, + } } // SnapshotProperties snapshot resource properties. @@ -8884,7 +8951,8 @@ func (future *SnapshotsCreateOrUpdateFuture) Result(client SnapshotsClient) (s S return } -// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SnapshotsDeleteFuture struct { azure.Future } @@ -8975,7 +9043,8 @@ func (future *SnapshotsRevokeAccessFuture) Result(client SnapshotsClient) (ar au return } -// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SnapshotsUpdateFuture struct { azure.Future } @@ -9097,8 +9166,8 @@ type SSHConfiguration struct { PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` } -// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where the -// public key is placed. +// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where +// the public key is placed. type SSHPublicKey struct { // Path - Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys Path *string `json:"path,omitempty"` @@ -9233,7 +9302,8 @@ type SSHPublicKeysGroupListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource values. +// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource +// values. type SSHPublicKeysGroupListResultIterator struct { i int page SSHPublicKeysGroupListResultPage @@ -9376,8 +9446,11 @@ func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { } // Creates a new instance of the SSHPublicKeysGroupListResultPage type. -func NewSSHPublicKeysGroupListResultPage(getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { - return SSHPublicKeysGroupListResultPage{fn: getNextPage} +func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { + return SSHPublicKeysGroupListResultPage{ + fn: getNextPage, + spkglr: cur, + } } // SSHPublicKeyUpdateResource specifies information about the SSH public key. @@ -9544,7 +9617,8 @@ type UpgradeOperationHistoricalStatusInfo struct { Location *string `json:"location,omitempty"` } -// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale Set. +// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale +// Set. type UpgradeOperationHistoricalStatusInfoProperties struct { // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` @@ -9608,8 +9682,8 @@ type UserArtifactSource struct { MediaLink *string `json:"mediaLink,omitempty"` } -// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate should -// reside on the VM. +// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate +// should reside on the VM. type VaultCertificate struct { // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

{
"data":"",
"dataType":"pfx",
"password":""
} CertificateURL *string `json:"certificateUrl,omitempty"` @@ -10144,8 +10218,8 @@ func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualMachineExtensionsCreateOrUpdateFuture struct { azure.Future } @@ -10716,8 +10790,11 @@ func (page VirtualMachineListResultPage) Values() []VirtualMachine { } // Creates a new instance of the VirtualMachineListResultPage type. -func NewVirtualMachineListResultPage(getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { - return VirtualMachineListResultPage{fn: getNextPage} +func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { + return VirtualMachineListResultPage{ + fn: getNextPage, + vmlr: cur, + } } // VirtualMachinePatchStatus the status of virtual machine patch operations. @@ -10764,7 +10841,7 @@ type VirtualMachineProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` // InstanceView - READ-ONLY; The virtual machine instance view. InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.

Possible values are:

Windows_Client

Windows_Server

If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.

For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

Minimum api-version: 2015-06-15 + // LicenseType - Specifies that the image or disk that is being used was licensed on-premises.

Possible values for Windows Server operating system are:

Windows_Client

Windows_Server

Possible values for Linux Server operating system are:

RHEL_BYOS (for RHEL)

SLES_BYOS (for SUSE)

For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)

[Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)

Minimum api-version: 2015-06-15 LicenseType *string `json:"licenseType,omitempty"` // VMID - READ-ONLY; Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. VMID *string `json:"vmId,omitempty"` @@ -10829,54 +10906,17 @@ func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will -// always be reimaged +// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk +// will always be reimaged type VirtualMachineReimageParameters struct { // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. TempDisk *bool `json:"tempDisk,omitempty"` } -// VirtualMachinesAssessPatchesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesAssessPatchesFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesAssessPatchesFuture) Result(client VirtualMachinesClient) (vmapr VirtualMachineAssessPatchesResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesAssessPatchesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmapr.Response.Response, err = future.GetResult(sender); err == nil && vmapr.Response.Response.StatusCode != http.StatusNoContent { - vmapr, err = client.AssessPatchesResponder(vmapr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", vmapr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSet describes a Virtual Machine Scale Set. -type VirtualMachineScaleSet struct { - autorest.Response `json:"-"` - // Sku - The virtual machine scale set sku. - Sku *Sku `json:"sku,omitempty"` - // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. - Plan *Plan `json:"plan,omitempty"` - *VirtualMachineScaleSetProperties `json:"properties,omitempty"` - // Identity - The identity of the virtual machine scale set, if configured. - Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` - // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set - Zones *[]string `json:"zones,omitempty"` +// VirtualMachineRunCommand describes a Virtual Machine run command. +type VirtualMachineRunCommand struct { + autorest.Response `json:"-"` + *VirtualMachineRunCommandProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -10889,35 +10929,23 @@ type VirtualMachineScaleSet struct { Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. -func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for VirtualMachineRunCommand. +func (vmrc VirtualMachineRunCommand) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if vmss.Sku != nil { - objectMap["sku"] = vmss.Sku - } - if vmss.Plan != nil { - objectMap["plan"] = vmss.Plan - } - if vmss.VirtualMachineScaleSetProperties != nil { - objectMap["properties"] = vmss.VirtualMachineScaleSetProperties - } - if vmss.Identity != nil { - objectMap["identity"] = vmss.Identity + if vmrc.VirtualMachineRunCommandProperties != nil { + objectMap["properties"] = vmrc.VirtualMachineRunCommandProperties } - if vmss.Zones != nil { - objectMap["zones"] = vmss.Zones - } - if vmss.Location != nil { - objectMap["location"] = vmss.Location + if vmrc.Location != nil { + objectMap["location"] = vmrc.Location } - if vmss.Tags != nil { - objectMap["tags"] = vmss.Tags + if vmrc.Tags != nil { + objectMap["tags"] = vmrc.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. -func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommand struct. +func (vmrc *VirtualMachineRunCommand) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -10925,50 +10953,14 @@ func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - vmss.Sku = &sku - } - case "plan": - if v != nil { - var plan Plan - err = json.Unmarshal(*v, &plan) - if err != nil { - return err - } - vmss.Plan = &plan - } case "properties": if v != nil { - var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) - if err != nil { - return err - } - vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties - } - case "identity": - if v != nil { - var identity VirtualMachineScaleSetIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - vmss.Identity = &identity - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) + var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties + err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) if err != nil { return err } - vmss.Zones = &zones + vmrc.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties } case "id": if v != nil { @@ -10977,7 +10969,7 @@ func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { if err != nil { return err } - vmss.ID = &ID + vmrc.ID = &ID } case "name": if v != nil { @@ -10986,7 +10978,7 @@ func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { if err != nil { return err } - vmss.Name = &name + vmrc.Name = &name } case "type": if v != nil { @@ -10995,7 +10987,7 @@ func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { if err != nil { return err } - vmss.Type = &typeVar + vmrc.Type = &typeVar } case "location": if v != nil { @@ -11004,7 +10996,7 @@ func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { if err != nil { return err } - vmss.Location = &location + vmrc.Location = &location } case "tags": if v != nil { @@ -11013,7 +11005,7 @@ func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { if err != nil { return err } - vmss.Tags = tags + vmrc.Tags = tags } } } @@ -11021,84 +11013,651 @@ func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { return nil } -// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. -type VirtualMachineScaleSetDataDisk struct { - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` - // Caching - Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` - // DiskIOPSReadWrite - Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` +// VirtualMachineRunCommandInstanceView the instance view of a virtual machine run command. +type VirtualMachineRunCommandInstanceView struct { + // ExecutionState - Script execution status. Possible values include: 'ExecutionStateUnknown', 'ExecutionStatePending', 'ExecutionStateRunning', 'ExecutionStateFailed', 'ExecutionStateSucceeded', 'ExecutionStateTimedOut', 'ExecutionStateCanceled' + ExecutionState ExecutionState `json:"executionState,omitempty"` + // ExecutionMessage - Communicate script configuration errors or execution messages. + ExecutionMessage *string `json:"executionMessage,omitempty"` + // ExitCode - Exit code returned from script execution. + ExitCode *int32 `json:"exitCode,omitempty"` + // Output - Script output stream. + Output *string `json:"output,omitempty"` + // Error - Script error stream. + Error *string `json:"error,omitempty"` + // StartTime - Script start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Script end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Statuses - The resource status information. + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` } -// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtension struct { - autorest.Response `json:"-"` - // Name - The name of the extension. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` +// VirtualMachineRunCommandProperties describes the properties of a Virtual Machine run command. +type VirtualMachineRunCommandProperties struct { + // Source - The source of the run command script. + Source *VirtualMachineRunCommandScriptSource `json:"source,omitempty"` + // Parameters - The parameters used by the script. + Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` + // ProtectedParameters - The parameters used by the script. + ProtectedParameters *[]RunCommandInputParameter `json:"protectedParameters,omitempty"` + // AsyncExecution - Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. + AsyncExecution *bool `json:"asyncExecution,omitempty"` + // RunAsUser - Specifies the user account on the VM when executing the run command. + RunAsUser *string `json:"runAsUser,omitempty"` + // RunAsPassword - Specifies the user account password on the VM when executing the run command. + RunAsPassword *string `json:"runAsPassword,omitempty"` + // TimeoutInSeconds - The timeout in seconds to execute the run command. + TimeoutInSeconds *int32 `json:"timeoutInSeconds,omitempty"` + // OutputBlobURI - Specifies the Azure storage blob where script output stream will be uploaded. + OutputBlobURI *string `json:"outputBlobUri,omitempty"` + // ErrorBlobURI - Specifies the Azure storage blob where script error stream will be uploaded. + ErrorBlobURI *string `json:"errorBlobUri,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // InstanceView - READ-ONLY; The virtual machine run command instance view. + InstanceView *VirtualMachineRunCommandInstanceView `json:"instanceView,omitempty"` } -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. -func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for VirtualMachineRunCommandProperties. +func (vmrcp VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if vmsse.Name != nil { - objectMap["name"] = vmsse.Name + if vmrcp.Source != nil { + objectMap["source"] = vmrcp.Source } - if vmsse.VirtualMachineScaleSetExtensionProperties != nil { - objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties + if vmrcp.Parameters != nil { + objectMap["parameters"] = vmrcp.Parameters + } + if vmrcp.ProtectedParameters != nil { + objectMap["protectedParameters"] = vmrcp.ProtectedParameters + } + if vmrcp.AsyncExecution != nil { + objectMap["asyncExecution"] = vmrcp.AsyncExecution + } + if vmrcp.RunAsUser != nil { + objectMap["runAsUser"] = vmrcp.RunAsUser + } + if vmrcp.RunAsPassword != nil { + objectMap["runAsPassword"] = vmrcp.RunAsPassword + } + if vmrcp.TimeoutInSeconds != nil { + objectMap["timeoutInSeconds"] = vmrcp.TimeoutInSeconds + } + if vmrcp.OutputBlobURI != nil { + objectMap["outputBlobUri"] = vmrcp.OutputBlobURI + } + if vmrcp.ErrorBlobURI != nil { + objectMap["errorBlobUri"] = vmrcp.ErrorBlobURI } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. -func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// VirtualMachineRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type VirtualMachineRunCommandsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) Result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) if err != nil { - return err + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmsse.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmsse.Type = &typeVar - } - case "properties": - if v != nil { - var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) - if err != nil { + if !done { + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { + vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineRunCommandScriptSource describes the script sources for run command. +type VirtualMachineRunCommandScriptSource struct { + // Script - Specifies the script content to be executed on the VM. + Script *string `json:"script,omitempty"` + // ScriptURI - Specifies the script download location. + ScriptURI *string `json:"scriptUri,omitempty"` + // CommandID - Specifies a commandId of predefined built-in script. + CommandID *string `json:"commandId,omitempty"` +} + +// VirtualMachineRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineRunCommandsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachineRunCommandsDeleteFuture) Result(client VirtualMachineRunCommandsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineRunCommandsListResult the List run command operation response +type VirtualMachineRunCommandsListResult struct { + autorest.Response `json:"-"` + // Value - The list of run commands + Value *[]VirtualMachineRunCommand `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of run commands. + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualMachineRunCommandsListResultIterator provides access to a complete listing of +// VirtualMachineRunCommand values. +type VirtualMachineRunCommandsListResultIterator struct { + i int + page VirtualMachineRunCommandsListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VirtualMachineRunCommandsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VirtualMachineRunCommandsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VirtualMachineRunCommandsListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VirtualMachineRunCommandsListResultIterator) Response() VirtualMachineRunCommandsListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VirtualMachineRunCommandsListResultIterator) Value() VirtualMachineRunCommand { + if !iter.page.NotDone() { + return VirtualMachineRunCommand{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VirtualMachineRunCommandsListResultIterator type. +func NewVirtualMachineRunCommandsListResultIterator(page VirtualMachineRunCommandsListResultPage) VirtualMachineRunCommandsListResultIterator { + return VirtualMachineRunCommandsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vmrclr VirtualMachineRunCommandsListResult) IsEmpty() bool { + return vmrclr.Value == nil || len(*vmrclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vmrclr VirtualMachineRunCommandsListResult) hasNextLink() bool { + return vmrclr.NextLink != nil && len(*vmrclr.NextLink) != 0 +} + +// virtualMachineRunCommandsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vmrclr VirtualMachineRunCommandsListResult) virtualMachineRunCommandsListResultPreparer(ctx context.Context) (*http.Request, error) { + if !vmrclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vmrclr.NextLink))) +} + +// VirtualMachineRunCommandsListResultPage contains a page of VirtualMachineRunCommand values. +type VirtualMachineRunCommandsListResultPage struct { + fn func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error) + vmrclr VirtualMachineRunCommandsListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VirtualMachineRunCommandsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vmrclr) + if err != nil { + return err + } + page.vmrclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VirtualMachineRunCommandsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VirtualMachineRunCommandsListResultPage) NotDone() bool { + return !page.vmrclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VirtualMachineRunCommandsListResultPage) Response() VirtualMachineRunCommandsListResult { + return page.vmrclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VirtualMachineRunCommandsListResultPage) Values() []VirtualMachineRunCommand { + if page.vmrclr.IsEmpty() { + return nil + } + return *page.vmrclr.Value +} + +// Creates a new instance of the VirtualMachineRunCommandsListResultPage type. +func NewVirtualMachineRunCommandsListResultPage(cur VirtualMachineRunCommandsListResult, getNextPage func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error)) VirtualMachineRunCommandsListResultPage { + return VirtualMachineRunCommandsListResultPage{ + fn: getNextPage, + vmrclr: cur, + } +} + +// VirtualMachineRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineRunCommandsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachineRunCommandsUpdateFuture) Result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { + vmrc, err = client.UpdateResponder(vmrc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineRunCommandUpdate describes a Virtual Machine run command. +type VirtualMachineRunCommandUpdate struct { + *VirtualMachineRunCommandProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineRunCommandUpdate. +func (vmrcu VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmrcu.VirtualMachineRunCommandProperties != nil { + objectMap["properties"] = vmrcu.VirtualMachineRunCommandProperties + } + if vmrcu.Tags != nil { + objectMap["tags"] = vmrcu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommandUpdate struct. +func (vmrcu *VirtualMachineRunCommandUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties + err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) + if err != nil { + return err + } + vmrcu.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmrcu.Tags = tags + } + } + } + + return nil +} + +// VirtualMachinesAssessPatchesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesAssessPatchesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachinesAssessPatchesFuture) Result(client VirtualMachinesClient) (vmapr VirtualMachineAssessPatchesResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesAssessPatchesFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmapr.Response.Response, err = future.GetResult(sender); err == nil && vmapr.Response.Response.StatusCode != http.StatusNoContent { + vmapr, err = client.AssessPatchesResponder(vmapr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", vmapr.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineScaleSet describes a Virtual Machine Scale Set. +type VirtualMachineScaleSet struct { + autorest.Response `json:"-"` + // Sku - The virtual machine scale set sku. + Sku *Sku `json:"sku,omitempty"` + // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. + Plan *Plan `json:"plan,omitempty"` + *VirtualMachineScaleSetProperties `json:"properties,omitempty"` + // Identity - The identity of the virtual machine scale set, if configured. + Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` + // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set + Zones *[]string `json:"zones,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. +func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmss.Sku != nil { + objectMap["sku"] = vmss.Sku + } + if vmss.Plan != nil { + objectMap["plan"] = vmss.Plan + } + if vmss.VirtualMachineScaleSetProperties != nil { + objectMap["properties"] = vmss.VirtualMachineScaleSetProperties + } + if vmss.Identity != nil { + objectMap["identity"] = vmss.Identity + } + if vmss.Zones != nil { + objectMap["zones"] = vmss.Zones + } + if vmss.Location != nil { + objectMap["location"] = vmss.Location + } + if vmss.Tags != nil { + objectMap["tags"] = vmss.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. +func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + vmss.Sku = &sku + } + case "plan": + if v != nil { + var plan Plan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + vmss.Plan = &plan + } + case "properties": + if v != nil { + var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) + if err != nil { + return err + } + vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties + } + case "identity": + if v != nil { + var identity VirtualMachineScaleSetIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + vmss.Identity = &identity + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + vmss.Zones = &zones + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmss.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vmss.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmss.Tags = tags + } + } + } + + return nil +} + +// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. +type VirtualMachineScaleSetDataDisk struct { + // Name - The disk name. + Name *string `json:"name,omitempty"` + // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. + Lun *int32 `json:"lun,omitempty"` + // Caching - Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' + Caching CachingTypes `json:"caching,omitempty"` + // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. + WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` + // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' + CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` + // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

This value cannot be larger than 1023 GB + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // ManagedDisk - The managed disk parameters. + ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` + // DiskIOPSReadWrite - Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. + DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` + // DiskMBpsReadWrite - Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. + DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` +} + +// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. +type VirtualMachineScaleSetExtension struct { + autorest.Response `json:"-"` + // Name - The name of the extension. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. +func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmsse.Name != nil { + objectMap["name"] = vmsse.Name + } + if vmsse.VirtualMachineScaleSetExtensionProperties != nil { + objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. +func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmsse.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmsse.Type = &typeVar + } + case "properties": + if v != nil { + var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) + if err != nil { return err } vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties @@ -11271,8 +11830,11 @@ func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMach } // Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. -func NewVirtualMachineScaleSetExtensionListResultPage(getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { - return VirtualMachineScaleSetExtensionListResultPage{fn: getNextPage} +func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { + return VirtualMachineScaleSetExtensionListResultPage{ + fn: getNextPage, + vmsselr: cur, + } } // VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. @@ -11283,7 +11845,8 @@ type VirtualMachineScaleSetExtensionProfile struct { ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` } -// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set Extension. +// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set +// Extension. type VirtualMachineScaleSetExtensionProperties struct { // ForceUpdateTag - If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` @@ -11369,8 +11932,8 @@ func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) Result(clien return } -// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualMachineScaleSetExtensionsDeleteFuture struct { azure.Future } @@ -11392,8 +11955,8 @@ func (future *VirtualMachineScaleSetExtensionsDeleteFuture) Result(client Virtua return } -// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualMachineScaleSetExtensionsUpdateFuture struct { azure.Future } @@ -11546,8 +12109,8 @@ func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of a -// virtual machine scale set. +// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of +// a virtual machine scale set. type VirtualMachineScaleSetInstanceViewStatusesSummary struct { // StatusesSummary - READ-ONLY; The extensions information. StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` @@ -11620,8 +12183,8 @@ func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) return nil } -// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's IP -// configuration properties. +// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's +// IP configuration properties. type VirtualMachineScaleSetIPConfigurationProperties struct { // Subnet - Specifies the identifier of the subnet. Subnet *APIEntityReference `json:"subnet,omitempty"` @@ -11649,8 +12212,8 @@ type VirtualMachineScaleSetIPTag struct { Tag *string `json:"tag,omitempty"` } -// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History operation -// response. +// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History +// operation response. type VirtualMachineScaleSetListOSUpgradeHistory struct { autorest.Response `json:"-"` // Value - The list of OS upgrades performed on the virtual machine scale set. @@ -11804,8 +12367,11 @@ func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOpe } // Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. -func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { - return VirtualMachineScaleSetListOSUpgradeHistoryPage{fn: getNextPage} +func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { + return VirtualMachineScaleSetListOSUpgradeHistoryPage{ + fn: getNextPage, + vmsslouh: cur, + } } // VirtualMachineScaleSetListResult the List Virtual Machine operation response. @@ -11961,8 +12527,11 @@ func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleS } // Creates a new instance of the VirtualMachineScaleSetListResultPage type. -func NewVirtualMachineScaleSetListResultPage(getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { - return VirtualMachineScaleSetListResultPage{fn: getNextPage} +func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { + return VirtualMachineScaleSetListResultPage{ + fn: getNextPage, + vmsslr: cur, + } } // VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. @@ -12118,8 +12687,11 @@ func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineSc } // Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. -func NewVirtualMachineScaleSetListSkusResultPage(getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { - return VirtualMachineScaleSetListSkusResultPage{fn: getNextPage} +func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { + return VirtualMachineScaleSetListSkusResultPage{ + fn: getNextPage, + vmsslsr: cur, + } } // VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. @@ -12275,8 +12847,11 @@ func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachi } // Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. -func NewVirtualMachineScaleSetListWithLinkResultPage(getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { - return VirtualMachineScaleSetListWithLinkResultPage{fn: getNextPage} +func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { + return VirtualMachineScaleSetListWithLinkResultPage{ + fn: getNextPage, + vmsslwlr: cur, + } } // VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. @@ -12287,8 +12862,8 @@ type VirtualMachineScaleSetManagedDiskParameters struct { DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` } -// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's network -// configurations. +// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's +// network configurations. type VirtualMachineScaleSetNetworkConfiguration struct { // Name - The network configuration name. Name *string `json:"name,omitempty"` @@ -12361,8 +12936,8 @@ type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { DNSServers *[]string `json:"dnsServers,omitempty"` } -// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network profile's -// IP configuration. +// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network +// profile's IP configuration. type VirtualMachineScaleSetNetworkConfigurationProperties struct { // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. Primary *bool `json:"primary,omitempty"` @@ -12502,8 +13077,8 @@ func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP Configuration's -// PublicIPAddress configuration +// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP +// Configuration's PublicIPAddress configuration type VirtualMachineScaleSetPublicIPAddressConfiguration struct { // Name - The publicIP address configuration name. Name *string `json:"name,omitempty"` @@ -12585,8 +13160,8 @@ type VirtualMachineScaleSetReimageParameters struct { TempDisk *bool `json:"tempDisk,omitempty"` } -// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { azure.Future } @@ -12631,8 +13206,8 @@ func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) return } -// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { azure.Future } @@ -12654,8 +13229,8 @@ func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) Result( return } -// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualMachineScaleSetsCreateOrUpdateFuture struct { azure.Future } @@ -12729,8 +13304,8 @@ func (future *VirtualMachineScaleSetsDeleteFuture) Result(client VirtualMachineS return } -// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualMachineScaleSetsDeleteInstancesFuture struct { azure.Future } @@ -12774,8 +13349,8 @@ type VirtualMachineScaleSetSkuCapacity struct { ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` } -// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type VirtualMachineScaleSetsPerformMaintenanceFuture struct { azure.Future } @@ -12912,8 +13487,8 @@ func (future *VirtualMachineScaleSetsRestartFuture) Result(client VirtualMachine return } -// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { azure.Future } @@ -12997,8 +13572,8 @@ func (future *VirtualMachineScaleSetsUpdateFuture) Result(client VirtualMachineS return } -// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualMachineScaleSetsUpdateInstancesFuture struct { azure.Future } @@ -13115,8 +13690,8 @@ func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { } // VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP -// configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the new -// subnet are in the same virtual network +// configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the +// new subnet are in the same virtual network type VirtualMachineScaleSetUpdateIPConfiguration struct { // Name - The IP configuration name. Name *string `json:"name,omitempty"` @@ -13270,8 +13845,9 @@ func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(b return nil } -// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set updatable -// network profile's IP configuration.Use this object for updating network profile's IP Configuration. +// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set +// updatable network profile's IP configuration.Use this object for updating network profile's IP +// Configuration. type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { // Primary - Whether this is a primary NIC on a virtual machine. Primary *bool `json:"primary,omitempty"` @@ -13295,8 +13871,8 @@ type VirtualMachineScaleSetUpdateNetworkProfile struct { NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` } -// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update Object. -// This should be used for Updating VMSS OS Disk. +// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update +// Object. This should be used for Updating VMSS OS Disk. type VirtualMachineScaleSetUpdateOSDisk struct { // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' Caching CachingTypes `json:"caching,omitempty"` @@ -13399,8 +13975,8 @@ func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) Unmar return nil } -// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale set IP -// Configuration's PublicIPAddress configuration +// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale +// set IP Configuration's PublicIPAddress configuration type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { // IdleTimeoutInMinutes - The idle timeout of the public IP address. IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` @@ -13598,6 +14174,78 @@ func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { return nil } +// VirtualMachineScaleSetVMExtension describes a VMSS VM Extension. +type VirtualMachineScaleSetVMExtension struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; The name of the extension. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + *VirtualMachineExtensionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtension. +func (vmssve VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssve.VirtualMachineExtensionProperties != nil { + objectMap["properties"] = vmssve.VirtualMachineExtensionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtension struct. +func (vmssve *VirtualMachineScaleSetVMExtension) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmssve.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmssve.Type = &typeVar + } + case "properties": + if v != nil { + var virtualMachineExtensionProperties VirtualMachineExtensionProperties + err = json.Unmarshal(*v, &virtualMachineExtensionProperties) + if err != nil { + return err + } + vmssve.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssve.ID = &ID + } + } + } + + return nil +} + // VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { @@ -13606,7 +14254,7 @@ type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) Result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { +func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) Result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13618,17 +14266,17 @@ func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) Result(cli return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.CreateOrUpdateResponder(vme.Response.Response) + if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { + vmssve, err = client.CreateOrUpdateResponder(vmssve.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") } } return } -// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { azure.Future } @@ -13650,8 +14298,15 @@ func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) Result(client Virt return } -// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine scale -// set. +// VirtualMachineScaleSetVMExtensionsListResult the List VMSS VM Extension operation response +type VirtualMachineScaleSetVMExtensionsListResult struct { + autorest.Response `json:"-"` + // Value - The list of VMSS VM extensions + Value *[]VirtualMachineScaleSetVMExtension `json:"value,omitempty"` +} + +// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine +// scale set. type VirtualMachineScaleSetVMExtensionsSummary struct { // Name - READ-ONLY; The extension name. Name *string `json:"name,omitempty"` @@ -13659,15 +14314,15 @@ type VirtualMachineScaleSetVMExtensionsSummary struct { StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` } -// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) Result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { +func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) Result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13679,16 +14334,88 @@ func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) Result(client Virt return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.UpdateResponder(vme.Response.Response) + if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { + vmssve, err = client.UpdateResponder(vmssve.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") } } return } -// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale set. +// VirtualMachineScaleSetVMExtensionUpdate describes a VMSS VM Extension. +type VirtualMachineScaleSetVMExtensionUpdate struct { + // Name - READ-ONLY; The name of the extension. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionUpdate. +func (vmssveu VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssveu.VirtualMachineExtensionUpdateProperties != nil { + objectMap["properties"] = vmssveu.VirtualMachineExtensionUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtensionUpdate struct. +func (vmssveu *VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmssveu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmssveu.Type = &typeVar + } + case "properties": + if v != nil { + var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties + err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) + if err != nil { + return err + } + vmssveu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssveu.ID = &ID + } + } + } + + return nil +} + +// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale +// set. type VirtualMachineScaleSetVMInstanceIDs struct { // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. InstanceIds *[]string `json:"instanceIds,omitempty"` @@ -13775,8 +14502,8 @@ type VirtualMachineScaleSetVMListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of VirtualMachineScaleSetVM -// values. +// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of +// VirtualMachineScaleSetVM values. type VirtualMachineScaleSetVMListResultIterator struct { i int page VirtualMachineScaleSetVMListResultPage @@ -13919,8 +14646,11 @@ func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScal } // Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. -func NewVirtualMachineScaleSetVMListResultPage(getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { - return VirtualMachineScaleSetVMListResultPage{fn: getNextPage} +func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { + return VirtualMachineScaleSetVMListResultPage{ + fn: getNextPage, + vmssvlr: cur, + } } // VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network @@ -13944,7 +14674,7 @@ type VirtualMachineScaleSetVMProfile struct { DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.

Possible values are:

Windows_Client

Windows_Server

If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.

For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

Minimum api-version: 2015-06-15 + // LicenseType - Specifies that the image or disk that is being used was licensed on-premises.

Possible values for Windows Server operating system are:

Windows_Client

Windows_Server

Possible values for Linux Server operating system are:

RHEL_BYOS (for RHEL)

SLES_BYOS (for SUSE)

For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)

[Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)

Minimum api-version: 2015-06-15 LicenseType *string `json:"licenseType,omitempty"` // Priority - Specifies the priority for the virtual machines in the scale set.

Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low', 'Spot' Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` @@ -13956,7 +14686,8 @@ type VirtualMachineScaleSetVMProfile struct { ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` } -// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual machine. +// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual +// machine. type VirtualMachineScaleSetVMProperties struct { // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. LatestModelApplied *bool `json:"latestModelApplied,omitempty"` @@ -13984,7 +14715,7 @@ type VirtualMachineScaleSetVMProperties struct { AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *string `json:"provisioningState,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.

Possible values are:

Windows_Client

Windows_Server

If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.

For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

Minimum api-version: 2015-06-15 + // LicenseType - Specifies that the image or disk that is being used was licensed on-premises.

Possible values for Windows Server operating system are:

Windows_Client

Windows_Server

Possible values for Linux Server operating system are:

RHEL_BYOS (for RHEL)

SLES_BYOS (for SUSE)

For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)

[Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)

Minimum api-version: 2015-06-15 LicenseType *string `json:"licenseType,omitempty"` // ModelDefinitionApplied - READ-ONLY; Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` @@ -14045,6 +14776,87 @@ type VirtualMachineScaleSetVMReimageParameters struct { TempDisk *bool `json:"tempDisk,omitempty"` } +// VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) Result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { + vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineScaleSetVMRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type VirtualMachineScaleSetVMRunCommandsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) Result(client VirtualMachineScaleSetVMRunCommandsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetVMRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type VirtualMachineScaleSetVMRunCommandsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) Result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { + vmrc, err = client.UpdateResponder(vmrc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") + } + } + return +} + // VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetVMsDeallocateFuture struct { @@ -14091,8 +14903,8 @@ func (future *VirtualMachineScaleSetVMsDeleteFuture) Result(client VirtualMachin return } -// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { azure.Future } @@ -14391,8 +15203,8 @@ func (future *VirtualMachinesCreateOrUpdateFuture) Result(client VirtualMachines return } -// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachinesDeallocateFuture struct { azure.Future } @@ -14622,8 +15434,8 @@ func (future *VirtualMachinesRestartFuture) Result(client VirtualMachinesClient) return } -// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachinesRunCommandFuture struct { azure.Future } diff --git a/services/compute/mgmt/2020-06-01/compute/virtualmachineruncommands.go b/services/compute/mgmt/2020-06-01/compute/virtualmachineruncommands.go index d15960cc3164..84ccbe6cb5c8 100644 --- a/services/compute/mgmt/2020-06-01/compute/virtualmachineruncommands.go +++ b/services/compute/mgmt/2020-06-01/compute/virtualmachineruncommands.go @@ -43,6 +43,162 @@ func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionI return VirtualMachineRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)} } +// CreateOrUpdate the operation to create or update the run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine where the run command should be created or updated. +// runCommandName - the name of the virtual machine run command. +// runCommand - parameters supplied to the Create Virtual Machine RunCommand operation. +func (client VirtualMachineRunCommandsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommand) (result VirtualMachineRunCommandsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, runCommandName, runCommand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VirtualMachineRunCommandsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommand) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2020-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), + autorest.WithJSON(runCommand), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineRunCommandsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete the run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine where the run command should be deleted. +// runCommandName - the name of the virtual machine run command. +func (client VirtualMachineRunCommandsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, runCommandName string) (result VirtualMachineRunCommandsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, runCommandName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VirtualMachineRunCommandsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2020-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) DeleteSender(req *http.Request) (future VirtualMachineRunCommandsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + // Get gets specific run command for a subscription in a location. // Parameters: // location - the location upon which run commands is queried. @@ -124,6 +280,87 @@ func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) return } +// GetByVirtualMachine the operation to get the run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine containing the run command. +// runCommandName - the name of the virtual machine run command. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineRunCommandsClient) GetByVirtualMachine(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, expand string) (result VirtualMachineRunCommand, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.GetByVirtualMachine") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetByVirtualMachinePreparer(ctx, resourceGroupName, VMName, runCommandName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "GetByVirtualMachine", nil, "Failure preparing request") + return + } + + resp, err := client.GetByVirtualMachineSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "GetByVirtualMachine", resp, "Failure sending request") + return + } + + result, err = client.GetByVirtualMachineResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "GetByVirtualMachine", resp, "Failure responding to request") + } + + return +} + +// GetByVirtualMachinePreparer prepares the GetByVirtualMachine request. +func (client VirtualMachineRunCommandsClient) GetByVirtualMachinePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2020-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByVirtualMachineSender sends the GetByVirtualMachine request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) GetByVirtualMachineSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetByVirtualMachineResponder handles the response to the GetByVirtualMachine request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) GetByVirtualMachineResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List lists all available run commands for a subscription in a location. // Parameters: // location - the location upon which run commands is queried. @@ -243,3 +480,203 @@ func (client VirtualMachineRunCommandsClient) ListComplete(ctx context.Context, result.page, err = client.List(ctx, location) return } + +// ListByVirtualMachine the operation to get all run commands of a Virtual Machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine containing the run command. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineRunCommandsClient) ListByVirtualMachine(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineRunCommandsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.ListByVirtualMachine") + defer func() { + sc := -1 + if result.vmrclr.Response.Response != nil { + sc = result.vmrclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByVirtualMachineNextResults + req, err := client.ListByVirtualMachinePreparer(ctx, resourceGroupName, VMName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "ListByVirtualMachine", nil, "Failure preparing request") + return + } + + resp, err := client.ListByVirtualMachineSender(req) + if err != nil { + result.vmrclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "ListByVirtualMachine", resp, "Failure sending request") + return + } + + result.vmrclr, err = client.ListByVirtualMachineResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "ListByVirtualMachine", resp, "Failure responding to request") + } + if result.vmrclr.hasNextLink() && result.vmrclr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListByVirtualMachinePreparer prepares the ListByVirtualMachine request. +func (client VirtualMachineRunCommandsClient) ListByVirtualMachinePreparer(ctx context.Context, resourceGroupName string, VMName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2020-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByVirtualMachineSender sends the ListByVirtualMachine request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) ListByVirtualMachineSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByVirtualMachineResponder handles the response to the ListByVirtualMachine request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) ListByVirtualMachineResponder(resp *http.Response) (result VirtualMachineRunCommandsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByVirtualMachineNextResults retrieves the next set of results, if any. +func (client VirtualMachineRunCommandsClient) listByVirtualMachineNextResults(ctx context.Context, lastResults VirtualMachineRunCommandsListResult) (result VirtualMachineRunCommandsListResult, err error) { + req, err := lastResults.virtualMachineRunCommandsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listByVirtualMachineNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByVirtualMachineSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listByVirtualMachineNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByVirtualMachineResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listByVirtualMachineNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByVirtualMachineComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachineRunCommandsClient) ListByVirtualMachineComplete(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineRunCommandsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.ListByVirtualMachine") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByVirtualMachine(ctx, resourceGroupName, VMName, expand) + return +} + +// Update the operation to update the run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine where the run command should be updated. +// runCommandName - the name of the virtual machine run command. +// runCommand - parameters supplied to the Update Virtual Machine RunCommand operation. +func (client VirtualMachineRunCommandsClient) Update(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (result VirtualMachineRunCommandsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, runCommandName, runCommand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VirtualMachineRunCommandsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2020-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), + autorest.WithJSON(runCommand), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) UpdateSender(req *http.Request) (future VirtualMachineRunCommandsUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) UpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2020-06-01/compute/virtualmachines.go b/services/compute/mgmt/2020-06-01/compute/virtualmachines.go index ac69843a71f6..773e11514288 100644 --- a/services/compute/mgmt/2020-06-01/compute/virtualmachines.go +++ b/services/compute/mgmt/2020-06-01/compute/virtualmachines.go @@ -459,7 +459,8 @@ func (client VirtualMachinesClient) DeallocateResponder(resp *http.Response) (re // Parameters: // resourceGroupName - the name of the resource group. // VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesDeleteFuture, err error) { +// forceDeletion - optional parameter to force delete virtual machines. +func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupName string, VMName string, forceDeletion *bool) (result VirtualMachinesDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Delete") defer func() { @@ -470,7 +471,7 @@ func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupNam tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMName) + req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, forceDeletion) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", nil, "Failure preparing request") return @@ -486,7 +487,7 @@ func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupNam } // DeletePreparer prepares the Delete request. -func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { +func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, forceDeletion *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -497,6 +498,9 @@ func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resource queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if forceDeletion != nil { + queryParameters["forceDeletion"] = autorest.Encode("query", *forceDeletion) + } preparer := autorest.CreatePreparer( autorest.AsDelete(), diff --git a/services/compute/mgmt/2020-06-01/compute/virtualmachinescalesetvmextensions.go b/services/compute/mgmt/2020-06-01/compute/virtualmachinescalesetvmextensions.go index 5984fa84de4b..6e22e236d11a 100644 --- a/services/compute/mgmt/2020-06-01/compute/virtualmachinescalesetvmextensions.go +++ b/services/compute/mgmt/2020-06-01/compute/virtualmachinescalesetvmextensions.go @@ -50,7 +50,7 @@ func NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(baseURI string, subs // instanceID - the instance ID of the virtual machine. // VMExtensionName - the name of the virtual machine extension. // extensionParameters - parameters supplied to the Create Virtual Machine Extension operation. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) { +func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension) (result VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.CreateOrUpdate") defer func() { @@ -77,7 +77,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdate(ctx contex } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) { +func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension) (*http.Request, error) { pathParameters := map[string]interface{}{ "instanceId": autorest.Encode("path", instanceID), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -91,6 +91,8 @@ func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdatePreparer(ct "api-version": APIVersion, } + extensionParameters.Name = nil + extensionParameters.Type = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), @@ -115,7 +117,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateSender(req // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { +func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtension, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), @@ -210,7 +212,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) DeleteResponder(resp *htt // instanceID - the instance ID of the virtual machine. // VMExtensionName - the name of the virtual machine extension. // expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) { +func (client VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (result VirtualMachineScaleSetVMExtension, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Get") defer func() { @@ -276,7 +278,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) GetSender(req *http.Reque // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) { +func (client VirtualMachineScaleSetVMExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtension, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -292,7 +294,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) GetResponder(resp *http.R // VMScaleSetName - the name of the VM scale set. // instanceID - the instance ID of the virtual machine. // expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineExtensionsListResult, err error) { +func (client VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineScaleSetVMExtensionsListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.List") defer func() { @@ -357,7 +359,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) ListSender(req *http.Requ // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) { +func (client VirtualMachineScaleSetVMExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtensionsListResult, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -374,7 +376,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) ListResponder(resp *http. // instanceID - the instance ID of the virtual machine. // VMExtensionName - the name of the virtual machine extension. // extensionParameters - parameters supplied to the Update Virtual Machine Extension operation. -func (client VirtualMachineScaleSetVMExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) { +func (client VirtualMachineScaleSetVMExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate) (result VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Update") defer func() { @@ -401,7 +403,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) Update(ctx context.Contex } // UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetVMExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) { +func (client VirtualMachineScaleSetVMExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate) (*http.Request, error) { pathParameters := map[string]interface{}{ "instanceId": autorest.Encode("path", instanceID), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -415,6 +417,8 @@ func (client VirtualMachineScaleSetVMExtensionsClient) UpdatePreparer(ctx contex "api-version": APIVersion, } + extensionParameters.Name = nil + extensionParameters.Type = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), @@ -439,7 +443,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) UpdateSender(req *http.Re // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { +func (client VirtualMachineScaleSetVMExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtension, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/services/compute/mgmt/2020-06-01/compute/virtualmachinescalesetvmruncommands.go b/services/compute/mgmt/2020-06-01/compute/virtualmachinescalesetvmruncommands.go new file mode 100644 index 000000000000..5d4ac113b773 --- /dev/null +++ b/services/compute/mgmt/2020-06-01/compute/virtualmachinescalesetvmruncommands.go @@ -0,0 +1,491 @@ +package compute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineScaleSetVMRunCommandsClient is the compute Client +type VirtualMachineScaleSetVMRunCommandsClient struct { + BaseClient +} + +// NewVirtualMachineScaleSetVMRunCommandsClient creates an instance of the VirtualMachineScaleSetVMRunCommandsClient +// client. +func NewVirtualMachineScaleSetVMRunCommandsClient(subscriptionID string) VirtualMachineScaleSetVMRunCommandsClient { + return NewVirtualMachineScaleSetVMRunCommandsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineScaleSetVMRunCommandsClientWithBaseURI creates an instance of the +// VirtualMachineScaleSetVMRunCommandsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewVirtualMachineScaleSetVMRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMRunCommandsClient { + return VirtualMachineScaleSetVMRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update the VMSS VM run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// runCommandName - the name of the virtual machine run command. +// runCommand - parameters supplied to the Create Virtual Machine RunCommand operation. +func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand) (result VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName, runCommand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2020-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), + autorest.WithJSON(runCommand), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete the VMSS VM run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// runCommandName - the name of the virtual machine run command. +func (client VirtualMachineScaleSetVMRunCommandsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string) (result VirtualMachineScaleSetVMRunCommandsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VirtualMachineScaleSetVMRunCommandsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2020-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMRunCommandsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMRunCommandsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMRunCommandsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get the operation to get the VMSS VM run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// runCommandName - the name of the virtual machine run command. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineScaleSetVMRunCommandsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, expand string) (result VirtualMachineRunCommand, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineScaleSetVMRunCommandsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2020-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMRunCommandsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMRunCommandsClient) GetResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List the operation to get all run commands of an instance in Virtual Machine Scaleset. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineScaleSetVMRunCommandsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineRunCommandsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.List") + defer func() { + sc := -1 + if result.vmrclr.Response.Response != nil { + sc = result.vmrclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vmrclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "List", resp, "Failure sending request") + return + } + + result.vmrclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "List", resp, "Failure responding to request") + } + if result.vmrclr.hasNextLink() && result.vmrclr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineScaleSetVMRunCommandsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2020-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMRunCommandsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMRunCommandsClient) ListResponder(resp *http.Response) (result VirtualMachineRunCommandsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client VirtualMachineScaleSetVMRunCommandsClient) listNextResults(ctx context.Context, lastResults VirtualMachineRunCommandsListResult) (result VirtualMachineRunCommandsListResult, err error) { + req, err := lastResults.virtualMachineRunCommandsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachineScaleSetVMRunCommandsClient) ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineRunCommandsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) + return +} + +// Update the operation to update the VMSS VM run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// runCommandName - the name of the virtual machine run command. +// runCommand - parameters supplied to the Update Virtual Machine RunCommand operation. +func (client VirtualMachineScaleSetVMRunCommandsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (result VirtualMachineScaleSetVMRunCommandsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName, runCommand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VirtualMachineScaleSetVMRunCommandsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2020-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), + autorest.WithJSON(runCommand), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMRunCommandsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMRunCommandsUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMRunCommandsClient) UpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +}