From 9df364be0737b9d65f19386db3c67823680121e1 Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 17:10:31 -0400 Subject: [PATCH 01/16] Create IVirtualMachineScaleSetsOperations.cs --- .../IVirtualMachineScaleSetsOperations.cs | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/IVirtualMachineScaleSetsOperations.cs diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/IVirtualMachineScaleSetsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/IVirtualMachineScaleSetsOperations.cs new file mode 100644 index 0000000000000..8afe4cd1d3407 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/IVirtualMachineScaleSetsOperations.cs @@ -0,0 +1,86 @@ +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// VirtualMachineScaleSetsOperations operations. + /// + public partial interface IVirtualMachineScaleSetsOperations + { + /// + /// Display information about a virtual machine scale set. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Display information about a virtual machine scale set. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The headers that will be added to request. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null); + + /// + /// Display information about a virtual machine scale set. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName); + } + +} From 1c8054cd07466a1bfd22a2a0e799a2c026ac4e48 Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 17:23:58 -0400 Subject: [PATCH 02/16] Update VirtualMachine.cs --- .../src/Customizations/VirtualMachine.cs | 781 ++++++++++++++++++ 1 file changed, 781 insertions(+) diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachine.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachine.cs index 4efa2efd6deb8..4110accf45091 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachine.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachine.cs @@ -272,5 +272,786 @@ public VirtualMachine(string location, string id, string name, string type, IDic ExtensionsTimeBudget = extensionsTimeBudget; CustomInit(); } + + /// + /// Initializes a new instance of the VirtualMachine class. + /// + /// Resource location + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// 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**. + /// Specifies the hardware settings for + /// the virtual machine. + /// Specifies the storage settings for the + /// virtual machine disks. + /// Specifies additional + /// capabilities enabled or disabled on the virtual machine. + /// Specifies the operating system settings + /// used while creating the virtual machine. Some of the settings + /// cannot be changed once VM is provisioned. + /// Specifies the network interfaces of + /// the virtual machine. + /// Specifies the Security related + /// profile settings for the virtual machine. + /// Specifies the boot diagnostic + /// settings state. <br><br>Minimum api-version: + /// 2015-06-15. + /// 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 [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// <br><br> For more information on Azure planned + /// maintenance, see [Maintenance and updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + /// <br><br> Currently, a VM can only be added to + /// availability set at creation time. The availability set to which + /// the VM is being added should be under the same resource group as + /// the availability set resource. An existing VM cannot be added to an + /// availability set. <br><br>This property cannot exist + /// along with a non-null properties.virtualMachineScaleSet + /// reference. + /// Specifies information about + /// the virtual machine scale set that the virtual machine should be + /// assigned to. Virtual machines specified in the same virtual machine + /// scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a + /// virtual machine scale set. <br><br>This property cannot + /// exist along with a non-null properties.availabilitySet reference. + /// <br><br>Minimum api‐version: 2019‐03‐01 + /// Specifies information about + /// the proximity placement group that the virtual machine should be + /// assigned to. <br><br>Minimum api-version: + /// 2018-04-01. + /// Specifies the priority for the virtual + /// machine. <br><br>Minimum api-version: 2019-03-01. + /// Possible values include: 'Regular', 'Low', 'Spot' + /// Specifies the eviction policy for the + /// Azure Spot virtual machine and Azure Spot scale set. + /// <br><br>For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2019-03-01. <br><br>For Azure Spot scale sets, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2017-10-30-preview. Possible values include: 'Deallocate', + /// 'Delete' + /// Specifies the billing related details + /// of a Azure Spot virtual machine. <br><br>Minimum + /// api-version: 2019-03-01. + /// Specifies information about the dedicated host + /// that the virtual machine resides in. <br><br>Minimum + /// api-version: 2018-10-01. + /// Specifies information about the dedicated + /// host group that the virtual machine resides in. + /// <br><br>Minimum api-version: 2020-06-01. + /// <br><br>NOTE: User cannot specify both host and + /// hostGroup properties. + /// The provisioning state, which only + /// appears in the response. + /// The virtual machine instance + /// view. + /// Specifies that the image or disk that is + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// 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. + /// Specifies the time alloted for + /// all extensions to start. The time duration should be between 15 + /// minutes and 120 minutes (inclusive) and should be specified in ISO + /// 8601 format. The default value is 90 minutes (PT1H30M). + /// <br><br> Minimum api-version: 2020-06-01 + /// Specifies the scale set logical + /// fault domain into which the Virtual Machine will be created. By + /// default, the Virtual Machine will by automatically assigned to a + /// fault domain that best maintains balance across available fault + /// domains.<br><li>This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.<li>The Virtual Machine Scale Set that is referenced, + /// must have 'platformFaultDomainCount' &gt; 1.<li>This + /// property cannot be updated once the Virtual Machine is + /// created.<li>Fault domain assignment can be viewed in the + /// Virtual Machine Instance View.<br><br>Minimum + /// api‐version: 2020‐12‐01 + /// Specifies Scheduled Event + /// related configurations. + /// The virtual machine child extension + /// resources. + /// The identity of the virtual machine, if + /// configured. + /// The virtual machine zones. + /// The extended location of the Virtual + /// Machine. + public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), IList resources = default(IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList), ExtendedLocation extendedLocation = default(ExtendedLocation)) + : base(location, id, name, type, tags) + { + Plan = plan; + HardwareProfile = hardwareProfile; + StorageProfile = storageProfile; + AdditionalCapabilities = additionalCapabilities; + OsProfile = osProfile; + NetworkProfile = networkProfile; + SecurityProfile = securityProfile; + DiagnosticsProfile = diagnosticsProfile; + AvailabilitySet = availabilitySet; + VirtualMachineScaleSet = virtualMachineScaleSet; + ProximityPlacementGroup = proximityPlacementGroup; + Priority = priority; + EvictionPolicy = evictionPolicy; + BillingProfile = billingProfile; + Host = host; + HostGroup = hostGroup; + ProvisioningState = provisioningState; + InstanceView = instanceView; + LicenseType = licenseType; + VmId = vmId; + ExtensionsTimeBudget = extensionsTimeBudget; + PlatformFaultDomain = platformFaultDomain; + ScheduledEventsProfile = scheduledEventsProfile; + Resources = resources; + Identity = identity; + Zones = zones; + ExtendedLocation = extendedLocation; + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachine class. + /// + /// Resource location + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// 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**. + /// Specifies the hardware settings for + /// the virtual machine. + /// Specifies the storage settings for the + /// virtual machine disks. + /// Specifies additional + /// capabilities enabled or disabled on the virtual machine. + /// Specifies the operating system settings + /// used while creating the virtual machine. Some of the settings + /// cannot be changed once VM is provisioned. + /// Specifies the network interfaces of + /// the virtual machine. + /// Specifies the Security related + /// profile settings for the virtual machine. + /// Specifies the boot diagnostic + /// settings state. <br><br>Minimum api-version: + /// 2015-06-15. + /// 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 [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// <br><br> For more information on Azure planned + /// maintenance, see [Maintenance and updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + /// <br><br> Currently, a VM can only be added to + /// availability set at creation time. The availability set to which + /// the VM is being added should be under the same resource group as + /// the availability set resource. An existing VM cannot be added to an + /// availability set. <br><br>This property cannot exist + /// along with a non-null properties.virtualMachineScaleSet + /// reference. + /// Specifies information about + /// the virtual machine scale set that the virtual machine should be + /// assigned to. Virtual machines specified in the same virtual machine + /// scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a + /// virtual machine scale set. <br><br>This property cannot + /// exist along with a non-null properties.availabilitySet reference. + /// <br><br>Minimum api‐version: 2019‐03‐01 + /// Specifies information about + /// the proximity placement group that the virtual machine should be + /// assigned to. <br><br>Minimum api-version: + /// 2018-04-01. + /// Specifies the priority for the virtual + /// machine. <br><br>Minimum api-version: 2019-03-01. + /// Possible values include: 'Regular', 'Low', 'Spot' + /// Specifies the eviction policy for the + /// Azure Spot virtual machine and Azure Spot scale set. + /// <br><br>For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2019-03-01. <br><br>For Azure Spot scale sets, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2017-10-30-preview. Possible values include: 'Deallocate', + /// 'Delete' + /// Specifies the billing related details + /// of a Azure Spot virtual machine. <br><br>Minimum + /// api-version: 2019-03-01. + /// Specifies information about the dedicated host + /// that the virtual machine resides in. <br><br>Minimum + /// api-version: 2018-10-01. + /// Specifies information about the dedicated + /// host group that the virtual machine resides in. + /// <br><br>Minimum api-version: 2020-06-01. + /// <br><br>NOTE: User cannot specify both host and + /// hostGroup properties. + /// The provisioning state, which only + /// appears in the response. + /// The virtual machine instance + /// view. + /// Specifies that the image or disk that is + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// 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. + /// Specifies the time alloted for + /// all extensions to start. The time duration should be between 15 + /// minutes and 120 minutes (inclusive) and should be specified in ISO + /// 8601 format. The default value is 90 minutes (PT1H30M). + /// <br><br> Minimum api-version: 2020-06-01 + /// Specifies the scale set logical + /// fault domain into which the Virtual Machine will be created. By + /// default, the Virtual Machine will by automatically assigned to a + /// fault domain that best maintains balance across available fault + /// domains.<br><li>This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.<li>The Virtual Machine Scale Set that is referenced, + /// must have 'platformFaultDomainCount' &gt; 1.<li>This + /// property cannot be updated once the Virtual Machine is + /// created.<li>Fault domain assignment can be viewed in the + /// Virtual Machine Instance View.<br><br>Minimum + /// api‐version: 2020‐12‐01 + /// Specifies Scheduled Event + /// related configurations. + /// The virtual machine child extension + /// resources. + /// The identity of the virtual machine, if + /// configured. + /// The virtual machine zones. + public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), IList resources = default(IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) + : base(location, id, name, type, tags) + { + Plan = plan; + HardwareProfile = hardwareProfile; + StorageProfile = storageProfile; + AdditionalCapabilities = additionalCapabilities; + OsProfile = osProfile; + NetworkProfile = networkProfile; + SecurityProfile = securityProfile; + DiagnosticsProfile = diagnosticsProfile; + AvailabilitySet = availabilitySet; + VirtualMachineScaleSet = virtualMachineScaleSet; + ProximityPlacementGroup = proximityPlacementGroup; + Priority = priority; + EvictionPolicy = evictionPolicy; + BillingProfile = billingProfile; + Host = host; + HostGroup = hostGroup; + ProvisioningState = provisioningState; + InstanceView = instanceView; + LicenseType = licenseType; + VmId = vmId; + ExtensionsTimeBudget = extensionsTimeBudget; + PlatformFaultDomain = platformFaultDomain; + ScheduledEventsProfile = scheduledEventsProfile; + Resources = resources; + Identity = identity; + Zones = zones; + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachine class. + /// + /// Resource location + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// 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**. + /// Specifies the hardware settings for + /// the virtual machine. + /// Specifies the storage settings for the + /// virtual machine disks. + /// Specifies additional + /// capabilities enabled or disabled on the virtual machine. + /// Specifies the operating system settings + /// used while creating the virtual machine. Some of the settings + /// cannot be changed once VM is provisioned. + /// Specifies the network interfaces of + /// the virtual machine. + /// Specifies the Security related + /// profile settings for the virtual machine. + /// Specifies the boot diagnostic + /// settings state. <br><br>Minimum api-version: + /// 2015-06-15. + /// 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 [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// <br><br> For more information on Azure planned + /// maintenance, see [Maintenance and updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + /// <br><br> Currently, a VM can only be added to + /// availability set at creation time. The availability set to which + /// the VM is being added should be under the same resource group as + /// the availability set resource. An existing VM cannot be added to an + /// availability set. <br><br>This property cannot exist + /// along with a non-null properties.virtualMachineScaleSet + /// reference. + /// Specifies information about + /// the virtual machine scale set that the virtual machine should be + /// assigned to. Virtual machines specified in the same virtual machine + /// scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a + /// virtual machine scale set. <br><br>This property cannot + /// exist along with a non-null properties.availabilitySet reference. + /// <br><br>Minimum api‐version: 2019‐03‐01 + /// Specifies information about + /// the proximity placement group that the virtual machine should be + /// assigned to. <br><br>Minimum api-version: + /// 2018-04-01. + /// Specifies the priority for the virtual + /// machine. <br><br>Minimum api-version: 2019-03-01. + /// Possible values include: 'Regular', 'Low', 'Spot' + /// Specifies the eviction policy for the + /// Azure Spot virtual machine and Azure Spot scale set. + /// <br><br>For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2019-03-01. <br><br>For Azure Spot scale sets, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2017-10-30-preview. Possible values include: 'Deallocate', + /// 'Delete' + /// Specifies the billing related details + /// of a Azure Spot virtual machine. <br><br>Minimum + /// api-version: 2019-03-01. + /// Specifies information about the dedicated host + /// that the virtual machine resides in. <br><br>Minimum + /// api-version: 2018-10-01. + /// Specifies information about the dedicated + /// host group that the virtual machine resides in. + /// <br><br>Minimum api-version: 2020-06-01. + /// <br><br>NOTE: User cannot specify both host and + /// hostGroup properties. + /// The provisioning state, which only + /// appears in the response. + /// The virtual machine instance + /// view. + /// Specifies that the image or disk that is + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// 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. + /// Specifies the time alloted for + /// all extensions to start. The time duration should be between 15 + /// minutes and 120 minutes (inclusive) and should be specified in ISO + /// 8601 format. The default value is 90 minutes (PT1H30M). + /// <br><br> Minimum api-version: 2020-06-01 + /// Specifies the scale set logical + /// fault domain into which the Virtual Machine will be created. By + /// default, the Virtual Machine will by automatically assigned to a + /// fault domain that best maintains balance across available fault + /// domains.<br><li>This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.<li>The Virtual Machine Scale Set that is referenced, + /// must have 'platformFaultDomainCount' &gt; 1.<li>This + /// property cannot be updated once the Virtual Machine is + /// created.<li>Fault domain assignment can be viewed in the + /// Virtual Machine Instance View.<br><br>Minimum + /// api‐version: 2020‐12‐01 + /// Specifies Scheduled Event + /// related configurations. + /// The virtual machine child extension + /// resources. + /// The identity of the virtual machine, if + /// configured. + public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), IList resources = default(IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity)) + : base(location, id, name, type, tags) + { + Plan = plan; + HardwareProfile = hardwareProfile; + StorageProfile = storageProfile; + AdditionalCapabilities = additionalCapabilities; + OsProfile = osProfile; + NetworkProfile = networkProfile; + SecurityProfile = securityProfile; + DiagnosticsProfile = diagnosticsProfile; + AvailabilitySet = availabilitySet; + VirtualMachineScaleSet = virtualMachineScaleSet; + ProximityPlacementGroup = proximityPlacementGroup; + Priority = priority; + EvictionPolicy = evictionPolicy; + BillingProfile = billingProfile; + Host = host; + HostGroup = hostGroup; + ProvisioningState = provisioningState; + InstanceView = instanceView; + LicenseType = licenseType; + VmId = vmId; + ExtensionsTimeBudget = extensionsTimeBudget; + PlatformFaultDomain = platformFaultDomain; + ScheduledEventsProfile = scheduledEventsProfile; + Resources = resources; + Identity = identity; + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachine class. + /// + /// Resource location + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// 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**. + /// Specifies the hardware settings for + /// the virtual machine. + /// Specifies the storage settings for the + /// virtual machine disks. + /// Specifies additional + /// capabilities enabled or disabled on the virtual machine. + /// Specifies the operating system settings + /// used while creating the virtual machine. Some of the settings + /// cannot be changed once VM is provisioned. + /// Specifies the network interfaces of + /// the virtual machine. + /// Specifies the Security related + /// profile settings for the virtual machine. + /// Specifies the boot diagnostic + /// settings state. <br><br>Minimum api-version: + /// 2015-06-15. + /// 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 [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// <br><br> For more information on Azure planned + /// maintenance, see [Maintenance and updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + /// <br><br> Currently, a VM can only be added to + /// availability set at creation time. The availability set to which + /// the VM is being added should be under the same resource group as + /// the availability set resource. An existing VM cannot be added to an + /// availability set. <br><br>This property cannot exist + /// along with a non-null properties.virtualMachineScaleSet + /// reference. + /// Specifies information about + /// the virtual machine scale set that the virtual machine should be + /// assigned to. Virtual machines specified in the same virtual machine + /// scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a + /// virtual machine scale set. <br><br>This property cannot + /// exist along with a non-null properties.availabilitySet reference. + /// <br><br>Minimum api‐version: 2019‐03‐01 + /// Specifies information about + /// the proximity placement group that the virtual machine should be + /// assigned to. <br><br>Minimum api-version: + /// 2018-04-01. + /// Specifies the priority for the virtual + /// machine. <br><br>Minimum api-version: 2019-03-01. + /// Possible values include: 'Regular', 'Low', 'Spot' + /// Specifies the eviction policy for the + /// Azure Spot virtual machine and Azure Spot scale set. + /// <br><br>For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2019-03-01. <br><br>For Azure Spot scale sets, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2017-10-30-preview. Possible values include: 'Deallocate', + /// 'Delete' + /// Specifies the billing related details + /// of a Azure Spot virtual machine. <br><br>Minimum + /// api-version: 2019-03-01. + /// Specifies information about the dedicated host + /// that the virtual machine resides in. <br><br>Minimum + /// api-version: 2018-10-01. + /// Specifies information about the dedicated + /// host group that the virtual machine resides in. + /// <br><br>Minimum api-version: 2020-06-01. + /// <br><br>NOTE: User cannot specify both host and + /// hostGroup properties. + /// The provisioning state, which only + /// appears in the response. + /// The virtual machine instance + /// view. + /// Specifies that the image or disk that is + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// 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. + /// Specifies the time alloted for + /// all extensions to start. The time duration should be between 15 + /// minutes and 120 minutes (inclusive) and should be specified in ISO + /// 8601 format. The default value is 90 minutes (PT1H30M). + /// <br><br> Minimum api-version: 2020-06-01 + /// Specifies the scale set logical + /// fault domain into which the Virtual Machine will be created. By + /// default, the Virtual Machine will by automatically assigned to a + /// fault domain that best maintains balance across available fault + /// domains.<br><li>This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.<li>The Virtual Machine Scale Set that is referenced, + /// must have 'platformFaultDomainCount' &gt; 1.<li>This + /// property cannot be updated once the Virtual Machine is + /// created.<li>Fault domain assignment can be viewed in the + /// Virtual Machine Instance View.<br><br>Minimum + /// api‐version: 2020‐12‐01 + /// Specifies Scheduled Event + /// related configurations. + /// The virtual machine child extension + /// resources. + public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), IList resources = default(IList)) + : base(location, id, name, type, tags) + { + Plan = plan; + HardwareProfile = hardwareProfile; + StorageProfile = storageProfile; + AdditionalCapabilities = additionalCapabilities; + OsProfile = osProfile; + NetworkProfile = networkProfile; + SecurityProfile = securityProfile; + DiagnosticsProfile = diagnosticsProfile; + AvailabilitySet = availabilitySet; + VirtualMachineScaleSet = virtualMachineScaleSet; + ProximityPlacementGroup = proximityPlacementGroup; + Priority = priority; + EvictionPolicy = evictionPolicy; + BillingProfile = billingProfile; + Host = host; + HostGroup = hostGroup; + ProvisioningState = provisioningState; + InstanceView = instanceView; + LicenseType = licenseType; + VmId = vmId; + ExtensionsTimeBudget = extensionsTimeBudget; + PlatformFaultDomain = platformFaultDomain; + ScheduledEventsProfile = scheduledEventsProfile; + Resources = resources; + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachine class. + /// + /// Resource location + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// 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**. + /// Specifies the hardware settings for + /// the virtual machine. + /// Specifies the storage settings for the + /// virtual machine disks. + /// Specifies additional + /// capabilities enabled or disabled on the virtual machine. + /// Specifies the operating system settings + /// used while creating the virtual machine. Some of the settings + /// cannot be changed once VM is provisioned. + /// Specifies the network interfaces of + /// the virtual machine. + /// Specifies the Security related + /// profile settings for the virtual machine. + /// Specifies the boot diagnostic + /// settings state. <br><br>Minimum api-version: + /// 2015-06-15. + /// 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 [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// <br><br> For more information on Azure planned + /// maintenance, see [Maintenance and updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + /// <br><br> Currently, a VM can only be added to + /// availability set at creation time. The availability set to which + /// the VM is being added should be under the same resource group as + /// the availability set resource. An existing VM cannot be added to an + /// availability set. <br><br>This property cannot exist + /// along with a non-null properties.virtualMachineScaleSet + /// reference. + /// Specifies information about + /// the virtual machine scale set that the virtual machine should be + /// assigned to. Virtual machines specified in the same virtual machine + /// scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a + /// virtual machine scale set. <br><br>This property cannot + /// exist along with a non-null properties.availabilitySet reference. + /// <br><br>Minimum api‐version: 2019‐03‐01 + /// Specifies information about + /// the proximity placement group that the virtual machine should be + /// assigned to. <br><br>Minimum api-version: + /// 2018-04-01. + /// Specifies the priority for the virtual + /// machine. <br><br>Minimum api-version: 2019-03-01. + /// Possible values include: 'Regular', 'Low', 'Spot' + /// Specifies the eviction policy for the + /// Azure Spot virtual machine and Azure Spot scale set. + /// <br><br>For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2019-03-01. <br><br>For Azure Spot scale sets, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2017-10-30-preview. Possible values include: 'Deallocate', + /// 'Delete' + /// Specifies the billing related details + /// of a Azure Spot virtual machine. <br><br>Minimum + /// api-version: 2019-03-01. + /// Specifies information about the dedicated host + /// that the virtual machine resides in. <br><br>Minimum + /// api-version: 2018-10-01. + /// Specifies information about the dedicated + /// host group that the virtual machine resides in. + /// <br><br>Minimum api-version: 2020-06-01. + /// <br><br>NOTE: User cannot specify both host and + /// hostGroup properties. + /// The provisioning state, which only + /// appears in the response. + /// The virtual machine instance + /// view. + /// Specifies that the image or disk that is + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// 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. + /// Specifies the time alloted for + /// all extensions to start. The time duration should be between 15 + /// minutes and 120 minutes (inclusive) and should be specified in ISO + /// 8601 format. The default value is 90 minutes (PT1H30M). + /// <br><br> Minimum api-version: 2020-06-01 + /// Specifies the scale set logical + /// fault domain into which the Virtual Machine will be created. By + /// default, the Virtual Machine will by automatically assigned to a + /// fault domain that best maintains balance across available fault + /// domains.<br><li>This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.<li>The Virtual Machine Scale Set that is referenced, + /// must have 'platformFaultDomainCount' &gt; 1.<li>This + /// property cannot be updated once the Virtual Machine is + /// created.<li>Fault domain assignment can be viewed in the + /// Virtual Machine Instance View.<br><br>Minimum + /// api‐version: 2020‐12‐01 + /// Specifies Scheduled Event + /// related configurations. + /// The virtual machine child extension + /// resources. + public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile)) + : base(location, id, name, type, tags) + { + Plan = plan; + HardwareProfile = hardwareProfile; + StorageProfile = storageProfile; + AdditionalCapabilities = additionalCapabilities; + OsProfile = osProfile; + NetworkProfile = networkProfile; + SecurityProfile = securityProfile; + DiagnosticsProfile = diagnosticsProfile; + AvailabilitySet = availabilitySet; + VirtualMachineScaleSet = virtualMachineScaleSet; + ProximityPlacementGroup = proximityPlacementGroup; + Priority = priority; + EvictionPolicy = evictionPolicy; + BillingProfile = billingProfile; + Host = host; + HostGroup = hostGroup; + ProvisioningState = provisioningState; + InstanceView = instanceView; + LicenseType = licenseType; + VmId = vmId; + ExtensionsTimeBudget = extensionsTimeBudget; + PlatformFaultDomain = platformFaultDomain; + ScheduledEventsProfile = scheduledEventsProfile; + CustomInit(); + } + } } From 0d8c80897e891cbb7b2bdef1b57937d2d5d8281b Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 17:33:47 -0400 Subject: [PATCH 03/16] Update VirtualMachineUpdate.cs --- .../Customizations/VirtualMachineUpdate.cs | 437 ++++++++++++++++++ 1 file changed, 437 insertions(+) diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineUpdate.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineUpdate.cs index 694d13cb8410a..2aa53d7dfd179 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineUpdate.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineUpdate.cs @@ -176,5 +176,442 @@ public VirtualMachineUpdate(IDictionary tags, Plan plan, Hardwar Identity = identity; CustomInit(); } + + /// + /// Initializes a new instance of the VirtualMachineUpdate class. + /// + /// Resource tags + /// 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**. + /// Specifies the hardware settings for + /// the virtual machine. + /// Specifies the storage settings for the + /// virtual machine disks. + /// Specifies additional + /// capabilities enabled or disabled on the virtual machine. + /// Specifies the operating system settings + /// used while creating the virtual machine. Some of the settings + /// cannot be changed once VM is provisioned. + /// Specifies the network interfaces of + /// the virtual machine. + /// Specifies the Security related + /// profile settings for the virtual machine. + /// Specifies the boot diagnostic + /// settings state. <br><br>Minimum api-version: + /// 2015-06-15. + /// 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 [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// <br><br> For more information on Azure planned + /// maintenance, see [Maintenance and updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + /// <br><br> Currently, a VM can only be added to + /// availability set at creation time. The availability set to which + /// the VM is being added should be under the same resource group as + /// the availability set resource. An existing VM cannot be added to an + /// availability set. <br><br>This property cannot exist + /// along with a non-null properties.virtualMachineScaleSet + /// reference. + /// Specifies information about + /// the virtual machine scale set that the virtual machine should be + /// assigned to. Virtual machines specified in the same virtual machine + /// scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a + /// virtual machine scale set. <br><br>This property cannot + /// exist along with a non-null properties.availabilitySet reference. + /// <br><br>Minimum api‐version: 2019‐03‐01 + /// Specifies information about + /// the proximity placement group that the virtual machine should be + /// assigned to. <br><br>Minimum api-version: + /// 2018-04-01. + /// Specifies the priority for the virtual + /// machine. <br><br>Minimum api-version: 2019-03-01. + /// Possible values include: 'Regular', 'Low', 'Spot' + /// Specifies the eviction policy for the + /// Azure Spot virtual machine and Azure Spot scale set. + /// <br><br>For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2019-03-01. <br><br>For Azure Spot scale sets, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2017-10-30-preview. Possible values include: 'Deallocate', + /// 'Delete' + /// Specifies the billing related details + /// of a Azure Spot virtual machine. <br><br>Minimum + /// api-version: 2019-03-01. + /// Specifies information about the dedicated host + /// that the virtual machine resides in. <br><br>Minimum + /// api-version: 2018-10-01. + /// Specifies information about the dedicated + /// host group that the virtual machine resides in. + /// <br><br>Minimum api-version: 2020-06-01. + /// <br><br>NOTE: User cannot specify both host and + /// hostGroup properties. + /// The provisioning state, which only + /// appears in the response. + /// The virtual machine instance + /// view. + /// Specifies that the image or disk that is + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// 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. + /// Specifies the time alloted for + /// all extensions to start. The time duration should be between 15 + /// minutes and 120 minutes (inclusive) and should be specified in ISO + /// 8601 format. The default value is 90 minutes (PT1H30M). + /// <br><br> Minimum api-version: 2020-06-01 + /// Specifies the scale set logical + /// fault domain into which the Virtual Machine will be created. By + /// default, the Virtual Machine will by automatically assigned to a + /// fault domain that best maintains balance across available fault + /// domains.<br><li>This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.<li>The Virtual Machine Scale Set that is referenced, + /// must have 'platformFaultDomainCount' &gt; 1.<li>This + /// property cannot be updated once the Virtual Machine is + /// created.<li>Fault domain assignment can be viewed in the + /// Virtual Machine Instance View.<br><br>Minimum + /// api‐version: 2020‐12‐01 + /// The identity of the virtual machine, if + /// configured. + /// The virtual machine zones. + public VirtualMachineUpdate(IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) + : base(tags) + { + Plan = plan; + HardwareProfile = hardwareProfile; + StorageProfile = storageProfile; + AdditionalCapabilities = additionalCapabilities; + OsProfile = osProfile; + NetworkProfile = networkProfile; + SecurityProfile = securityProfile; + DiagnosticsProfile = diagnosticsProfile; + AvailabilitySet = availabilitySet; + VirtualMachineScaleSet = virtualMachineScaleSet; + ProximityPlacementGroup = proximityPlacementGroup; + Priority = priority; + EvictionPolicy = evictionPolicy; + BillingProfile = billingProfile; + Host = host; + HostGroup = hostGroup; + ProvisioningState = provisioningState; + InstanceView = instanceView; + LicenseType = licenseType; + VmId = vmId; + ExtensionsTimeBudget = extensionsTimeBudget; + PlatformFaultDomain = platformFaultDomain; + Identity = identity; + Zones = zones; + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineUpdate class. + /// + /// Resource tags + /// 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**. + /// Specifies the hardware settings for + /// the virtual machine. + /// Specifies the storage settings for the + /// virtual machine disks. + /// Specifies additional + /// capabilities enabled or disabled on the virtual machine. + /// Specifies the operating system settings + /// used while creating the virtual machine. Some of the settings + /// cannot be changed once VM is provisioned. + /// Specifies the network interfaces of + /// the virtual machine. + /// Specifies the Security related + /// profile settings for the virtual machine. + /// Specifies the boot diagnostic + /// settings state. <br><br>Minimum api-version: + /// 2015-06-15. + /// 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 [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// <br><br> For more information on Azure planned + /// maintenance, see [Maintenance and updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + /// <br><br> Currently, a VM can only be added to + /// availability set at creation time. The availability set to which + /// the VM is being added should be under the same resource group as + /// the availability set resource. An existing VM cannot be added to an + /// availability set. <br><br>This property cannot exist + /// along with a non-null properties.virtualMachineScaleSet + /// reference. + /// Specifies information about + /// the virtual machine scale set that the virtual machine should be + /// assigned to. Virtual machines specified in the same virtual machine + /// scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a + /// virtual machine scale set. <br><br>This property cannot + /// exist along with a non-null properties.availabilitySet reference. + /// <br><br>Minimum api‐version: 2019‐03‐01 + /// Specifies information about + /// the proximity placement group that the virtual machine should be + /// assigned to. <br><br>Minimum api-version: + /// 2018-04-01. + /// Specifies the priority for the virtual + /// machine. <br><br>Minimum api-version: 2019-03-01. + /// Possible values include: 'Regular', 'Low', 'Spot' + /// Specifies the eviction policy for the + /// Azure Spot virtual machine and Azure Spot scale set. + /// <br><br>For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2019-03-01. <br><br>For Azure Spot scale sets, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2017-10-30-preview. Possible values include: 'Deallocate', + /// 'Delete' + /// Specifies the billing related details + /// of a Azure Spot virtual machine. <br><br>Minimum + /// api-version: 2019-03-01. + /// Specifies information about the dedicated host + /// that the virtual machine resides in. <br><br>Minimum + /// api-version: 2018-10-01. + /// Specifies information about the dedicated + /// host group that the virtual machine resides in. + /// <br><br>Minimum api-version: 2020-06-01. + /// <br><br>NOTE: User cannot specify both host and + /// hostGroup properties. + /// The provisioning state, which only + /// appears in the response. + /// The virtual machine instance + /// view. + /// Specifies that the image or disk that is + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// 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. + /// Specifies the time alloted for + /// all extensions to start. The time duration should be between 15 + /// minutes and 120 minutes (inclusive) and should be specified in ISO + /// 8601 format. The default value is 90 minutes (PT1H30M). + /// <br><br> Minimum api-version: 2020-06-01 + /// Specifies the scale set logical + /// fault domain into which the Virtual Machine will be created. By + /// default, the Virtual Machine will by automatically assigned to a + /// fault domain that best maintains balance across available fault + /// domains.<br><li>This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.<li>The Virtual Machine Scale Set that is referenced, + /// must have 'platformFaultDomainCount' &gt; 1.<li>This + /// property cannot be updated once the Virtual Machine is + /// created.<li>Fault domain assignment can be viewed in the + /// Virtual Machine Instance View.<br><br>Minimum + /// api‐version: 2020‐12‐01 + /// The identity of the virtual machine, if + /// configured. + public VirtualMachineUpdate(IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), VirtualMachineIdentity identity = default(VirtualMachineIdentity)) + : base(tags) + { + Plan = plan; + HardwareProfile = hardwareProfile; + StorageProfile = storageProfile; + AdditionalCapabilities = additionalCapabilities; + OsProfile = osProfile; + NetworkProfile = networkProfile; + SecurityProfile = securityProfile; + DiagnosticsProfile = diagnosticsProfile; + AvailabilitySet = availabilitySet; + VirtualMachineScaleSet = virtualMachineScaleSet; + ProximityPlacementGroup = proximityPlacementGroup; + Priority = priority; + EvictionPolicy = evictionPolicy; + BillingProfile = billingProfile; + Host = host; + HostGroup = hostGroup; + ProvisioningState = provisioningState; + InstanceView = instanceView; + LicenseType = licenseType; + VmId = vmId; + ExtensionsTimeBudget = extensionsTimeBudget; + PlatformFaultDomain = platformFaultDomain; + Identity = identity; + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineUpdate class. + /// + /// Resource tags + /// 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**. + /// Specifies the hardware settings for + /// the virtual machine. + /// Specifies the storage settings for the + /// virtual machine disks. + /// Specifies additional + /// capabilities enabled or disabled on the virtual machine. + /// Specifies the operating system settings + /// used while creating the virtual machine. Some of the settings + /// cannot be changed once VM is provisioned. + /// Specifies the network interfaces of + /// the virtual machine. + /// Specifies the Security related + /// profile settings for the virtual machine. + /// Specifies the boot diagnostic + /// settings state. <br><br>Minimum api-version: + /// 2015-06-15. + /// 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 [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// <br><br> For more information on Azure planned + /// maintenance, see [Maintenance and updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + /// <br><br> Currently, a VM can only be added to + /// availability set at creation time. The availability set to which + /// the VM is being added should be under the same resource group as + /// the availability set resource. An existing VM cannot be added to an + /// availability set. <br><br>This property cannot exist + /// along with a non-null properties.virtualMachineScaleSet + /// reference. + /// Specifies information about + /// the virtual machine scale set that the virtual machine should be + /// assigned to. Virtual machines specified in the same virtual machine + /// scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a + /// virtual machine scale set. <br><br>This property cannot + /// exist along with a non-null properties.availabilitySet reference. + /// <br><br>Minimum api‐version: 2019‐03‐01 + /// Specifies information about + /// the proximity placement group that the virtual machine should be + /// assigned to. <br><br>Minimum api-version: + /// 2018-04-01. + /// Specifies the priority for the virtual + /// machine. <br><br>Minimum api-version: 2019-03-01. + /// Possible values include: 'Regular', 'Low', 'Spot' + /// Specifies the eviction policy for the + /// Azure Spot virtual machine and Azure Spot scale set. + /// <br><br>For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2019-03-01. <br><br>For Azure Spot scale sets, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2017-10-30-preview. Possible values include: 'Deallocate', + /// 'Delete' + /// Specifies the billing related details + /// of a Azure Spot virtual machine. <br><br>Minimum + /// api-version: 2019-03-01. + /// Specifies information about the dedicated host + /// that the virtual machine resides in. <br><br>Minimum + /// api-version: 2018-10-01. + /// Specifies information about the dedicated + /// host group that the virtual machine resides in. + /// <br><br>Minimum api-version: 2020-06-01. + /// <br><br>NOTE: User cannot specify both host and + /// hostGroup properties. + /// The provisioning state, which only + /// appears in the response. + /// The virtual machine instance + /// view. + /// Specifies that the image or disk that is + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// 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. + /// Specifies the time alloted for + /// all extensions to start. The time duration should be between 15 + /// minutes and 120 minutes (inclusive) and should be specified in ISO + /// 8601 format. The default value is 90 minutes (PT1H30M). + /// <br><br> Minimum api-version: 2020-06-01 + /// Specifies the scale set logical + /// fault domain into which the Virtual Machine will be created. By + /// default, the Virtual Machine will by automatically assigned to a + /// fault domain that best maintains balance across available fault + /// domains.<br><li>This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.<li>The Virtual Machine Scale Set that is referenced, + /// must have 'platformFaultDomainCount' &gt; 1.<li>This + /// property cannot be updated once the Virtual Machine is + /// created.<li>Fault domain assignment can be viewed in the + /// Virtual Machine Instance View.<br><br>Minimum + /// api‐version: 2020‐12‐01 + public VirtualMachineUpdate(IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?)) + : base(tags) + { + Plan = plan; + HardwareProfile = hardwareProfile; + StorageProfile = storageProfile; + AdditionalCapabilities = additionalCapabilities; + OsProfile = osProfile; + NetworkProfile = networkProfile; + SecurityProfile = securityProfile; + DiagnosticsProfile = diagnosticsProfile; + AvailabilitySet = availabilitySet; + VirtualMachineScaleSet = virtualMachineScaleSet; + ProximityPlacementGroup = proximityPlacementGroup; + Priority = priority; + EvictionPolicy = evictionPolicy; + BillingProfile = billingProfile; + Host = host; + HostGroup = hostGroup; + ProvisioningState = provisioningState; + InstanceView = instanceView; + LicenseType = licenseType; + VmId = vmId; + ExtensionsTimeBudget = extensionsTimeBudget; + PlatformFaultDomain = platformFaultDomain; + CustomInit(); + } } } From 9b293b18dba9d74e68689580fdb5f5df35a75e12 Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 17:41:48 -0400 Subject: [PATCH 04/16] Create VirtualMachineScaleSetsOperations.cs --- .../VirtualMachineScaleSetsOperations.cs | 575 ++++++++++++++++++ 1 file changed, 575 insertions(+) create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs new file mode 100644 index 0000000000000..576310c42ab5d --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs @@ -0,0 +1,575 @@ +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// VirtualMachineScaleSetsOperations operations. + /// + internal partial class VirtualMachineScaleSetsOperations : IServiceOperations, IVirtualMachineScaleSetsOperations + { + /// + /// Display information about a virtual machine scale set. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (vmScaleSetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-03-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Display information about a virtual machine scale set. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Headers that will be added to request. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (vmScaleSetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-03-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("apiVersion", apiVersion); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + + /// + /// Display information about a virtual machine scale set. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (vmScaleSetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-03-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("apiVersion", apiVersion); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } + +} From 9e5530b825f553eec1b7f92a4e4faa768fcb3f9a Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 17:45:39 -0400 Subject: [PATCH 05/16] Create VirtualMachineScaleSetsOperationsExtensions.cs --- ...ualMachineScaleSetsOperationsExtensions.cs | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperationsExtensions.cs diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperationsExtensions.cs new file mode 100644 index 0000000000000..c576d84fa4a6c --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperationsExtensions.cs @@ -0,0 +1,71 @@ +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for VirtualMachineScaleSetsOperations. + /// + public static partial class VirtualMachineScaleSetsOperationsExtensions + { + /// + /// Display information about a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Display information about a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The expand expression to apply on the operation. 'UserData' retrieves the + /// UserData property of the VM scale set that was provided by the user during + /// the VM scale set Create/Update operation. Possible values include: + /// 'userData' + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null).ConfigureAwait(false)) + { + return _result.Body; + } + } + } + + + +} From 5eefa5ccf143fa4b6c8a4f8d86e214eb40da0235 Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 20:28:06 -0400 Subject: [PATCH 06/16] Update VirtualMachine.cs --- .../src/Customizations/VirtualMachine.cs | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachine.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachine.cs index 4110accf45091..08114a735eaf3 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachine.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachine.cs @@ -1052,6 +1052,166 @@ public VirtualMachine(string location, string id, string name, string type, IDic ScheduledEventsProfile = scheduledEventsProfile; CustomInit(); } + + /// + /// Initializes a new instance of the VirtualMachine class. + /// + /// Resource location + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// 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**. + /// Specifies the hardware settings for + /// the virtual machine. + /// Specifies the storage settings for the + /// virtual machine disks. + /// Specifies additional + /// capabilities enabled or disabled on the virtual machine. + /// Specifies the operating system settings + /// used while creating the virtual machine. Some of the settings + /// cannot be changed once VM is provisioned. + /// Specifies the network interfaces of + /// the virtual machine. + /// Specifies the Security related + /// profile settings for the virtual machine. + /// Specifies the boot diagnostic + /// settings state. <br><br>Minimum api-version: + /// 2015-06-15. + /// 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 [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// <br><br> For more information on Azure planned + /// maintenance, see [Maintenance and updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + /// <br><br> Currently, a VM can only be added to + /// availability set at creation time. The availability set to which + /// the VM is being added should be under the same resource group as + /// the availability set resource. An existing VM cannot be added to an + /// availability set. <br><br>This property cannot exist + /// along with a non-null properties.virtualMachineScaleSet + /// reference. + /// Specifies information about + /// the virtual machine scale set that the virtual machine should be + /// assigned to. Virtual machines specified in the same virtual machine + /// scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a + /// virtual machine scale set. <br><br>This property cannot + /// exist along with a non-null properties.availabilitySet reference. + /// <br><br>Minimum api‐version: 2019‐03‐01 + /// Specifies information about + /// the proximity placement group that the virtual machine should be + /// assigned to. <br><br>Minimum api-version: + /// 2018-04-01. + /// Specifies the priority for the virtual + /// machine. <br><br>Minimum api-version: 2019-03-01. + /// Possible values include: 'Regular', 'Low', 'Spot' + /// Specifies the eviction policy for the + /// Azure Spot virtual machine and Azure Spot scale set. + /// <br><br>For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2019-03-01. <br><br>For Azure Spot scale sets, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2017-10-30-preview. Possible values include: 'Deallocate', + /// 'Delete' + /// Specifies the billing related details + /// of a Azure Spot virtual machine. <br><br>Minimum + /// api-version: 2019-03-01. + /// Specifies information about the dedicated host + /// that the virtual machine resides in. <br><br>Minimum + /// api-version: 2018-10-01. + /// Specifies information about the dedicated + /// host group that the virtual machine resides in. + /// <br><br>Minimum api-version: 2020-06-01. + /// <br><br>NOTE: User cannot specify both host and + /// hostGroup properties. + /// The provisioning state, which only + /// appears in the response. + /// The virtual machine instance + /// view. + /// Specifies that the image or disk that is + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// 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. + /// Specifies the time alloted for + /// all extensions to start. The time duration should be between 15 + /// minutes and 120 minutes (inclusive) and should be specified in ISO + /// 8601 format. The default value is 90 minutes (PT1H30M). + /// <br><br> Minimum api-version: 2020-06-01 + /// Specifies the scale set logical + /// fault domain into which the Virtual Machine will be created. By + /// default, the Virtual Machine will by automatically assigned to a + /// fault domain that best maintains balance across available fault + /// domains.<br><li>This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.<li>The Virtual Machine Scale Set that is referenced, + /// must have 'platformFaultDomainCount' &gt; 1.<li>This + /// property cannot be updated once the Virtual Machine is + /// created.<li>Fault domain assignment can be viewed in the + /// Virtual Machine Instance View.<br><br>Minimum + /// api‐version: 2020‐12‐01 + /// Specifies Scheduled Event + /// related configurations. + /// The identity of the virtual machine, if + /// configured. + /// The virtual machine zones. + /// The extended location of the Virtual + /// Machine. + public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), IList resources = default(IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList), ExtendedLocation extendedLocation = default(ExtendedLocation)) + : base(location, id, name, type, tags) + { + Plan = plan; + HardwareProfile = hardwareProfile; + StorageProfile = storageProfile; + AdditionalCapabilities = additionalCapabilities; + OsProfile = osProfile; + NetworkProfile = networkProfile; + SecurityProfile = securityProfile; + DiagnosticsProfile = diagnosticsProfile; + AvailabilitySet = availabilitySet; + VirtualMachineScaleSet = virtualMachineScaleSet; + ProximityPlacementGroup = proximityPlacementGroup; + Priority = priority; + EvictionPolicy = evictionPolicy; + BillingProfile = billingProfile; + Host = host; + HostGroup = hostGroup; + ProvisioningState = provisioningState; + InstanceView = instanceView; + LicenseType = licenseType; + VmId = vmId; + ExtensionsTimeBudget = extensionsTimeBudget; + PlatformFaultDomain = platformFaultDomain; + ScheduledEventsProfile = scheduledEventsProfile; + Resources = resources; + Identity = identity; + Zones = zones; + ExtendedLocation = extendedLocation; + CustomInit(); + } + } } From 4434cd6ed8b8db76d457a0c29fa7e10223e3f74f Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 20:33:18 -0400 Subject: [PATCH 07/16] Update VirtualMachineUpdate.cs --- .../Customizations/VirtualMachineUpdate.cs | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineUpdate.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineUpdate.cs index 2aa53d7dfd179..2565107168885 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineUpdate.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineUpdate.cs @@ -613,5 +613,155 @@ public VirtualMachineUpdate(IDictionary tags, Plan plan, Hardwar PlatformFaultDomain = platformFaultDomain; CustomInit(); } + + + /// + /// Initializes a new instance of the VirtualMachineUpdate class. + /// + /// Resource tags + /// 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**. + /// Specifies the hardware settings for + /// the virtual machine. + /// Specifies the storage settings for the + /// virtual machine disks. + /// Specifies additional + /// capabilities enabled or disabled on the virtual machine. + /// Specifies the operating system settings + /// used while creating the virtual machine. Some of the settings + /// cannot be changed once VM is provisioned. + /// Specifies the network interfaces of + /// the virtual machine. + /// Specifies the Security related + /// profile settings for the virtual machine. + /// Specifies the boot diagnostic + /// settings state. <br><br>Minimum api-version: + /// 2015-06-15. + /// 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 [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// <br><br> For more information on Azure planned + /// maintenance, see [Maintenance and updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + /// <br><br> Currently, a VM can only be added to + /// availability set at creation time. The availability set to which + /// the VM is being added should be under the same resource group as + /// the availability set resource. An existing VM cannot be added to an + /// availability set. <br><br>This property cannot exist + /// along with a non-null properties.virtualMachineScaleSet + /// reference. + /// Specifies information about + /// the virtual machine scale set that the virtual machine should be + /// assigned to. Virtual machines specified in the same virtual machine + /// scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a + /// virtual machine scale set. <br><br>This property cannot + /// exist along with a non-null properties.availabilitySet reference. + /// <br><br>Minimum api‐version: 2019‐03‐01 + /// Specifies information about + /// the proximity placement group that the virtual machine should be + /// assigned to. <br><br>Minimum api-version: + /// 2018-04-01. + /// Specifies the priority for the virtual + /// machine. <br><br>Minimum api-version: 2019-03-01. + /// Possible values include: 'Regular', 'Low', 'Spot' + /// Specifies the eviction policy for the + /// Azure Spot virtual machine and Azure Spot scale set. + /// <br><br>For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2019-03-01. <br><br>For Azure Spot scale sets, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version + /// is 2017-10-30-preview. Possible values include: 'Deallocate', + /// 'Delete' + /// Specifies the billing related details + /// of a Azure Spot virtual machine. <br><br>Minimum + /// api-version: 2019-03-01. + /// Specifies information about the dedicated host + /// that the virtual machine resides in. <br><br>Minimum + /// api-version: 2018-10-01. + /// Specifies information about the dedicated + /// host group that the virtual machine resides in. + /// <br><br>Minimum api-version: 2020-06-01. + /// <br><br>NOTE: User cannot specify both host and + /// hostGroup properties. + /// The provisioning state, which only + /// appears in the response. + /// The virtual machine instance + /// view. + /// Specifies that the image or disk that is + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// 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. + /// Specifies the time alloted for + /// all extensions to start. The time duration should be between 15 + /// minutes and 120 minutes (inclusive) and should be specified in ISO + /// 8601 format. The default value is 90 minutes (PT1H30M). + /// <br><br> Minimum api-version: 2020-06-01 + /// Specifies the scale set logical + /// fault domain into which the Virtual Machine will be created. By + /// default, the Virtual Machine will by automatically assigned to a + /// fault domain that best maintains balance across available fault + /// domains.<br><li>This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.<li>The Virtual Machine Scale Set that is referenced, + /// must have 'platformFaultDomainCount' &gt; 1.<li>This + /// property cannot be updated once the Virtual Machine is + /// created.<li>Fault domain assignment can be viewed in the + /// Virtual Machine Instance View.<br><br>Minimum + /// api‐version: 2020‐12‐01 + /// The identity of the virtual machine, if + /// configured. + /// The virtual machine zones. + public VirtualMachineUpdate(IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) + : base(tags) + { + Plan = plan; + HardwareProfile = hardwareProfile; + StorageProfile = storageProfile; + AdditionalCapabilities = additionalCapabilities; + OsProfile = osProfile; + NetworkProfile = networkProfile; + SecurityProfile = securityProfile; + DiagnosticsProfile = diagnosticsProfile; + AvailabilitySet = availabilitySet; + VirtualMachineScaleSet = virtualMachineScaleSet; + ProximityPlacementGroup = proximityPlacementGroup; + Priority = priority; + EvictionPolicy = evictionPolicy; + BillingProfile = billingProfile; + Host = host; + HostGroup = hostGroup; + ProvisioningState = provisioningState; + InstanceView = instanceView; + LicenseType = licenseType; + VmId = vmId; + ExtensionsTimeBudget = extensionsTimeBudget; + PlatformFaultDomain = platformFaultDomain; + Identity = identity; + Zones = zones; + CustomInit(); + } + } } From 85bd83564869d631887a77bf7af483792bdc31ae Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 20:47:29 -0400 Subject: [PATCH 08/16] Update IVirtualMachinesOperations.cs --- .../src/Customizations/IVirtualMachinesOperations.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/IVirtualMachinesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/IVirtualMachinesOperations.cs index 84c17aa1da35a..b4cfe420eb720 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/IVirtualMachinesOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/IVirtualMachinesOperations.cs @@ -18,8 +18,10 @@ public partial interface IVirtualMachinesOperations /// /// /// The name of the virtual machine. + /// /// /// The headers that will be added to request. + /// /// /// Thrown when the operation returned an invalid status code /// @@ -35,6 +37,7 @@ public partial interface IVirtualMachinesOperations /// /// /// The name of the virtual machine. + /// /// /// The headers that will be added to request. /// @@ -56,8 +59,10 @@ public partial interface IVirtualMachinesOperations /// /// /// The name of the virtual machine. + /// /// /// The headers that will be added to request. + /// /// /// Thrown when the operation returned an invalid status code /// @@ -73,6 +78,7 @@ public partial interface IVirtualMachinesOperations /// /// /// The name of the virtual machine. + /// /// /// The headers that will be added to request. /// From 5b536f4cf99055dd2354eb68bbc3f32264214a98 Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 20:49:27 -0400 Subject: [PATCH 09/16] Update VirtualMachinesOperationsExtensions.cs --- .../src/Customizations/VirtualMachinesOperationsExtensions.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachinesOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachinesOperationsExtensions.cs index 006ccf0f5c844..43a7841686e76 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachinesOperationsExtensions.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachinesOperationsExtensions.cs @@ -24,6 +24,7 @@ public static partial class VirtualMachinesOperationsExtensions /// /// /// The name of the virtual machine. + /// public static async Task DeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) { await DeleteAsync(operations, resourceGroupName, vmName, false, default(CancellationToken)); From ac60f78afbc49a51a4e556d8cef9071e72db177f Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 20:53:04 -0400 Subject: [PATCH 10/16] Update VirtualMachine.cs --- .../src/Customizations/VirtualMachine.cs | 160 ------------------ 1 file changed, 160 deletions(-) diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachine.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachine.cs index 08114a735eaf3..dfc40b8db257d 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachine.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachine.cs @@ -1053,165 +1053,5 @@ public VirtualMachine(string location, string id, string name, string type, IDic CustomInit(); } - /// - /// Initializes a new instance of the VirtualMachine class. - /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// 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**. - /// Specifies the hardware settings for - /// the virtual machine. - /// Specifies the storage settings for the - /// virtual machine disks. - /// Specifies additional - /// capabilities enabled or disabled on the virtual machine. - /// Specifies the operating system settings - /// used while creating the virtual machine. Some of the settings - /// cannot be changed once VM is provisioned. - /// Specifies the network interfaces of - /// the virtual machine. - /// Specifies the Security related - /// profile settings for the virtual machine. - /// Specifies the boot diagnostic - /// settings state. <br><br>Minimum api-version: - /// 2015-06-15. - /// 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 [Availability sets - /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). - /// <br><br> For more information on Azure planned - /// maintenance, see [Maintenance and updates for Virtual Machines in - /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) - /// <br><br> Currently, a VM can only be added to - /// availability set at creation time. The availability set to which - /// the VM is being added should be under the same resource group as - /// the availability set resource. An existing VM cannot be added to an - /// availability set. <br><br>This property cannot exist - /// along with a non-null properties.virtualMachineScaleSet - /// reference. - /// Specifies information about - /// the virtual machine scale set that the virtual machine should be - /// assigned to. Virtual machines specified in the same virtual machine - /// scale set are allocated to different nodes to maximize - /// availability. Currently, a VM can only be added to virtual machine - /// scale set at creation time. An existing VM cannot be added to a - /// virtual machine scale set. <br><br>This property cannot - /// exist along with a non-null properties.availabilitySet reference. - /// <br><br>Minimum api‐version: 2019‐03‐01 - /// Specifies information about - /// the proximity placement group that the virtual machine should be - /// assigned to. <br><br>Minimum api-version: - /// 2018-04-01. - /// Specifies the priority for the virtual - /// machine. <br><br>Minimum api-version: 2019-03-01. - /// Possible values include: 'Regular', 'Low', 'Spot' - /// Specifies the eviction policy for the - /// Azure Spot virtual machine and Azure Spot scale set. - /// <br><br>For Azure Spot virtual machines, both - /// 'Deallocate' and 'Delete' are supported and the minimum api-version - /// is 2019-03-01. <br><br>For Azure Spot scale sets, both - /// 'Deallocate' and 'Delete' are supported and the minimum api-version - /// is 2017-10-30-preview. Possible values include: 'Deallocate', - /// 'Delete' - /// Specifies the billing related details - /// of a Azure Spot virtual machine. <br><br>Minimum - /// api-version: 2019-03-01. - /// Specifies information about the dedicated host - /// that the virtual machine resides in. <br><br>Minimum - /// api-version: 2018-10-01. - /// Specifies information about the dedicated - /// host group that the virtual machine resides in. - /// <br><br>Minimum api-version: 2020-06-01. - /// <br><br>NOTE: User cannot specify both host and - /// hostGroup properties. - /// The provisioning state, which only - /// appears in the response. - /// The virtual machine instance - /// view. - /// Specifies that the image or disk that is - /// being used was licensed on-premises. <br><br> Possible - /// values for Windows Server operating system are: - /// <br><br> Windows_Client <br><br> - /// Windows_Server <br><br> Possible values for Linux - /// Server operating system are: <br><br> RHEL_BYOS (for - /// RHEL) <br><br> SLES_BYOS (for SUSE) - /// <br><br> For more information, see [Azure Hybrid Use - /// Benefit for Windows - /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - /// <br><br> [Azure Hybrid Use Benefit for Linux - /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) - /// <br><br> Minimum api-version: 2015-06-15 - /// 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. - /// Specifies the time alloted for - /// all extensions to start. The time duration should be between 15 - /// minutes and 120 minutes (inclusive) and should be specified in ISO - /// 8601 format. The default value is 90 minutes (PT1H30M). - /// <br><br> Minimum api-version: 2020-06-01 - /// Specifies the scale set logical - /// fault domain into which the Virtual Machine will be created. By - /// default, the Virtual Machine will by automatically assigned to a - /// fault domain that best maintains balance across available fault - /// domains.<br><li>This is applicable only if the - /// 'virtualMachineScaleSet' property of this Virtual Machine is - /// set.<li>The Virtual Machine Scale Set that is referenced, - /// must have 'platformFaultDomainCount' &gt; 1.<li>This - /// property cannot be updated once the Virtual Machine is - /// created.<li>Fault domain assignment can be viewed in the - /// Virtual Machine Instance View.<br><br>Minimum - /// api‐version: 2020‐12‐01 - /// Specifies Scheduled Event - /// related configurations. - /// The identity of the virtual machine, if - /// configured. - /// The virtual machine zones. - /// The extended location of the Virtual - /// Machine. - public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), IList resources = default(IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList), ExtendedLocation extendedLocation = default(ExtendedLocation)) - : base(location, id, name, type, tags) - { - Plan = plan; - HardwareProfile = hardwareProfile; - StorageProfile = storageProfile; - AdditionalCapabilities = additionalCapabilities; - OsProfile = osProfile; - NetworkProfile = networkProfile; - SecurityProfile = securityProfile; - DiagnosticsProfile = diagnosticsProfile; - AvailabilitySet = availabilitySet; - VirtualMachineScaleSet = virtualMachineScaleSet; - ProximityPlacementGroup = proximityPlacementGroup; - Priority = priority; - EvictionPolicy = evictionPolicy; - BillingProfile = billingProfile; - Host = host; - HostGroup = hostGroup; - ProvisioningState = provisioningState; - InstanceView = instanceView; - LicenseType = licenseType; - VmId = vmId; - ExtensionsTimeBudget = extensionsTimeBudget; - PlatformFaultDomain = platformFaultDomain; - ScheduledEventsProfile = scheduledEventsProfile; - Resources = resources; - Identity = identity; - Zones = zones; - ExtendedLocation = extendedLocation; - CustomInit(); - } - - } } From d3903f25601bc472638fff7f32e8c56a6b5dc86e Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 20:54:25 -0400 Subject: [PATCH 11/16] Update VirtualMachineUpdate.cs --- .../Customizations/VirtualMachineUpdate.cs | 149 ------------------ 1 file changed, 149 deletions(-) diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineUpdate.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineUpdate.cs index 2565107168885..626b57fb2bf3a 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineUpdate.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineUpdate.cs @@ -614,154 +614,5 @@ public VirtualMachineUpdate(IDictionary tags, Plan plan, Hardwar CustomInit(); } - - /// - /// Initializes a new instance of the VirtualMachineUpdate class. - /// - /// Resource tags - /// 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**. - /// Specifies the hardware settings for - /// the virtual machine. - /// Specifies the storage settings for the - /// virtual machine disks. - /// Specifies additional - /// capabilities enabled or disabled on the virtual machine. - /// Specifies the operating system settings - /// used while creating the virtual machine. Some of the settings - /// cannot be changed once VM is provisioned. - /// Specifies the network interfaces of - /// the virtual machine. - /// Specifies the Security related - /// profile settings for the virtual machine. - /// Specifies the boot diagnostic - /// settings state. <br><br>Minimum api-version: - /// 2015-06-15. - /// 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 [Availability sets - /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). - /// <br><br> For more information on Azure planned - /// maintenance, see [Maintenance and updates for Virtual Machines in - /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) - /// <br><br> Currently, a VM can only be added to - /// availability set at creation time. The availability set to which - /// the VM is being added should be under the same resource group as - /// the availability set resource. An existing VM cannot be added to an - /// availability set. <br><br>This property cannot exist - /// along with a non-null properties.virtualMachineScaleSet - /// reference. - /// Specifies information about - /// the virtual machine scale set that the virtual machine should be - /// assigned to. Virtual machines specified in the same virtual machine - /// scale set are allocated to different nodes to maximize - /// availability. Currently, a VM can only be added to virtual machine - /// scale set at creation time. An existing VM cannot be added to a - /// virtual machine scale set. <br><br>This property cannot - /// exist along with a non-null properties.availabilitySet reference. - /// <br><br>Minimum api‐version: 2019‐03‐01 - /// Specifies information about - /// the proximity placement group that the virtual machine should be - /// assigned to. <br><br>Minimum api-version: - /// 2018-04-01. - /// Specifies the priority for the virtual - /// machine. <br><br>Minimum api-version: 2019-03-01. - /// Possible values include: 'Regular', 'Low', 'Spot' - /// Specifies the eviction policy for the - /// Azure Spot virtual machine and Azure Spot scale set. - /// <br><br>For Azure Spot virtual machines, both - /// 'Deallocate' and 'Delete' are supported and the minimum api-version - /// is 2019-03-01. <br><br>For Azure Spot scale sets, both - /// 'Deallocate' and 'Delete' are supported and the minimum api-version - /// is 2017-10-30-preview. Possible values include: 'Deallocate', - /// 'Delete' - /// Specifies the billing related details - /// of a Azure Spot virtual machine. <br><br>Minimum - /// api-version: 2019-03-01. - /// Specifies information about the dedicated host - /// that the virtual machine resides in. <br><br>Minimum - /// api-version: 2018-10-01. - /// Specifies information about the dedicated - /// host group that the virtual machine resides in. - /// <br><br>Minimum api-version: 2020-06-01. - /// <br><br>NOTE: User cannot specify both host and - /// hostGroup properties. - /// The provisioning state, which only - /// appears in the response. - /// The virtual machine instance - /// view. - /// Specifies that the image or disk that is - /// being used was licensed on-premises. <br><br> Possible - /// values for Windows Server operating system are: - /// <br><br> Windows_Client <br><br> - /// Windows_Server <br><br> Possible values for Linux - /// Server operating system are: <br><br> RHEL_BYOS (for - /// RHEL) <br><br> SLES_BYOS (for SUSE) - /// <br><br> For more information, see [Azure Hybrid Use - /// Benefit for Windows - /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - /// <br><br> [Azure Hybrid Use Benefit for Linux - /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) - /// <br><br> Minimum api-version: 2015-06-15 - /// 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. - /// Specifies the time alloted for - /// all extensions to start. The time duration should be between 15 - /// minutes and 120 minutes (inclusive) and should be specified in ISO - /// 8601 format. The default value is 90 minutes (PT1H30M). - /// <br><br> Minimum api-version: 2020-06-01 - /// Specifies the scale set logical - /// fault domain into which the Virtual Machine will be created. By - /// default, the Virtual Machine will by automatically assigned to a - /// fault domain that best maintains balance across available fault - /// domains.<br><li>This is applicable only if the - /// 'virtualMachineScaleSet' property of this Virtual Machine is - /// set.<li>The Virtual Machine Scale Set that is referenced, - /// must have 'platformFaultDomainCount' &gt; 1.<li>This - /// property cannot be updated once the Virtual Machine is - /// created.<li>Fault domain assignment can be viewed in the - /// Virtual Machine Instance View.<br><br>Minimum - /// api‐version: 2020‐12‐01 - /// The identity of the virtual machine, if - /// configured. - /// The virtual machine zones. - public VirtualMachineUpdate(IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) - : base(tags) - { - Plan = plan; - HardwareProfile = hardwareProfile; - StorageProfile = storageProfile; - AdditionalCapabilities = additionalCapabilities; - OsProfile = osProfile; - NetworkProfile = networkProfile; - SecurityProfile = securityProfile; - DiagnosticsProfile = diagnosticsProfile; - AvailabilitySet = availabilitySet; - VirtualMachineScaleSet = virtualMachineScaleSet; - ProximityPlacementGroup = proximityPlacementGroup; - Priority = priority; - EvictionPolicy = evictionPolicy; - BillingProfile = billingProfile; - Host = host; - HostGroup = hostGroup; - ProvisioningState = provisioningState; - InstanceView = instanceView; - LicenseType = licenseType; - VmId = vmId; - ExtensionsTimeBudget = extensionsTimeBudget; - PlatformFaultDomain = platformFaultDomain; - Identity = identity; - Zones = zones; - CustomInit(); - } - } } From 39dfe7cf08dd3e346bdd6df0f13440e0bb362e55 Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 22:15:52 -0400 Subject: [PATCH 12/16] Update VirtualMachineScaleSetsOperations.cs add null for removed cancellationToken param --- .../src/Customizations/VirtualMachineScaleSetsOperations.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs index 576310c42ab5d..189474ad72283 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs @@ -317,7 +317,7 @@ public async Task> GetWithHttpMes // Set Credentials if (Client.Credentials != null) { - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, null).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -489,7 +489,7 @@ public async Task> GetWithHttpMes // Set Credentials if (Client.Credentials != null) { - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, null).ConfigureAwait(false); } // Send Request if (_shouldTrace) From 9a0c4ceccb5cc15d9980a2f972da10accdcf4021 Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 22:25:16 -0400 Subject: [PATCH 13/16] Update VirtualMachineScaleSetsOperations.cs --- .../VirtualMachineScaleSetsOperations.cs | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs index 189474ad72283..1cac02e0249db 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs @@ -240,6 +240,8 @@ internal partial class VirtualMachineScaleSetsOperations : IServiceOperations public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null) { + Dictionary> customHeaders = null; + if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -263,6 +265,8 @@ public async Task> GetWithHttpMes tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("expand", expand); + tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL @@ -276,6 +280,10 @@ public async Task> GetWithHttpMes { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -317,19 +325,22 @@ public async Task> GetWithHttpMes // Set Credentials if (Client.Credentials != null) { - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, null).ConfigureAwait(false); + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest).ConfigureAwait(false); + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { @@ -425,6 +436,9 @@ public async Task> GetWithHttpMes /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName) { + CancellationToken cancellationToken = default(CancellationToken); + Dictionary> customHeaders = null; + if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -448,6 +462,8 @@ public async Task> GetWithHttpMes tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("expand", expand); + tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL @@ -461,6 +477,10 @@ public async Task> GetWithHttpMes { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -484,24 +504,40 @@ public async Task> GetWithHttpMes _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, null).ConfigureAwait(false); + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest).ConfigureAwait(false); + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { From cc94321af954c1511f7ab845a971551b38e99ea0 Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Tue, 25 May 2021 22:26:57 -0400 Subject: [PATCH 14/16] Update VirtualMachinesOperations.cs --- .../src/Customizations/VirtualMachinesOperations.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachinesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachinesOperations.cs index 0b99b37522413..eb551a05e7900 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachinesOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachinesOperations.cs @@ -22,6 +22,7 @@ internal partial class VirtualMachinesOperations : IServiceOperations /// /// The headers that will be added to request. + /// public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders) { return await DeleteWithHttpMessagesAsync(resourceGroupName, vmName, false, customHeaders, default(CancellationToken)); @@ -58,6 +59,7 @@ public async Task DeleteWithHttpMessagesAsync(string res /// /// /// Headers that will be added to request. + /// /// /// Thrown when the operation returned an invalid status code /// From b1279eaa73d297165ebf0e18217283a4a9da9c5f Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Wed, 26 May 2021 08:55:09 -0400 Subject: [PATCH 15/16] Update VirtualMachineScaleSetsOperations.cs --- .../VirtualMachineScaleSetsOperations.cs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs index 1cac02e0249db..5334c698ff511 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs @@ -240,7 +240,7 @@ internal partial class VirtualMachineScaleSetsOperations : IServiceOperations public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null) { - Dictionary> customHeaders = null; + CancellationToken cancellationToken = default(CancellationToken) if (resourceGroupName == null) { @@ -265,7 +265,6 @@ public async Task> GetWithHttpMes tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -280,10 +279,6 @@ public async Task> GetWithHttpMes { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -462,7 +457,6 @@ public async Task> GetWithHttpMes tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -477,10 +471,6 @@ public async Task> GetWithHttpMes { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); From 5fb65d0d3818c95750bd878723a9c98038882448 Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Wed, 26 May 2021 09:38:23 -0400 Subject: [PATCH 16/16] Update VirtualMachineScaleSetsOperations.cs --- .../src/Customizations/VirtualMachineScaleSetsOperations.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs index 5334c698ff511..65e95bdd1b5fe 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs @@ -240,7 +240,7 @@ internal partial class VirtualMachineScaleSetsOperations : IServiceOperations public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null) { - CancellationToken cancellationToken = default(CancellationToken) + CancellationToken cancellationToken = default(CancellationToken); if (resourceGroupName == null) {