From 14539b2cae28c603173fe99c68c6a1ce1548dd1a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 15 Oct 2021 22:40:11 +0000 Subject: [PATCH] CodeGen from PR 16426 in Azure/azure-rest-api-specs Merge e9b361c730a26640648cb57b5b685727fe2aac71 into da7991839a5faba0ba2617c9783112eaa8048054 --- .../src/Generated/AddonsOperations.cs | 16 - .../src/Generated/AuthorizationsOperations.cs | 33 +- .../AuthorizationsOperationsExtensions.cs | 28 +- .../src/Generated/AvsClient.cs | 16 +- .../src/Generated/CloudLinksOperations.cs | 16 - .../src/Generated/ClustersOperations.cs | 20 - .../src/Generated/DatastoresOperations.cs | 16 - .../GlobalReachConnectionsOperations.cs | 16 - .../Generated/HcxEnterpriseSitesOperations.cs | 16 - .../Generated/IAuthorizationsOperations.cs | 10 +- .../src/Generated/IAvsClient.cs | 10 + .../Generated/IPlacementPoliciesOperations.cs | 307 ++++ .../src/Generated/IScriptCmdletsOperations.cs | 8 +- .../Generated/IScriptExecutionsOperations.cs | 10 +- .../Generated/IScriptPackagesOperations.cs | 8 +- .../Generated/IVirtualMachinesOperations.cs | 172 ++ .../Generated/Models/AddonSrmProperties.cs | 20 +- .../src/Generated/Models/AffinityType.cs | 22 + .../Models/AvailabilityProperties.cs | 71 + .../Generated/Models/AvailabilityStrategy.cs | 22 + .../src/Generated/Models/Cluster.cs | 4 +- .../src/Generated/Models/ClusterUpdate.cs | 12 +- .../Models/CommonClusterProperties.cs | 4 +- .../src/Generated/Models/Datastore.cs | 14 +- .../src/Generated/Models/DatastoreStatus.cs | 27 + .../src/Generated/Models/Encryption.cs | 62 + .../Generated/Models/EncryptionKeyStatus.cs | 22 + .../Models/EncryptionKeyVaultProperties.cs | 90 + .../src/Generated/Models/EncryptionState.cs | 22 + .../Generated/Models/EncryptionVersionType.cs | 22 + .../Models/ExpressRouteAuthorization.cs | 11 +- .../Generated/Models/GlobalReachConnection.cs | 13 +- .../src/Generated/Models/PlacementPolicy.cs | 55 + .../Models/PlacementPolicyProperties.cs | 73 + .../PlacementPolicyProvisioningState.cs | 25 + .../Generated/Models/PlacementPolicyState.cs | 22 + .../Generated/Models/PlacementPolicyUpdate.cs | 74 + .../Models/PortMirroringDirectionEnum.cs | 4 +- .../Models/PortMirroringStatusEnum.cs | 3 +- .../src/Generated/Models/PrivateCloud.cs | 42 +- .../Generated/Models/PrivateCloudIdentity.cs | 79 + .../Generated/Models/PrivateCloudUpdate.cs | 31 +- .../Generated/Models/ResourceIdentityType.cs | 22 + .../src/Generated/Models/SegmentStatusEnum.cs | 3 +- .../src/Generated/Models/VMGroupStatusEnum.cs | 3 +- .../src/Generated/Models/VMTypeEnum.cs | 4 +- .../src/Generated/Models/VirtualMachine.cs | 86 + .../Models/VirtualMachineRestrictMovement.cs | 54 + .../VirtualMachineRestrictMovementState.cs | 22 + .../Models/VmHostPlacementPolicyProperties.cs | 104 ++ .../Models/VmVmPlacementPolicyProperties.cs | 92 + .../Models/WorkloadNetworkPortMirroring.cs | 11 +- .../Models/WorkloadNetworkSegment.cs | 4 +- .../Models/WorkloadNetworkVMGroup.cs | 4 +- .../Models/WorkloadNetworkVirtualMachine.cs | 6 +- .../Generated/PlacementPoliciesOperations.cs | 1553 +++++++++++++++++ .../PlacementPoliciesOperationsExtensions.cs | 501 ++++++ .../src/Generated/PrivateCloudsOperations.cs | 32 - .../src/Generated/ScriptCmdletsOperations.cs | 16 +- .../ScriptCmdletsOperationsExtensions.cs | 16 +- .../Generated/ScriptExecutionsOperations.cs | 30 +- .../ScriptExecutionsOperationsExtensions.cs | 20 +- .../src/Generated/ScriptPackagesOperations.cs | 16 +- .../ScriptPackagesOperationsExtensions.cs | 16 +- .../SdkInfo_AzureVMwareSolutionAPI.cs | 41 +- .../Generated/VirtualMachinesOperations.cs | 959 ++++++++++ .../VirtualMachinesOperationsExtensions.cs | 267 +++ .../Generated/WorkloadNetworksOperations.cs | 152 -- 68 files changed, 5106 insertions(+), 476 deletions(-) create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IPlacementPoliciesOperations.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IVirtualMachinesOperations.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AffinityType.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AvailabilityProperties.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AvailabilityStrategy.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoreStatus.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Encryption.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyStatus.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyVaultProperties.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionState.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionVersionType.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicy.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProperties.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProvisioningState.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyState.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyUpdate.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudIdentity.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceIdentityType.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachine.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovement.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovementState.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmHostPlacementPolicyProperties.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmVmPlacementPolicyProperties.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperations.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperationsExtensions.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperations.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperationsExtensions.cs diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AddonsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AddonsOperations.cs index 9fe02e1aa9d6..8fdcc3d31894 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AddonsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AddonsOperations.cs @@ -107,10 +107,6 @@ internal AddonsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -335,10 +331,6 @@ internal AddonsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -625,10 +617,6 @@ internal AddonsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -885,10 +873,6 @@ internal AddonsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperations.cs index d0d133a22a86..54c167fb0ee5 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperations.cs @@ -107,10 +107,6 @@ internal AuthorizationsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -335,10 +331,6 @@ internal AuthorizationsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -521,16 +513,19 @@ internal AuthorizationsOperations(AvsClient client) /// /// Name of the ExpressRoute Circuit Authorization in the private cloud /// + /// + /// An ExpressRoute Circuit Authorization + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, authorization, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -571,6 +566,9 @@ internal AuthorizationsOperations(AvsClient client) /// /// Name of the ExpressRoute Circuit Authorization in the private cloud /// + /// + /// An ExpressRoute Circuit Authorization + /// /// /// Headers that will be added to request. /// @@ -592,7 +590,7 @@ internal AuthorizationsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -619,10 +617,6 @@ internal AuthorizationsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -632,6 +626,10 @@ internal AuthorizationsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); } + if (authorization == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorization"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -643,7 +641,6 @@ internal AuthorizationsOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } - ExpressRouteAuthorization authorization = new ExpressRouteAuthorization(); // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -876,10 +873,6 @@ internal AuthorizationsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperationsExtensions.cs index 396f174e4bf5..72d69e7c3ce8 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperationsExtensions.cs @@ -122,9 +122,12 @@ public static ExpressRouteAuthorization Get(this IAuthorizationsOperations opera /// /// Name of the ExpressRoute Circuit Authorization in the private cloud /// - public static ExpressRouteAuthorization CreateOrUpdate(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName) + /// + /// An ExpressRoute Circuit Authorization + /// + public static ExpressRouteAuthorization CreateOrUpdate(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization) { - return operations.CreateOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName, authorization).GetAwaiter().GetResult(); } /// @@ -142,12 +145,15 @@ public static ExpressRouteAuthorization CreateOrUpdate(this IAuthorizationsOpera /// /// Name of the ExpressRoute Circuit Authorization in the private cloud /// + /// + /// An ExpressRoute Circuit Authorization + /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, authorization, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -211,9 +217,12 @@ public static void Delete(this IAuthorizationsOperations operations, string reso /// /// Name of the ExpressRoute Circuit Authorization in the private cloud /// - public static ExpressRouteAuthorization BeginCreateOrUpdate(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName) + /// + /// An ExpressRoute Circuit Authorization + /// + public static ExpressRouteAuthorization BeginCreateOrUpdate(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName).GetAwaiter().GetResult(); + return operations.BeginCreateOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName, authorization).GetAwaiter().GetResult(); } /// @@ -231,12 +240,15 @@ public static ExpressRouteAuthorization BeginCreateOrUpdate(this IAuthorizations /// /// Name of the ExpressRoute Circuit Authorization in the private cloud /// + /// + /// An ExpressRoute Circuit Authorization + /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, authorization, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AvsClient.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AvsClient.cs index 9839f7f607fe..7a769ff600af 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AvsClient.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AvsClient.cs @@ -129,6 +129,16 @@ public partial class AvsClient : ServiceClient, IAvsClient, IAzureCli /// public virtual IAddonsOperations Addons { get; private set; } + /// + /// Gets the IVirtualMachinesOperations. + /// + public virtual IVirtualMachinesOperations VirtualMachines { get; private set; } + + /// + /// Gets the IPlacementPoliciesOperations. + /// + public virtual IPlacementPoliciesOperations PlacementPolicies { get; private set; } + /// /// Gets the IScriptPackagesOperations. /// @@ -396,11 +406,13 @@ private void Initialize() WorkloadNetworks = new WorkloadNetworksOperations(this); CloudLinks = new CloudLinksOperations(this); Addons = new AddonsOperations(this); + VirtualMachines = new VirtualMachinesOperations(this); + PlacementPolicies = new PlacementPoliciesOperations(this); ScriptPackages = new ScriptPackagesOperations(this); ScriptCmdlets = new ScriptCmdletsOperations(this); ScriptExecutions = new ScriptExecutionsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-06-01"; + ApiVersion = "2021-12-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -434,6 +446,8 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("addonType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("dhcpType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("dhcpType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); CustomInitialize(); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/CloudLinksOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/CloudLinksOperations.cs index b36d8a01a70c..441d86610183 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/CloudLinksOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/CloudLinksOperations.cs @@ -107,10 +107,6 @@ internal CloudLinksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -335,10 +331,6 @@ internal CloudLinksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -625,10 +617,6 @@ internal CloudLinksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -885,10 +873,6 @@ internal CloudLinksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ClustersOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ClustersOperations.cs index be50518371ba..7914c7f66e4c 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ClustersOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ClustersOperations.cs @@ -107,10 +107,6 @@ internal ClustersOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -335,10 +331,6 @@ internal ClustersOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -653,10 +645,6 @@ internal ClustersOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -923,10 +911,6 @@ internal ClustersOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -1183,10 +1167,6 @@ internal ClustersOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/DatastoresOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/DatastoresOperations.cs index 2012faa2b8ec..cd53b56cffeb 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/DatastoresOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/DatastoresOperations.cs @@ -110,10 +110,6 @@ internal DatastoresOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -347,10 +343,6 @@ internal DatastoresOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -652,10 +644,6 @@ internal DatastoresOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -925,10 +913,6 @@ internal DatastoresOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/GlobalReachConnectionsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/GlobalReachConnectionsOperations.cs index bf9741d4d040..d7a5e3200259 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/GlobalReachConnectionsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/GlobalReachConnectionsOperations.cs @@ -107,10 +107,6 @@ internal GlobalReachConnectionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -335,10 +331,6 @@ internal GlobalReachConnectionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -625,10 +617,6 @@ internal GlobalReachConnectionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -885,10 +873,6 @@ internal GlobalReachConnectionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/HcxEnterpriseSitesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/HcxEnterpriseSitesOperations.cs index a1bd0251cd25..f2ab538bf2d1 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/HcxEnterpriseSitesOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/HcxEnterpriseSitesOperations.cs @@ -107,10 +107,6 @@ internal HcxEnterpriseSitesOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -335,10 +331,6 @@ internal HcxEnterpriseSitesOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -569,10 +561,6 @@ internal HcxEnterpriseSitesOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -826,10 +814,6 @@ internal HcxEnterpriseSitesOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAuthorizationsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAuthorizationsOperations.cs index d47d8f9c8e17..d6b64beb94b3 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAuthorizationsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAuthorizationsOperations.cs @@ -90,6 +90,9 @@ public partial interface IAuthorizationsOperations /// /// Name of the ExpressRoute Circuit Authorization in the private cloud /// + /// + /// An ExpressRoute Circuit Authorization + /// /// /// The headers that will be added to request. /// @@ -105,7 +108,7 @@ public partial interface IAuthorizationsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete an ExpressRoute Circuit Authorization in a private cloud /// @@ -144,6 +147,9 @@ public partial interface IAuthorizationsOperations /// /// Name of the ExpressRoute Circuit Authorization in the private cloud /// + /// + /// An ExpressRoute Circuit Authorization + /// /// /// The headers that will be added to request. /// @@ -159,7 +165,7 @@ public partial interface IAuthorizationsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete an ExpressRoute Circuit Authorization in a private cloud /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAvsClient.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAvsClient.cs index befcd7eeea86..ed73047e95f4 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAvsClient.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAvsClient.cs @@ -124,6 +124,16 @@ public partial interface IAvsClient : System.IDisposable /// IAddonsOperations Addons { get; } + /// + /// Gets the IVirtualMachinesOperations. + /// + IVirtualMachinesOperations VirtualMachines { get; } + + /// + /// Gets the IPlacementPoliciesOperations. + /// + IPlacementPoliciesOperations PlacementPolicies { get; } + /// /// Gets the IScriptPackagesOperations. /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IPlacementPoliciesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IPlacementPoliciesOperations.cs new file mode 100644 index 000000000000..ab3883ca42c3 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IPlacementPoliciesOperations.cs @@ -0,0 +1,307 @@ +// +// 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.Avs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PlacementPoliciesOperations operations. + /// + public partial interface IPlacementPoliciesOperations + { + /// + /// List placement policies in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a placement policy by name in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) + /// placement policy + /// + /// + /// 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 privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a placement policy in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) + /// placement policy + /// + /// + /// A placement policy in the private cloud cluster + /// + /// + /// 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 privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a placement policy in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) + /// placement policy + /// + /// + /// The placement policy properties that may be updated + /// + /// + /// 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 privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a placement policy in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) + /// placement policy + /// + /// + /// 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 privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a placement policy in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) + /// placement policy + /// + /// + /// A placement policy in the private cloud cluster + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a placement policy in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) + /// placement policy + /// + /// + /// The placement policy properties that may be updated + /// + /// + /// 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a placement policy in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) + /// placement policy + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List placement policies in a private cloud cluster + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptCmdletsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptCmdletsOperations.cs index 08be682b082d..4225c4ddf30f 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptCmdletsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptCmdletsOperations.cs @@ -24,8 +24,8 @@ namespace Microsoft.Azure.Management.Avs public partial interface IScriptCmdletsOperations { /// - /// Return script cmdlet resources available for a private cloud to - /// create a script execution resource on their Private Cloud + /// List script cmdlet resources available for a private cloud to + /// create a script execution resource on a private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -86,8 +86,8 @@ public partial interface IScriptCmdletsOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptPackageName, string scriptCmdletName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Return script cmdlet resources available for a private cloud to - /// create a script execution resource on their Private Cloud + /// List script cmdlet resources available for a private cloud to + /// create a script execution resource on a private cloud /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptExecutionsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptExecutionsOperations.cs index 15e4b2815f76..92dde14012da 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptExecutionsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptExecutionsOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IScriptExecutionsOperations { /// - /// Get an script execution resource by name in a private cloud + /// List script executions in a private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -49,7 +49,7 @@ public partial interface IScriptExecutionsOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get an script execution resource by name in a private cloud + /// Get an script execution by name in a private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -77,7 +77,7 @@ public partial interface IScriptExecutionsOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a script execution resource in a private cloud + /// Create or update a script execution in a private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -165,7 +165,7 @@ public partial interface IScriptExecutionsOperations /// Task> GetExecutionLogsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, IList scriptOutputStreamType = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a script execution resource in a private cloud + /// Create or update a script execution in a private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -221,7 +221,7 @@ public partial interface IScriptExecutionsOperations /// Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get an script execution resource by name in a private cloud + /// List script executions in a private cloud /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptPackagesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptPackagesOperations.cs index e8a9e4f0522b..45ac3a9fe974 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptPackagesOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptPackagesOperations.cs @@ -24,8 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IScriptPackagesOperations { /// - /// Return script packages available for a private cloud to run on - /// their Private Cloud + /// List script packages available to run on the private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -50,7 +49,7 @@ public partial interface IScriptPackagesOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Return script package available to run on an Private Cloud + /// Get a script package available to run on a private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -78,8 +77,7 @@ public partial interface IScriptPackagesOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptPackageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Return script packages available for a private cloud to run on - /// their Private Cloud + /// List script packages available to run on the private cloud /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IVirtualMachinesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IVirtualMachinesOperations.cs new file mode 100644 index 000000000000..e7c8f4539677 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IVirtualMachinesOperations.cs @@ -0,0 +1,172 @@ +// +// 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.Avs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// VirtualMachinesOperations operations. + /// + public partial interface IVirtualMachinesOperations + { + /// + /// List of virtual machines in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a virtual machine by id in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Virtual Machine identifier + /// + /// + /// 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 privateCloudName, string clusterName, string virtualMachineId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Enable or disable DRS-driven VM movement restriction + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Virtual Machine identifier + /// + /// + /// Whether VM DRS-driven movement is restricted (Enabled) or not + /// (Disabled) + /// + /// + /// 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 RestrictMovementWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Enable or disable DRS-driven VM movement restriction + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Virtual Machine identifier + /// + /// + /// Whether VM DRS-driven movement is restricted (Enabled) or not + /// (Disabled) + /// + /// + /// 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 BeginRestrictMovementWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List of virtual machines in a private cloud cluster + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonSrmProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonSrmProperties.cs index 72d105e4f0cc..c2039dda6ce2 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonSrmProperties.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonSrmProperties.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.Avs.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -31,12 +30,12 @@ public AddonSrmProperties() /// /// Initializes a new instance of the AddonSrmProperties class. /// - /// The Site Recovery Manager (SRM) - /// license /// The state of the addon /// provisioning. Possible values include: 'Succeeded', 'Failed', /// 'Cancelled', 'Building', 'Deleting', 'Updating' - public AddonSrmProperties(string licenseKey, string provisioningState = default(string)) + /// The Site Recovery Manager (SRM) + /// license + public AddonSrmProperties(string provisioningState = default(string), string licenseKey = default(string)) : base(provisioningState) { LicenseKey = licenseKey; @@ -54,18 +53,5 @@ public AddonSrmProperties() [JsonProperty(PropertyName = "licenseKey")] public string LicenseKey { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (LicenseKey == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "LicenseKey"); - } - } } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AffinityType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AffinityType.cs new file mode 100644 index 000000000000..6909957635fe --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AffinityType.cs @@ -0,0 +1,22 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for AffinityType. + /// + public static class AffinityType + { + public const string Affinity = "Affinity"; + public const string AntiAffinity = "AntiAffinity"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AvailabilityProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AvailabilityProperties.cs new file mode 100644 index 000000000000..3f7373e042b4 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AvailabilityProperties.cs @@ -0,0 +1,71 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties describing private cloud availability zone distribution + /// + public partial class AvailabilityProperties + { + /// + /// Initializes a new instance of the AvailabilityProperties class. + /// + public AvailabilityProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AvailabilityProperties class. + /// + /// The availability strategy for the private + /// cloud. Possible values include: 'SingleZone', 'DualZone' + /// The primary availability zone for the private + /// cloud + /// The secondary availability zone for the + /// private cloud + public AvailabilityProperties(string strategy = default(string), int? zone = default(int?), int? secondaryZone = default(int?)) + { + Strategy = strategy; + Zone = zone; + SecondaryZone = secondaryZone; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the availability strategy for the private cloud. + /// Possible values include: 'SingleZone', 'DualZone' + /// + [JsonProperty(PropertyName = "strategy")] + public string Strategy { get; set; } + + /// + /// Gets or sets the primary availability zone for the private cloud + /// + [JsonProperty(PropertyName = "zone")] + public int? Zone { get; set; } + + /// + /// Gets or sets the secondary availability zone for the private cloud + /// + [JsonProperty(PropertyName = "secondaryZone")] + public int? SecondaryZone { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AvailabilityStrategy.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AvailabilityStrategy.cs new file mode 100644 index 000000000000..1a31efe57e51 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AvailabilityStrategy.cs @@ -0,0 +1,22 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for AvailabilityStrategy. + /// + public static class AvailabilityStrategy + { + public const string SingleZone = "SingleZone"; + public const string DualZone = "DualZone"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Cluster.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Cluster.cs index cb7d3ca0bc9d..dd401c0c1c2e 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Cluster.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Cluster.cs @@ -86,10 +86,10 @@ public Cluster() public int? ClusterId { get; private set; } /// - /// Gets the hosts + /// Gets or sets the hosts /// [JsonProperty(PropertyName = "properties.hosts")] - public IList Hosts { get; private set; } + public IList Hosts { get; set; } /// /// Validate the object. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterUpdate.cs index 9f7592be6aa2..9bf31fa13b20 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterUpdate.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterUpdate.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.Avs.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -33,9 +35,11 @@ public ClusterUpdate() /// Initializes a new instance of the ClusterUpdate class. /// /// The cluster size - public ClusterUpdate(int? clusterSize = default(int?)) + /// The hosts + public ClusterUpdate(int? clusterSize = default(int?), IList hosts = default(IList)) { ClusterSize = clusterSize; + Hosts = hosts; CustomInit(); } @@ -50,5 +54,11 @@ public ClusterUpdate() [JsonProperty(PropertyName = "properties.clusterSize")] public int? ClusterSize { get; set; } + /// + /// Gets or sets the hosts + /// + [JsonProperty(PropertyName = "properties.hosts")] + public IList Hosts { get; set; } + } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CommonClusterProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CommonClusterProperties.cs index 4a348eddc63f..aa02ad36a136 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CommonClusterProperties.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CommonClusterProperties.cs @@ -71,10 +71,10 @@ public CommonClusterProperties() public int? ClusterId { get; private set; } /// - /// Gets the hosts + /// Gets or sets the hosts /// [JsonProperty(PropertyName = "hosts")] - public IList Hosts { get; private set; } + public IList Hosts { get; set; } } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Datastore.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Datastore.cs index 5411b1db16f9..d44f040753d1 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Datastore.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Datastore.cs @@ -40,12 +40,16 @@ public Datastore() /// 'Cancelled', 'Pending', 'Creating', 'Updating', 'Deleting' /// An Azure NetApp Files volume /// An iSCSI volume - public Datastore(string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), NetAppVolume netAppVolume = default(NetAppVolume), DiskPoolVolume diskPoolVolume = default(DiskPoolVolume)) + /// The operational status of the datastore. + /// Possible values include: 'Unknown', 'Accessible', 'Inaccessible', + /// 'Attached', 'Detached', 'LostCommunication', 'DeadOrError' + public Datastore(string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), NetAppVolume netAppVolume = default(NetAppVolume), DiskPoolVolume diskPoolVolume = default(DiskPoolVolume), string status = default(string)) : base(id, name, type) { ProvisioningState = provisioningState; NetAppVolume = netAppVolume; DiskPoolVolume = diskPoolVolume; + Status = status; CustomInit(); } @@ -74,6 +78,14 @@ public Datastore() [JsonProperty(PropertyName = "properties.diskPoolVolume")] public DiskPoolVolume DiskPoolVolume { get; set; } + /// + /// Gets the operational status of the datastore. Possible values + /// include: 'Unknown', 'Accessible', 'Inaccessible', 'Attached', + /// 'Detached', 'LostCommunication', 'DeadOrError' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoreStatus.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoreStatus.cs new file mode 100644 index 000000000000..74a4c2d61399 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoreStatus.cs @@ -0,0 +1,27 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for DatastoreStatus. + /// + public static class DatastoreStatus + { + public const string Unknown = "Unknown"; + public const string Accessible = "Accessible"; + public const string Inaccessible = "Inaccessible"; + public const string Attached = "Attached"; + public const string Detached = "Detached"; + public const string LostCommunication = "LostCommunication"; + public const string DeadOrError = "DeadOrError"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Encryption.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Encryption.cs new file mode 100644 index 000000000000..453ec99b7c94 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Encryption.cs @@ -0,0 +1,62 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties of customer managed encryption key + /// + public partial class Encryption + { + /// + /// Initializes a new instance of the Encryption class. + /// + public Encryption() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Encryption class. + /// + /// Status of customer managed encryption key. + /// Possible values include: 'Enabled', 'Disabled' + /// The key vault where the encryption + /// key is stored + public Encryption(string status = default(string), EncryptionKeyVaultProperties keyVaultProperties = default(EncryptionKeyVaultProperties)) + { + Status = status; + KeyVaultProperties = keyVaultProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets status of customer managed encryption key. Possible + /// values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets the key vault where the encryption key is stored + /// + [JsonProperty(PropertyName = "keyVaultProperties")] + public EncryptionKeyVaultProperties KeyVaultProperties { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyStatus.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyStatus.cs new file mode 100644 index 000000000000..56601b3b2ca5 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyStatus.cs @@ -0,0 +1,22 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for EncryptionKeyStatus. + /// + public static class EncryptionKeyStatus + { + public const string Connected = "Connected"; + public const string AccessDenied = "AccessDenied"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyVaultProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyVaultProperties.cs new file mode 100644 index 000000000000..9ba727d39b8d --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyVaultProperties.cs @@ -0,0 +1,90 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An Encryption Key + /// + public partial class EncryptionKeyVaultProperties + { + /// + /// Initializes a new instance of the EncryptionKeyVaultProperties + /// class. + /// + public EncryptionKeyVaultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EncryptionKeyVaultProperties + /// class. + /// + /// The name of the key. + /// The version of the key. + /// The URL of the vault. + /// The state of key provided. Possible values + /// include: 'Connected', 'AccessDenied' + /// Property of the key if user provided or + /// auto detected. Possible values include: 'Fixed', + /// 'AutoDetected' + public EncryptionKeyVaultProperties(string keyName = default(string), string keyVersion = default(string), string keyVaultUrl = default(string), string keyState = default(string), string versionType = default(string)) + { + KeyName = keyName; + KeyVersion = keyVersion; + KeyVaultUrl = keyVaultUrl; + KeyState = keyState; + VersionType = versionType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the key. + /// + [JsonProperty(PropertyName = "keyName")] + public string KeyName { get; set; } + + /// + /// Gets or sets the version of the key. + /// + [JsonProperty(PropertyName = "keyVersion")] + public string KeyVersion { get; set; } + + /// + /// Gets or sets the URL of the vault. + /// + [JsonProperty(PropertyName = "keyVaultUrl")] + public string KeyVaultUrl { get; set; } + + /// + /// Gets the state of key provided. Possible values include: + /// 'Connected', 'AccessDenied' + /// + [JsonProperty(PropertyName = "keyState")] + public string KeyState { get; private set; } + + /// + /// Gets property of the key if user provided or auto detected. + /// Possible values include: 'Fixed', 'AutoDetected' + /// + [JsonProperty(PropertyName = "versionType")] + public string VersionType { get; private set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionState.cs new file mode 100644 index 000000000000..0ed895943078 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionState.cs @@ -0,0 +1,22 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for EncryptionState. + /// + public static class EncryptionState + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionVersionType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionVersionType.cs new file mode 100644 index 000000000000..784ca45fd04e --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionVersionType.cs @@ -0,0 +1,22 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for EncryptionVersionType. + /// + public static class EncryptionVersionType + { + public const string Fixed = "Fixed"; + public const string AutoDetected = "AutoDetected"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ExpressRouteAuthorization.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ExpressRouteAuthorization.cs index 324499cbf468..adf509db542a 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ExpressRouteAuthorization.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ExpressRouteAuthorization.cs @@ -42,12 +42,15 @@ public ExpressRouteAuthorization() /// ExpressRoute Circuit Authorization /// The key of the /// ExpressRoute Circuit Authorization - public ExpressRouteAuthorization(string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), string expressRouteAuthorizationId = default(string), string expressRouteAuthorizationKey = default(string)) + /// The ID of the ExpressRoute + /// Circuit + public ExpressRouteAuthorization(string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), string expressRouteAuthorizationId = default(string), string expressRouteAuthorizationKey = default(string), string expressRouteId = default(string)) : base(id, name, type) { ProvisioningState = provisioningState; ExpressRouteAuthorizationId = expressRouteAuthorizationId; ExpressRouteAuthorizationKey = expressRouteAuthorizationKey; + ExpressRouteId = expressRouteId; CustomInit(); } @@ -76,5 +79,11 @@ public ExpressRouteAuthorization() [JsonProperty(PropertyName = "properties.expressRouteAuthorizationKey")] public string ExpressRouteAuthorizationKey { get; private set; } + /// + /// Gets or sets the ID of the ExpressRoute Circuit + /// + [JsonProperty(PropertyName = "properties.expressRouteId")] + public string ExpressRouteId { get; set; } + } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnection.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnection.cs index 1b8a42075131..7b90bb9eebeb 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnection.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnection.cs @@ -49,7 +49,10 @@ public GlobalReachConnection() /// Identifier of the /// ExpressRoute Circuit to peer with in the global reach /// connection - public GlobalReachConnection(string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), string addressPrefix = default(string), string authorizationKey = default(string), string circuitConnectionStatus = default(string), string peerExpressRouteCircuit = default(string)) + /// The ID of the Private Cloud's + /// ExpressRoute Circuit that is participating in the global reach + /// connection + public GlobalReachConnection(string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), string addressPrefix = default(string), string authorizationKey = default(string), string circuitConnectionStatus = default(string), string peerExpressRouteCircuit = default(string), string expressRouteId = default(string)) : base(id, name, type) { ProvisioningState = provisioningState; @@ -57,6 +60,7 @@ public GlobalReachConnection() AuthorizationKey = authorizationKey; CircuitConnectionStatus = circuitConnectionStatus; PeerExpressRouteCircuit = peerExpressRouteCircuit; + ExpressRouteId = expressRouteId; CustomInit(); } @@ -101,5 +105,12 @@ public GlobalReachConnection() [JsonProperty(PropertyName = "properties.peerExpressRouteCircuit")] public string PeerExpressRouteCircuit { get; set; } + /// + /// Gets or sets the ID of the Private Cloud's ExpressRoute Circuit + /// that is participating in the global reach connection + /// + [JsonProperty(PropertyName = "properties.expressRouteId")] + public string ExpressRouteId { get; set; } + } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicy.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicy.cs new file mode 100644 index 000000000000..1302c5657dbf --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicy.cs @@ -0,0 +1,55 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A vSphere Distributed Resource Scheduler (DRS) placement policy + /// + public partial class PlacementPolicy : Resource + { + /// + /// Initializes a new instance of the PlacementPolicy class. + /// + public PlacementPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PlacementPolicy class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// placement policy properties + public PlacementPolicy(string id = default(string), string name = default(string), string type = default(string), PlacementPolicyProperties properties = default(PlacementPolicyProperties)) + : base(id, name, type) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets placement policy properties + /// + [JsonProperty(PropertyName = "properties")] + public PlacementPolicyProperties Properties { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProperties.cs new file mode 100644 index 000000000000..a900368d9b58 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProperties.cs @@ -0,0 +1,73 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Abstract placement policy properties + /// + public partial class PlacementPolicyProperties + { + /// + /// Initializes a new instance of the PlacementPolicyProperties class. + /// + public PlacementPolicyProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PlacementPolicyProperties class. + /// + /// Whether the placement policy is enabled or + /// disabled. Possible values include: 'Enabled', 'Disabled' + /// Display name of the placement + /// policy + /// The provisioning state. Possible + /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', + /// 'Updating' + public PlacementPolicyProperties(string state = default(string), string displayName = default(string), string provisioningState = default(string)) + { + State = state; + DisplayName = displayName; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets whether the placement policy is enabled or disabled. + /// Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "state")] + public string State { get; set; } + + /// + /// Gets or sets display name of the placement policy + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets the provisioning state. Possible values include: 'Succeeded', + /// 'Failed', 'Building', 'Deleting', 'Updating' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProvisioningState.cs new file mode 100644 index 000000000000..997a5a64585f --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProvisioningState.cs @@ -0,0 +1,25 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for PlacementPolicyProvisioningState. + /// + public static class PlacementPolicyProvisioningState + { + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Building = "Building"; + public const string Deleting = "Deleting"; + public const string Updating = "Updating"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyState.cs new file mode 100644 index 000000000000..fbc86b85ff25 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyState.cs @@ -0,0 +1,22 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for PlacementPolicyState. + /// + public static class PlacementPolicyState + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyUpdate.cs new file mode 100644 index 000000000000..0d8f222fc26f --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyUpdate.cs @@ -0,0 +1,74 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An update of a DRS placement policy resource + /// + [Rest.Serialization.JsonTransformation] + public partial class PlacementPolicyUpdate + { + /// + /// Initializes a new instance of the PlacementPolicyUpdate class. + /// + public PlacementPolicyUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PlacementPolicyUpdate class. + /// + /// Whether the placement policy is enabled or + /// disabled. Possible values include: 'Enabled', 'Disabled' + /// Virtual machine members list + /// Host members list + public PlacementPolicyUpdate(string state = default(string), IList vmMembers = default(IList), IList hostMembers = default(IList)) + { + State = state; + VmMembers = vmMembers; + HostMembers = hostMembers; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets whether the placement policy is enabled or disabled. + /// Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; set; } + + /// + /// Gets or sets virtual machine members list + /// + [JsonProperty(PropertyName = "properties.vmMembers")] + public IList VmMembers { get; set; } + + /// + /// Gets or sets host members list + /// + [JsonProperty(PropertyName = "properties.hostMembers")] + public IList HostMembers { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringDirectionEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringDirectionEnum.cs index 793ccd3553c0..f147dad15abd 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringDirectionEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringDirectionEnum.cs @@ -16,6 +16,8 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class PortMirroringDirectionEnum { - public const string INGRESSEGRESSBIDIRECTIONAL = "INGRESS, EGRESS, BIDIRECTIONAL"; + public const string INGRESS = "INGRESS"; + public const string EGRESS = "EGRESS"; + public const string BIDIRECTIONAL = "BIDIRECTIONAL"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringStatusEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringStatusEnum.cs index d43685318d4b..0f50ac49f6ef 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringStatusEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringStatusEnum.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class PortMirroringStatusEnum { - public const string SUCCESSFAILURE = "SUCCESS, FAILURE"; + public const string SUCCESS = "SUCCESS"; + public const string FAILURE = "FAILURE"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloud.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloud.cs index 39319262bf54..26cf5bba067b 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloud.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloud.cs @@ -50,6 +50,10 @@ public PrivateCloud() /// disabled. Possible values include: 'Enabled', 'Disabled' /// vCenter Single Sign On Identity /// Sources + /// Properties describing how the cloud is + /// distributed across availability zones + /// Customer managed key encryption, can be + /// enabled or disabled /// The provisioning state. Possible /// values include: 'Succeeded', 'Failed', 'Cancelled', 'Pending', /// 'Building', 'Deleting', 'Updating' @@ -71,13 +75,20 @@ public PrivateCloud() /// Manager SSL certificate /// Array of cloud link IDs from other /// clouds that connect to this one - public PrivateCloud(Sku sku, string networkBlock, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ManagementCluster managementCluster = default(ManagementCluster), string internet = default(string), IList identitySources = default(IList), string provisioningState = default(string), Circuit circuit = default(Circuit), Endpoints endpoints = default(Endpoints), string managementNetwork = default(string), string provisioningNetwork = default(string), string vmotionNetwork = default(string), string vcenterPassword = default(string), string nsxtPassword = default(string), string vcenterCertificateThumbprint = default(string), string nsxtCertificateThumbprint = default(string), IList externalCloudLinks = default(IList)) + /// A secondary expressRoute circuit + /// from a separate AZ. Only present in a stretched private + /// cloud + /// The identity of the private cloud, if + /// configured. + public PrivateCloud(Sku sku, string networkBlock, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ManagementCluster managementCluster = default(ManagementCluster), string internet = default(string), IList identitySources = default(IList), AvailabilityProperties availability = default(AvailabilityProperties), Encryption encryption = default(Encryption), string provisioningState = default(string), Circuit circuit = default(Circuit), Endpoints endpoints = default(Endpoints), string managementNetwork = default(string), string provisioningNetwork = default(string), string vmotionNetwork = default(string), string vcenterPassword = default(string), string nsxtPassword = default(string), string vcenterCertificateThumbprint = default(string), string nsxtCertificateThumbprint = default(string), IList externalCloudLinks = default(IList), Circuit secondaryCircuit = default(Circuit), PrivateCloudIdentity identity = default(PrivateCloudIdentity)) : base(id, name, type, location, tags) { Sku = sku; ManagementCluster = managementCluster; Internet = internet; IdentitySources = identitySources; + Availability = availability; + Encryption = encryption; ProvisioningState = provisioningState; Circuit = circuit; Endpoints = endpoints; @@ -90,6 +101,8 @@ public PrivateCloud() VcenterCertificateThumbprint = vcenterCertificateThumbprint; NsxtCertificateThumbprint = nsxtCertificateThumbprint; ExternalCloudLinks = externalCloudLinks; + SecondaryCircuit = secondaryCircuit; + Identity = identity; CustomInit(); } @@ -123,6 +136,20 @@ public PrivateCloud() [JsonProperty(PropertyName = "properties.identitySources")] public IList IdentitySources { get; set; } + /// + /// Gets or sets properties describing how the cloud is distributed + /// across availability zones + /// + [JsonProperty(PropertyName = "properties.availability")] + public AvailabilityProperties Availability { get; set; } + + /// + /// Gets or sets customer managed key encryption, can be enabled or + /// disabled + /// + [JsonProperty(PropertyName = "properties.encryption")] + public Encryption Encryption { get; set; } + /// /// Gets the provisioning state. Possible values include: 'Succeeded', /// 'Failed', 'Cancelled', 'Pending', 'Building', 'Deleting', @@ -204,6 +231,19 @@ public PrivateCloud() [JsonProperty(PropertyName = "properties.externalCloudLinks")] public IList ExternalCloudLinks { get; private set; } + /// + /// Gets or sets a secondary expressRoute circuit from a separate AZ. + /// Only present in a stretched private cloud + /// + [JsonProperty(PropertyName = "properties.secondaryCircuit")] + public Circuit SecondaryCircuit { get; set; } + + /// + /// Gets or sets the identity of the private cloud, if configured. + /// + [JsonProperty(PropertyName = "identity")] + public PrivateCloudIdentity Identity { get; set; } + /// /// Validate the object. /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudIdentity.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudIdentity.cs new file mode 100644 index 000000000000..dd0cfb57bdd7 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudIdentity.cs @@ -0,0 +1,79 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Identity for the virtual machine. + /// + public partial class PrivateCloudIdentity + { + /// + /// Initializes a new instance of the PrivateCloudIdentity class. + /// + public PrivateCloudIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateCloudIdentity class. + /// + /// The principal ID of private cloud + /// identity. This property will only be provided for a system assigned + /// identity. + /// The tenant ID associated with the private + /// cloud. This property will only be provided for a system assigned + /// identity. + /// The type of identity used for the private cloud. + /// The type 'SystemAssigned' refers to an implicitly created identity. + /// The type 'None' will remove any identities from the Private Cloud. + /// Possible values include: 'SystemAssigned', 'None' + public PrivateCloudIdentity(string principalId = default(string), string tenantId = default(string), string type = default(string)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal ID of private cloud identity. This property will + /// only be provided for a system assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the tenant ID associated with the private cloud. This property + /// will only be provided for a system assigned identity. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets the type of identity used for the private cloud. The + /// type 'SystemAssigned' refers to an implicitly created identity. The + /// type 'None' will remove any identities from the Private Cloud. + /// Possible values include: 'SystemAssigned', 'None' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudUpdate.cs index 29a781a3201a..2503d994b358 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudUpdate.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudUpdate.cs @@ -41,12 +41,21 @@ public PrivateCloudUpdate() /// disabled. Possible values include: 'Enabled', 'Disabled' /// vCenter Single Sign On Identity /// Sources - public PrivateCloudUpdate(IDictionary tags = default(IDictionary), ManagementCluster managementCluster = default(ManagementCluster), string internet = default(string), IList identitySources = default(IList)) + /// Properties describing how the cloud is + /// distributed across availability zones + /// Customer managed key encryption, can be + /// enabled or disabled + /// The identity of the private cloud, if + /// configured. + public PrivateCloudUpdate(IDictionary tags = default(IDictionary), ManagementCluster managementCluster = default(ManagementCluster), string internet = default(string), IList identitySources = default(IList), AvailabilityProperties availability = default(AvailabilityProperties), Encryption encryption = default(Encryption), PrivateCloudIdentity identity = default(PrivateCloudIdentity)) { Tags = tags; ManagementCluster = managementCluster; Internet = internet; IdentitySources = identitySources; + Availability = availability; + Encryption = encryption; + Identity = identity; CustomInit(); } @@ -80,5 +89,25 @@ public PrivateCloudUpdate() [JsonProperty(PropertyName = "properties.identitySources")] public IList IdentitySources { get; set; } + /// + /// Gets or sets properties describing how the cloud is distributed + /// across availability zones + /// + [JsonProperty(PropertyName = "properties.availability")] + public AvailabilityProperties Availability { get; set; } + + /// + /// Gets or sets customer managed key encryption, can be enabled or + /// disabled + /// + [JsonProperty(PropertyName = "properties.encryption")] + public Encryption Encryption { get; set; } + + /// + /// Gets or sets the identity of the private cloud, if configured. + /// + [JsonProperty(PropertyName = "identity")] + public PrivateCloudIdentity Identity { get; set; } + } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceIdentityType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceIdentityType.cs new file mode 100644 index 000000000000..00b4cc55be76 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceIdentityType.cs @@ -0,0 +1,22 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for ResourceIdentityType. + /// + public static class ResourceIdentityType + { + public const string SystemAssigned = "SystemAssigned"; + public const string None = "None"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SegmentStatusEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SegmentStatusEnum.cs index c339d194ed25..6db7fd8dc810 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SegmentStatusEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SegmentStatusEnum.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class SegmentStatusEnum { - public const string SUCCESSFAILURE = "SUCCESS, FAILURE"; + public const string SUCCESS = "SUCCESS"; + public const string FAILURE = "FAILURE"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMGroupStatusEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMGroupStatusEnum.cs index 742a4b865e84..27a0299db2f0 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMGroupStatusEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMGroupStatusEnum.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class VMGroupStatusEnum { - public const string SUCCESSFAILURE = "SUCCESS, FAILURE"; + public const string SUCCESS = "SUCCESS"; + public const string FAILURE = "FAILURE"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMTypeEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMTypeEnum.cs index cb194cf8b75e..758ae70f1f6e 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMTypeEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMTypeEnum.cs @@ -16,6 +16,8 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class VMTypeEnum { - public const string REGULAREDGESERVICE = "REGULAR, EDGE, SERVICE"; + public const string REGULAR = "REGULAR"; + public const string EDGE = "EDGE"; + public const string SERVICE = "SERVICE"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachine.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachine.cs new file mode 100644 index 000000000000..1459a2563d0f --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachine.cs @@ -0,0 +1,86 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Virtual Machine + /// + [Rest.Serialization.JsonTransformation] + public partial class VirtualMachine : ProxyResource + { + /// + /// Initializes a new instance of the VirtualMachine class. + /// + public VirtualMachine() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachine class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Display name of the VM. + /// Virtual machine managed object reference + /// id + /// Path to virtual machine's folder starting + /// from datacenter virtual machine folder + /// Possible values include: 'Enabled', + /// 'Disabled' + public VirtualMachine(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string moRefId = default(string), string folderPath = default(string), string restrictMovement = default(string)) + : base(id, name, type) + { + DisplayName = displayName; + MoRefId = moRefId; + FolderPath = folderPath; + RestrictMovement = restrictMovement; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets display name of the VM. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets virtual machine managed object reference id + /// + [JsonProperty(PropertyName = "properties.moRefId")] + public string MoRefId { get; private set; } + + /// + /// Gets path to virtual machine's folder starting from datacenter + /// virtual machine folder + /// + [JsonProperty(PropertyName = "properties.folderPath")] + public string FolderPath { get; private set; } + + /// + /// Gets possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.restrictMovement")] + public string RestrictMovement { get; private set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovement.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovement.cs new file mode 100644 index 000000000000..641ff49e8de4 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovement.cs @@ -0,0 +1,54 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Set VM DRS-driven movement to restricted (enabled) or not (disabled) + /// + public partial class VirtualMachineRestrictMovement + { + /// + /// Initializes a new instance of the VirtualMachineRestrictMovement + /// class. + /// + public VirtualMachineRestrictMovement() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineRestrictMovement + /// class. + /// + /// Possible values include: 'Enabled', + /// 'Disabled' + public VirtualMachineRestrictMovement(string restrictMovement = default(string)) + { + RestrictMovement = restrictMovement; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "restrictMovement")] + public string RestrictMovement { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovementState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovementState.cs new file mode 100644 index 000000000000..f2d85e9b9756 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovementState.cs @@ -0,0 +1,22 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for VirtualMachineRestrictMovementState. + /// + public static class VirtualMachineRestrictMovementState + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmHostPlacementPolicyProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmHostPlacementPolicyProperties.cs new file mode 100644 index 000000000000..bc174c1c3367 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmHostPlacementPolicyProperties.cs @@ -0,0 +1,104 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// VM-Host placement policy properties + /// + [Newtonsoft.Json.JsonObject("VmHost")] + public partial class VmHostPlacementPolicyProperties : PlacementPolicyProperties + { + /// + /// Initializes a new instance of the VmHostPlacementPolicyProperties + /// class. + /// + public VmHostPlacementPolicyProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VmHostPlacementPolicyProperties + /// class. + /// + /// Virtual machine members list + /// Host members list + /// placement policy affinity type. Possible + /// values include: 'Affinity', 'AntiAffinity' + /// Whether the placement policy is enabled or + /// disabled. Possible values include: 'Enabled', 'Disabled' + /// Display name of the placement + /// policy + /// The provisioning state. Possible + /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', + /// 'Updating' + public VmHostPlacementPolicyProperties(IList vmMembers, IList hostMembers, string affinityType, string state = default(string), string displayName = default(string), string provisioningState = default(string)) + : base(state, displayName, provisioningState) + { + VmMembers = vmMembers; + HostMembers = hostMembers; + AffinityType = affinityType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets virtual machine members list + /// + [JsonProperty(PropertyName = "vmMembers")] + public IList VmMembers { get; set; } + + /// + /// Gets or sets host members list + /// + [JsonProperty(PropertyName = "hostMembers")] + public IList HostMembers { get; set; } + + /// + /// Gets or sets placement policy affinity type. Possible values + /// include: 'Affinity', 'AntiAffinity' + /// + [JsonProperty(PropertyName = "affinityType")] + public string AffinityType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VmMembers == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VmMembers"); + } + if (HostMembers == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "HostMembers"); + } + if (AffinityType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AffinityType"); + } + } + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmVmPlacementPolicyProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmVmPlacementPolicyProperties.cs new file mode 100644 index 000000000000..145bbaaf0756 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmVmPlacementPolicyProperties.cs @@ -0,0 +1,92 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// VM-VM placement policy properties + /// + [Newtonsoft.Json.JsonObject("VmVm")] + public partial class VmVmPlacementPolicyProperties : PlacementPolicyProperties + { + /// + /// Initializes a new instance of the VmVmPlacementPolicyProperties + /// class. + /// + public VmVmPlacementPolicyProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VmVmPlacementPolicyProperties + /// class. + /// + /// Virtual machine members list + /// placement policy affinity type. Possible + /// values include: 'Affinity', 'AntiAffinity' + /// Whether the placement policy is enabled or + /// disabled. Possible values include: 'Enabled', 'Disabled' + /// Display name of the placement + /// policy + /// The provisioning state. Possible + /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', + /// 'Updating' + public VmVmPlacementPolicyProperties(IList vmMembers, string affinityType, string state = default(string), string displayName = default(string), string provisioningState = default(string)) + : base(state, displayName, provisioningState) + { + VmMembers = vmMembers; + AffinityType = affinityType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets virtual machine members list + /// + [JsonProperty(PropertyName = "vmMembers")] + public IList VmMembers { get; set; } + + /// + /// Gets or sets placement policy affinity type. Possible values + /// include: 'Affinity', 'AntiAffinity' + /// + [JsonProperty(PropertyName = "affinityType")] + public string AffinityType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VmMembers == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VmMembers"); + } + if (AffinityType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AffinityType"); + } + } + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroring.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroring.cs index 7012b6171721..cd66a9d91106 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroring.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroring.cs @@ -40,11 +40,12 @@ public WorkloadNetworkPortMirroring() /// Display name of the port mirroring /// profile. /// Direction of port mirroring profile. - /// Possible values include: 'INGRESS, EGRESS, BIDIRECTIONAL' + /// Possible values include: 'INGRESS', 'EGRESS', + /// 'BIDIRECTIONAL' /// Source VM Group. /// Destination VM Group. /// Port Mirroring Status. Possible values - /// include: 'SUCCESS, FAILURE' + /// include: 'SUCCESS', 'FAILURE' /// The provisioning state. Possible /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', /// 'Updating' @@ -75,7 +76,7 @@ public WorkloadNetworkPortMirroring() /// /// Gets or sets direction of port mirroring profile. Possible values - /// include: 'INGRESS, EGRESS, BIDIRECTIONAL' + /// include: 'INGRESS', 'EGRESS', 'BIDIRECTIONAL' /// [JsonProperty(PropertyName = "properties.direction")] public string Direction { get; set; } @@ -93,8 +94,8 @@ public WorkloadNetworkPortMirroring() public string Destination { get; set; } /// - /// Gets port Mirroring Status. Possible values include: 'SUCCESS, - /// FAILURE' + /// Gets port Mirroring Status. Possible values include: 'SUCCESS', + /// 'FAILURE' /// [JsonProperty(PropertyName = "properties.status")] public string Status { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegment.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegment.cs index dddad4794113..3d61e730f412 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegment.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegment.cs @@ -44,7 +44,7 @@ public WorkloadNetworkSegment() /// Port Vif which segment is associated /// with. /// Segment status. Possible values include: - /// 'SUCCESS, FAILURE' + /// 'SUCCESS', 'FAILURE' /// The provisioning state. Possible /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', /// 'Updating' @@ -92,7 +92,7 @@ public WorkloadNetworkSegment() public IList PortVif { get; private set; } /// - /// Gets segment status. Possible values include: 'SUCCESS, FAILURE' + /// Gets segment status. Possible values include: 'SUCCESS', 'FAILURE' /// [JsonProperty(PropertyName = "properties.status")] public string Status { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroup.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroup.cs index d593cc66159f..bfd3bf72e350 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroup.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroup.cs @@ -41,7 +41,7 @@ public WorkloadNetworkVMGroup() /// Virtual machine members of this /// group. /// VM Group status. Possible values include: - /// 'SUCCESS, FAILURE' + /// 'SUCCESS', 'FAILURE' /// The provisioning state. Possible /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', /// 'Updating' @@ -75,7 +75,7 @@ public WorkloadNetworkVMGroup() public IList Members { get; set; } /// - /// Gets VM Group status. Possible values include: 'SUCCESS, FAILURE' + /// Gets VM Group status. Possible values include: 'SUCCESS', 'FAILURE' /// [JsonProperty(PropertyName = "properties.status")] public string Status { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVirtualMachine.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVirtualMachine.cs index 5a90a70483cd..c7f391295189 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVirtualMachine.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVirtualMachine.cs @@ -39,7 +39,7 @@ public WorkloadNetworkVirtualMachine() /// Resource type. /// Display name of the VM. /// Virtual machine type. Possible values include: - /// 'REGULAR, EDGE, SERVICE' + /// 'REGULAR', 'EDGE', 'SERVICE' public WorkloadNetworkVirtualMachine(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string vmType = default(string)) : base(id, name, type) { @@ -60,8 +60,8 @@ public WorkloadNetworkVirtualMachine() public string DisplayName { get; set; } /// - /// Gets virtual machine type. Possible values include: 'REGULAR, EDGE, - /// SERVICE' + /// Gets virtual machine type. Possible values include: 'REGULAR', + /// 'EDGE', 'SERVICE' /// [JsonProperty(PropertyName = "properties.vmType")] public string VmType { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperations.cs new file mode 100644 index 000000000000..850378376b12 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperations.cs @@ -0,0 +1,1553 @@ +// +// 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.Avs +{ + 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; + + /// + /// PlacementPoliciesOperations operations. + /// + internal partial class PlacementPoliciesOperations : IServiceOperations, IPlacementPoliciesOperations + { + /// + /// Initializes a new instance of the PlacementPoliciesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PlacementPoliciesOperations(AvsClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AvsClient + /// + public AvsClient Client { get; private set; } + + /// + /// List placement policies in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + } + + /// + /// Get a placement policy by name in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// 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 privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (placementPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("placementPolicyName", placementPolicyName); + 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{placementPolicyName}", System.Uri.EscapeDataString(placementPolicyName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + } + + /// + /// Create or update a placement policy in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// A placement policy in the private cloud cluster + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicy, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a placement policy in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// The placement policy properties that may be updated + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicyUpdate, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a placement policy in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update a placement policy in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// A placement policy in the private cloud cluster + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (placementPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyName"); + } + if (placementPolicy == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicy"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("placementPolicyName", placementPolicyName); + tracingParameters.Add("placementPolicy", placementPolicy); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{placementPolicyName}", System.Uri.EscapeDataString(placementPolicyName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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(placementPolicy != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(placementPolicy, 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 placement policy in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// The placement policy properties that may be updated + /// + /// + /// 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (placementPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyName"); + } + if (placementPolicyUpdate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyUpdate"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("placementPolicyName", placementPolicyName); + tracingParameters.Add("placementPolicyUpdate", placementPolicyUpdate); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{placementPolicyName}", System.Uri.EscapeDataString(placementPolicyName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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(placementPolicyUpdate != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(placementPolicyUpdate, 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 != 202) + { + 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 == 202) + { + _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 placement policy in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (placementPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("placementPolicyName", placementPolicyName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{placementPolicyName}", System.Uri.EscapeDataString(placementPolicyName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + 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; + } + + /// + /// List placement policies in a private cloud cluster + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", 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/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperationsExtensions.cs new file mode 100644 index 000000000000..8c1e9de87106 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperationsExtensions.cs @@ -0,0 +1,501 @@ +// +// 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.Avs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PlacementPoliciesOperations. + /// + public static partial class PlacementPoliciesOperationsExtensions + { + /// + /// List placement policies in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + public static IPage List(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName) + { + return operations.ListAsync(resourceGroupName, privateCloudName, clusterName).GetAwaiter().GetResult(); + } + + /// + /// List placement policies in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a placement policy by name in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + public static PlacementPolicy Get(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName) + { + return operations.GetAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName).GetAwaiter().GetResult(); + } + + /// + /// Get a placement policy by name in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update a placement policy in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// A placement policy in the private cloud cluster + /// + public static PlacementPolicy CreateOrUpdate(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy) + { + return operations.CreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicy).GetAwaiter().GetResult(); + } + + /// + /// Create or update a placement policy in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// A placement policy in the private cloud cluster + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicy, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a placement policy in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// The placement policy properties that may be updated + /// + public static PlacementPolicy Update(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate) + { + return operations.UpdateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicyUpdate).GetAwaiter().GetResult(); + } + + /// + /// Update a placement policy in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// The placement policy properties that may be updated + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicyUpdate, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a placement policy in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + public static void Delete(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName) + { + operations.DeleteAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName).GetAwaiter().GetResult(); + } + + /// + /// Delete a placement policy in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Create or update a placement policy in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// A placement policy in the private cloud cluster + /// + public static PlacementPolicy BeginCreateOrUpdate(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicy).GetAwaiter().GetResult(); + } + + /// + /// Create or update a placement policy in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// A placement policy in the private cloud cluster + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicy, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a placement policy in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// The placement policy properties that may be updated + /// + public static PlacementPolicy BeginUpdate(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate) + { + return operations.BeginUpdateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicyUpdate).GetAwaiter().GetResult(); + } + + /// + /// Update a placement policy in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// The placement policy properties that may be updated + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicyUpdate, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a placement policy in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + public static void BeginDelete(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName) + { + operations.BeginDeleteAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName).GetAwaiter().GetResult(); + } + + /// + /// Delete a placement policy in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement + /// policy + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List placement policies in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IPlacementPoliciesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List placement policies in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IPlacementPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PrivateCloudsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PrivateCloudsOperations.cs index 65900d0df5bf..cac3f577fafb 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PrivateCloudsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PrivateCloudsOperations.cs @@ -104,10 +104,6 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -515,10 +511,6 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -856,10 +848,6 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -1084,10 +1072,6 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -1345,10 +1329,6 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -1596,10 +1576,6 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -1800,10 +1776,6 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -2004,10 +1976,6 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperations.cs index 91d013eb7b13..d1e685408afa 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperations.cs @@ -51,8 +51,8 @@ internal ScriptCmdletsOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// Return script cmdlet resources available for a private cloud to create a - /// script execution resource on their Private Cloud + /// List script cmdlet resources available for a private cloud to create a + /// script execution resource on a private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -111,10 +111,6 @@ internal ScriptCmdletsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -350,10 +346,6 @@ internal ScriptCmdletsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -531,8 +523,8 @@ internal ScriptCmdletsOperations(AvsClient client) } /// - /// Return script cmdlet resources available for a private cloud to create a - /// script execution resource on their Private Cloud + /// List script cmdlet resources available for a private cloud to create a + /// script execution resource on a private cloud /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperationsExtensions.cs index 1269e391bdd0..b6b206dd6bc7 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperationsExtensions.cs @@ -22,8 +22,8 @@ namespace Microsoft.Azure.Management.Avs public static partial class ScriptCmdletsOperationsExtensions { /// - /// Return script cmdlet resources available for a private cloud to create a - /// script execution resource on their Private Cloud + /// List script cmdlet resources available for a private cloud to create a + /// script execution resource on a private cloud /// /// /// The operations group for this extension method. @@ -43,8 +43,8 @@ public static IPage List(this IScriptCmdletsOperations operations, } /// - /// Return script cmdlet resources available for a private cloud to create a - /// script execution resource on their Private Cloud + /// List script cmdlet resources available for a private cloud to create a + /// script execution resource on a private cloud /// /// /// The operations group for this extension method. @@ -126,8 +126,8 @@ public static ScriptCmdlet Get(this IScriptCmdletsOperations operations, string } /// - /// Return script cmdlet resources available for a private cloud to create a - /// script execution resource on their Private Cloud + /// List script cmdlet resources available for a private cloud to create a + /// script execution resource on a private cloud /// /// /// The operations group for this extension method. @@ -141,8 +141,8 @@ public static IPage ListNext(this IScriptCmdletsOperations operati } /// - /// Return script cmdlet resources available for a private cloud to create a - /// script execution resource on their Private Cloud + /// List script cmdlet resources available for a private cloud to create a + /// script execution resource on a private cloud /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperations.cs index 543a6bd1c54d..b912a99c2435 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperations.cs @@ -51,7 +51,7 @@ internal ScriptExecutionsOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// Get an script execution resource by name in a private cloud + /// List script executions in a private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -107,10 +107,6 @@ internal ScriptExecutionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -276,7 +272,7 @@ internal ScriptExecutionsOperations(AvsClient client) } /// - /// Get an script execution resource by name in a private cloud + /// Get an script execution by name in a private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -335,10 +331,6 @@ internal ScriptExecutionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -510,7 +502,7 @@ internal ScriptExecutionsOperations(AvsClient client) } /// - /// Create or update a script execution resource in a private cloud + /// Create or update a script execution in a private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -626,10 +618,6 @@ internal ScriptExecutionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -808,7 +796,7 @@ internal ScriptExecutionsOperations(AvsClient client) } /// - /// Create or update a script execution resource in a private cloud + /// Create or update a script execution in a private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -870,10 +858,6 @@ internal ScriptExecutionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -1134,10 +1118,6 @@ internal ScriptExecutionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -1291,7 +1271,7 @@ internal ScriptExecutionsOperations(AvsClient client) } /// - /// Get an script execution resource by name in a private cloud + /// List script executions in a private cloud /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperationsExtensions.cs index e6da0ac98ad7..74423d569e23 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperationsExtensions.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class ScriptExecutionsOperationsExtensions { /// - /// Get an script execution resource by name in a private cloud + /// List script executions in a private cloud /// /// /// The operations group for this extension method. @@ -41,7 +41,7 @@ public static IPage List(this IScriptExecutionsOperations opera } /// - /// Get an script execution resource by name in a private cloud + /// List script executions in a private cloud /// /// /// The operations group for this extension method. @@ -64,7 +64,7 @@ public static IPage List(this IScriptExecutionsOperations opera } /// - /// Get an script execution resource by name in a private cloud + /// Get an script execution by name in a private cloud /// /// /// The operations group for this extension method. @@ -84,7 +84,7 @@ public static ScriptExecution Get(this IScriptExecutionsOperations operations, s } /// - /// Get an script execution resource by name in a private cloud + /// Get an script execution by name in a private cloud /// /// /// The operations group for this extension method. @@ -110,7 +110,7 @@ public static ScriptExecution Get(this IScriptExecutionsOperations operations, s } /// - /// Create or update a script execution resource in a private cloud + /// Create or update a script execution in a private cloud /// /// /// The operations group for this extension method. @@ -133,7 +133,7 @@ public static ScriptExecution CreateOrUpdate(this IScriptExecutionsOperations op } /// - /// Create or update a script execution resource in a private cloud + /// Create or update a script execution in a private cloud /// /// /// The operations group for this extension method. @@ -259,7 +259,7 @@ public static void Delete(this IScriptExecutionsOperations operations, string re } /// - /// Create or update a script execution resource in a private cloud + /// Create or update a script execution in a private cloud /// /// /// The operations group for this extension method. @@ -282,7 +282,7 @@ public static ScriptExecution BeginCreateOrUpdate(this IScriptExecutionsOperatio } /// - /// Create or update a script execution resource in a private cloud + /// Create or update a script execution in a private cloud /// /// /// The operations group for this extension method. @@ -354,7 +354,7 @@ public static void BeginDelete(this IScriptExecutionsOperations operations, stri } /// - /// Get an script execution resource by name in a private cloud + /// List script executions in a private cloud /// /// /// The operations group for this extension method. @@ -368,7 +368,7 @@ public static IPage ListNext(this IScriptExecutionsOperations o } /// - /// Get an script execution resource by name in a private cloud + /// List script executions in a private cloud /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperations.cs index 21c19bfcae26..1773ab12499b 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperations.cs @@ -51,8 +51,7 @@ internal ScriptPackagesOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// Return script packages available for a private cloud to run on their - /// Private Cloud + /// List script packages available to run on the private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -108,10 +107,6 @@ internal ScriptPackagesOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -277,7 +272,7 @@ internal ScriptPackagesOperations(AvsClient client) } /// - /// Return script package available to run on an Private Cloud + /// Get a script package available to run on a private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -336,10 +331,6 @@ internal ScriptPackagesOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateCloudName == null) { @@ -511,8 +502,7 @@ internal ScriptPackagesOperations(AvsClient client) } /// - /// Return script packages available for a private cloud to run on their - /// Private Cloud + /// List script packages available to run on the private cloud /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperationsExtensions.cs index f8720e7b13d3..80d91d2cd274 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperationsExtensions.cs @@ -22,8 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class ScriptPackagesOperationsExtensions { /// - /// Return script packages available for a private cloud to run on their - /// Private Cloud + /// List script packages available to run on the private cloud /// /// /// The operations group for this extension method. @@ -40,8 +39,7 @@ public static IPage List(this IScriptPackagesOperations operation } /// - /// Return script packages available for a private cloud to run on their - /// Private Cloud + /// List script packages available to run on the private cloud /// /// /// The operations group for this extension method. @@ -64,7 +62,7 @@ public static IPage List(this IScriptPackagesOperations operation } /// - /// Return script package available to run on an Private Cloud + /// Get a script package available to run on a private cloud /// /// /// The operations group for this extension method. @@ -84,7 +82,7 @@ public static ScriptPackage Get(this IScriptPackagesOperations operations, strin } /// - /// Return script package available to run on an Private Cloud + /// Get a script package available to run on a private cloud /// /// /// The operations group for this extension method. @@ -110,8 +108,7 @@ public static ScriptPackage Get(this IScriptPackagesOperations operations, strin } /// - /// Return script packages available for a private cloud to run on their - /// Private Cloud + /// List script packages available to run on the private cloud /// /// /// The operations group for this extension method. @@ -125,8 +122,7 @@ public static IPage ListNext(this IScriptPackagesOperations opera } /// - /// Return script packages available for a private cloud to run on their - /// Private Cloud + /// List script packages available to run on the private cloud /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/SdkInfo_AzureVMwareSolutionAPI.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/SdkInfo_AzureVMwareSolutionAPI.cs index fbf7cb40fc93..33e3b4ce688b 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/SdkInfo_AzureVMwareSolutionAPI.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/SdkInfo_AzureVMwareSolutionAPI.cs @@ -19,33 +19,24 @@ public static IEnumerable> ApiInfo_AzureVMwareSolu { return new Tuple[] { - new Tuple("AVS", "Addons", "2021-06-01"), - new Tuple("AVS", "Authorizations", "2021-06-01"), - new Tuple("AVS", "CloudLinks", "2021-06-01"), - new Tuple("AVS", "Clusters", "2021-06-01"), - new Tuple("AVS", "Datastores", "2021-06-01"), - new Tuple("AVS", "GlobalReachConnections", "2021-06-01"), - new Tuple("AVS", "HcxEnterpriseSites", "2021-06-01"), - new Tuple("AVS", "Locations", "2021-06-01"), - new Tuple("AVS", "Operations", "2021-06-01"), - new Tuple("AVS", "PrivateClouds", "2021-06-01"), - new Tuple("AVS", "ScriptCmdlets", "2021-06-01"), - new Tuple("AVS", "ScriptExecutions", "2021-06-01"), - new Tuple("AVS", "ScriptPackages", "2021-06-01"), - new Tuple("AVS", "WorkloadNetworks", "2021-06-01"), + new Tuple("AVS", "Addons", "2021-12-01"), + new Tuple("AVS", "Authorizations", "2021-12-01"), + new Tuple("AVS", "CloudLinks", "2021-12-01"), + new Tuple("AVS", "Clusters", "2021-12-01"), + new Tuple("AVS", "Datastores", "2021-12-01"), + new Tuple("AVS", "GlobalReachConnections", "2021-12-01"), + new Tuple("AVS", "HcxEnterpriseSites", "2021-12-01"), + new Tuple("AVS", "Locations", "2021-12-01"), + new Tuple("AVS", "Operations", "2021-12-01"), + new Tuple("AVS", "PlacementPolicies", "2021-12-01"), + new Tuple("AVS", "PrivateClouds", "2021-12-01"), + new Tuple("AVS", "ScriptCmdlets", "2021-12-01"), + new Tuple("AVS", "ScriptExecutions", "2021-12-01"), + new Tuple("AVS", "ScriptPackages", "2021-12-01"), + new Tuple("AVS", "VirtualMachines", "2021-12-01"), + new Tuple("AVS", "WorkloadNetworks", "2021-12-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/AVS/dotnet/specification/vmware/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Users\\cataggar\\io\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "AVS/dotnet"; - public static readonly String GithubCommidId = "13dc07975e72d633349c2f0696610f7ddf25fc16"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperations.cs new file mode 100644 index 000000000000..8f14cb90e4f2 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperations.cs @@ -0,0 +1,959 @@ +// +// 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.Avs +{ + 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; + + /// + /// VirtualMachinesOperations operations. + /// + internal partial class VirtualMachinesOperations : IServiceOperations, IVirtualMachinesOperations + { + /// + /// Initializes a new instance of the VirtualMachinesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal VirtualMachinesOperations(AvsClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AvsClient + /// + public AvsClient Client { get; private set; } + + /// + /// List of virtual machines in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + } + + /// + /// Get a virtual machine by id in a private cloud cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Virtual Machine identifier + /// + /// + /// 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 privateCloudName, string clusterName, string virtualMachineId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (virtualMachineId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("virtualMachineId", virtualMachineId); + 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{virtualMachineId}", System.Uri.EscapeDataString(virtualMachineId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + } + + /// + /// Enable or disable DRS-driven VM movement restriction + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Virtual Machine identifier + /// + /// + /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestrictMovementWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestrictMovementWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Enable or disable DRS-driven VM movement restriction + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Virtual Machine identifier + /// + /// + /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// + /// + /// 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 BeginRestrictMovementWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (virtualMachineId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineId"); + } + if (restrictMovement == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "restrictMovement"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("virtualMachineId", virtualMachineId); + tracingParameters.Add("restrictMovement", restrictMovement); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestrictMovement", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{virtualMachineId}", System.Uri.EscapeDataString(virtualMachineId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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("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(restrictMovement != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restrictMovement, 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 != 202) + { + 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; + } + + /// + /// List of virtual machines in a private cloud cluster + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", 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/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperationsExtensions.cs new file mode 100644 index 000000000000..9cf4713d6563 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperationsExtensions.cs @@ -0,0 +1,267 @@ +// +// 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.Avs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for VirtualMachinesOperations. + /// + public static partial class VirtualMachinesOperationsExtensions + { + /// + /// List of virtual machines in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + public static IPage List(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName) + { + return operations.ListAsync(resourceGroupName, privateCloudName, clusterName).GetAwaiter().GetResult(); + } + + /// + /// List of virtual machines in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a virtual machine by id in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Virtual Machine identifier + /// + public static VirtualMachine Get(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId) + { + return operations.GetAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId).GetAwaiter().GetResult(); + } + + /// + /// Get a virtual machine by id in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Virtual Machine identifier + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Enable or disable DRS-driven VM movement restriction + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Virtual Machine identifier + /// + /// + /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// + public static void RestrictMovement(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement) + { + operations.RestrictMovementAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement).GetAwaiter().GetResult(); + } + + /// + /// Enable or disable DRS-driven VM movement restriction + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Virtual Machine identifier + /// + /// + /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// + /// + /// The cancellation token. + /// + public static async Task RestrictMovementAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RestrictMovementWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Enable or disable DRS-driven VM movement restriction + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Virtual Machine identifier + /// + /// + /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// + public static void BeginRestrictMovement(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement) + { + operations.BeginRestrictMovementAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement).GetAwaiter().GetResult(); + } + + /// + /// Enable or disable DRS-driven VM movement restriction + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster in the private cloud + /// + /// + /// Virtual Machine identifier + /// + /// + /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// + /// + /// The cancellation token. + /// + public static async Task BeginRestrictMovementAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRestrictMovementWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List of virtual machines in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IVirtualMachinesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List of virtual machines in a private cloud cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IVirtualMachinesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/WorkloadNetworksOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/WorkloadNetworksOperations.cs index 603b73e5eecc..0c3056e285c7 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/WorkloadNetworksOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/WorkloadNetworksOperations.cs @@ -107,10 +107,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -335,10 +331,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -647,10 +639,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -875,10 +863,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -1187,10 +1171,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -1415,10 +1395,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -1646,10 +1622,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -1875,10 +1847,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -2191,10 +2159,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -2419,10 +2383,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -2731,10 +2691,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -2959,10 +2915,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -3190,10 +3142,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -3419,10 +3367,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -3734,10 +3678,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -3962,10 +3902,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -4274,10 +4210,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -4503,10 +4435,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -4795,10 +4723,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -5061,10 +4985,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -5303,10 +5223,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -5522,10 +5438,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -5788,10 +5700,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -6030,10 +5938,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -6250,10 +6154,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -6518,10 +6418,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -6761,10 +6657,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -6980,10 +6872,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -7246,10 +7134,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -7488,10 +7372,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -7708,10 +7588,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -7975,10 +7851,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -8218,10 +8090,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -8437,10 +8305,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -8703,10 +8567,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -8945,10 +8805,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -9165,10 +9021,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) { @@ -9426,10 +9278,6 @@ internal WorkloadNetworksOperations(AvsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (Client.ApiVersion == null) {