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); + } + +} 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. /// 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..dfc40b8db257d 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(); + } + } } 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..65e95bdd1b5fe --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/VirtualMachineScaleSetsOperations.cs @@ -0,0 +1,601 @@ +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) + { + 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. + /// + /// + /// 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) + { + CancellationToken cancellationToken = default(CancellationToken); + 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); + 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; + } + + } + +} 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; + } + } + } + + + +} 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..626b57fb2bf3a 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,443 @@ 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(); + } + } } 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 /// 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));