diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchManagementClient.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchManagementClient.cs index c137c0ad15af..a19713799d67 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchManagementClient.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchManagementClient.cs @@ -368,7 +368,7 @@ private void Initialize() PrivateEndpointConnection = new PrivateEndpointConnectionOperations(this); Pool = new PoolOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-03-01"; + ApiVersion = "2020-05-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IPrivateEndpointConnectionOperations.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IPrivateEndpointConnectionOperations.cs index f2bc6d66865d..83d9c776f997 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IPrivateEndpointConnectionOperations.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IPrivateEndpointConnectionOperations.cs @@ -121,6 +121,45 @@ public partial interface IPrivateEndpointConnectionOperations /// Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Updates the properties of an existing private endpoint connection. + /// + /// + /// The name of the resource group that contains the Batch account. + /// + /// + /// The name of the Batch account. + /// + /// + /// The private endpoint connection name. This must be unique within + /// the account. + /// + /// + /// PrivateEndpointConnection properties that should be updated. + /// Properties that are supplied will be updated, any property not + /// supplied will be unchanged. + /// + /// + /// The state (ETag) version of the private endpoint connection to + /// update. This value can be omitted or set to "*" to apply the + /// operation unconditionally. + /// + /// + /// 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 accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists all of the private endpoint connections in the specified /// account. /// diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccount.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccount.cs index 5dd517196ed6..b0987e033648 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccount.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccount.cs @@ -71,7 +71,8 @@ public BatchAccount() /// account. /// The active job and job /// schedule quota for the Batch account. - public BatchAccount(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string accountEndpoint = default(string), ProvisioningState provisioningState = default(ProvisioningState), PoolAllocationMode? poolAllocationMode = default(PoolAllocationMode?), KeyVaultReference keyVaultReference = default(KeyVaultReference), PublicNetworkAccessType? publicNetworkAccess = default(PublicNetworkAccessType?), IList privateEndpointConnections = default(IList), AutoStorageProperties autoStorage = default(AutoStorageProperties), EncryptionProperties encryption = default(EncryptionProperties), int? dedicatedCoreQuota = default(int?), int? lowPriorityCoreQuota = default(int?), IList dedicatedCoreQuotaPerVMFamily = default(IList), bool dedicatedCoreQuotaPerVMFamilyEnforced = default(bool), int poolQuota = default(int), int activeJobAndJobScheduleQuota = default(int)) + /// The identity of the Batch account. + public BatchAccount(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string accountEndpoint = default(string), ProvisioningState provisioningState = default(ProvisioningState), PoolAllocationMode? poolAllocationMode = default(PoolAllocationMode?), KeyVaultReference keyVaultReference = default(KeyVaultReference), PublicNetworkAccessType? publicNetworkAccess = default(PublicNetworkAccessType?), IList privateEndpointConnections = default(IList), AutoStorageProperties autoStorage = default(AutoStorageProperties), EncryptionProperties encryption = default(EncryptionProperties), int? dedicatedCoreQuota = default(int?), int? lowPriorityCoreQuota = default(int?), IList dedicatedCoreQuotaPerVMFamily = default(IList), bool dedicatedCoreQuotaPerVMFamilyEnforced = default(bool), int poolQuota = default(int), int activeJobAndJobScheduleQuota = default(int), BatchAccountIdentity identity = default(BatchAccountIdentity)) : base(id, name, type, location, tags) { AccountEndpoint = accountEndpoint; @@ -88,6 +89,7 @@ public BatchAccount() DedicatedCoreQuotaPerVMFamilyEnforced = dedicatedCoreQuotaPerVMFamilyEnforced; PoolQuota = poolQuota; ActiveJobAndJobScheduleQuota = activeJobAndJobScheduleQuota; + Identity = identity; CustomInit(); } @@ -155,6 +157,11 @@ public BatchAccount() /// /// Gets the encryption configuration for the Batch account. /// + /// + /// Configures how customer data is encrypted inside the Batch account. + /// By default, accounts are encrypted using a Microsoft managed key. + /// For additional control, a customer-managed key can be used instead. + /// [JsonProperty(PropertyName = "properties.encryption")] public EncryptionProperties Encryption { get; private set; } @@ -217,6 +224,12 @@ public BatchAccount() [JsonProperty(PropertyName = "properties.activeJobAndJobScheduleQuota")] public int ActiveJobAndJobScheduleQuota { get; private set; } + /// + /// Gets or sets the identity of the Batch account. + /// + [JsonProperty(PropertyName = "identity")] + public BatchAccountIdentity Identity { get; set; } + /// /// Validate the object. /// @@ -243,6 +256,10 @@ public virtual void Validate() { AutoStorage.Validate(); } + if (Identity != null) + { + Identity.Validate(); + } } } } diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountCreateParameters.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountCreateParameters.cs index 2de874ac253e..a32c2bc81efc 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountCreateParameters.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountCreateParameters.cs @@ -50,7 +50,8 @@ public BatchAccountCreateParameters() /// accessing Azure Batch account. /// The encryption configuration for the Batch /// account. - public BatchAccountCreateParameters(string location, IDictionary tags = default(IDictionary), AutoStorageBaseProperties autoStorage = default(AutoStorageBaseProperties), PoolAllocationMode? poolAllocationMode = default(PoolAllocationMode?), KeyVaultReference keyVaultReference = default(KeyVaultReference), PublicNetworkAccessType? publicNetworkAccess = default(PublicNetworkAccessType?), EncryptionProperties encryption = default(EncryptionProperties)) + /// The identity of the Batch account. + public BatchAccountCreateParameters(string location, IDictionary tags = default(IDictionary), AutoStorageBaseProperties autoStorage = default(AutoStorageBaseProperties), PoolAllocationMode? poolAllocationMode = default(PoolAllocationMode?), KeyVaultReference keyVaultReference = default(KeyVaultReference), PublicNetworkAccessType? publicNetworkAccess = default(PublicNetworkAccessType?), EncryptionProperties encryption = default(EncryptionProperties), BatchAccountIdentity identity = default(BatchAccountIdentity)) { Location = location; Tags = tags; @@ -59,6 +60,7 @@ public BatchAccountCreateParameters() KeyVaultReference = keyVaultReference; PublicNetworkAccess = publicNetworkAccess; Encryption = encryption; + Identity = identity; CustomInit(); } @@ -121,9 +123,20 @@ public BatchAccountCreateParameters() /// /// Gets or sets the encryption configuration for the Batch account. /// + /// + /// Configures how customer data is encrypted inside the Batch account. + /// By default, accounts are encrypted using a Microsoft managed key. + /// For additional control, a customer-managed key can be used instead. + /// [JsonProperty(PropertyName = "properties.encryption")] public EncryptionProperties Encryption { get; set; } + /// + /// Gets or sets the identity of the Batch account. + /// + [JsonProperty(PropertyName = "identity")] + public BatchAccountIdentity Identity { get; set; } + /// /// Validate the object. /// @@ -144,6 +157,10 @@ public virtual void Validate() { KeyVaultReference.Validate(); } + if (Identity != null) + { + Identity.Validate(); + } } } } diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountIdentity.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountIdentity.cs new file mode 100644 index 000000000000..c6a9a9cfde86 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountIdentity.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.Batch.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The identity of the Batch account, if configured. This is only used + /// when the user specifies 'Azure.KeyVault' as their Batch account + /// encryption configuration. + /// + public partial class BatchAccountIdentity + { + /// + /// Initializes a new instance of the BatchAccountIdentity class. + /// + public BatchAccountIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BatchAccountIdentity class. + /// + /// The type of identity used for the Batch account. + /// Possible values include: 'SystemAssigned', 'None' + /// The principal id of the Batch account. + /// This property will only be provided for a system assigned + /// identity. + /// The tenant id associated with the Batch + /// account. This property will only be provided for a system assigned + /// identity. + public BatchAccountIdentity(ResourceIdentityType type, string principalId = default(string), string tenantId = 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 the Batch account. 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 Batch account. 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 Batch account. + /// Possible values include: 'SystemAssigned', 'None' + /// + [JsonProperty(PropertyName = "type")] + public ResourceIdentityType Type { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountUpdateParameters.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountUpdateParameters.cs index 074e7fb1de41..80214cc96c31 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountUpdateParameters.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountUpdateParameters.cs @@ -42,11 +42,13 @@ public BatchAccountUpdateParameters() /// auto-storage account. /// The encryption configuration for the Batch /// account. - public BatchAccountUpdateParameters(IDictionary tags = default(IDictionary), AutoStorageBaseProperties autoStorage = default(AutoStorageBaseProperties), EncryptionProperties encryption = default(EncryptionProperties)) + /// The identity of the Batch account. + public BatchAccountUpdateParameters(IDictionary tags = default(IDictionary), AutoStorageBaseProperties autoStorage = default(AutoStorageBaseProperties), EncryptionProperties encryption = default(EncryptionProperties), BatchAccountIdentity identity = default(BatchAccountIdentity)) { Tags = tags; AutoStorage = autoStorage; Encryption = encryption; + Identity = identity; CustomInit(); } @@ -70,9 +72,20 @@ public BatchAccountUpdateParameters() /// /// Gets or sets the encryption configuration for the Batch account. /// + /// + /// Configures how customer data is encrypted inside the Batch account. + /// By default, accounts are encrypted using a Microsoft managed key. + /// For additional control, a customer-managed key can be used instead. + /// [JsonProperty(PropertyName = "properties.encryption")] public EncryptionProperties Encryption { get; set; } + /// + /// Gets or sets the identity of the Batch account. + /// + [JsonProperty(PropertyName = "identity")] + public BatchAccountIdentity Identity { get; set; } + /// /// Validate the object. /// @@ -85,6 +98,10 @@ public virtual void Validate() { AutoStorage.Validate(); } + if (Identity != null) + { + Identity.Validate(); + } } } } diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/EncryptionProperties.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/EncryptionProperties.cs index 9b3c29733b5d..4613da9fe2dd 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/EncryptionProperties.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/EncryptionProperties.cs @@ -13,6 +13,11 @@ namespace Microsoft.Azure.Management.Batch.Models using Newtonsoft.Json; using System.Linq; + /// + /// Configures how customer data is encrypted inside the Batch account. By + /// default, accounts are encrypted using a Microsoft managed key. For + /// additional control, a customer-managed key can be used instead. + /// public partial class EncryptionProperties { /// diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/KeySource.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/KeySource.cs index 840d49d934b0..3ec496323868 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/KeySource.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/KeySource.cs @@ -29,7 +29,9 @@ public enum KeySource MicrosoftBatch, /// /// The encryption keys used to protect the account data are stored in - /// an external key vault. + /// an external key vault. If this is set then the Batch Account + /// identity must be set to `SystemAssigned` and a valid Key Identifier + /// must also be supplied under the keyVaultProperties. /// [EnumMember(Value = "Microsoft.KeyVault")] MicrosoftKeyVault diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/KeyVaultProperties.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/KeyVaultProperties.cs index bf86e5601d62..8d1178c26d32 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/KeyVaultProperties.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/KeyVaultProperties.cs @@ -13,6 +13,10 @@ namespace Microsoft.Azure.Management.Batch.Models using Newtonsoft.Json; using System.Linq; + /// + /// KeyVault configuration when using an encryption KeySource of + /// Microsoft.KeyVault. + /// public partial class KeyVaultProperties { /// @@ -28,7 +32,13 @@ public KeyVaultProperties() /// /// Full path to the versioned secret. /// Example - /// https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053 + /// https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053. + /// To be usable the following prerequisites must be met: + /// + /// The Batch Account has a System Assigned identity + /// The account identity has been granted Key/Get, Key/Unwrap and + /// Key/Wrap permissions + /// The KeyVault has soft-delete and purge protection enabled public KeyVaultProperties(string keyIdentifier = default(string)) { KeyIdentifier = keyIdentifier; @@ -42,7 +52,13 @@ public KeyVaultProperties() /// /// Gets or sets full path to the versioned secret. Example - /// https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053 + /// https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053. + /// To be usable the following prerequisites must be met: + /// + /// The Batch Account has a System Assigned identity + /// The account identity has been granted Key/Get, Key/Unwrap and + /// Key/Wrap permissions + /// The KeyVault has soft-delete and purge protection enabled /// [JsonProperty(PropertyName = "keyIdentifier")] public string KeyIdentifier { get; set; } diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/PrivateEndpointConnectionUpdateHeaders.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/PrivateEndpointConnectionUpdateHeaders.cs index 5b117e2e9dc7..38f93ded4fc8 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/PrivateEndpointConnectionUpdateHeaders.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/PrivateEndpointConnectionUpdateHeaders.cs @@ -31,13 +31,15 @@ public PrivateEndpointConnectionUpdateHeaders() /// Initializes a new instance of the /// PrivateEndpointConnectionUpdateHeaders class. /// - /// The ETag HTTP response header. This is an opaque - /// string. You can use it to detect whether the resource has changed - /// between requests. In particular, you can pass the ETag to one of - /// the If-Match or If-None-Match headers. - public PrivateEndpointConnectionUpdateHeaders(string eTag = default(string)) + /// The URL of the resource used to check the + /// status of the asynchronous operation. + /// Suggested delay to check the status of the + /// asynchronous operation. The value is an integer that represents the + /// seconds. + public PrivateEndpointConnectionUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) { - ETag = eTag; + Location = location; + RetryAfter = retryAfter; CustomInit(); } @@ -47,13 +49,19 @@ public PrivateEndpointConnectionUpdateHeaders() partial void CustomInit(); /// - /// Gets or sets the ETag HTTP response header. This is an opaque - /// string. You can use it to detect whether the resource has changed - /// between requests. In particular, you can pass the ETag to one of - /// the If-Match or If-None-Match headers. + /// Gets or sets the URL of the resource used to check the status of + /// the asynchronous operation. /// - [JsonProperty(PropertyName = "ETag")] - public string ETag { get; set; } + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets suggested delay to check the status of the + /// asynchronous operation. The value is an integer that represents the + /// seconds. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } } } diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ResourceIdentityType.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ResourceIdentityType.cs new file mode 100644 index 000000000000..8fdd728b85f3 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ResourceIdentityType.cs @@ -0,0 +1,67 @@ +// +// 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.Batch.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ResourceIdentityType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ResourceIdentityType + { + /// + /// Batch account has a system assigned identity with it. + /// + [EnumMember(Value = "SystemAssigned")] + SystemAssigned, + /// + /// Batch account has no identity associated with it. Setting `None` in + /// update account will remove existing identities. + /// + [EnumMember(Value = "None")] + None + } + internal static class ResourceIdentityTypeEnumExtension + { + internal static string ToSerializedValue(this ResourceIdentityType? value) + { + return value == null ? null : ((ResourceIdentityType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ResourceIdentityType value) + { + switch( value ) + { + case ResourceIdentityType.SystemAssigned: + return "SystemAssigned"; + case ResourceIdentityType.None: + return "None"; + } + return null; + } + + internal static ResourceIdentityType? ParseResourceIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return ResourceIdentityType.SystemAssigned; + case "None": + return ResourceIdentityType.None; + } + return null; + } + } +} diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/PrivateEndpointConnectionOperations.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/PrivateEndpointConnectionOperations.cs index a4b5f6fd14a7..82b6b022b292 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/PrivateEndpointConnectionOperations.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/PrivateEndpointConnectionOperations.cs @@ -338,17 +338,17 @@ internal PrivateEndpointConnectionOperations(BatchManagementClient client) } if (privateEndpointConnectionName != null) { - if (privateEndpointConnectionName.Length > 64) + if (privateEndpointConnectionName.Length > 101) { - throw new ValidationException(ValidationRules.MaxLength, "privateEndpointConnectionName", 64); + throw new ValidationException(ValidationRules.MaxLength, "privateEndpointConnectionName", 101); } if (privateEndpointConnectionName.Length < 1) { throw new ValidationException(ValidationRules.MinLength, "privateEndpointConnectionName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(privateEndpointConnectionName, "^[a-zA-Z0-9_-]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateEndpointConnectionName, "^[a-zA-Z0-9_-]+\\.?[a-fA-F0-9-]*$")) { - throw new ValidationException(ValidationRules.Pattern, "privateEndpointConnectionName", "^[a-zA-Z0-9_-]+$"); + throw new ValidationException(ValidationRules.Pattern, "privateEndpointConnectionName", "^[a-zA-Z0-9_-]+\\.?[a-fA-F0-9-]*$"); } } if (Client.ApiVersion == null) @@ -505,6 +505,41 @@ internal PrivateEndpointConnectionOperations(BatchManagementClient client) return _result; } + /// + /// Updates the properties of an existing private endpoint connection. + /// + /// + /// The name of the resource group that contains the Batch account. + /// + /// + /// The name of the Batch account. + /// + /// + /// The private endpoint connection name. This must be unique within the + /// account. + /// + /// + /// PrivateEndpointConnection properties that should be updated. Properties + /// that are supplied will be updated, any property not supplied will be + /// unchanged. + /// + /// + /// The state (ETag) version of the private endpoint connection to update. This + /// value can be omitted or set to "*" to apply the operation unconditionally. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, parameters, ifMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Updates the properties of an existing private endpoint connection. /// @@ -548,7 +583,7 @@ internal PrivateEndpointConnectionOperations(BatchManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -583,17 +618,17 @@ internal PrivateEndpointConnectionOperations(BatchManagementClient client) } if (privateEndpointConnectionName != null) { - if (privateEndpointConnectionName.Length > 64) + if (privateEndpointConnectionName.Length > 101) { - throw new ValidationException(ValidationRules.MaxLength, "privateEndpointConnectionName", 64); + throw new ValidationException(ValidationRules.MaxLength, "privateEndpointConnectionName", 101); } if (privateEndpointConnectionName.Length < 1) { throw new ValidationException(ValidationRules.MinLength, "privateEndpointConnectionName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(privateEndpointConnectionName, "^[a-zA-Z0-9_-]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateEndpointConnectionName, "^[a-zA-Z0-9_-]+\\.?[a-fA-F0-9-]*$")) { - throw new ValidationException(ValidationRules.Pattern, "privateEndpointConnectionName", "^[a-zA-Z0-9_-]+$"); + throw new ValidationException(ValidationRules.Pattern, "privateEndpointConnectionName", "^[a-zA-Z0-9_-]+\\.?[a-fA-F0-9-]*$"); } } if (Client.ApiVersion == null) @@ -617,7 +652,7 @@ internal PrivateEndpointConnectionOperations(BatchManagementClient client) tracingParameters.Add("parameters", parameters); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -703,7 +738,7 @@ internal PrivateEndpointConnectionOperations(BatchManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + 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 diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/PrivateEndpointConnectionOperationsExtensions.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/PrivateEndpointConnectionOperationsExtensions.cs index fa1f0f974e1c..c72ccf25bd83 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/PrivateEndpointConnectionOperationsExtensions.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/PrivateEndpointConnectionOperationsExtensions.cs @@ -181,6 +181,72 @@ public static PrivateEndpointConnection Get(this IPrivateEndpointConnectionOpera } } + /// + /// Updates the properties of an existing private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the Batch account. + /// + /// + /// The name of the Batch account. + /// + /// + /// The private endpoint connection name. This must be unique within the + /// account. + /// + /// + /// PrivateEndpointConnection properties that should be updated. Properties + /// that are supplied will be updated, any property not supplied will be + /// unchanged. + /// + /// + /// The state (ETag) version of the private endpoint connection to update. This + /// value can be omitted or set to "*" to apply the operation unconditionally. + /// + public static PrivateEndpointConnection BeginUpdate(this IPrivateEndpointConnectionOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, string ifMatch = default(string)) + { + return operations.BeginUpdateAsync(resourceGroupName, accountName, privateEndpointConnectionName, parameters, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Updates the properties of an existing private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the Batch account. + /// + /// + /// The name of the Batch account. + /// + /// + /// The private endpoint connection name. This must be unique within the + /// account. + /// + /// + /// PrivateEndpointConnection properties that should be updated. Properties + /// that are supplied will be updated, any property not supplied will be + /// unchanged. + /// + /// + /// The state (ETag) version of the private endpoint connection to update. This + /// value can be omitted or set to "*" to apply the operation unconditionally. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IPrivateEndpointConnectionOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists all of the private endpoint connections in the specified account. /// diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/PrivateLinkResourceOperations.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/PrivateLinkResourceOperations.cs index fa5836b5448b..2bf3612c6f80 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/PrivateLinkResourceOperations.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/PrivateLinkResourceOperations.cs @@ -337,17 +337,17 @@ internal PrivateLinkResourceOperations(BatchManagementClient client) } if (privateLinkResourceName != null) { - if (privateLinkResourceName.Length > 64) + if (privateLinkResourceName.Length > 101) { - throw new ValidationException(ValidationRules.MaxLength, "privateLinkResourceName", 64); + throw new ValidationException(ValidationRules.MaxLength, "privateLinkResourceName", 101); } if (privateLinkResourceName.Length < 1) { throw new ValidationException(ValidationRules.MinLength, "privateLinkResourceName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(privateLinkResourceName, "^[a-zA-Z0-9_-]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateLinkResourceName, "^[a-zA-Z0-9_-]+\\.?[a-fA-F0-9-]*$")) { - throw new ValidationException(ValidationRules.Pattern, "privateLinkResourceName", "^[a-zA-Z0-9_-]+$"); + throw new ValidationException(ValidationRules.Pattern, "privateLinkResourceName", "^[a-zA-Z0-9_-]+\\.?[a-fA-F0-9-]*$"); } } if (Client.ApiVersion == null) diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/SdkInfo_BatchManagement.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/SdkInfo_BatchManagement.cs index 9bd7d8334342..2eb8d50512e8 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/SdkInfo_BatchManagement.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/SdkInfo_BatchManagement.cs @@ -19,15 +19,15 @@ public static IEnumerable> ApiInfo_BatchManagement { return new Tuple[] { - new Tuple("Batch", "Application", "2020-03-01"), - new Tuple("Batch", "ApplicationPackage", "2020-03-01"), - new Tuple("Batch", "BatchAccount", "2020-03-01"), - new Tuple("Batch", "Certificate", "2020-03-01"), - new Tuple("Batch", "Location", "2020-03-01"), - new Tuple("Batch", "Operations", "2020-03-01"), - new Tuple("Batch", "Pool", "2020-03-01"), - new Tuple("Batch", "PrivateEndpointConnection", "2020-03-01"), - new Tuple("Batch", "PrivateLinkResource", "2020-03-01"), + new Tuple("Batch", "Application", "2020-05-01"), + new Tuple("Batch", "ApplicationPackage", "2020-05-01"), + new Tuple("Batch", "BatchAccount", "2020-05-01"), + new Tuple("Batch", "Certificate", "2020-05-01"), + new Tuple("Batch", "Location", "2020-05-01"), + new Tuple("Batch", "Operations", "2020-05-01"), + new Tuple("Batch", "Pool", "2020-05-01"), + new Tuple("Batch", "PrivateEndpointConnection", "2020-05-01"), + new Tuple("Batch", "PrivateLinkResource", "2020-05-01"), }.AsEnumerable(); } }