From 8cf0b11423dd2129cefb8d3146125820e7b7bb40 Mon Sep 17 00:00:00 2001 From: adxsdknet Date: Fri, 12 Apr 2019 18:43:39 +0000 Subject: [PATCH] .NET SDK Resource Provider:'Compute' REST Spec PR 'https://github.com/Azure/azure-rest-api-specs/pull/5628' REST Spec PR Author 'lmazuel' REST Spec PR Last commit --- src/SDKs/Compute/AzSdk.RP.props | 2 +- .../Generated/AvailabilitySetsOperations.cs | 14 +- .../Generated/ComputeManagementClient.cs | 12 +- .../Generated/GalleriesOperations.cs | 10 +- .../GalleryImageVersionsOperations.cs | 8 +- .../Generated/GalleryImagesOperations.cs | 8 +- .../Generated/IComputeManagementClient.cs | 10 +- .../IProximityPlacementGroupsOperations.cs | 216 --- .../IVirtualMachineScaleSetOperations.cs | 57 + .../IVirtualMachineScaleSetVMsOperations.cs | 14 +- .../IVirtualMachineScaleSetsOperations.cs | 14 +- .../Generated/IVirtualMachinesOperations.cs | 14 +- .../Generated/ImagesOperations.cs | 12 +- .../Generated/LogAnalyticsOperations.cs | 4 +- .../Generated/Models/AvailabilitySet.cs | 16 +- .../Generated/Models/AvailabilitySetUpdate.cs | 16 +- .../GalleryImageVersionPublishingProfile.cs | 14 +- .../Models/ProximityPlacementGroup.cs | 110 -- .../Models/ProximityPlacementGroupUpdate.cs | 48 - ...mentGroupType.cs => StorageAccountType.cs} | 8 +- .../Generated/Models/TargetRegion.cs | 14 +- ...leSetConvertToSinglePlacementGroupInput.cs | 58 + .../Generated/Models/VirtualMachine.cs | 16 +- .../Models/VirtualMachineScaleSet.cs | 31 +- .../Models/VirtualMachineScaleSetVM.cs | 34 +- ...neScaleSetVMNetworkProfileConfiguration.cs | 56 + ...irtualMachineScaleSetVMProtectionPolicy.cs | 69 + .../Generated/Models/VirtualMachineUpdate.cs | 16 +- .../Generated/Operations.cs | 2 +- .../ProximityPlacementGroupsOperations.cs | 1567 ----------------- ...mityPlacementGroupsOperationsExtensions.cs | 326 ---- .../SdkInfo_ComputeManagementClient.cs | 38 +- .../Generated/UsageOperations.cs | 2 +- ...VirtualMachineExtensionImagesOperations.cs | 6 +- .../VirtualMachineExtensionsOperations.cs | 10 +- .../VirtualMachineImagesOperations.cs | 10 +- .../VirtualMachineRunCommandsOperations.cs | 4 +- ...tualMachineScaleSetExtensionsOperations.cs | 8 +- .../VirtualMachineScaleSetOperations.cs | 240 +++ ...tualMachineScaleSetOperationsExtensions.cs | 76 + ...achineScaleSetRollingUpgradesOperations.cs | 8 +- .../VirtualMachineScaleSetVMsOperations.cs | 49 +- ...lMachineScaleSetVMsOperationsExtensions.cs | 36 +- .../VirtualMachineScaleSetsOperations.cs | 61 +- ...ualMachineScaleSetsOperationsExtensions.cs | 36 +- .../VirtualMachineSizesOperations.cs | 2 +- .../Generated/VirtualMachinesOperations.cs | 61 +- .../VirtualMachinesOperationsExtensions.cs | 36 +- 48 files changed, 952 insertions(+), 2527 deletions(-) delete mode 100644 src/SDKs/Compute/Management.Compute/Generated/IProximityPlacementGroupsOperations.cs create mode 100644 src/SDKs/Compute/Management.Compute/Generated/IVirtualMachineScaleSetOperations.cs delete mode 100644 src/SDKs/Compute/Management.Compute/Generated/Models/ProximityPlacementGroup.cs delete mode 100644 src/SDKs/Compute/Management.Compute/Generated/Models/ProximityPlacementGroupUpdate.cs rename src/SDKs/Compute/Management.Compute/Generated/Models/{ProximityPlacementGroupType.cs => StorageAccountType.cs} (69%) create mode 100644 src/SDKs/Compute/Management.Compute/Generated/Models/VMScaleSetConvertToSinglePlacementGroupInput.cs create mode 100644 src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSetVMNetworkProfileConfiguration.cs create mode 100644 src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSetVMProtectionPolicy.cs delete mode 100644 src/SDKs/Compute/Management.Compute/Generated/ProximityPlacementGroupsOperations.cs delete mode 100644 src/SDKs/Compute/Management.Compute/Generated/ProximityPlacementGroupsOperationsExtensions.cs create mode 100644 src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetOperations.cs create mode 100644 src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetOperationsExtensions.cs diff --git a/src/SDKs/Compute/AzSdk.RP.props b/src/SDKs/Compute/AzSdk.RP.props index b8b85ec760474..a22c36aebd490 100644 --- a/src/SDKs/Compute/AzSdk.RP.props +++ b/src/SDKs/Compute/AzSdk.RP.props @@ -1,7 +1,7 @@  - Compute_2018-10-01;Compute_2018-09-30;Compute_2018-06-01;Compute_2017-09-01;ContainerService_2017-01-31; + Compute_2019-03-01;Compute_2018-09-30;Compute_2017-09-01;ContainerService_2017-01-31; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/src/SDKs/Compute/Management.Compute/Generated/AvailabilitySetsOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/AvailabilitySetsOperations.cs index 7d920e3ca3a7c..e37c477a11b8d 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/AvailabilitySetsOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/AvailabilitySetsOperations.cs @@ -105,7 +105,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -313,7 +313,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -511,7 +511,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -687,7 +687,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -867,7 +867,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1050,7 +1050,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1243,7 +1243,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/ComputeManagementClient.cs b/src/SDKs/Compute/Management.Compute/Generated/ComputeManagementClient.cs index 00286b4a0c50f..e1c2399839dcd 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/ComputeManagementClient.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/ComputeManagementClient.cs @@ -81,11 +81,6 @@ public partial class ComputeManagementClient : ServiceClient public virtual IAvailabilitySetsOperations AvailabilitySets { get; private set; } - /// - /// Gets the IProximityPlacementGroupsOperations. - /// - public virtual IProximityPlacementGroupsOperations ProximityPlacementGroups { get; private set; } - /// /// Gets the IVirtualMachineExtensionImagesOperations. /// @@ -136,6 +131,11 @@ public partial class ComputeManagementClient : ServiceClient public virtual IVirtualMachineScaleSetRollingUpgradesOperations VirtualMachineScaleSetRollingUpgrades { get; private set; } + /// + /// Gets the IVirtualMachineScaleSetOperations. + /// + public virtual IVirtualMachineScaleSetOperations VirtualMachineScaleSet { get; private set; } + /// /// Gets the IVirtualMachineScaleSetVMsOperations. /// @@ -429,7 +429,6 @@ private void Initialize() { Operations = new Operations(this); AvailabilitySets = new AvailabilitySetsOperations(this); - ProximityPlacementGroups = new ProximityPlacementGroupsOperations(this); VirtualMachineExtensionImages = new VirtualMachineExtensionImagesOperations(this); VirtualMachineExtensions = new VirtualMachineExtensionsOperations(this); VirtualMachineImages = new VirtualMachineImagesOperations(this); @@ -440,6 +439,7 @@ private void Initialize() VirtualMachineScaleSets = new VirtualMachineScaleSetsOperations(this); VirtualMachineScaleSetExtensions = new VirtualMachineScaleSetExtensionsOperations(this); VirtualMachineScaleSetRollingUpgrades = new VirtualMachineScaleSetRollingUpgradesOperations(this); + VirtualMachineScaleSet = new VirtualMachineScaleSetOperations(this); VirtualMachineScaleSetVMs = new VirtualMachineScaleSetVMsOperations(this); LogAnalytics = new LogAnalyticsOperations(this); VirtualMachineRunCommands = new VirtualMachineRunCommandsOperations(this); diff --git a/src/SDKs/Compute/Management.Compute/Generated/GalleriesOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/GalleriesOperations.cs index 18f8c1a255b68..9d3bca62d1fb7 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/GalleriesOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/GalleriesOperations.cs @@ -121,7 +121,7 @@ internal GalleriesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -330,7 +330,7 @@ internal GalleriesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -508,7 +508,7 @@ internal GalleriesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -711,7 +711,7 @@ internal GalleriesOperations(ComputeManagementClient client) { gallery.Validate(); } - string apiVersion = "2018-06-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -945,7 +945,7 @@ internal GalleriesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/GalleryImageVersionsOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/GalleryImageVersionsOperations.cs index af7d9af8f65e1..ba1a471334644 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/GalleryImageVersionsOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/GalleryImageVersionsOperations.cs @@ -149,7 +149,7 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersionName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -389,7 +389,7 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -615,7 +615,7 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) { galleryImageVersion.Validate(); } - string apiVersion = "2018-06-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -868,7 +868,7 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersionName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/GalleryImagesOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/GalleryImagesOperations.cs index 35234212a3ecf..3a1b279861563 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/GalleryImagesOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/GalleryImagesOperations.cs @@ -133,7 +133,7 @@ internal GalleryImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -356,7 +356,7 @@ internal GalleryImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -571,7 +571,7 @@ internal GalleryImagesOperations(ComputeManagementClient client) { galleryImage.Validate(); } - string apiVersion = "2018-06-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -815,7 +815,7 @@ internal GalleryImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/IComputeManagementClient.cs b/src/SDKs/Compute/Management.Compute/Generated/IComputeManagementClient.cs index 393489305f2de..fca3ebe781706 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/IComputeManagementClient.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/IComputeManagementClient.cs @@ -76,11 +76,6 @@ public partial interface IComputeManagementClient : System.IDisposable /// IAvailabilitySetsOperations AvailabilitySets { get; } - /// - /// Gets the IProximityPlacementGroupsOperations. - /// - IProximityPlacementGroupsOperations ProximityPlacementGroups { get; } - /// /// Gets the IVirtualMachineExtensionImagesOperations. /// @@ -131,6 +126,11 @@ public partial interface IComputeManagementClient : System.IDisposable /// IVirtualMachineScaleSetRollingUpgradesOperations VirtualMachineScaleSetRollingUpgrades { get; } + /// + /// Gets the IVirtualMachineScaleSetOperations. + /// + IVirtualMachineScaleSetOperations VirtualMachineScaleSet { get; } + /// /// Gets the IVirtualMachineScaleSetVMsOperations. /// diff --git a/src/SDKs/Compute/Management.Compute/Generated/IProximityPlacementGroupsOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/IProximityPlacementGroupsOperations.cs deleted file mode 100644 index dbae9809c3ca4..0000000000000 --- a/src/SDKs/Compute/Management.Compute/Generated/IProximityPlacementGroupsOperations.cs +++ /dev/null @@ -1,216 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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; - - /// - /// ProximityPlacementGroupsOperations operations. - /// - public partial interface IProximityPlacementGroupsOperations - { - /// - /// Create or update a proximity placement group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// Parameters supplied to the Create Proximity Placement Group - /// operation. - /// - /// - /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Update a proximity placement group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// Resource tags - /// - /// - /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete a proximity placement group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves information about a proximity placement group . - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// 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 proximityPlacementGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all proximity placement groups in a subscription. - /// - /// - /// 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>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all proximity placement groups in a resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all proximity placement groups in a subscription. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all proximity placement groups in a resource group. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachineScaleSetOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachineScaleSetOperations.cs new file mode 100644 index 0000000000000..bc10aedae175c --- /dev/null +++ b/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachineScaleSetOperations.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +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; + + /// + /// VirtualMachineScaleSetOperations operations. + /// + public partial interface IVirtualMachineScaleSetOperations + { + /// + /// Converts SinglePlacementGroup property to false for a existing + /// virtual machine scale set. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set to create or update. + /// + /// + /// Id of the placement group in which you want future virtual machine + /// instances to be placed. To query placement group Id, please use + /// Virtual Machine Scale Set VMs - Get API. If not provided, the + /// platform will choose one with maximum number of virtual machine + /// instances. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ConvertToSinglePlacementGroupWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string activePlacementGroupId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachineScaleSetVMsOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachineScaleSetVMsOperations.cs index e3301fdc27ad8..7207e9ace55cb 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachineScaleSetVMsOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachineScaleSetVMsOperations.cs @@ -268,6 +268,11 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// The instance ID of the virtual machine. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for + /// this flag indicates non-graceful shutdown whereas false indicates + /// otherwise. Default value for this flag is false if not specified + /// /// /// The headers that will be added to request. /// @@ -280,7 +285,7 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when a required parameter is null /// - Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Restarts a virtual machine in a VM scale set. /// @@ -569,6 +574,11 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// The instance ID of the virtual machine. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for + /// this flag indicates non-graceful shutdown whereas false indicates + /// otherwise. Default value for this flag is false if not specified + /// /// /// The headers that will be added to request. /// @@ -581,7 +591,7 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when a required parameter is null /// - Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Restarts a virtual machine in a VM scale set. /// diff --git a/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachineScaleSetsOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachineScaleSetsOperations.cs index 31b717a0f7466..10a10435f50f3 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachineScaleSetsOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachineScaleSetsOperations.cs @@ -313,6 +313,11 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// The name of the VM scale set. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for + /// this flag indicates non-graceful shutdown whereas false indicates + /// otherwise. Default value for this flag is false if not specified + /// /// /// The virtual machine scale set instance ids. Omitting the virtual /// machine scale set instance ids will result in the operation being @@ -330,7 +335,7 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when a required parameter is null /// - Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? skipShutdown = false, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Restarts one or more virtual machines in a VM scale set. /// @@ -701,6 +706,11 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// The name of the VM scale set. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for + /// this flag indicates non-graceful shutdown whereas false indicates + /// otherwise. Default value for this flag is false if not specified + /// /// /// The virtual machine scale set instance ids. Omitting the virtual /// machine scale set instance ids will result in the operation being @@ -718,7 +728,7 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when a required parameter is null /// - Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? skipShutdown = false, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Restarts one or more virtual machines in a VM scale set. /// diff --git a/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachinesOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachinesOperations.cs index 8ea1b72368d66..49d605b45ad11 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachinesOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/IVirtualMachinesOperations.cs @@ -362,6 +362,11 @@ public partial interface IVirtualMachinesOperations /// /// The name of the virtual machine. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for + /// this flag indicates non-graceful shutdown whereas false indicates + /// otherwise. Default value for this flag is false if not specified + /// /// /// The headers that will be added to request. /// @@ -374,7 +379,7 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when a required parameter is null /// - Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to restart a virtual machine. /// @@ -683,6 +688,11 @@ public partial interface IVirtualMachinesOperations /// /// The name of the virtual machine. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for + /// this flag indicates non-graceful shutdown whereas false indicates + /// otherwise. Default value for this flag is false if not specified + /// /// /// The headers that will be added to request. /// @@ -695,7 +705,7 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when a required parameter is null /// - Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to restart a virtual machine. /// diff --git a/src/SDKs/Compute/Management.Compute/Generated/ImagesOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/ImagesOperations.cs index 5e4ce6a06868a..30e8f9cd9afec 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/ImagesOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/ImagesOperations.cs @@ -169,7 +169,7 @@ internal ImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -361,7 +361,7 @@ internal ImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -541,7 +541,7 @@ internal ImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -742,7 +742,7 @@ internal ImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -968,7 +968,7 @@ internal ImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1184,7 +1184,7 @@ internal ImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/LogAnalyticsOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/LogAnalyticsOperations.cs index 9bf47eb41599f..0246ea672b270 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/LogAnalyticsOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/LogAnalyticsOperations.cs @@ -152,7 +152,7 @@ internal LogAnalyticsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,7 +363,7 @@ internal LogAnalyticsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/AvailabilitySet.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/AvailabilitySet.cs index 996056f68bb6f..9576acb9998e8 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/Models/AvailabilitySet.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/AvailabilitySet.cs @@ -55,23 +55,18 @@ public AvailabilitySet() /// Fault Domain count. /// A list of references to all virtual /// machines in the availability set. - /// Specifies information about - /// the proximity placement group that the availability set should be - /// assigned to. <br><br>Minimum api-version: - /// 2018-04-01. /// The resource status information. /// Sku of the availability set, only name is /// required to be set. See AvailabilitySetSkuTypes for possible set of /// values. Use 'Aligned' for virtual machines with managed disks and /// 'Classic' for virtual machines with unmanaged disks. Default value /// is 'Classic'. - public AvailabilitySet(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), IList virtualMachines = default(IList), SubResource proximityPlacementGroup = default(SubResource), IList statuses = default(IList), Sku sku = default(Sku)) + public AvailabilitySet(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), IList virtualMachines = default(IList), IList statuses = default(IList), Sku sku = default(Sku)) : base(location, id, name, type, tags) { PlatformUpdateDomainCount = platformUpdateDomainCount; PlatformFaultDomainCount = platformFaultDomainCount; VirtualMachines = virtualMachines; - ProximityPlacementGroup = proximityPlacementGroup; Statuses = statuses; Sku = sku; CustomInit(); @@ -101,15 +96,6 @@ public AvailabilitySet() [JsonProperty(PropertyName = "properties.virtualMachines")] public IList VirtualMachines { get; set; } - /// - /// Gets or sets specifies information about the proximity placement - /// group that the availability set should be assigned to. - /// &lt;br&gt;&lt;br&gt;Minimum api-version: - /// 2018-04-01. - /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] - public SubResource ProximityPlacementGroup { get; set; } - /// /// Gets the resource status information. /// diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/AvailabilitySetUpdate.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/AvailabilitySetUpdate.cs index 7249426adf54e..051a2c67c6cbc 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/Models/AvailabilitySetUpdate.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/AvailabilitySetUpdate.cs @@ -41,19 +41,14 @@ public AvailabilitySetUpdate() /// Fault Domain count. /// A list of references to all virtual /// machines in the availability set. - /// Specifies information about - /// the proximity placement group that the availability set should be - /// assigned to. <br><br>Minimum api-version: - /// 2018-04-01. /// The resource status information. /// Sku of the availability set - public AvailabilitySetUpdate(IDictionary tags = default(IDictionary), int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), IList virtualMachines = default(IList), SubResource proximityPlacementGroup = default(SubResource), IList statuses = default(IList), Sku sku = default(Sku)) + public AvailabilitySetUpdate(IDictionary tags = default(IDictionary), int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), IList virtualMachines = default(IList), IList statuses = default(IList), Sku sku = default(Sku)) : base(tags) { PlatformUpdateDomainCount = platformUpdateDomainCount; PlatformFaultDomainCount = platformFaultDomainCount; VirtualMachines = virtualMachines; - ProximityPlacementGroup = proximityPlacementGroup; Statuses = statuses; Sku = sku; CustomInit(); @@ -83,15 +78,6 @@ public AvailabilitySetUpdate() [JsonProperty(PropertyName = "properties.virtualMachines")] public IList VirtualMachines { get; set; } - /// - /// Gets or sets specifies information about the proximity placement - /// group that the availability set should be assigned to. - /// &lt;br&gt;&lt;br&gt;Minimum api-version: - /// 2018-04-01. - /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] - public SubResource ProximityPlacementGroup { get; set; } - /// /// Gets the resource status information. /// diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/GalleryImageVersionPublishingProfile.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/GalleryImageVersionPublishingProfile.cs index 1acb6d0af07a2..4fd577dc36da0 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/Models/GalleryImageVersionPublishingProfile.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/GalleryImageVersionPublishingProfile.cs @@ -48,13 +48,17 @@ public GalleryImageVersionPublishingProfile() /// The end of life date of the gallery /// Image Version. This property can be used for decommissioning /// purposes. This property is updatable. - public GalleryImageVersionPublishingProfile(GalleryArtifactSource source, IList targetRegions = default(IList), int? replicaCount = default(int?), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?)) + /// Specifies the storage account type + /// to be used to store the image. This property is not updatable. + /// Possible values include: 'Standard_LRS', 'Standard_ZRS' + public GalleryImageVersionPublishingProfile(GalleryArtifactSource source, IList targetRegions = default(IList), int? replicaCount = default(int?), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), string storageAccountType = default(string)) : base(source, targetRegions) { ReplicaCount = replicaCount; ExcludeFromLatest = excludeFromLatest; PublishedDate = publishedDate; EndOfLifeDate = endOfLifeDate; + StorageAccountType = storageAccountType; CustomInit(); } @@ -94,6 +98,14 @@ public GalleryImageVersionPublishingProfile() [JsonProperty(PropertyName = "endOfLifeDate")] public System.DateTime? EndOfLifeDate { get; set; } + /// + /// Gets or sets specifies the storage account type to be used to store + /// the image. This property is not updatable. Possible values include: + /// 'Standard_LRS', 'Standard_ZRS' + /// + [JsonProperty(PropertyName = "storageAccountType")] + public string StorageAccountType { get; set; } + /// /// Validate the object. /// diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/ProximityPlacementGroup.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/ProximityPlacementGroup.cs deleted file mode 100644 index ab6d2f16a1d4b..0000000000000 --- a/src/SDKs/Compute/Management.Compute/Generated/Models/ProximityPlacementGroup.cs +++ /dev/null @@ -1,110 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Specifies information about the proximity placement group. - /// - [Rest.Serialization.JsonTransformation] - public partial class ProximityPlacementGroup : Resource - { - /// - /// Initializes a new instance of the ProximityPlacementGroup class. - /// - public ProximityPlacementGroup() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ProximityPlacementGroup class. - /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// Specifies the type of the - /// proximity placement group. <br><br> Possible values - /// are: <br><br> **Standard** <br><br> - /// **Ultra**. Possible values include: 'Standard', 'Ultra' - /// A list of references to all virtual - /// machines in the proximity placement group. - /// A list of references to all - /// virtual machine scale sets in the proximity placement - /// group. - /// A list of references to all - /// availability sets in the proximity placement group. - public ProximityPlacementGroup(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string proximityPlacementGroupType = default(string), IList virtualMachines = default(IList), IList virtualMachineScaleSets = default(IList), IList availabilitySets = default(IList)) - : base(location, id, name, type, tags) - { - ProximityPlacementGroupType = proximityPlacementGroupType; - VirtualMachines = virtualMachines; - VirtualMachineScaleSets = virtualMachineScaleSets; - AvailabilitySets = availabilitySets; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets specifies the type of the proximity placement group. - /// &lt;br&gt;&lt;br&gt; Possible values are: - /// &lt;br&gt;&lt;br&gt; **Standard** - /// &lt;br&gt;&lt;br&gt; **Ultra**. Possible values - /// include: 'Standard', 'Ultra' - /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroupType")] - public string ProximityPlacementGroupType { get; set; } - - /// - /// Gets a list of references to all virtual machines in the proximity - /// placement group. - /// - [JsonProperty(PropertyName = "properties.virtualMachines")] - public IList VirtualMachines { get; private set; } - - /// - /// Gets a list of references to all virtual machine scale sets in the - /// proximity placement group. - /// - [JsonProperty(PropertyName = "properties.virtualMachineScaleSets")] - public IList VirtualMachineScaleSets { get; private set; } - - /// - /// Gets a list of references to all availability sets in the proximity - /// placement group. - /// - [JsonProperty(PropertyName = "properties.availabilitySets")] - public IList AvailabilitySets { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/ProximityPlacementGroupUpdate.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/ProximityPlacementGroupUpdate.cs deleted file mode 100644 index 0343a07d68f68..0000000000000 --- a/src/SDKs/Compute/Management.Compute/Generated/Models/ProximityPlacementGroupUpdate.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Specifies information about the proximity placement group. - /// - public partial class ProximityPlacementGroupUpdate : UpdateResource - { - /// - /// Initializes a new instance of the ProximityPlacementGroupUpdate - /// class. - /// - public ProximityPlacementGroupUpdate() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ProximityPlacementGroupUpdate - /// class. - /// - /// Resource tags - public ProximityPlacementGroupUpdate(IDictionary tags = default(IDictionary)) - : base(tags) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - } -} diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/ProximityPlacementGroupType.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/StorageAccountType.cs similarity index 69% rename from src/SDKs/Compute/Management.Compute/Generated/Models/ProximityPlacementGroupType.cs rename to src/SDKs/Compute/Management.Compute/Generated/Models/StorageAccountType.cs index 9d5fc54330490..7bb338ee5e2a0 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/Models/ProximityPlacementGroupType.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/StorageAccountType.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.Compute.Models { /// - /// Defines values for ProximityPlacementGroupType. + /// Defines values for StorageAccountType. /// - public static class ProximityPlacementGroupType + public static class StorageAccountType { - public const string Standard = "Standard"; - public const string Ultra = "Ultra"; + public const string StandardLRS = "Standard_LRS"; + public const string StandardZRS = "Standard_ZRS"; } } diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/TargetRegion.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/TargetRegion.cs index 4179cf259b098..8e331c042ccda 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/Models/TargetRegion.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/TargetRegion.cs @@ -34,10 +34,14 @@ public TargetRegion() /// The number of replicas of the /// Image Version to be created per region. This property is /// updatable. - public TargetRegion(string name, int? regionalReplicaCount = default(int?)) + /// Specifies the storage account type + /// to be used to store the image. This property is not updatable. + /// Possible values include: 'Standard_LRS', 'Standard_ZRS' + public TargetRegion(string name, int? regionalReplicaCount = default(int?), string storageAccountType = default(string)) { Name = name; RegionalReplicaCount = regionalReplicaCount; + StorageAccountType = storageAccountType; CustomInit(); } @@ -59,6 +63,14 @@ public TargetRegion() [JsonProperty(PropertyName = "regionalReplicaCount")] public int? RegionalReplicaCount { get; set; } + /// + /// Gets or sets specifies the storage account type to be used to store + /// the image. This property is not updatable. Possible values include: + /// 'Standard_LRS', 'Standard_ZRS' + /// + [JsonProperty(PropertyName = "storageAccountType")] + public string StorageAccountType { get; set; } + /// /// Validate the object. /// diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/VMScaleSetConvertToSinglePlacementGroupInput.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/VMScaleSetConvertToSinglePlacementGroupInput.cs new file mode 100644 index 0000000000000..b2955a8cb32da --- /dev/null +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/VMScaleSetConvertToSinglePlacementGroupInput.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class VMScaleSetConvertToSinglePlacementGroupInput + { + /// + /// Initializes a new instance of the + /// VMScaleSetConvertToSinglePlacementGroupInput class. + /// + public VMScaleSetConvertToSinglePlacementGroupInput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// VMScaleSetConvertToSinglePlacementGroupInput class. + /// + /// Id of the placement group in + /// which you want future virtual machine instances to be placed. To + /// query placement group Id, please use Virtual Machine Scale Set VMs + /// - Get API. If not provided, the platform will choose one with + /// maximum number of virtual machine instances. + public VMScaleSetConvertToSinglePlacementGroupInput(string activePlacementGroupId = default(string)) + { + ActivePlacementGroupId = activePlacementGroupId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets id of the placement group in which you want future + /// virtual machine instances to be placed. To query placement group + /// Id, please use Virtual Machine Scale Set VMs - Get API. If not + /// provided, the platform will choose one with maximum number of + /// virtual machine instances. + /// + [JsonProperty(PropertyName = "activePlacementGroupId")] + public string ActivePlacementGroupId { get; set; } + + } +} diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachine.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachine.cs index 851477f35b4d5..a103de40463e6 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachine.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachine.cs @@ -72,10 +72,6 @@ public VirtualMachine() /// <br><br> Currently, a VM can only be added to /// availability set at creation time. An existing VM cannot be added /// to an availability set. - /// Specifies information about - /// the proximity placement group that the virtual machine should be - /// assigned to. <br><br>Minimum api-version: - /// 2018-04-01. /// The provisioning state, which only /// appears in the response. /// The virtual machine instance @@ -99,7 +95,7 @@ public VirtualMachine() /// 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), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), IList resources = default(IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) + 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), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), IList resources = default(IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) : base(location, id, name, type, tags) { Plan = plan; @@ -110,7 +106,6 @@ public VirtualMachine() NetworkProfile = networkProfile; DiagnosticsProfile = diagnosticsProfile; AvailabilitySet = availabilitySet; - ProximityPlacementGroup = proximityPlacementGroup; ProvisioningState = provisioningState; InstanceView = instanceView; LicenseType = licenseType; @@ -199,15 +194,6 @@ public VirtualMachine() [JsonProperty(PropertyName = "properties.availabilitySet")] public SubResource AvailabilitySet { get; set; } - /// - /// Gets or sets specifies information about the proximity placement - /// group that the virtual machine should be assigned to. - /// &lt;br&gt;&lt;br&gt;Minimum api-version: - /// 2018-04-01. - /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] - public SubResource ProximityPlacementGroup { get; set; } - /// /// Gets the provisioning state, which only appears in the response. /// diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSet.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSet.cs index 7a1550e99da68..761d55af01ad3 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSet.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSet.cs @@ -54,6 +54,11 @@ public VirtualMachineScaleSet() /// appears in the response. /// Specifies whether the Virtual Machine /// Scale Set should be overprovisioned. + /// When + /// Overprovision is enabled, extensions are launched only on the + /// requested number of VMs which are finally kept. This property will + /// hence ensure that the extensions do not run on the extra + /// overprovisioned VMs. /// Specifies the ID which uniquely identifies a /// Virtual Machine Scale Set. /// When true this limits the scale @@ -64,14 +69,10 @@ public VirtualMachineScaleSet() /// outage. /// Fault Domain count for each /// placement group. - /// Specifies information about - /// the proximity placement group that the virtual machine scale set - /// should be assigned to. <br><br>Minimum api-version: - /// 2018-04-01. /// The identity of the virtual machine scale /// set, if configured. /// The virtual machine scale set zones. - public VirtualMachineScaleSet(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), Plan plan = default(Plan), UpgradePolicy upgradePolicy = default(UpgradePolicy), VirtualMachineScaleSetVMProfile virtualMachineProfile = default(VirtualMachineScaleSetVMProfile), string provisioningState = default(string), bool? overprovision = default(bool?), string uniqueId = default(string), bool? singlePlacementGroup = default(bool?), bool? zoneBalance = default(bool?), int? platformFaultDomainCount = default(int?), SubResource proximityPlacementGroup = default(SubResource), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity), IList zones = default(IList)) + public VirtualMachineScaleSet(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), Plan plan = default(Plan), UpgradePolicy upgradePolicy = default(UpgradePolicy), VirtualMachineScaleSetVMProfile virtualMachineProfile = default(VirtualMachineScaleSetVMProfile), string provisioningState = default(string), bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVMs = default(bool?), string uniqueId = default(string), bool? singlePlacementGroup = default(bool?), bool? zoneBalance = default(bool?), int? platformFaultDomainCount = default(int?), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity), IList zones = default(IList)) : base(location, id, name, type, tags) { Sku = sku; @@ -80,11 +81,11 @@ public VirtualMachineScaleSet() VirtualMachineProfile = virtualMachineProfile; ProvisioningState = provisioningState; Overprovision = overprovision; + DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; UniqueId = uniqueId; SinglePlacementGroup = singlePlacementGroup; ZoneBalance = zoneBalance; PlatformFaultDomainCount = platformFaultDomainCount; - ProximityPlacementGroup = proximityPlacementGroup; Identity = identity; Zones = zones; CustomInit(); @@ -138,6 +139,15 @@ public VirtualMachineScaleSet() [JsonProperty(PropertyName = "properties.overprovision")] public bool? Overprovision { get; set; } + /// + /// Gets or sets when Overprovision is enabled, extensions are launched + /// only on the requested number of VMs which are finally kept. This + /// property will hence ensure that the extensions do not run on the + /// extra overprovisioned VMs. + /// + [JsonProperty(PropertyName = "properties.doNotRunExtensionsOnOverprovisionedVMs")] + public bool? DoNotRunExtensionsOnOverprovisionedVMs { get; set; } + /// /// Gets specifies the ID which uniquely identifies a Virtual Machine /// Scale Set. @@ -165,15 +175,6 @@ public VirtualMachineScaleSet() [JsonProperty(PropertyName = "properties.platformFaultDomainCount")] public int? PlatformFaultDomainCount { get; set; } - /// - /// Gets or sets specifies information about the proximity placement - /// group that the virtual machine scale set should be assigned to. - /// &lt;br&gt;&lt;br&gt;Minimum api-version: - /// 2018-04-01. - /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] - public SubResource ProximityPlacementGroup { get; set; } - /// /// Gets or sets the identity of the virtual machine scale set, if /// configured. diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSetVM.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSetVM.cs index 4ca9bb307f6a8..26dbda4597c2c 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSetVM.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSetVM.cs @@ -59,6 +59,8 @@ public VirtualMachineScaleSetVM() /// the virtual machine. /// Specifies the network interfaces of /// the virtual machine. + /// Specifies the network + /// profile configuration of the virtual machine. /// Specifies the boot diagnostic /// settings state. <br><br>Minimum api-version: /// 2015-06-15. @@ -88,6 +90,11 @@ public VirtualMachineScaleSetVM() /// [Azure Hybrid Use Benefit for Windows /// Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) /// <br><br> Minimum api-version: 2015-06-15 + /// Specifies whether the model + /// applied to the virtual machine is the model of the virtual machine + /// scale set or the customized model for the virtual machine. + /// Specifies the protection policy of + /// the virtual machine. /// 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 @@ -98,7 +105,7 @@ public VirtualMachineScaleSetVM() /// The virtual machine child extension /// resources. /// The virtual machine zones. - public VirtualMachineScaleSetVM(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string instanceId = default(string), Sku sku = default(Sku), bool? latestModelApplied = default(bool?), string vmId = default(string), VirtualMachineScaleSetVMInstanceView instanceView = default(VirtualMachineScaleSetVMInstanceView), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), string provisioningState = default(string), string licenseType = default(string), Plan plan = default(Plan), IList resources = default(IList), IList zones = default(IList)) + public VirtualMachineScaleSetVM(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string instanceId = default(string), Sku sku = default(Sku), bool? latestModelApplied = default(bool?), string vmId = default(string), VirtualMachineScaleSetVMInstanceView instanceView = default(VirtualMachineScaleSetVMInstanceView), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration = default(VirtualMachineScaleSetVMNetworkProfileConfiguration), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), string provisioningState = default(string), string licenseType = default(string), string modelDefinitionApplied = default(string), VirtualMachineScaleSetVMProtectionPolicy protectionPolicy = default(VirtualMachineScaleSetVMProtectionPolicy), Plan plan = default(Plan), IList resources = default(IList), IList zones = default(IList)) : base(location, id, name, type, tags) { InstanceId = instanceId; @@ -111,10 +118,13 @@ public VirtualMachineScaleSetVM() AdditionalCapabilities = additionalCapabilities; OsProfile = osProfile; NetworkProfile = networkProfile; + NetworkProfileConfiguration = networkProfileConfiguration; DiagnosticsProfile = diagnosticsProfile; AvailabilitySet = availabilitySet; ProvisioningState = provisioningState; LicenseType = licenseType; + ModelDefinitionApplied = modelDefinitionApplied; + ProtectionPolicy = protectionPolicy; Plan = plan; Resources = resources; Zones = zones; @@ -194,6 +204,13 @@ public VirtualMachineScaleSetVM() [JsonProperty(PropertyName = "properties.networkProfile")] public NetworkProfile NetworkProfile { get; set; } + /// + /// Gets or sets specifies the network profile configuration of the + /// virtual machine. + /// + [JsonProperty(PropertyName = "properties.networkProfileConfiguration")] + public VirtualMachineScaleSetVMNetworkProfileConfiguration NetworkProfileConfiguration { get; set; } + /// /// Gets or sets specifies the boot diagnostic settings state. /// &lt;br&gt;&lt;br&gt;Minimum api-version: @@ -244,6 +261,21 @@ public VirtualMachineScaleSetVM() [JsonProperty(PropertyName = "properties.licenseType")] public string LicenseType { get; set; } + /// + /// Gets specifies whether the model applied to the virtual machine is + /// the model of the virtual machine scale set or the customized model + /// for the virtual machine. + /// + [JsonProperty(PropertyName = "properties.modelDefinitionApplied")] + public string ModelDefinitionApplied { get; private set; } + + /// + /// Gets or sets specifies the protection policy of the virtual + /// machine. + /// + [JsonProperty(PropertyName = "properties.protectionPolicy")] + public VirtualMachineScaleSetVMProtectionPolicy ProtectionPolicy { get; set; } + /// /// Gets or sets specifies information about the marketplace image used /// to create the virtual machine. This element is only used for diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSetVMNetworkProfileConfiguration.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSetVMNetworkProfileConfiguration.cs new file mode 100644 index 0000000000000..f8e141cdd2b98 --- /dev/null +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSetVMNetworkProfileConfiguration.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes a virtual machine scale set VM network profile. + /// + public partial class VirtualMachineScaleSetVMNetworkProfileConfiguration + { + /// + /// Initializes a new instance of the + /// VirtualMachineScaleSetVMNetworkProfileConfiguration class. + /// + public VirtualMachineScaleSetVMNetworkProfileConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// VirtualMachineScaleSetVMNetworkProfileConfiguration class. + /// + /// The list of network + /// configurations. + public VirtualMachineScaleSetVMNetworkProfileConfiguration(IList networkInterfaceConfigurations = default(IList)) + { + NetworkInterfaceConfigurations = networkInterfaceConfigurations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list of network configurations. + /// + [JsonProperty(PropertyName = "networkInterfaceConfigurations")] + public IList NetworkInterfaceConfigurations { get; set; } + + } +} diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSetVMProtectionPolicy.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSetVMProtectionPolicy.cs new file mode 100644 index 0000000000000..73637dcff1c88 --- /dev/null +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineScaleSetVMProtectionPolicy.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The protection policy of a virtual machine scale set VM. + /// + public partial class VirtualMachineScaleSetVMProtectionPolicy + { + /// + /// Initializes a new instance of the + /// VirtualMachineScaleSetVMProtectionPolicy class. + /// + public VirtualMachineScaleSetVMProtectionPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// VirtualMachineScaleSetVMProtectionPolicy class. + /// + /// Indicates that the virtual machine + /// scale set VM shouldn't be considered for deletion during a scale-in + /// operation. + /// Indicates that model + /// updates or actions (including scale-in) initiated on the virtual + /// machine scale set should not be applied to the virtual machine + /// scale set VM. + public VirtualMachineScaleSetVMProtectionPolicy(bool? protectFromScaleIn = default(bool?), bool? protectFromScaleSetActions = default(bool?)) + { + ProtectFromScaleIn = protectFromScaleIn; + ProtectFromScaleSetActions = protectFromScaleSetActions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates that the virtual machine scale set VM + /// shouldn't be considered for deletion during a scale-in operation. + /// + [JsonProperty(PropertyName = "protectFromScaleIn")] + public bool? ProtectFromScaleIn { get; set; } + + /// + /// Gets or sets indicates that model updates or actions (including + /// scale-in) initiated on the virtual machine scale set should not be + /// applied to the virtual machine scale set VM. + /// + [JsonProperty(PropertyName = "protectFromScaleSetActions")] + public bool? ProtectFromScaleSetActions { get; set; } + + } +} diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineUpdate.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineUpdate.cs index f2298eea32d80..b1b1f4a66e168 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineUpdate.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineUpdate.cs @@ -68,10 +68,6 @@ public VirtualMachineUpdate() /// <br><br> Currently, a VM can only be added to /// availability set at creation time. An existing VM cannot be added /// to an availability set. - /// Specifies information about - /// the proximity placement group that the virtual machine should be - /// assigned to. <br><br>Minimum api-version: - /// 2018-04-01. /// The provisioning state, which only /// appears in the response. /// The virtual machine instance @@ -93,7 +89,7 @@ public VirtualMachineUpdate() /// 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), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) + 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), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) : base(tags) { Plan = plan; @@ -104,7 +100,6 @@ public VirtualMachineUpdate() NetworkProfile = networkProfile; DiagnosticsProfile = diagnosticsProfile; AvailabilitySet = availabilitySet; - ProximityPlacementGroup = proximityPlacementGroup; ProvisioningState = provisioningState; InstanceView = instanceView; LicenseType = licenseType; @@ -192,15 +187,6 @@ public VirtualMachineUpdate() [JsonProperty(PropertyName = "properties.availabilitySet")] public SubResource AvailabilitySet { get; set; } - /// - /// Gets or sets specifies information about the proximity placement - /// group that the virtual machine should be assigned to. - /// &lt;br&gt;&lt;br&gt;Minimum api-version: - /// 2018-04-01. - /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] - public SubResource ProximityPlacementGroup { get; set; } - /// /// Gets the provisioning state, which only appears in the response. /// diff --git a/src/SDKs/Compute/Management.Compute/Generated/Operations.cs b/src/SDKs/Compute/Management.Compute/Generated/Operations.cs index 1e22ea9fcce71..8c2104e84ef84 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/Operations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/Operations.cs @@ -70,7 +70,7 @@ internal Operations(ComputeManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/ProximityPlacementGroupsOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/ProximityPlacementGroupsOperations.cs deleted file mode 100644 index 1b45dc6dd70e7..0000000000000 --- a/src/SDKs/Compute/Management.Compute/Generated/ProximityPlacementGroupsOperations.cs +++ /dev/null @@ -1,1567 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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; - - /// - /// ProximityPlacementGroupsOperations operations. - /// - internal partial class ProximityPlacementGroupsOperations : IServiceOperations, IProximityPlacementGroupsOperations - { - /// - /// Initializes a new instance of the ProximityPlacementGroupsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ProximityPlacementGroupsOperations(ComputeManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ComputeManagementClient - /// - public ComputeManagementClient Client { get; private set; } - - /// - /// Create or update a proximity placement group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// Parameters supplied to the Create Proximity Placement Group operation. - /// - /// - /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (proximityPlacementGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "proximityPlacementGroupName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2018-10-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("proximityPlacementGroupName", proximityPlacementGroupName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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/proximityPlacementGroups/{proximityPlacementGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{proximityPlacementGroupName}", System.Uri.EscapeDataString(proximityPlacementGroupName)); - _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("PUT"); - _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; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // 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 && (int)_statusCode != 201) - { - 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); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _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; - } - - /// - /// Update a proximity placement group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// Resource tags - /// - /// - /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (proximityPlacementGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "proximityPlacementGroupName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2018-10-01"; - ProximityPlacementGroupUpdate parameters = new ProximityPlacementGroupUpdate(); - if (tags != null) - { - parameters.Tags = tags; - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("proximityPlacementGroupName", proximityPlacementGroupName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", 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/proximityPlacementGroups/{proximityPlacementGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{proximityPlacementGroupName}", System.Uri.EscapeDataString(proximityPlacementGroupName)); - _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("PATCH"); - _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; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // 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; - } - - /// - /// Delete a proximity placement group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (proximityPlacementGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "proximityPlacementGroupName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2018-10-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("proximityPlacementGroupName", proximityPlacementGroupName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", 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/proximityPlacementGroups/{proximityPlacementGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{proximityPlacementGroupName}", System.Uri.EscapeDataString(proximityPlacementGroupName)); - _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("DELETE"); - _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(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves information about a proximity placement group . - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// 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 proximityPlacementGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (proximityPlacementGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "proximityPlacementGroupName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2018-10-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("proximityPlacementGroupName", proximityPlacementGroupName); - 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/proximityPlacementGroups/{proximityPlacementGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{proximityPlacementGroupName}", System.Uri.EscapeDataString(proximityPlacementGroupName)); - _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; - } - - /// - /// Lists all proximity placement groups in a subscription. - /// - /// - /// 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>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2018-10-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups").ToString(); - _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; - } - - /// - /// Lists all proximity placement groups in a resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2018-10-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("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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/proximityPlacementGroups").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _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; - } - - /// - /// Lists all proximity placement groups in a subscription. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - 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; - } - - /// - /// Lists all proximity placement groups in a resource group. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - 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/src/SDKs/Compute/Management.Compute/Generated/ProximityPlacementGroupsOperationsExtensions.cs b/src/SDKs/Compute/Management.Compute/Generated/ProximityPlacementGroupsOperationsExtensions.cs deleted file mode 100644 index 189e7609ad499..0000000000000 --- a/src/SDKs/Compute/Management.Compute/Generated/ProximityPlacementGroupsOperationsExtensions.cs +++ /dev/null @@ -1,326 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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 ProximityPlacementGroupsOperations. - /// - public static partial class ProximityPlacementGroupsOperationsExtensions - { - /// - /// Create or update a proximity placement group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// Parameters supplied to the Create Proximity Placement Group operation. - /// - public static ProximityPlacementGroup CreateOrUpdate(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroup parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, proximityPlacementGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create or update a proximity placement group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// Parameters supplied to the Create Proximity Placement Group operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, proximityPlacementGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a proximity placement group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// Resource tags - /// - public static ProximityPlacementGroup Update(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, IDictionary tags = default(IDictionary)) - { - return operations.UpdateAsync(resourceGroupName, proximityPlacementGroupName, tags).GetAwaiter().GetResult(); - } - - /// - /// Update a proximity placement group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// Resource tags - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, proximityPlacementGroupName, tags, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a proximity placement group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - public static void Delete(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName) - { - operations.DeleteAsync(resourceGroupName, proximityPlacementGroupName).GetAwaiter().GetResult(); - } - - /// - /// Delete a proximity placement group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, proximityPlacementGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Retrieves information about a proximity placement group . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - public static ProximityPlacementGroup Get(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName) - { - return operations.GetAsync(resourceGroupName, proximityPlacementGroupName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves information about a proximity placement group . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, proximityPlacementGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all proximity placement groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListBySubscription(this IProximityPlacementGroupsOperations operations) - { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all proximity placement groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IProximityPlacementGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all proximity placement groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IProximityPlacementGroupsOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all proximity placement groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all proximity placement groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IProximityPlacementGroupsOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all proximity placement groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this IProximityPlacementGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all proximity placement groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IProximityPlacementGroupsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all proximity placement groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IProximityPlacementGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/SDKs/Compute/Management.Compute/Generated/SdkInfo_ComputeManagementClient.cs b/src/SDKs/Compute/Management.Compute/Generated/SdkInfo_ComputeManagementClient.cs index 67f2233ea328e..a26709004e2f1 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/SdkInfo_ComputeManagementClient.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/SdkInfo_ComputeManagementClient.cs @@ -19,28 +19,28 @@ public static IEnumerable> ApiInfo_ComputeManageme { return new Tuple[] { - new Tuple("Compute", "AvailabilitySets", "2018-10-01"), + new Tuple("Compute", "AvailabilitySets", "2019-03-01"), new Tuple("Compute", "Disks", "2018-09-30"), - new Tuple("Compute", "Galleries", "2018-06-01"), - new Tuple("Compute", "GalleryImageVersions", "2018-06-01"), - new Tuple("Compute", "GalleryImages", "2018-06-01"), - new Tuple("Compute", "Images", "2018-10-01"), - new Tuple("Compute", "LogAnalytics", "2018-10-01"), - new Tuple("Compute", "Operations", "2018-10-01"), - new Tuple("Compute", "ProximityPlacementGroups", "2018-10-01"), + new Tuple("Compute", "Galleries", "2019-03-01"), + new Tuple("Compute", "GalleryImageVersions", "2019-03-01"), + new Tuple("Compute", "GalleryImages", "2019-03-01"), + new Tuple("Compute", "Images", "2019-03-01"), + new Tuple("Compute", "LogAnalytics", "2019-03-01"), + new Tuple("Compute", "Operations", "2019-03-01"), new Tuple("Compute", "ResourceSkus", "2017-09-01"), new Tuple("Compute", "Snapshots", "2018-09-30"), - new Tuple("Compute", "Usage", "2018-10-01"), - new Tuple("Compute", "VirtualMachineExtensionImages", "2018-10-01"), - new Tuple("Compute", "VirtualMachineExtensions", "2018-10-01"), - new Tuple("Compute", "VirtualMachineImages", "2018-10-01"), - new Tuple("Compute", "VirtualMachineRunCommands", "2018-10-01"), - new Tuple("Compute", "VirtualMachineScaleSetExtensions", "2018-10-01"), - new Tuple("Compute", "VirtualMachineScaleSetRollingUpgrades", "2018-10-01"), - new Tuple("Compute", "VirtualMachineScaleSetVMs", "2018-10-01"), - new Tuple("Compute", "VirtualMachineScaleSets", "2018-10-01"), - new Tuple("Compute", "VirtualMachineSizes", "2018-10-01"), - new Tuple("Compute", "VirtualMachines", "2018-10-01"), + new Tuple("Compute", "Usage", "2019-03-01"), + new Tuple("Compute", "VirtualMachineExtensionImages", "2019-03-01"), + new Tuple("Compute", "VirtualMachineExtensions", "2019-03-01"), + new Tuple("Compute", "VirtualMachineImages", "2019-03-01"), + new Tuple("Compute", "VirtualMachineRunCommands", "2019-03-01"), + new Tuple("Compute", "VirtualMachineScaleSet", "2019-03-01"), + new Tuple("Compute", "VirtualMachineScaleSetExtensions", "2019-03-01"), + new Tuple("Compute", "VirtualMachineScaleSetRollingUpgrades", "2019-03-01"), + new Tuple("Compute", "VirtualMachineScaleSetVMs", "2019-03-01"), + new Tuple("Compute", "VirtualMachineScaleSets", "2019-03-01"), + new Tuple("Compute", "VirtualMachineSizes", "2019-03-01"), + new Tuple("Compute", "VirtualMachines", "2019-03-01"), new Tuple("ContainerService", "ContainerServices", "2017-01-31"), }.AsEnumerable(); } diff --git a/src/SDKs/Compute/Management.Compute/Generated/UsageOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/UsageOperations.cs index 29d849fb4e74d..3d7e35cec396d 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/UsageOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/UsageOperations.cs @@ -96,7 +96,7 @@ internal UsageOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineExtensionImagesOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineExtensionImagesOperations.cs index 23f69a8d3ab44..fc0ed6255f6b2 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineExtensionImagesOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineExtensionImagesOperations.cs @@ -106,7 +106,7 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -303,7 +303,7 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -505,7 +505,7 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineExtensionsOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineExtensionsOperations.cs index 8573d2ff12694..10f1939ddc35f 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineExtensionsOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineExtensionsOperations.cs @@ -186,7 +186,7 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -390,7 +390,7 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -608,7 +608,7 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -843,7 +843,7 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1050,7 +1050,7 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineImagesOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineImagesOperations.cs index cccb49d3ecd74..d6eee87d187e3 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineImagesOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineImagesOperations.cs @@ -116,7 +116,7 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -334,7 +334,7 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -542,7 +542,7 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -730,7 +730,7 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -930,7 +930,7 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineRunCommandsOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineRunCommandsOperations.cs index 6c4aa38680631..1682e6d4c7816 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineRunCommandsOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineRunCommandsOperations.cs @@ -94,7 +94,7 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -293,7 +293,7 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetExtensionsOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetExtensionsOperations.cs index da9458fc58072..ff3808f9f32a8 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetExtensionsOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetExtensionsOperations.cs @@ -158,7 +158,7 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -359,7 +359,7 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -568,7 +568,7 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -793,7 +793,7 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetOperations.cs new file mode 100644 index 0000000000000..4647318664605 --- /dev/null +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetOperations.cs @@ -0,0 +1,240 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +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; + + /// + /// VirtualMachineScaleSetOperations operations. + /// + internal partial class VirtualMachineScaleSetOperations : IServiceOperations, IVirtualMachineScaleSetOperations + { + /// + /// Initializes a new instance of the VirtualMachineScaleSetOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal VirtualMachineScaleSetOperations(ComputeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ComputeManagementClient + /// + public ComputeManagementClient Client { get; private set; } + + /// + /// Converts SinglePlacementGroup property to false for a existing virtual + /// machine scale set. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set to create or update. + /// + /// + /// Id of the placement group in which you want future virtual machine + /// instances to be placed. To query placement group Id, please use Virtual + /// Machine Scale Set VMs - Get API. If not provided, the platform will choose + /// one with maximum number of virtual machine instances. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 ConvertToSinglePlacementGroupWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string activePlacementGroupId = default(string), 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"); + } + VMScaleSetConvertToSinglePlacementGroupInput parameters = new VMScaleSetConvertToSinglePlacementGroupInput(); + if (activePlacementGroupId != null) + { + parameters.ActivePlacementGroupId = activePlacementGroupId; + } + // 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("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ConvertToSinglePlacementGroup", 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}/convertToSinglePlacementGroup").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 (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _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; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetOperationsExtensions.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetOperationsExtensions.cs new file mode 100644 index 0000000000000..a3006e84e3902 --- /dev/null +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetOperationsExtensions.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for VirtualMachineScaleSetOperations. + /// + public static partial class VirtualMachineScaleSetOperationsExtensions + { + /// + /// Converts SinglePlacementGroup property to false for a existing virtual + /// machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set to create or update. + /// + /// + /// Id of the placement group in which you want future virtual machine + /// instances to be placed. To query placement group Id, please use Virtual + /// Machine Scale Set VMs - Get API. If not provided, the platform will choose + /// one with maximum number of virtual machine instances. + /// + public static void ConvertToSinglePlacementGroup(this IVirtualMachineScaleSetOperations operations, string resourceGroupName, string vmScaleSetName, string activePlacementGroupId = default(string)) + { + operations.ConvertToSinglePlacementGroupAsync(resourceGroupName, vmScaleSetName, activePlacementGroupId).GetAwaiter().GetResult(); + } + + /// + /// Converts SinglePlacementGroup property to false for a existing virtual + /// machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set to create or update. + /// + /// + /// Id of the placement group in which you want future virtual machine + /// instances to be placed. To query placement group Id, please use Virtual + /// Machine Scale Set VMs - Get API. If not provided, the platform will choose + /// one with maximum number of virtual machine instances. + /// + /// + /// The cancellation token. + /// + public static async Task ConvertToSinglePlacementGroupAsync(this IVirtualMachineScaleSetOperations operations, string resourceGroupName, string vmScaleSetName, string activePlacementGroupId = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ConvertToSinglePlacementGroupWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, activePlacementGroupId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetRollingUpgradesOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetRollingUpgradesOperations.cs index aad836d819dda..76e51e7170b37 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetRollingUpgradesOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetRollingUpgradesOperations.cs @@ -164,7 +164,7 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -355,7 +355,7 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -530,7 +530,7 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -705,7 +705,7 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetVMsOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetVMsOperations.cs index 127ae5957caf8..1a9c679159d74 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetVMsOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetVMsOperations.cs @@ -239,7 +239,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -442,7 +442,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -644,7 +644,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -822,16 +822,21 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The instance ID of the virtual machine. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -1015,7 +1020,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters); if (tempDisk != null) { @@ -1211,7 +1216,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1396,7 +1401,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1593,7 +1598,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1818,7 +1823,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1966,6 +1971,11 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The instance ID of the virtual machine. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// Headers that will be added to request. /// @@ -1984,7 +1994,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2002,7 +2012,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2013,6 +2023,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("skipShutdown", skipShutdown); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginPowerOff", tracingParameters); @@ -2025,6 +2036,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (skipShutdown != null) + { + _queryParameters.Add(string.Format("skipShutdown={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skipShutdown, Client.SerializationSettings).Trim('"')))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2184,7 +2199,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2366,7 +2381,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2548,7 +2563,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2730,7 +2745,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2926,7 +2941,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetVMsOperationsExtensions.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetVMsOperationsExtensions.cs index 269109b0b3fa1..6604fac87046a 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetVMsOperationsExtensions.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetVMsOperationsExtensions.cs @@ -425,9 +425,14 @@ public static VirtualMachineScaleSetVMInstanceView GetInstanceView(this IVirtual /// /// The instance ID of the virtual machine. /// - public static void PowerOff(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + public static void PowerOff(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = false) { - operations.PowerOffAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + operations.PowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).GetAwaiter().GetResult(); } /// @@ -447,12 +452,17 @@ public static void PowerOff(this IVirtualMachineScaleSetVMsOperations operations /// /// The instance ID of the virtual machine. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// The cancellation token. /// - public static async Task PowerOffAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task PowerOffAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = false, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -938,9 +948,14 @@ public static void BeginDelete(this IVirtualMachineScaleSetVMsOperations operati /// /// The instance ID of the virtual machine. /// - public static void BeginPowerOff(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + public static void BeginPowerOff(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = false) { - operations.BeginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + operations.BeginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).GetAwaiter().GetResult(); } /// @@ -960,12 +975,17 @@ public static void BeginPowerOff(this IVirtualMachineScaleSetVMsOperations opera /// /// The instance ID of the virtual machine. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// The cancellation token. /// - public static async Task BeginPowerOffAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginPowerOffAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = false, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetsOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetsOperations.cs index 294aea34c4314..be2ff2c3f975b 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetsOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetsOperations.cs @@ -166,7 +166,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -414,7 +414,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -601,7 +601,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -782,7 +782,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -973,7 +973,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1167,7 +1167,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1328,6 +1328,11 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The name of the VM scale set. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// The virtual machine scale set instance ids. Omitting the virtual machine /// scale set instance ids will result in the operation being performed on all @@ -1339,10 +1344,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - public async Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? skipShutdown = false, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -1586,7 +1591,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1793,7 +1798,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2019,7 +2024,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2217,7 +2222,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2397,7 +2402,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { @@ -2590,7 +2595,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceIds"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); if (instanceIds != null) { @@ -2745,6 +2750,11 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The name of the VM scale set. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// The virtual machine scale set instance ids. Omitting the virtual machine /// scale set instance ids will result in the operation being performed on all @@ -2768,7 +2778,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? skipShutdown = false, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2782,7 +2792,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { @@ -2798,6 +2808,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("skipShutdown", skipShutdown); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vmInstanceIDs", vmInstanceIDs); tracingParameters.Add("cancellationToken", cancellationToken); @@ -2810,6 +2821,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (skipShutdown != null) + { + _queryParameters.Add(string.Format("skipShutdown={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skipShutdown, Client.SerializationSettings).Trim('"')))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2973,7 +2988,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { @@ -3164,7 +3179,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { @@ -3355,7 +3370,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { @@ -3549,7 +3564,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { @@ -3743,7 +3758,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceIds"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); if (instanceIds != null) { @@ -3933,7 +3948,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4119,7 +4134,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetsOperationsExtensions.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetsOperationsExtensions.cs index d4857edd71a82..9553a96ae5506 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetsOperationsExtensions.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineScaleSetsOperationsExtensions.cs @@ -490,14 +490,19 @@ public static IPage GetOSUpgradeHistory(th /// /// The name of the VM scale set. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// The virtual machine scale set instance ids. Omitting the virtual machine /// scale set instance ids will result in the operation being performed on all /// virtual machines in the virtual machine scale set. /// - public static void PowerOff(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) + public static void PowerOff(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? skipShutdown = false, IList instanceIds = default(IList)) { - operations.PowerOffAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + operations.PowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds).GetAwaiter().GetResult(); } /// @@ -514,6 +519,11 @@ public static IPage GetOSUpgradeHistory(th /// /// The name of the VM scale set. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// The virtual machine scale set instance ids. Omitting the virtual machine /// scale set instance ids will result in the operation being performed on all @@ -522,9 +532,9 @@ public static IPage GetOSUpgradeHistory(th /// /// The cancellation token. /// - public static async Task PowerOffAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task PowerOffAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? skipShutdown = false, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -1147,14 +1157,19 @@ public static void BeginDeleteInstances(this IVirtualMachineScaleSetsOperations /// /// The name of the VM scale set. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// The virtual machine scale set instance ids. Omitting the virtual machine /// scale set instance ids will result in the operation being performed on all /// virtual machines in the virtual machine scale set. /// - public static void BeginPowerOff(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) + public static void BeginPowerOff(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? skipShutdown = false, IList instanceIds = default(IList)) { - operations.BeginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + operations.BeginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds).GetAwaiter().GetResult(); } /// @@ -1171,6 +1186,11 @@ public static void BeginDeleteInstances(this IVirtualMachineScaleSetsOperations /// /// The name of the VM scale set. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// The virtual machine scale set instance ids. Omitting the virtual machine /// scale set instance ids will result in the operation being performed on all @@ -1179,9 +1199,9 @@ public static void BeginDeleteInstances(this IVirtualMachineScaleSetsOperations /// /// The cancellation token. /// - public static async Task BeginPowerOffAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginPowerOffAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? skipShutdown = false, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineSizesOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineSizesOperations.cs index 957f9a4a4293e..5b007710dc793 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineSizesOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachineSizesOperations.cs @@ -95,7 +95,7 @@ internal VirtualMachineSizesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachinesOperations.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachinesOperations.cs index 9019e423ac240..27d34e95669e1 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachinesOperations.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachinesOperations.cs @@ -95,7 +95,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -390,7 +390,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -589,7 +589,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -826,7 +826,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -996,7 +996,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1175,7 +1175,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1366,7 +1366,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1527,16 +1527,21 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The name of the virtual machine. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmName, skipShutdown, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -1735,7 +1740,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1947,7 +1952,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2173,7 +2178,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2389,7 +2394,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2563,7 +2568,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2737,7 +2742,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2880,6 +2885,11 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The name of the virtual machine. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// Headers that will be added to request. /// @@ -2898,7 +2908,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2912,7 +2922,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2922,6 +2932,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + tracingParameters.Add("skipShutdown", skipShutdown); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginPowerOff", tracingParameters); @@ -2933,6 +2944,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (skipShutdown != null) + { + _queryParameters.Add(string.Format("skipShutdown={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skipShutdown, Client.SerializationSettings).Trim('"')))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3085,7 +3100,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3258,7 +3273,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3431,7 +3446,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3608,7 +3623,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters); if (tempDisk != null) { @@ -3794,7 +3809,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3981,7 +3996,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachinesOperationsExtensions.cs b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachinesOperationsExtensions.cs index d278b56842fb0..6653228434166 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/VirtualMachinesOperationsExtensions.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/VirtualMachinesOperationsExtensions.cs @@ -563,9 +563,14 @@ public static IEnumerable ListAvailableSizes(this IVirtualMa /// /// The name of the virtual machine. /// - public static void PowerOff(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + public static void PowerOff(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? skipShutdown = false) { - operations.PowerOffAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + operations.PowerOffAsync(resourceGroupName, vmName, skipShutdown).GetAwaiter().GetResult(); } /// @@ -582,12 +587,17 @@ public static void PowerOff(this IVirtualMachinesOperations operations, string r /// /// The name of the virtual machine. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// The cancellation token. /// - public static async Task PowerOffAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task PowerOffAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? skipShutdown = false, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, vmName, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -1098,9 +1108,14 @@ public static void BeginDeallocate(this IVirtualMachinesOperations operations, s /// /// The name of the virtual machine. /// - public static void BeginPowerOff(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + public static void BeginPowerOff(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? skipShutdown = false) { - operations.BeginPowerOffAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + operations.BeginPowerOffAsync(resourceGroupName, vmName, skipShutdown).GetAwaiter().GetResult(); } /// @@ -1117,12 +1132,17 @@ public static void BeginPowerOff(this IVirtualMachinesOperations operations, str /// /// The name of the virtual machine. /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// /// /// The cancellation token. /// - public static async Task BeginPowerOffAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginPowerOffAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? skipShutdown = false, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmName, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); } ///