From 641208d10f95f4377630e30892d1934c3712ca94 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 29 Jul 2021 08:58:32 +0000 Subject: [PATCH] CodeGen from PR 15424 in Azure/azure-rest-api-specs Merge bdd6ea27462880a3ed90dd464fb838755300586d into 74dbcfee45a6634d0043e478aba324796d98940c --- .../Generated/ApplicationPackageOperations.cs | 7 +- .../ApplicationPackageOperationsExtensions.cs | 14 +- .../src/Generated/BatchAccountOperations.cs | 417 ++++++++- .../BatchAccountOperationsExtensions.cs | 140 ++- .../src/Generated/BatchManagementClient.cs | 5 +- .../IApplicationPackageOperations.cs | 10 +- .../src/Generated/IBatchAccountOperations.cs | 83 +- .../src/Generated/IBatchManagementClient.cs | 1 + .../src/Generated/ILocationOperations.cs | 106 +++ .../src/Generated/LocationOperations.cs | 800 +++++++++++++++++- .../Generated/LocationOperationsExtensions.cs | 168 ++++ .../Generated/Models/AuthenticationMode.cs | 75 ++ .../Models/AutoStorageAuthenticationMode.cs | 68 ++ .../Models/AutoStorageBaseProperties.cs | 30 +- .../Generated/Models/AutoStorageProperties.cs | 11 +- .../AzureBlobFileSystemConfiguration.cs | 24 +- .../src/Generated/Models/BatchAccount.cs | 19 +- .../Models/BatchAccountCreateParameters.cs | 15 +- .../Generated/Models/BatchAccountIdentity.cs | 19 +- ...ountIdentityUserAssignedIdentitiesValue.cs | 60 -- .../Models/BatchAccountUpdateParameters.cs | 15 +- .../src/Generated/Models/BatchPoolIdentity.cs | 12 +- .../Models/CertificateBaseProperties.cs | 3 + .../Models/ComputeNodeIdentityReference.cs | 55 ++ .../src/Generated/Models/ContainerRegistry.cs | 48 +- .../src/Generated/Models/DiffDiskPlacement.cs | 57 ++ .../src/Generated/Models/DiffDiskSettings.cs | 65 ++ .../Generated/Models/EndpointDependency.cs | 74 ++ .../src/Generated/Models/EndpointDetail.cs | 52 ++ .../Generated/Models/FixedScaleSettings.cs | 6 +- .../src/Generated/Models/OSDisk.cs | 54 ++ .../src/Generated/Models/Operation.cs | 11 +- .../Models/OutboundEnvironmentEndpoint.cs | 67 ++ .../src/Generated/Models/Pool.cs | 4 +- .../Generated/Models/ResizeOperationStatus.cs | 6 +- .../src/Generated/Models/ResourceFile.cs | 38 +- .../src/Generated/Models/SkuCapability.cs | 59 ++ .../src/Generated/Models/SupportedSku.cs | 70 ++ .../Generated/Models/TaskContainerSettings.cs | 4 - ...tiesValue.cs => UserAssignedIdentities.cs} | 15 +- .../Models/VirtualMachineConfiguration.cs | 15 +- .../src/Generated/SdkInfo_BatchManagement.cs | 46 - .../SdkInfo_BatchManagementClient.cs | 35 + 43 files changed, 2624 insertions(+), 259 deletions(-) create mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AuthenticationMode.cs create mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AutoStorageAuthenticationMode.cs delete mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountIdentityUserAssignedIdentitiesValue.cs create mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ComputeNodeIdentityReference.cs create mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/DiffDiskPlacement.cs create mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/DiffDiskSettings.cs create mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/EndpointDependency.cs create mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/EndpointDetail.cs create mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/OSDisk.cs create mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/OutboundEnvironmentEndpoint.cs create mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/SkuCapability.cs create mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/SupportedSku.cs rename sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/{BatchPoolIdentityUserAssignedIdentitiesValue.cs => UserAssignedIdentities.cs} (75%) delete mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/SdkInfo_BatchManagement.cs create mode 100644 sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/SdkInfo_BatchManagementClient.cs diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/ApplicationPackageOperations.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/ApplicationPackageOperations.cs index 085edd7da4aa..e63ea1fd3a60 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/ApplicationPackageOperations.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/ApplicationPackageOperations.cs @@ -331,10 +331,11 @@ internal ApplicationPackageOperations(BatchManagementClient client) } /// - /// Creates an application package record. The record contains the SAS where - /// the package should be uploaded to. Once it is uploaded the + /// Creates an application package record. The record contains a storageUrl + /// where the package should be uploaded to. Once it is uploaded the /// `ApplicationPackage` needs to be activated using `ApplicationPackageActive` - /// before it can be used. + /// before it can be used. If the auto storage account was configured to use + /// storage keys, the URL returned will contain a SAS. /// /// /// The name of the resource group that contains the Batch account. diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/ApplicationPackageOperationsExtensions.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/ApplicationPackageOperationsExtensions.cs index 52c9f82ec97a..a6e592fbd837 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/ApplicationPackageOperationsExtensions.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/ApplicationPackageOperationsExtensions.cs @@ -84,10 +84,11 @@ public static ApplicationPackage Activate(this IApplicationPackageOperations ope } /// - /// Creates an application package record. The record contains the SAS where - /// the package should be uploaded to. Once it is uploaded the + /// Creates an application package record. The record contains a storageUrl + /// where the package should be uploaded to. Once it is uploaded the /// `ApplicationPackage` needs to be activated using `ApplicationPackageActive` - /// before it can be used. + /// before it can be used. If the auto storage account was configured to use + /// storage keys, the URL returned will contain a SAS. /// /// /// The operations group for this extension method. @@ -110,10 +111,11 @@ public static ApplicationPackage Create(this IApplicationPackageOperations opera } /// - /// Creates an application package record. The record contains the SAS where - /// the package should be uploaded to. Once it is uploaded the + /// Creates an application package record. The record contains a storageUrl + /// where the package should be uploaded to. Once it is uploaded the /// `ApplicationPackage` needs to be activated using `ApplicationPackageActive` - /// before it can be used. + /// before it can be used. If the auto storage account was configured to use + /// storage keys, the URL returned will contain a SAS. /// /// /// The operations group for this extension method. diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchAccountOperations.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchAccountOperations.cs index 295637f218b7..cf7e11c7e2a4 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchAccountOperations.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchAccountOperations.cs @@ -908,7 +908,7 @@ internal BatchAccountOperations(BatchManagementClient client) /// /// Synchronizes access keys for the auto-storage account configured for the - /// specified Batch account. + /// specified Batch account, only if storage key authentication is being used. /// /// /// The name of the resource group that contains the Batch account. @@ -1100,6 +1100,14 @@ internal BatchAccountOperations(BatchManagementClient client) /// /// Regenerates the specified account key for the Batch account. /// + /// + /// This operation applies only to Batch accounts with + /// allowedAuthenticationModes containing 'SharedKey'. If the Batch account + /// doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients + /// cannot use shared keys to authenticate, and must use another + /// allowedAuthenticationModes instead. In this case, regenerating the keys + /// will fail. + /// /// /// The name of the resource group that contains the Batch account. /// @@ -1325,11 +1333,12 @@ internal BatchAccountOperations(BatchManagementClient client) /// Gets the account keys for the specified Batch account. /// /// - /// This operation applies only to Batch accounts created with a - /// poolAllocationMode of 'BatchService'. If the Batch account was created with - /// a poolAllocationMode of 'UserSubscription', clients cannot use access to - /// keys to authenticate, and must use Azure Active Directory instead. In this - /// case, getting the keys will fail. + /// This operation applies only to Batch accounts with + /// allowedAuthenticationModes containing 'SharedKey'. If the Batch account + /// doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients + /// cannot use shared keys to authenticate, and must use another + /// allowedAuthenticationModes instead. In this case, getting the keys will + /// fail. /// /// /// The name of the resource group that contains the Batch account. @@ -1539,6 +1548,223 @@ internal BatchAccountOperations(BatchManagementClient client) return _result; } + /// + /// Lists the endpoints that a Batch Compute Node under this Batch Account may + /// call as part of Batch service administration. If you are deploying a Pool + /// inside of a virtual network that you specify, you must make sure your + /// network allows outbound access to these endpoints. Failure to allow access + /// to these endpoints may cause Batch to mark the affected nodes as unusable. + /// For more information about creating a pool inside of a virtual network, see + /// https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// + /// + /// The name of the resource group that contains the Batch account. + /// + /// + /// The name of the Batch account. + /// + /// + /// 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>> ListOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 24) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListOutboundNetworkDependenciesEndpoints", 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.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + 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; + } + /// /// Creates a new Batch account with the specified parameters. Existing /// accounts cannot be updated with this API and should instead be updated with @@ -2338,5 +2564,184 @@ internal BatchAccountOperations(BatchManagementClient client) return _result; } + /// + /// Lists the endpoints that a Batch Compute Node under this Batch Account may + /// call as part of Batch service administration. If you are deploying a Pool + /// inside of a virtual network that you specify, you must make sure your + /// network allows outbound access to these endpoints. Failure to allow access + /// to these endpoints may cause Batch to mark the affected nodes as unusable. + /// For more information about creating a pool inside of a virtual network, see + /// https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// + /// + /// 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>> ListOutboundNetworkDependenciesEndpointsNextWithHttpMessagesAsync(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, "ListOutboundNetworkDependenciesEndpointsNext", 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/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchAccountOperationsExtensions.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchAccountOperationsExtensions.cs index f94f9ed6e3a2..a0264f663500 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchAccountOperationsExtensions.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchAccountOperationsExtensions.cs @@ -273,7 +273,7 @@ public static IPage ListByResourceGroup(this IBatchAccountOperatio /// /// Synchronizes access keys for the auto-storage account configured for the - /// specified Batch account. + /// specified Batch account, only if storage key authentication is being used. /// /// /// The operations group for this extension method. @@ -291,7 +291,7 @@ public static void SynchronizeAutoStorageKeys(this IBatchAccountOperations opera /// /// Synchronizes access keys for the auto-storage account configured for the - /// specified Batch account. + /// specified Batch account, only if storage key authentication is being used. /// /// /// The operations group for this extension method. @@ -313,6 +313,14 @@ public static void SynchronizeAutoStorageKeys(this IBatchAccountOperations opera /// /// Regenerates the specified account key for the Batch account. /// + /// + /// This operation applies only to Batch accounts with + /// allowedAuthenticationModes containing 'SharedKey'. If the Batch account + /// doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients + /// cannot use shared keys to authenticate, and must use another + /// allowedAuthenticationModes instead. In this case, regenerating the keys + /// will fail. + /// /// /// The operations group for this extension method. /// @@ -334,6 +342,14 @@ public static BatchAccountKeys RegenerateKey(this IBatchAccountOperations operat /// /// Regenerates the specified account key for the Batch account. /// + /// + /// This operation applies only to Batch accounts with + /// allowedAuthenticationModes containing 'SharedKey'. If the Batch account + /// doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients + /// cannot use shared keys to authenticate, and must use another + /// allowedAuthenticationModes instead. In this case, regenerating the keys + /// will fail. + /// /// /// The operations group for this extension method. /// @@ -362,11 +378,12 @@ public static BatchAccountKeys RegenerateKey(this IBatchAccountOperations operat /// Gets the account keys for the specified Batch account. /// /// - /// This operation applies only to Batch accounts created with a - /// poolAllocationMode of 'BatchService'. If the Batch account was created with - /// a poolAllocationMode of 'UserSubscription', clients cannot use access to - /// keys to authenticate, and must use Azure Active Directory instead. In this - /// case, getting the keys will fail. + /// This operation applies only to Batch accounts with + /// allowedAuthenticationModes containing 'SharedKey'. If the Batch account + /// doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients + /// cannot use shared keys to authenticate, and must use another + /// allowedAuthenticationModes instead. In this case, getting the keys will + /// fail. /// /// /// The operations group for this extension method. @@ -386,11 +403,12 @@ public static BatchAccountKeys GetKeys(this IBatchAccountOperations operations, /// Gets the account keys for the specified Batch account. /// /// - /// This operation applies only to Batch accounts created with a - /// poolAllocationMode of 'BatchService'. If the Batch account was created with - /// a poolAllocationMode of 'UserSubscription', clients cannot use access to - /// keys to authenticate, and must use Azure Active Directory instead. In this - /// case, getting the keys will fail. + /// This operation applies only to Batch accounts with + /// allowedAuthenticationModes containing 'SharedKey'. If the Batch account + /// doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients + /// cannot use shared keys to authenticate, and must use another + /// allowedAuthenticationModes instead. In this case, getting the keys will + /// fail. /// /// /// The operations group for this extension method. @@ -412,6 +430,58 @@ public static BatchAccountKeys GetKeys(this IBatchAccountOperations operations, } } + /// + /// Lists the endpoints that a Batch Compute Node under this Batch Account may + /// call as part of Batch service administration. If you are deploying a Pool + /// inside of a virtual network that you specify, you must make sure your + /// network allows outbound access to these endpoints. Failure to allow access + /// to these endpoints may cause Batch to mark the affected nodes as unusable. + /// For more information about creating a pool inside of a virtual network, see + /// https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the Batch account. + /// + /// + /// The name of the Batch account. + /// + public static IPage ListOutboundNetworkDependenciesEndpoints(this IBatchAccountOperations operations, string resourceGroupName, string accountName) + { + return operations.ListOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Lists the endpoints that a Batch Compute Node under this Batch Account may + /// call as part of Batch service administration. If you are deploying a Pool + /// inside of a virtual network that you specify, you must make sure your + /// network allows outbound access to these endpoints. Failure to allow access + /// to these endpoints may cause Batch to mark the affected nodes as unusable. + /// For more information about creating a pool inside of a virtual network, see + /// https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// + /// + /// 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 cancellation token. + /// + public static async Task> ListOutboundNetworkDependenciesEndpointsAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Creates a new Batch account with the specified parameters. Existing /// accounts cannot be updated with this API and should instead be updated with @@ -582,5 +652,51 @@ public static IPage ListByResourceGroupNext(this IBatchAccountOper } } + /// + /// Lists the endpoints that a Batch Compute Node under this Batch Account may + /// call as part of Batch service administration. If you are deploying a Pool + /// inside of a virtual network that you specify, you must make sure your + /// network allows outbound access to these endpoints. Failure to allow access + /// to these endpoints may cause Batch to mark the affected nodes as unusable. + /// For more information about creating a pool inside of a virtual network, see + /// https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListOutboundNetworkDependenciesEndpointsNext(this IBatchAccountOperations operations, string nextPageLink) + { + return operations.ListOutboundNetworkDependenciesEndpointsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the endpoints that a Batch Compute Node under this Batch Account may + /// call as part of Batch service administration. If you are deploying a Pool + /// inside of a virtual network that you specify, you must make sure your + /// network allows outbound access to these endpoints. Failure to allow access + /// to these endpoints may cause Batch to mark the affected nodes as unusable. + /// For more information about creating a pool inside of a virtual network, see + /// https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListOutboundNetworkDependenciesEndpointsNextAsync(this IBatchAccountOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOutboundNetworkDependenciesEndpointsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } 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 848c46624334..50f0464f4981 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchManagementClient.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/BatchManagementClient.cs @@ -21,6 +21,9 @@ namespace Microsoft.Azure.Management.Batch using System.Net; using System.Net.Http; + /// + /// Batch Client + /// public partial class BatchManagementClient : ServiceClient, IBatchManagementClient, IAzureClient { /// @@ -368,7 +371,7 @@ private void Initialize() PrivateEndpointConnection = new PrivateEndpointConnectionOperations(this); Pool = new PoolOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-01-01"; + ApiVersion = "2021-06-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IApplicationPackageOperations.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IApplicationPackageOperations.cs index dfc986a11f13..7def00614d67 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IApplicationPackageOperations.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IApplicationPackageOperations.cs @@ -62,10 +62,12 @@ public partial interface IApplicationPackageOperations /// Task> ActivateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationName, string versionName, string format, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates an application package record. The record contains the SAS - /// where the package should be uploaded to. Once it is uploaded the - /// `ApplicationPackage` needs to be activated using - /// `ApplicationPackageActive` before it can be used. + /// Creates an application package record. The record contains a + /// storageUrl where the package should be uploaded to. Once it is + /// uploaded the `ApplicationPackage` needs to be activated using + /// `ApplicationPackageActive` before it can be used. If the auto + /// storage account was configured to use storage keys, the URL + /// returned will contain a SAS. /// /// /// The name of the resource group that contains the Batch account. diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IBatchAccountOperations.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IBatchAccountOperations.cs index ccd05f6a78f7..4d2b646890d1 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IBatchAccountOperations.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IBatchAccountOperations.cs @@ -178,7 +178,8 @@ public partial interface IBatchAccountOperations Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Synchronizes access keys for the auto-storage account configured - /// for the specified Batch account. + /// for the specified Batch account, only if storage key authentication + /// is being used. /// /// /// The name of the resource group that contains the Batch account. @@ -202,6 +203,14 @@ public partial interface IBatchAccountOperations /// /// Regenerates the specified account key for the Batch account. /// + /// + /// This operation applies only to Batch accounts with + /// allowedAuthenticationModes containing 'SharedKey'. If the Batch + /// account doesn't contain 'SharedKey' in its + /// allowedAuthenticationMode, clients cannot use shared keys to + /// authenticate, and must use another allowedAuthenticationModes + /// instead. In this case, regenerating the keys will fail. + /// /// /// The name of the resource group that contains the Batch account. /// @@ -232,11 +241,12 @@ public partial interface IBatchAccountOperations /// Gets the account keys for the specified Batch account. /// /// - /// This operation applies only to Batch accounts created with a - /// poolAllocationMode of 'BatchService'. If the Batch account was - /// created with a poolAllocationMode of 'UserSubscription', clients - /// cannot use access to keys to authenticate, and must use Azure - /// Active Directory instead. In this case, getting the keys will fail. + /// This operation applies only to Batch accounts with + /// allowedAuthenticationModes containing 'SharedKey'. If the Batch + /// account doesn't contain 'SharedKey' in its + /// allowedAuthenticationMode, clients cannot use shared keys to + /// authenticate, and must use another allowedAuthenticationModes + /// instead. In this case, getting the keys will fail. /// /// /// The name of the resource group that contains the Batch account. @@ -261,6 +271,38 @@ public partial interface IBatchAccountOperations /// Task> GetKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Lists the endpoints that a Batch Compute Node under this Batch + /// Account may call as part of Batch service administration. If you + /// are deploying a Pool inside of a virtual network that you specify, + /// you must make sure your network allows outbound access to these + /// endpoints. Failure to allow access to these endpoints may cause + /// Batch to mark the affected nodes as unusable. For more information + /// about creating a pool inside of a virtual network, see + /// https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// + /// + /// The name of the resource group that contains the Batch account. + /// + /// + /// The name of the Batch account. + /// + /// + /// 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>> ListOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Creates a new Batch account with the specified parameters. Existing /// accounts cannot be updated with this API and should instead be /// updated with the Update Batch Account API. @@ -363,5 +405,34 @@ public partial interface IBatchAccountOperations /// Thrown when a required parameter is null /// Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the endpoints that a Batch Compute Node under this Batch + /// Account may call as part of Batch service administration. If you + /// are deploying a Pool inside of a virtual network that you specify, + /// you must make sure your network allows outbound access to these + /// endpoints. Failure to allow access to these endpoints may cause + /// Batch to mark the affected nodes as unusable. For more information + /// about creating a pool inside of a virtual network, see + /// https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// + /// + /// 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>> ListOutboundNetworkDependenciesEndpointsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IBatchManagementClient.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IBatchManagementClient.cs index a5044e02df3c..0f81354b9cca 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IBatchManagementClient.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/IBatchManagementClient.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Management.Batch using Newtonsoft.Json; /// + /// Batch Client /// public partial interface IBatchManagementClient : System.IDisposable { diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/ILocationOperations.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/ILocationOperations.cs index 72eb5290bb86..7d6bfcabaca6 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/ILocationOperations.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/ILocationOperations.cs @@ -47,6 +47,66 @@ public partial interface ILocationOperations /// Task> GetQuotasWithHttpMessagesAsync(string locationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the list of Batch supported Virtual Machine VM sizes available + /// at the given location. + /// + /// + /// The region for which to retrieve Batch service supported SKUs. + /// + /// + /// The maximum number of items to return in the response. + /// + /// + /// OData filter expression. Valid properties for filtering are + /// "familyName". + /// + /// + /// 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>> ListSupportedVirtualMachineSkusWithHttpMessagesAsync(string locationName, int? maxresults = default(int?), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of Batch supported Cloud Service VM sizes available + /// at the given location. + /// + /// + /// The region for which to retrieve Batch service supported SKUs. + /// + /// + /// The maximum number of items to return in the response. + /// + /// + /// OData filter expression. Valid properties for filtering are + /// "familyName". + /// + /// + /// 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>> ListSupportedCloudServiceSkusWithHttpMessagesAsync(string locationName, int? maxresults = default(int?), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Checks whether the Batch account name is available in the specified /// region. /// @@ -72,5 +132,51 @@ public partial interface ILocationOperations /// Thrown when a required parameter is null /// Task> CheckNameAvailabilityWithHttpMessagesAsync(string locationName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of Batch supported Virtual Machine VM sizes available + /// at the given location. + /// + /// + /// 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>> ListSupportedVirtualMachineSkusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of Batch supported Cloud Service VM sizes available + /// at the given location. + /// + /// + /// 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>> ListSupportedCloudServiceSkusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/LocationOperations.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/LocationOperations.cs index bdc78c58bcf0..5c307ccd6160 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/LocationOperations.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/LocationOperations.cs @@ -239,13 +239,17 @@ internal LocationOperations(BatchManagementClient client) } /// - /// Checks whether the Batch account name is available in the specified region. + /// Gets the list of Batch supported Virtual Machine VM sizes available at the + /// given location. /// /// - /// The desired region for the name check. + /// The region for which to retrieve Batch service supported SKUs. /// - /// - /// The name to check for availability + /// + /// The maximum number of items to return in the response. + /// + /// + /// OData filter expression. Valid properties for filtering are "familyName". /// /// /// Headers that will be added to request. @@ -268,7 +272,7 @@ internal LocationOperations(BatchManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckNameAvailabilityWithHttpMessagesAsync(string locationName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSupportedVirtualMachineSkusWithHttpMessagesAsync(string locationName, int? maxresults = default(int?), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (locationName == null) { @@ -282,14 +286,209 @@ internal LocationOperations(BatchManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (name == null) + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("locationName", locationName); + tracingParameters.Add("maxresults", maxresults); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSupportedVirtualMachineSkus", tracingParameters); } - CheckNameAvailabilityParameters parameters = new CheckNameAvailabilityParameters(); - if (name != null) + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/virtualMachineSkus").ToString(); + _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (maxresults != null) { - parameters.Name = name; + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxresults, Client.SerializationSettings).Trim('"')))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + 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; + } + + /// + /// Gets the list of Batch supported Cloud Service VM sizes available at the + /// given location. + /// + /// + /// The region for which to retrieve Batch service supported SKUs. + /// + /// + /// The maximum number of items to return in the response. + /// + /// + /// OData filter expression. Valid properties for filtering are "familyName". + /// + /// + /// 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>> ListSupportedCloudServiceSkusWithHttpMessagesAsync(string locationName, int? maxresults = default(int?), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (locationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -299,16 +498,25 @@ internal LocationOperations(BatchManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("locationName", locationName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("maxresults", maxresults); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSupportedCloudServiceSkus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/checkNameAvailability").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/cloudServiceSkus").ToString(); _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (maxresults != null) + { + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxresults, Client.SerializationSettings).Trim('"')))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -320,7 +528,7 @@ internal LocationOperations(BatchManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -351,12 +559,6 @@ internal LocationOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -412,7 +614,7 @@ internal LocationOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -425,7 +627,561 @@ internal LocationOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _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; + } + + /// + /// Checks whether the Batch account name is available in the specified region. + /// + /// + /// The desired region for the name check. + /// + /// + /// The name to check for availability + /// + /// + /// 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> CheckNameAvailabilityWithHttpMessagesAsync(string locationName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (locationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + CheckNameAvailabilityParameters parameters = new CheckNameAvailabilityParameters(); + if (name != null) + { + parameters.Name = name; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("locationName", locationName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/checkNameAvailability").ToString(); + _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + 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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the list of Batch supported Virtual Machine VM sizes available at the + /// given location. + /// + /// + /// 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>> ListSupportedVirtualMachineSkusNextWithHttpMessagesAsync(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, "ListSupportedVirtualMachineSkusNext", 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; + } + + /// + /// Gets the list of Batch supported Cloud Service VM sizes available at the + /// given location. + /// + /// + /// 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>> ListSupportedCloudServiceSkusNextWithHttpMessagesAsync(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, "ListSupportedCloudServiceSkusNext", 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) { diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/LocationOperationsExtensions.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/LocationOperationsExtensions.cs index da2cc9f816c5..27c2d9898fde 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/LocationOperationsExtensions.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/LocationOperationsExtensions.cs @@ -57,6 +57,102 @@ public static BatchLocationQuota GetQuotas(this ILocationOperations operations, } } + /// + /// Gets the list of Batch supported Virtual Machine VM sizes available at the + /// given location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region for which to retrieve Batch service supported SKUs. + /// + /// + /// The maximum number of items to return in the response. + /// + /// + /// OData filter expression. Valid properties for filtering are "familyName". + /// + public static IPage ListSupportedVirtualMachineSkus(this ILocationOperations operations, string locationName, int? maxresults = default(int?), string filter = default(string)) + { + return operations.ListSupportedVirtualMachineSkusAsync(locationName, maxresults, filter).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of Batch supported Virtual Machine VM sizes available at the + /// given location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region for which to retrieve Batch service supported SKUs. + /// + /// + /// The maximum number of items to return in the response. + /// + /// + /// OData filter expression. Valid properties for filtering are "familyName". + /// + /// + /// The cancellation token. + /// + public static async Task> ListSupportedVirtualMachineSkusAsync(this ILocationOperations operations, string locationName, int? maxresults = default(int?), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSupportedVirtualMachineSkusWithHttpMessagesAsync(locationName, maxresults, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the list of Batch supported Cloud Service VM sizes available at the + /// given location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region for which to retrieve Batch service supported SKUs. + /// + /// + /// The maximum number of items to return in the response. + /// + /// + /// OData filter expression. Valid properties for filtering are "familyName". + /// + public static IPage ListSupportedCloudServiceSkus(this ILocationOperations operations, string locationName, int? maxresults = default(int?), string filter = default(string)) + { + return operations.ListSupportedCloudServiceSkusAsync(locationName, maxresults, filter).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of Batch supported Cloud Service VM sizes available at the + /// given location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region for which to retrieve Batch service supported SKUs. + /// + /// + /// The maximum number of items to return in the response. + /// + /// + /// OData filter expression. Valid properties for filtering are "familyName". + /// + /// + /// The cancellation token. + /// + public static async Task> ListSupportedCloudServiceSkusAsync(this ILocationOperations operations, string locationName, int? maxresults = default(int?), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSupportedCloudServiceSkusWithHttpMessagesAsync(locationName, maxresults, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Checks whether the Batch account name is available in the specified region. /// @@ -97,5 +193,77 @@ public static CheckNameAvailabilityResult CheckNameAvailability(this ILocationOp } } + /// + /// Gets the list of Batch supported Virtual Machine VM sizes available at the + /// given location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListSupportedVirtualMachineSkusNext(this ILocationOperations operations, string nextPageLink) + { + return operations.ListSupportedVirtualMachineSkusNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of Batch supported Virtual Machine VM sizes available at the + /// given location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListSupportedVirtualMachineSkusNextAsync(this ILocationOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSupportedVirtualMachineSkusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the list of Batch supported Cloud Service VM sizes available at the + /// given location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListSupportedCloudServiceSkusNext(this ILocationOperations operations, string nextPageLink) + { + return operations.ListSupportedCloudServiceSkusNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of Batch supported Cloud Service VM sizes available at the + /// given location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListSupportedCloudServiceSkusNextAsync(this ILocationOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSupportedCloudServiceSkusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AuthenticationMode.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AuthenticationMode.cs new file mode 100644 index 000000000000..6bd4013dcc5e --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AuthenticationMode.cs @@ -0,0 +1,75 @@ +// +// 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 AuthenticationMode. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum AuthenticationMode + { + /// + /// The authentication mode using shared keys. + /// + [EnumMember(Value = "SharedKey")] + SharedKey, + /// + /// The authentication mode using Azure Active Directory. + /// + [EnumMember(Value = "AAD")] + AAD, + /// + /// The authentication mode using task authentication tokens. + /// + [EnumMember(Value = "TaskAuthenticationToken")] + TaskAuthenticationToken + } + internal static class AuthenticationModeEnumExtension + { + internal static string ToSerializedValue(this AuthenticationMode? value) + { + return value == null ? null : ((AuthenticationMode)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AuthenticationMode value) + { + switch( value ) + { + case AuthenticationMode.SharedKey: + return "SharedKey"; + case AuthenticationMode.AAD: + return "AAD"; + case AuthenticationMode.TaskAuthenticationToken: + return "TaskAuthenticationToken"; + } + return null; + } + + internal static AuthenticationMode? ParseAuthenticationMode(this string value) + { + switch( value ) + { + case "SharedKey": + return AuthenticationMode.SharedKey; + case "AAD": + return AuthenticationMode.AAD; + case "TaskAuthenticationToken": + return AuthenticationMode.TaskAuthenticationToken; + } + return null; + } + } +} diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AutoStorageAuthenticationMode.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AutoStorageAuthenticationMode.cs new file mode 100644 index 000000000000..0832984cdecd --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AutoStorageAuthenticationMode.cs @@ -0,0 +1,68 @@ +// +// 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 AutoStorageAuthenticationMode. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum AutoStorageAuthenticationMode + { + /// + /// The Batch service will authenticate requests to auto-storage using + /// storage account keys. + /// + [EnumMember(Value = "StorageKeys")] + StorageKeys, + /// + /// The Batch service will authenticate requests to auto-storage using + /// the managed identity assigned to the Batch account. + /// + [EnumMember(Value = "BatchAccountManagedIdentity")] + BatchAccountManagedIdentity + } + internal static class AutoStorageAuthenticationModeEnumExtension + { + internal static string ToSerializedValue(this AutoStorageAuthenticationMode? value) + { + return value == null ? null : ((AutoStorageAuthenticationMode)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AutoStorageAuthenticationMode value) + { + switch( value ) + { + case AutoStorageAuthenticationMode.StorageKeys: + return "StorageKeys"; + case AutoStorageAuthenticationMode.BatchAccountManagedIdentity: + return "BatchAccountManagedIdentity"; + } + return null; + } + + internal static AutoStorageAuthenticationMode? ParseAutoStorageAuthenticationMode(this string value) + { + switch( value ) + { + case "StorageKeys": + return AutoStorageAuthenticationMode.StorageKeys; + case "BatchAccountManagedIdentity": + return AutoStorageAuthenticationMode.BatchAccountManagedIdentity; + } + return null; + } + } +} diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AutoStorageBaseProperties.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AutoStorageBaseProperties.cs index 653517dc0935..4abfdad9c44f 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AutoStorageBaseProperties.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AutoStorageBaseProperties.cs @@ -32,9 +32,18 @@ public AutoStorageBaseProperties() /// /// The resource ID of the storage /// account to be used for auto-storage account. - public AutoStorageBaseProperties(string storageAccountId) + /// The authentication mode which the + /// Batch service will use to manage the auto-storage account. Possible + /// values include: 'StorageKeys', + /// 'BatchAccountManagedIdentity' + /// The reference to the user + /// assigned identity which compute nodes will use to access + /// auto-storage. + public AutoStorageBaseProperties(string storageAccountId, AutoStorageAuthenticationMode? authenticationMode = default(AutoStorageAuthenticationMode?), ComputeNodeIdentityReference nodeIdentityReference = default(ComputeNodeIdentityReference)) { StorageAccountId = storageAccountId; + AuthenticationMode = authenticationMode; + NodeIdentityReference = nodeIdentityReference; CustomInit(); } @@ -50,6 +59,25 @@ public AutoStorageBaseProperties(string storageAccountId) [JsonProperty(PropertyName = "storageAccountId")] public string StorageAccountId { get; set; } + /// + /// Gets or sets the authentication mode which the Batch service will + /// use to manage the auto-storage account. Possible values include: + /// 'StorageKeys', 'BatchAccountManagedIdentity' + /// + [JsonProperty(PropertyName = "authenticationMode")] + public AutoStorageAuthenticationMode? AuthenticationMode { get; set; } + + /// + /// Gets or sets the reference to the user assigned identity which + /// compute nodes will use to access auto-storage. + /// + /// + /// The identity referenced here must be assigned to pools which have + /// compute nodes that need access to auto-storage. + /// + [JsonProperty(PropertyName = "nodeIdentityReference")] + public ComputeNodeIdentityReference NodeIdentityReference { get; set; } + /// /// Validate the object. /// diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AutoStorageProperties.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AutoStorageProperties.cs index f519ea0cd060..ad6d6517aeb1 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AutoStorageProperties.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AutoStorageProperties.cs @@ -34,8 +34,15 @@ public AutoStorageProperties() /// account to be used for auto-storage account. /// The UTC time at which storage keys were /// last synchronized with the Batch account. - public AutoStorageProperties(string storageAccountId, System.DateTime lastKeySync) - : base(storageAccountId) + /// The authentication mode which the + /// Batch service will use to manage the auto-storage account. Possible + /// values include: 'StorageKeys', + /// 'BatchAccountManagedIdentity' + /// The reference to the user + /// assigned identity which compute nodes will use to access + /// auto-storage. + public AutoStorageProperties(string storageAccountId, System.DateTime lastKeySync, AutoStorageAuthenticationMode? authenticationMode = default(AutoStorageAuthenticationMode?), ComputeNodeIdentityReference nodeIdentityReference = default(ComputeNodeIdentityReference)) + : base(storageAccountId, authenticationMode, nodeIdentityReference) { LastKeySync = lastKeySync; CustomInit(); diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AzureBlobFileSystemConfiguration.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AzureBlobFileSystemConfiguration.cs index 691b1a05cf31..33ddef7e7ca3 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AzureBlobFileSystemConfiguration.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/AzureBlobFileSystemConfiguration.cs @@ -42,7 +42,9 @@ public AzureBlobFileSystemConfiguration() /// The Azure Storage SAS token. /// Additional command line options to /// pass to the mount command. - public AzureBlobFileSystemConfiguration(string accountName, string containerName, string relativeMountPath, string accountKey = default(string), string sasKey = default(string), string blobfuseOptions = default(string)) + /// The reference to the user assigned + /// identity to use to access containerName + public AzureBlobFileSystemConfiguration(string accountName, string containerName, string relativeMountPath, string accountKey = default(string), string sasKey = default(string), string blobfuseOptions = default(string), ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference)) { AccountName = accountName; ContainerName = containerName; @@ -50,6 +52,7 @@ public AzureBlobFileSystemConfiguration() SasKey = sasKey; BlobfuseOptions = blobfuseOptions; RelativeMountPath = relativeMountPath; + IdentityReference = identityReference; CustomInit(); } @@ -74,8 +77,8 @@ public AzureBlobFileSystemConfiguration() /// Gets or sets the Azure Storage Account key. /// /// - /// This property is mutually exclusive with sasKey and one must be - /// specified. + /// This property is mutually exclusive with both sasKey and identity; + /// exactly one must be specified. /// [JsonProperty(PropertyName = "accountKey")] public string AccountKey { get; set; } @@ -84,8 +87,8 @@ public AzureBlobFileSystemConfiguration() /// Gets or sets the Azure Storage SAS token. /// /// - /// This property is mutually exclusive with accountKey and one must be - /// specified. + /// This property is mutually exclusive with both accountKey and + /// identity; exactly one must be specified. /// [JsonProperty(PropertyName = "sasKey")] public string SasKey { get; set; } @@ -113,6 +116,17 @@ public AzureBlobFileSystemConfiguration() [JsonProperty(PropertyName = "relativeMountPath")] public string RelativeMountPath { get; set; } + /// + /// Gets or sets the reference to the user assigned identity to use to + /// access containerName + /// + /// + /// This property is mutually exclusive with both accountKey and + /// sasKey; exactly one must be specified. + /// + [JsonProperty(PropertyName = "identityReference")] + public ComputeNodeIdentityReference IdentityReference { get; set; } + /// /// Validate the object. /// 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 597e19cc3252..2984ca3ee51a 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 @@ -58,7 +58,7 @@ public BatchAccount() /// account. /// The dedicated core quota for the /// Batch account. - /// The low priority core quota for + /// The low-priority core quota for /// the Batch account. /// A list of the dedicated /// core quota per Virtual Machine family for the Batch account. For @@ -71,8 +71,12 @@ public BatchAccount() /// account. /// The active job and job /// schedule quota for the Batch account. + /// List of allowed + /// authentication modes for the Batch account that can be used to + /// authenticate with the data plane. This does not affect + /// authentication with the control plane. /// 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)) + 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), IList allowedAuthenticationModes = default(IList), BatchAccountIdentity identity = default(BatchAccountIdentity)) : base(id, name, type, location, tags) { AccountEndpoint = accountEndpoint; @@ -89,6 +93,7 @@ public BatchAccount() DedicatedCoreQuotaPerVMFamilyEnforced = dedicatedCoreQuotaPerVMFamilyEnforced; PoolQuota = poolQuota; ActiveJobAndJobScheduleQuota = activeJobAndJobScheduleQuota; + AllowedAuthenticationModes = allowedAuthenticationModes; Identity = identity; CustomInit(); } @@ -176,7 +181,7 @@ public BatchAccount() public int? DedicatedCoreQuota { get; private set; } /// - /// Gets the low priority core quota for the Batch account. + /// Gets the low-priority core quota for the Batch account. /// /// /// For accounts with PoolAllocationMode set to UserSubscription, quota @@ -224,6 +229,14 @@ public BatchAccount() [JsonProperty(PropertyName = "properties.activeJobAndJobScheduleQuota")] public int ActiveJobAndJobScheduleQuota { get; private set; } + /// + /// Gets list of allowed authentication modes for the Batch account + /// that can be used to authenticate with the data plane. This does not + /// affect authentication with the control plane. + /// + [JsonProperty(PropertyName = "properties.allowedAuthenticationModes")] + public IList AllowedAuthenticationModes { get; private set; } + /// /// Gets or sets the identity of the Batch account. /// 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 a32c2bc81efc..a2208b67668c 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,8 +50,12 @@ public BatchAccountCreateParameters() /// accessing Azure Batch account. /// The encryption configuration for the Batch /// account. + /// List of allowed + /// authentication modes for the Batch account that can be used to + /// authenticate with the data plane. This does not affect + /// authentication with the control plane. /// 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)) + 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), IList allowedAuthenticationModes = default(IList), BatchAccountIdentity identity = default(BatchAccountIdentity)) { Location = location; Tags = tags; @@ -60,6 +64,7 @@ public BatchAccountCreateParameters() KeyVaultReference = keyVaultReference; PublicNetworkAccess = publicNetworkAccess; Encryption = encryption; + AllowedAuthenticationModes = allowedAuthenticationModes; Identity = identity; CustomInit(); } @@ -131,6 +136,14 @@ public BatchAccountCreateParameters() [JsonProperty(PropertyName = "properties.encryption")] public EncryptionProperties Encryption { get; set; } + /// + /// Gets or sets list of allowed authentication modes for the Batch + /// account that can be used to authenticate with the data plane. This + /// does not affect authentication with the control plane. + /// + [JsonProperty(PropertyName = "properties.allowedAuthenticationModes")] + public IList AllowedAuthenticationModes { get; set; } + /// /// Gets or sets the identity of the Batch account. /// 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 index ce247998c031..058e2b4daca0 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountIdentity.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountIdentity.cs @@ -16,9 +16,10 @@ namespace Microsoft.Azure.Management.Batch.Models using System.Linq; /// - /// The identity of the Batch account, if configured. This is only used - /// when the user specifies 'Microsoft.KeyVault' as their Batch account - /// encryption configuration. + /// The identity of the Batch account, if configured. This is used when the + /// user specifies 'Microsoft.KeyVault' as their Batch account encryption + /// configuration or when `ManagedIdentity` is selected as the auto-storage + /// authentication mode. /// public partial class BatchAccountIdentity { @@ -43,10 +44,8 @@ public BatchAccountIdentity() /// account. This property will only be provided for a system assigned /// identity. /// The list of user identities - /// associated with the Batch account. The user identity dictionary key - /// references will be ARM resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - public BatchAccountIdentity(ResourceIdentityType type, string principalId = default(string), string tenantId = default(string), IDictionary userAssignedIdentities = default(IDictionary)) + /// associated with the Batch account. + public BatchAccountIdentity(ResourceIdentityType type, string principalId = default(string), string tenantId = default(string), IDictionary userAssignedIdentities = default(IDictionary)) { PrincipalId = principalId; TenantId = tenantId; @@ -83,12 +82,10 @@ public BatchAccountIdentity() /// /// Gets or sets the list of user identities associated with the Batch - /// account. The user identity dictionary key references will be ARM - /// resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// account. /// [JsonProperty(PropertyName = "userAssignedIdentities")] - public IDictionary UserAssignedIdentities { get; set; } + public IDictionary UserAssignedIdentities { get; set; } /// /// Validate the object. diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountIdentityUserAssignedIdentitiesValue.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountIdentityUserAssignedIdentitiesValue.cs deleted file mode 100644 index e1072790153c..000000000000 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchAccountIdentityUserAssignedIdentitiesValue.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Batch.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class BatchAccountIdentityUserAssignedIdentitiesValue - { - /// - /// Initializes a new instance of the - /// BatchAccountIdentityUserAssignedIdentitiesValue class. - /// - public BatchAccountIdentityUserAssignedIdentitiesValue() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// BatchAccountIdentityUserAssignedIdentitiesValue class. - /// - /// The principal id of user assigned - /// identity. - /// The client id of user assigned - /// identity. - public BatchAccountIdentityUserAssignedIdentitiesValue(string principalId = default(string), string clientId = default(string)) - { - PrincipalId = principalId; - ClientId = clientId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the principal id of user assigned identity. - /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } - - /// - /// Gets the client id of user assigned identity. - /// - [JsonProperty(PropertyName = "clientId")] - public string ClientId { get; private set; } - - } -} 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 80214cc96c31..e66cb461308e 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,12 +42,17 @@ public BatchAccountUpdateParameters() /// auto-storage account. /// The encryption configuration for the Batch /// account. + /// List of allowed + /// authentication modes for the Batch account that can be used to + /// authenticate with the data plane. This does not affect + /// authentication with the control plane. /// The identity of the Batch account. - public BatchAccountUpdateParameters(IDictionary tags = default(IDictionary), AutoStorageBaseProperties autoStorage = default(AutoStorageBaseProperties), EncryptionProperties encryption = default(EncryptionProperties), BatchAccountIdentity identity = default(BatchAccountIdentity)) + public BatchAccountUpdateParameters(IDictionary tags = default(IDictionary), AutoStorageBaseProperties autoStorage = default(AutoStorageBaseProperties), EncryptionProperties encryption = default(EncryptionProperties), IList allowedAuthenticationModes = default(IList), BatchAccountIdentity identity = default(BatchAccountIdentity)) { Tags = tags; AutoStorage = autoStorage; Encryption = encryption; + AllowedAuthenticationModes = allowedAuthenticationModes; Identity = identity; CustomInit(); } @@ -80,6 +85,14 @@ public BatchAccountUpdateParameters() [JsonProperty(PropertyName = "properties.encryption")] public EncryptionProperties Encryption { get; set; } + /// + /// Gets or sets list of allowed authentication modes for the Batch + /// account that can be used to authenticate with the data plane. This + /// does not affect authentication with the control plane. + /// + [JsonProperty(PropertyName = "properties.allowedAuthenticationModes")] + public IList AllowedAuthenticationModes { get; set; } + /// /// Gets or sets the identity of the Batch account. /// diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchPoolIdentity.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchPoolIdentity.cs index 46345b4ed457..2ddf711faac5 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchPoolIdentity.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchPoolIdentity.cs @@ -36,10 +36,8 @@ public BatchPoolIdentity() /// The type of identity used for the Batch Pool. /// Possible values include: 'UserAssigned', 'None' /// The list of user identities - /// associated with the Batch pool. The user identity dictionary key - /// references will be ARM resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - public BatchPoolIdentity(PoolIdentityType type, IDictionary userAssignedIdentities = default(IDictionary)) + /// associated with the Batch pool. + public BatchPoolIdentity(PoolIdentityType type, IDictionary userAssignedIdentities = default(IDictionary)) { Type = type; UserAssignedIdentities = userAssignedIdentities; @@ -60,12 +58,10 @@ public BatchPoolIdentity() /// /// Gets or sets the list of user identities associated with the Batch - /// pool. The user identity dictionary key references will be ARM - /// resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// pool. /// [JsonProperty(PropertyName = "userAssignedIdentities")] - public IDictionary UserAssignedIdentities { get; set; } + public IDictionary UserAssignedIdentities { get; set; } /// /// Validate the object. diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/CertificateBaseProperties.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/CertificateBaseProperties.cs index 8d729e028dfa..71d73fc0baf7 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/CertificateBaseProperties.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/CertificateBaseProperties.cs @@ -13,6 +13,9 @@ namespace Microsoft.Azure.Management.Batch.Models using Newtonsoft.Json; using System.Linq; + /// + /// Base certificate properties. + /// public partial class CertificateBaseProperties { /// diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ComputeNodeIdentityReference.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ComputeNodeIdentityReference.cs new file mode 100644 index 000000000000..48a3b9dd05f2 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ComputeNodeIdentityReference.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.Batch.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The reference to a user assigned identity associated with the Batch + /// pool which a compute node will use. + /// + public partial class ComputeNodeIdentityReference + { + /// + /// Initializes a new instance of the ComputeNodeIdentityReference + /// class. + /// + public ComputeNodeIdentityReference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeNodeIdentityReference + /// class. + /// + /// The ARM resource id of the user assigned + /// identity. + public ComputeNodeIdentityReference(string resourceId = default(string)) + { + ResourceId = resourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ARM resource id of the user assigned identity. + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ContainerRegistry.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ContainerRegistry.cs index d02b35b6a391..4411d36f4792 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ContainerRegistry.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ContainerRegistry.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.Batch.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -35,11 +34,15 @@ public ContainerRegistry() /// The password to log into the registry /// server. /// The registry URL. - public ContainerRegistry(string userName, string password, string registryServer = default(string)) + /// The reference to the user assigned + /// identity to use to access an Azure Container Registry instead of + /// username and password. + public ContainerRegistry(string userName = default(string), string password = default(string), string registryServer = default(string), ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference)) { - RegistryServer = registryServer; UserName = userName; Password = password; + RegistryServer = registryServer; + IdentityReference = identityReference; CustomInit(); } @@ -48,15 +51,6 @@ public ContainerRegistry() /// partial void CustomInit(); - /// - /// Gets or sets the registry URL. - /// - /// - /// If omitted, the default is "docker.io". - /// - [JsonProperty(PropertyName = "registryServer")] - public string RegistryServer { get; set; } - /// /// Gets or sets the user name to log into the registry server. /// @@ -70,21 +64,21 @@ public ContainerRegistry() public string Password { get; set; } /// - /// Validate the object. + /// Gets or sets the registry URL. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (UserName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "UserName"); - } - if (Password == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Password"); - } - } + /// + /// If omitted, the default is "docker.io". + /// + [JsonProperty(PropertyName = "registryServer")] + public string RegistryServer { get; set; } + + /// + /// Gets or sets the reference to the user assigned identity to use to + /// access an Azure Container Registry instead of username and + /// password. + /// + [JsonProperty(PropertyName = "identityReference")] + public ComputeNodeIdentityReference IdentityReference { get; set; } + } } diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/DiffDiskPlacement.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/DiffDiskPlacement.cs new file mode 100644 index 000000000000..fbb99fa66c8e --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/DiffDiskPlacement.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Batch.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DiffDiskPlacement. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DiffDiskPlacement + { + /// + /// The Ephemeral OS Disk is stored on the VM cache. + /// + [EnumMember(Value = "CacheDisk")] + CacheDisk + } + internal static class DiffDiskPlacementEnumExtension + { + internal static string ToSerializedValue(this DiffDiskPlacement? value) + { + return value == null ? null : ((DiffDiskPlacement)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DiffDiskPlacement value) + { + switch( value ) + { + case DiffDiskPlacement.CacheDisk: + return "CacheDisk"; + } + return null; + } + + internal static DiffDiskPlacement? ParseDiffDiskPlacement(this string value) + { + switch( value ) + { + case "CacheDisk": + return DiffDiskPlacement.CacheDisk; + } + return null; + } + } +} diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/DiffDiskSettings.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/DiffDiskSettings.cs new file mode 100644 index 000000000000..692f54d80273 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/DiffDiskSettings.cs @@ -0,0 +1,65 @@ +// +// 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; + + /// + /// Specifies the ephemeral Disk Settings for the operating system disk + /// used by the virtual machine. + /// + public partial class DiffDiskSettings + { + /// + /// Initializes a new instance of the DiffDiskSettings class. + /// + public DiffDiskSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiffDiskSettings class. + /// + /// Specifies the ephemeral disk placement for + /// operating system disk for all VMs in the pool. + public DiffDiskSettings(DiffDiskPlacement? placement = default(DiffDiskPlacement?)) + { + Placement = placement; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the ephemeral disk placement for operating + /// system disk for all VMs in the pool. + /// + /// + /// This property can be used by user in the request to choose which + /// location the operating system should be in. e.g., cache disk space + /// for Ephemeral OS disk provisioning. For more information on + /// Ephemeral OS disk size requirements, please refer to Ephemeral OS + /// disk size requirements for Windows VMs at + /// https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements + /// and Linux VMs at + /// https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + /// Possible values include: 'CacheDisk' + /// + [JsonProperty(PropertyName = "placement")] + public DiffDiskPlacement? Placement { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/EndpointDependency.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/EndpointDependency.cs new file mode 100644 index 000000000000..6d20231ce030 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/EndpointDependency.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.Batch.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A domain name and connection details used to access a dependency. + /// + public partial class EndpointDependency + { + /// + /// Initializes a new instance of the EndpointDependency class. + /// + public EndpointDependency() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EndpointDependency class. + /// + /// The domain name of the dependency. Domain + /// names may be fully qualified or may contain a * wildcard. + /// Human-readable supplemental information + /// about the dependency and when it is applicable. + /// The list of connection details for + /// this endpoint. + public EndpointDependency(string domainName = default(string), string description = default(string), IList endpointDetails = default(IList)) + { + DomainName = domainName; + Description = description; + EndpointDetails = endpointDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the domain name of the dependency. Domain names may be fully + /// qualified or may contain a * wildcard. + /// + [JsonProperty(PropertyName = "domainName")] + public string DomainName { get; private set; } + + /// + /// Gets human-readable supplemental information about the dependency + /// and when it is applicable. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + /// + /// Gets the list of connection details for this endpoint. + /// + [JsonProperty(PropertyName = "endpointDetails")] + public IList EndpointDetails { get; private set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/EndpointDetail.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/EndpointDetail.cs new file mode 100644 index 000000000000..b5aa60a66dfa --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/EndpointDetail.cs @@ -0,0 +1,52 @@ +// +// 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; + + /// + /// Details about the connection between the Batch service and the + /// endpoint. + /// + public partial class EndpointDetail + { + /// + /// Initializes a new instance of the EndpointDetail class. + /// + public EndpointDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EndpointDetail class. + /// + /// The port an endpoint is connected to. + public EndpointDetail(int? port = default(int?)) + { + Port = port; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the port an endpoint is connected to. + /// + [JsonProperty(PropertyName = "port")] + public int? Port { get; private set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/FixedScaleSettings.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/FixedScaleSettings.cs index 419294256fa9..229fab3c66e7 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/FixedScaleSettings.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/FixedScaleSettings.cs @@ -33,8 +33,8 @@ public FixedScaleSettings() /// nodes to the pool. /// The desired number of dedicated /// compute nodes in the pool. - /// The desired number of low - /// priority compute nodes in the pool. + /// The desired number of + /// low-priority compute nodes in the pool. /// Determines what to do with a /// node and its running task(s) if the pool size is /// decreasing. @@ -78,7 +78,7 @@ public FixedScaleSettings() public int? TargetDedicatedNodes { get; set; } /// - /// Gets or sets the desired number of low priority compute nodes in + /// Gets or sets the desired number of low-priority compute nodes in /// the pool. /// /// diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/OSDisk.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/OSDisk.cs new file mode 100644 index 000000000000..31e41fb3c0eb --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/OSDisk.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.Batch.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Settings for the operating system disk of the virtual machine. + /// + public partial class OSDisk + { + /// + /// Initializes a new instance of the OSDisk class. + /// + public OSDisk() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OSDisk class. + /// + /// Specifies the ephemeral Disk + /// Settings for the operating system disk used by the virtual + /// machine. + public OSDisk(DiffDiskSettings ephemeralOSDiskSettings = default(DiffDiskSettings)) + { + EphemeralOSDiskSettings = ephemeralOSDiskSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the ephemeral Disk Settings for the + /// operating system disk used by the virtual machine. + /// + [JsonProperty(PropertyName = "ephemeralOSDiskSettings")] + public DiffDiskSettings EphemeralOSDiskSettings { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/Operation.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/Operation.cs index 9336782617af..54d5ef380ec2 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/Operation.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/Operation.cs @@ -30,14 +30,17 @@ public Operation() /// Initializes a new instance of the Operation class. /// /// The operation name. + /// Indicates whether the operation is a + /// data action /// The object that describes the /// operation. /// The intended executor of the /// operation. /// Properties of the operation. - public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay), string origin = default(string), object properties = default(object)) + public Operation(string name = default(string), bool? isDataAction = default(bool?), OperationDisplay display = default(OperationDisplay), string origin = default(string), object properties = default(object)) { Name = name; + IsDataAction = isDataAction; Display = display; Origin = origin; Properties = properties; @@ -58,6 +61,12 @@ public Operation() [JsonProperty(PropertyName = "name")] public string Name { get; set; } + /// + /// Gets or sets indicates whether the operation is a data action + /// + [JsonProperty(PropertyName = "isDataAction")] + public bool? IsDataAction { get; set; } + /// /// Gets or sets the object that describes the operation. /// diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/OutboundEnvironmentEndpoint.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/OutboundEnvironmentEndpoint.cs new file mode 100644 index 000000000000..59d7abfeace7 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/OutboundEnvironmentEndpoint.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 System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A collection of related endpoints from the same service for which the + /// Batch service requires outbound access. + /// + public partial class OutboundEnvironmentEndpoint + { + /// + /// Initializes a new instance of the OutboundEnvironmentEndpoint + /// class. + /// + public OutboundEnvironmentEndpoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OutboundEnvironmentEndpoint + /// class. + /// + /// The type of service that the Batch service + /// connects to. + /// The endpoints for this service to which the + /// Batch service makes outbound calls. + public OutboundEnvironmentEndpoint(string category = default(string), IList endpoints = default(IList)) + { + Category = category; + Endpoints = endpoints; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the type of service that the Batch service connects to. + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; private set; } + + /// + /// Gets the endpoints for this service to which the Batch service + /// makes outbound calls. + /// + [JsonProperty(PropertyName = "endpoints")] + public IList Endpoints { get; private set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/Pool.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/Pool.cs index 823576f2f169..4c45359d688a 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/Pool.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/Pool.cs @@ -57,7 +57,7 @@ public Pool() /// Machines. /// The number of compute nodes /// currently in the pool. - /// The number of low priority + /// The number of low-priority /// compute nodes currently in the pool. /// Settings which configure the number of /// nodes in the pool. @@ -228,7 +228,7 @@ public Pool() public int? CurrentDedicatedNodes { get; private set; } /// - /// Gets the number of low priority compute nodes currently in the + /// Gets the number of low-priority compute nodes currently in the /// pool. /// [JsonProperty(PropertyName = "properties.currentLowPriorityNodes")] diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ResizeOperationStatus.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ResizeOperationStatus.cs index b7a9f8169cf2..1643c6a06e84 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ResizeOperationStatus.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ResizeOperationStatus.cs @@ -38,8 +38,8 @@ public ResizeOperationStatus() /// /// The desired number of dedicated /// compute nodes in the pool. - /// The desired number of low - /// priority compute nodes in the pool. + /// The desired number of + /// low-priority compute nodes in the pool. /// The timeout for allocation of compute /// nodes to the pool or removal of compute nodes from the /// pool. @@ -74,7 +74,7 @@ public ResizeOperationStatus() public int? TargetDedicatedNodes { get; set; } /// - /// Gets or sets the desired number of low priority compute nodes in + /// Gets or sets the desired number of low-priority compute nodes in /// the pool. /// [JsonProperty(PropertyName = "targetLowPriorityNodes")] diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ResourceFile.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ResourceFile.cs index 21fb9e800975..52f1750435e7 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ResourceFile.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/ResourceFile.cs @@ -42,7 +42,10 @@ public ResourceFile() /// directory. /// The file permission mode attribute in octal /// format. - public ResourceFile(string autoStorageContainerName = default(string), string storageContainerUrl = default(string), string httpUrl = default(string), string blobPrefix = default(string), string filePath = default(string), string fileMode = default(string)) + /// The reference to the user assigned + /// identity to use to access Azure Blob Storage specified by + /// storageContainerUrl or httpUrl + public ResourceFile(string autoStorageContainerName = default(string), string storageContainerUrl = default(string), string httpUrl = default(string), string blobPrefix = default(string), string filePath = default(string), string fileMode = default(string), ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference)) { AutoStorageContainerName = autoStorageContainerName; StorageContainerUrl = storageContainerUrl; @@ -50,6 +53,7 @@ public ResourceFile() BlobPrefix = blobPrefix; FilePath = filePath; FileMode = fileMode; + IdentityReference = identityReference; CustomInit(); } @@ -77,12 +81,12 @@ public ResourceFile() /// /// The autoStorageContainerName, storageContainerUrl and httpUrl /// properties are mutually exclusive and one of them must be - /// specified. This URL must be readable and listable using anonymous - /// access; that is, the Batch service does not present any credentials - /// when downloading the blob. There are two ways to get such a URL for - /// a blob in Azure storage: include a Shared Access Signature (SAS) - /// granting read and list permissions on the blob, or set the ACL for - /// the blob or its container to allow public access. + /// specified. This URL must be readable and listable from compute + /// nodes. There are three ways to get such a URL for a container in + /// Azure storage: include a Shared Access Signature (SAS) granting + /// read and list permissions on the container, use a managed identity + /// with read and list permissions, or set the ACL for the container to + /// allow public access. /// [JsonProperty(PropertyName = "storageContainerUrl")] public string StorageContainerUrl { get; set; } @@ -93,12 +97,12 @@ public ResourceFile() /// /// The autoStorageContainerName, storageContainerUrl and httpUrl /// properties are mutually exclusive and one of them must be - /// specified. If the URL is Azure Blob Storage, it must be readable - /// using anonymous access; that is, the Batch service does not present - /// any credentials when downloading the blob. There are two ways to - /// get such a URL for a blob in Azure storage: include a Shared Access - /// Signature (SAS) granting read permissions on the blob, or set the - /// ACL for the blob or its container to allow public access. + /// specified. If the URL points to Azure Blob Storage, it must be + /// readable from compute nodes. There are three ways to get such a URL + /// for a blob in Azure storage: include a Shared Access Signature + /// (SAS) granting read permissions on the blob, use a managed identity + /// with read permission, or set the ACL for the blob or its container + /// to allow public access. /// [JsonProperty(PropertyName = "httpUrl")] public string HttpUrl { get; set; } @@ -149,5 +153,13 @@ public ResourceFile() [JsonProperty(PropertyName = "fileMode")] public string FileMode { get; set; } + /// + /// Gets or sets the reference to the user assigned identity to use to + /// access Azure Blob Storage specified by storageContainerUrl or + /// httpUrl + /// + [JsonProperty(PropertyName = "identityReference")] + public ComputeNodeIdentityReference IdentityReference { get; set; } + } } diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/SkuCapability.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/SkuCapability.cs new file mode 100644 index 000000000000..3b3381bb74a8 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/SkuCapability.cs @@ -0,0 +1,59 @@ +// +// 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; + + /// + /// A SKU capability, such as the number of cores. + /// + public partial class SkuCapability + { + /// + /// Initializes a new instance of the SkuCapability class. + /// + public SkuCapability() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuCapability class. + /// + /// The name of the feature. + /// The value of the feature. + public SkuCapability(string name = default(string), string value = default(string)) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the feature. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the value of the feature. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/SupportedSku.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/SupportedSku.cs new file mode 100644 index 000000000000..8c00cfef4838 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/SupportedSku.cs @@ -0,0 +1,70 @@ +// +// 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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes a Batch supported SKU. + /// + public partial class SupportedSku + { + /// + /// Initializes a new instance of the SupportedSku class. + /// + public SupportedSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SupportedSku class. + /// + /// The name of the SKU. + /// The family name of the SKU. + /// A collection of capabilities which this + /// SKU supports. + public SupportedSku(string name = default(string), string familyName = default(string), IList capabilities = default(IList)) + { + Name = name; + FamilyName = familyName; + Capabilities = capabilities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the SKU. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the family name of the SKU. + /// + [JsonProperty(PropertyName = "familyName")] + public string FamilyName { get; private set; } + + /// + /// Gets a collection of capabilities which this SKU supports. + /// + [JsonProperty(PropertyName = "capabilities")] + public IList Capabilities { get; private set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/TaskContainerSettings.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/TaskContainerSettings.cs index ad8c40e10289..cfa284c74260 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/TaskContainerSettings.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/TaskContainerSettings.cs @@ -110,10 +110,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "ImageName"); } - if (Registry != null) - { - Registry.Validate(); - } } } } diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchPoolIdentityUserAssignedIdentitiesValue.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/UserAssignedIdentities.cs similarity index 75% rename from sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchPoolIdentityUserAssignedIdentitiesValue.cs rename to sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/UserAssignedIdentities.cs index 2773c9eac2d2..2e967ef80603 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/BatchPoolIdentityUserAssignedIdentitiesValue.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/UserAssignedIdentities.cs @@ -13,26 +13,27 @@ namespace Microsoft.Azure.Management.Batch.Models using Newtonsoft.Json; using System.Linq; - public partial class BatchPoolIdentityUserAssignedIdentitiesValue + /// + /// The list of associated user identities. + /// + public partial class UserAssignedIdentities { /// - /// Initializes a new instance of the - /// BatchPoolIdentityUserAssignedIdentitiesValue class. + /// Initializes a new instance of the UserAssignedIdentities class. /// - public BatchPoolIdentityUserAssignedIdentitiesValue() + public UserAssignedIdentities() { CustomInit(); } /// - /// Initializes a new instance of the - /// BatchPoolIdentityUserAssignedIdentitiesValue class. + /// Initializes a new instance of the UserAssignedIdentities class. /// /// The principal id of user assigned /// identity. /// The client id of user assigned /// identity. - public BatchPoolIdentityUserAssignedIdentitiesValue(string principalId = default(string), string clientId = default(string)) + public UserAssignedIdentities(string principalId = default(string), string clientId = default(string)) { PrincipalId = principalId; ClientId = clientId; diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/VirtualMachineConfiguration.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/VirtualMachineConfiguration.cs index d59ae0e4d845..4429fee7c769 100644 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/VirtualMachineConfiguration.cs +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/Models/VirtualMachineConfiguration.cs @@ -54,7 +54,9 @@ public VirtualMachineConfiguration() /// configuration for the pool. /// The virtual machine extension for the /// pool. - public VirtualMachineConfiguration(ImageReference imageReference, string nodeAgentSkuId, WindowsConfiguration windowsConfiguration = default(WindowsConfiguration), IList dataDisks = default(IList), string licenseType = default(string), ContainerConfiguration containerConfiguration = default(ContainerConfiguration), DiskEncryptionConfiguration diskEncryptionConfiguration = default(DiskEncryptionConfiguration), NodePlacementConfiguration nodePlacementConfiguration = default(NodePlacementConfiguration), IList extensions = default(IList)) + /// Settings for the operating system disk of the + /// Virtual Machine. + public VirtualMachineConfiguration(ImageReference imageReference, string nodeAgentSkuId, WindowsConfiguration windowsConfiguration = default(WindowsConfiguration), IList dataDisks = default(IList), string licenseType = default(string), ContainerConfiguration containerConfiguration = default(ContainerConfiguration), DiskEncryptionConfiguration diskEncryptionConfiguration = default(DiskEncryptionConfiguration), NodePlacementConfiguration nodePlacementConfiguration = default(NodePlacementConfiguration), IList extensions = default(IList), OSDisk osDisk = default(OSDisk)) { ImageReference = imageReference; NodeAgentSkuId = nodeAgentSkuId; @@ -65,6 +67,7 @@ public VirtualMachineConfiguration() DiskEncryptionConfiguration = diskEncryptionConfiguration; NodePlacementConfiguration = nodePlacementConfiguration; Extensions = extensions; + OsDisk = osDisk; CustomInit(); } @@ -178,6 +181,16 @@ public VirtualMachineConfiguration() [JsonProperty(PropertyName = "extensions")] public IList Extensions { get; set; } + /// + /// Gets or sets settings for the operating system disk of the Virtual + /// Machine. + /// + /// + /// Contains configuration for ephemeral OSDisk settings. + /// + [JsonProperty(PropertyName = "osDisk")] + public OSDisk OsDisk { get; set; } + /// /// Validate the object. /// 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 deleted file mode 100644 index b7a2100e717d..000000000000 --- a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/SdkInfo_BatchManagement.cs +++ /dev/null @@ -1,46 +0,0 @@ - -// -// 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 -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_BatchManagement - { - get - { - return new Tuple[] - { - new Tuple("Batch", "Application", "2021-01-01"), - new Tuple("Batch", "ApplicationPackage", "2021-01-01"), - new Tuple("Batch", "BatchAccount", "2021-01-01"), - new Tuple("Batch", "Certificate", "2021-01-01"), - new Tuple("Batch", "Location", "2021-01-01"), - new Tuple("Batch", "Operations", "2021-01-01"), - new Tuple("Batch", "Pool", "2021-01-01"), - new Tuple("Batch", "PrivateEndpointConnection", "2021-01-01"), - new Tuple("Batch", "PrivateLinkResource", "2021-01-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/master/specification/batch/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=E:\\development\\microsoft\\public\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "d88bf131ab29975a4488e3d9f4527a7791b3e438"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section - } -} - diff --git a/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/SdkInfo_BatchManagementClient.cs b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/SdkInfo_BatchManagementClient.cs new file mode 100644 index 000000000000..b045a8f1b84e --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Management.Batch/src/Generated/SdkInfo_BatchManagementClient.cs @@ -0,0 +1,35 @@ + +// +// 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 +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_BatchManagementClient + { + get + { + return new Tuple[] + { + new Tuple("Batch", "Application", "2021-06-01"), + new Tuple("Batch", "ApplicationPackage", "2021-06-01"), + new Tuple("Batch", "BatchAccount", "2021-06-01"), + new Tuple("Batch", "Certificate", "2021-06-01"), + new Tuple("Batch", "Location", "2021-06-01"), + new Tuple("Batch", "Operations", "2021-06-01"), + new Tuple("Batch", "Pool", "2021-06-01"), + new Tuple("Batch", "PrivateEndpointConnection", "2021-06-01"), + new Tuple("Batch", "PrivateLinkResource", "2021-06-01"), + }.AsEnumerable(); + } + } + } +}