diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/AvailabilitySetsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/AvailabilitySetsOperations.cs index f2701a2ef0692..a68b33a6ee12d 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/AvailabilitySetsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/AvailabilitySetsOperations.cs @@ -105,7 +105,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -313,7 +313,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -511,7 +511,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -687,7 +687,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -871,7 +871,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1059,7 +1059,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1252,7 +1252,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRoleInstancesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRoleInstancesOperations.cs deleted file mode 100644 index f5b2de88542bb..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRoleInstancesOperations.cs +++ /dev/null @@ -1,1855 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CloudServiceRoleInstancesOperations operations. - /// - internal partial class CloudServiceRoleInstancesOperations : IServiceOperations, ICloudServiceRoleInstancesOperations - { - /// - /// Initializes a new instance of the CloudServiceRoleInstancesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal CloudServiceRoleInstancesOperations(ComputeManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ComputeManagementClient - /// - public ComputeManagementClient Client { get; private set; } - - /// - /// Deletes a role instance from a cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a role instance from a cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The expand expression to apply to the operation. Possible values include: - /// 'instanceView' - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (roleInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("roleInstanceName", roleInstanceName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("expand", expand); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}").ToString(); - _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expand, Client.SerializationSettings).Trim('"')))); - } - 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; - } - - /// - /// Retrieves information about the run-time state of a role instance in a - /// cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// 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> GetInstanceViewWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (roleInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("roleInstanceName", roleInstanceName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceView", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/instanceView").ToString(); - _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the list of all role instances in a cloud service. Use nextLink - /// property in the response to get the next page of role instances. Do this - /// till nextLink is null to fetch all the role instances. - /// - /// - /// - /// - /// - /// - /// The expand expression to apply to the operation. Possible values include: - /// 'instanceView' - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("expand", expand); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expand, Client.SerializationSettings).Trim('"')))); - } - 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; - } - - /// - /// The Reboot Role Instance asynchronous operation requests a reboot of a role - /// instance in the cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestartWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestartWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// The Reimage Role Instance asynchronous operation reinstalls the operating - /// system on instances of web roles or worker roles. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task ReimageWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginReimageWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// The Rebuild Role Instance asynchronous operation reinstalls the operating - /// system on instances of web roles or worker roles and initializes the - /// storage resources that are used by them. If you do not want to initialize - /// storage resources, you can use Reimage Role Instance. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RebuildWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRebuildWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a remote desktop file for a role instance in a cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// 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> GetRemoteDesktopFileWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (roleInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("roleInstanceName", roleInstanceName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetRemoteDesktopFile", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/remoteDesktopFile").ToString(); - _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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) - { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a role instance from a cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginDeleteWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (roleInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("roleInstanceName", roleInstanceName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}").ToString(); - _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// The Reboot Role Instance asynchronous operation requests a reboot of a role - /// instance in the cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginRestartWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (roleInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("roleInstanceName", roleInstanceName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/restart").ToString(); - _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("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; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// The Reimage Role Instance asynchronous operation reinstalls the operating - /// system on instances of web roles or worker roles. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginReimageWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (roleInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("roleInstanceName", roleInstanceName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReimage", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/reimage").ToString(); - _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("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; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// The Rebuild Role Instance asynchronous operation reinstalls the operating - /// system on instances of web roles or worker roles and initializes the - /// storage resources that are used by them. If you do not want to initialize - /// storage resources, you can use Reimage Role Instance. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginRebuildWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (roleInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("roleInstanceName", roleInstanceName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRebuild", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/rebuild").ToString(); - _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("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; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the list of all role instances in a cloud service. Use nextLink - /// property in the response to get the next page of role instances. Do this - /// till nextLink is null to fetch all the role instances. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRoleInstancesOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRoleInstancesOperationsExtensions.cs deleted file mode 100644 index b629a041cd9b8..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRoleInstancesOperationsExtensions.cs +++ /dev/null @@ -1,579 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.IO; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for CloudServiceRoleInstancesOperations. - /// - public static partial class CloudServiceRoleInstancesOperationsExtensions - { - /// - /// Deletes a role instance from a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - public static void Delete(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) - { - operations.DeleteAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a role instance from a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a role instance from a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The expand expression to apply to the operation. Possible values include: - /// 'instanceView' - /// - public static RoleInstance Get(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?)) - { - return operations.GetAsync(roleInstanceName, resourceGroupName, cloudServiceName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets a role instance from a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The expand expression to apply to the operation. Possible values include: - /// 'instanceView' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves information about the run-time state of a role instance in a - /// cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - public static RoleInstanceInstanceView GetInstanceView(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) - { - return operations.GetInstanceViewAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves information about the run-time state of a role instance in a - /// cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetInstanceViewAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetInstanceViewWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the list of all role instances in a cloud service. Use nextLink - /// property in the response to get the next page of role instances. Do this - /// till nextLink is null to fetch all the role instances. - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// - /// - /// The expand expression to apply to the operation. Possible values include: - /// 'instanceView' - /// - public static IPage List(this ICloudServiceRoleInstancesOperations operations, string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?)) - { - return operations.ListAsync(resourceGroupName, cloudServiceName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of all role instances in a cloud service. Use nextLink - /// property in the response to get the next page of role instances. Do this - /// till nextLink is null to fetch all the role instances. - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// - /// - /// The expand expression to apply to the operation. Possible values include: - /// 'instanceView' - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ICloudServiceRoleInstancesOperations operations, string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, cloudServiceName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The Reboot Role Instance asynchronous operation requests a reboot of a role - /// instance in the cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - public static void Restart(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) - { - operations.RestartAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// The Reboot Role Instance asynchronous operation requests a reboot of a role - /// instance in the cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task RestartAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RestartWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The Reimage Role Instance asynchronous operation reinstalls the operating - /// system on instances of web roles or worker roles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - public static void Reimage(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) - { - operations.ReimageAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// The Reimage Role Instance asynchronous operation reinstalls the operating - /// system on instances of web roles or worker roles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task ReimageAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ReimageWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The Rebuild Role Instance asynchronous operation reinstalls the operating - /// system on instances of web roles or worker roles and initializes the - /// storage resources that are used by them. If you do not want to initialize - /// storage resources, you can use Reimage Role Instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - public static void Rebuild(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) - { - operations.RebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// The Rebuild Role Instance asynchronous operation reinstalls the operating - /// system on instances of web roles or worker roles and initializes the - /// storage resources that are used by them. If you do not want to initialize - /// storage resources, you can use Reimage Role Instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task RebuildAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RebuildWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a remote desktop file for a role instance in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - public static Stream GetRemoteDesktopFile(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) - { - return operations.GetRemoteDesktopFileAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Gets a remote desktop file for a role instance in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetRemoteDesktopFileAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - var _result = await operations.GetRemoteDesktopFileWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false); - _result.Request.Dispose(); - return _result.Body; - } - - /// - /// Deletes a role instance from a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - public static void BeginDelete(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) - { - operations.BeginDeleteAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a role instance from a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The Reboot Role Instance asynchronous operation requests a reboot of a role - /// instance in the cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - public static void BeginRestart(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) - { - operations.BeginRestartAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// The Reboot Role Instance asynchronous operation requests a reboot of a role - /// instance in the cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task BeginRestartAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRestartWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The Reimage Role Instance asynchronous operation reinstalls the operating - /// system on instances of web roles or worker roles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - public static void BeginReimage(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) - { - operations.BeginReimageAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// The Reimage Role Instance asynchronous operation reinstalls the operating - /// system on instances of web roles or worker roles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task BeginReimageAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginReimageWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The Rebuild Role Instance asynchronous operation reinstalls the operating - /// system on instances of web roles or worker roles and initializes the - /// storage resources that are used by them. If you do not want to initialize - /// storage resources, you can use Reimage Role Instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - public static void BeginRebuild(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) - { - operations.BeginRebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// The Rebuild Role Instance asynchronous operation reinstalls the operating - /// system on instances of web roles or worker roles and initializes the - /// storage resources that are used by them. If you do not want to initialize - /// storage resources, you can use Reimage Role Instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task BeginRebuildAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRebuildWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the list of all role instances in a cloud service. Use nextLink - /// property in the response to get the next page of role instances. Do this - /// till nextLink is null to fetch all the role instances. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ICloudServiceRoleInstancesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of all role instances in a cloud service. Use nextLink - /// property in the response to get the next page of role instances. Do this - /// till nextLink is null to fetch all the role instances. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ICloudServiceRoleInstancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperations.cs deleted file mode 100644 index 4f89d31c68754..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperations.cs +++ /dev/null @@ -1,624 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CloudServiceRolesOperations operations. - /// - internal partial class CloudServiceRolesOperations : IServiceOperations, ICloudServiceRolesOperations - { - /// - /// Initializes a new instance of the CloudServiceRolesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal CloudServiceRolesOperations(ComputeManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ComputeManagementClient - /// - public ComputeManagementClient Client { get; private set; } - - /// - /// Gets a role from a cloud service. - /// - /// - /// Name of the role. - /// - /// - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string roleName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (roleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "roleName"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("roleName", roleName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}").ToString(); - _url = _url.Replace("{roleName}", System.Uri.EscapeDataString(roleName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a list of all roles in a cloud service. Use nextLink property in the - /// response to get the next page of roles. Do this till nextLink is null to - /// fetch all the roles. - /// - /// - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a list of all roles in a cloud service. Use nextLink property in the - /// response to get the next page of roles. Do this till nextLink is null to - /// fetch all the roles. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperationsExtensions.cs deleted file mode 100644 index 5e85be38ce4a5..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperationsExtensions.cs +++ /dev/null @@ -1,145 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for CloudServiceRolesOperations. - /// - public static partial class CloudServiceRolesOperationsExtensions - { - /// - /// Gets a role from a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role. - /// - /// - /// - /// - /// - public static CloudServiceRole Get(this ICloudServiceRolesOperations operations, string roleName, string resourceGroupName, string cloudServiceName) - { - return operations.GetAsync(roleName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Gets a role from a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the role. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ICloudServiceRolesOperations operations, string roleName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(roleName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of all roles in a cloud service. Use nextLink property in the - /// response to get the next page of roles. Do this till nextLink is null to - /// fetch all the roles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// - public static IPage List(this ICloudServiceRolesOperations operations, string resourceGroupName, string cloudServiceName) - { - return operations.ListAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all roles in a cloud service. Use nextLink property in the - /// response to get the next page of roles. Do this till nextLink is null to - /// fetch all the roles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ICloudServiceRolesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of all roles in a cloud service. Use nextLink property in the - /// response to get the next page of roles. Do this till nextLink is null to - /// fetch all the roles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ICloudServiceRolesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all roles in a cloud service. Use nextLink property in the - /// response to get the next page of roles. Do this till nextLink is null to - /// fetch all the roles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ICloudServiceRolesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperations.cs deleted file mode 100644 index cfad17514e220..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperations.cs +++ /dev/null @@ -1,3122 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CloudServicesOperations operations. - /// - internal partial class CloudServicesOperations : IServiceOperations, ICloudServicesOperations - { - /// - /// Initializes a new instance of the CloudServicesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal CloudServicesOperations(ComputeManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ComputeManagementClient - /// - public ComputeManagementClient Client { get; private set; } - - /// - /// Create or update a cloud service. Please note some properties can be set - /// only during cloud service creation. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cloud service object. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, cloudServiceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Update a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Resource tags - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, cloudServiceName, tags, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Display information about a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the status of a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// 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> GetInstanceViewWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceView", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/instanceView").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a list of all cloud services in the subscription, regardless of the - /// associated resource group. Use nextLink property in the response to get the - /// next page of Cloud Services. Do this till nextLink is null to fetch all the - /// Cloud Services. - /// - /// - /// 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>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a list of all cloud services under a resource group. Use nextLink - /// property in the response to get the next page of Cloud Services. Do this - /// till nextLink is null to fetch all the Cloud Services. - /// - /// - /// Name of the resource group. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Starts the cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Power off the cloud service. Note that resources are still attached and you - /// are getting charged for the resources. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Restarts one or more role instances in a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestartWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Reimage asynchronous operation reinstalls the operating system on instances - /// of web roles or worker roles. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task ReimageWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginReimageWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Rebuild Role Instances reinstalls the operating system on instances of web - /// roles or worker roles and initializes the storage resources that are used - /// by them. If you do not want to initialize storage resources, you can use - /// Reimage Role Instances. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RebuildWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRebuildWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes role instances in a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteInstancesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Create or update a cloud service. Please note some properties can be set - /// only during cloud service creation. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cloud service object. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (parameters != null) - { - parameters.Validate(); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Update a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Resource tags - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - CloudServiceUpdate parameters = default(CloudServiceUpdate); - if (tags != null) - { - parameters = new CloudServiceUpdate(); - parameters.Tags = tags; - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Starts the cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/start").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("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; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Power off the cloud service. Note that resources are still attached and you - /// are getting charged for the resources. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPowerOff", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/poweroff").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("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; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Restarts one or more role instances in a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (roleInstancesProperty == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstancesProperty"); - } - string apiVersion = "2020-10-01-preview"; - RoleInstances parameters = default(RoleInstances); - if (roleInstancesProperty != null) - { - parameters = new RoleInstances(); - parameters.RoleInstancesProperty = roleInstancesProperty; - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/restart").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("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 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Reimage asynchronous operation reinstalls the operating system on instances - /// of web roles or worker roles. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (roleInstancesProperty == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstancesProperty"); - } - string apiVersion = "2020-10-01-preview"; - RoleInstances parameters = default(RoleInstances); - if (roleInstancesProperty != null) - { - parameters = new RoleInstances(); - parameters.RoleInstancesProperty = roleInstancesProperty; - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReimage", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/reimage").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("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 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Rebuild Role Instances reinstalls the operating system on instances of web - /// roles or worker roles and initializes the storage resources that are used - /// by them. If you do not want to initialize storage resources, you can use - /// Reimage Role Instances. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginRebuildWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (roleInstancesProperty == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstancesProperty"); - } - string apiVersion = "2020-10-01-preview"; - RoleInstances parameters = default(RoleInstances); - if (roleInstancesProperty != null) - { - parameters = new RoleInstances(); - parameters.RoleInstancesProperty = roleInstancesProperty; - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRebuild", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/rebuild").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("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 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes role instances in a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginDeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (roleInstancesProperty == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "roleInstancesProperty"); - } - string apiVersion = "2020-10-01-preview"; - RoleInstances parameters = default(RoleInstances); - if (roleInstancesProperty != null) - { - parameters = new RoleInstances(); - parameters.RoleInstancesProperty = roleInstancesProperty; - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteInstances", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/delete").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("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 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a list of all cloud services in the subscription, regardless of the - /// associated resource group. Use nextLink property in the response to get the - /// next page of Cloud Services. Do this till nextLink is null to fetch all the - /// Cloud Services. - /// - /// - /// 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>> ListAllNextWithHttpMessagesAsync(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, "ListAllNext", 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 a list of all cloud services under a resource group. Use nextLink - /// property in the response to get the next page of Cloud Services. Do this - /// till nextLink is null to fetch all the Cloud Services. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperationsExtensions.cs deleted file mode 100644 index 84568a13d4c19..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperationsExtensions.cs +++ /dev/null @@ -1,1047 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for CloudServicesOperations. - /// - public static partial class CloudServicesOperationsExtensions - { - /// - /// Create or update a cloud service. Please note some properties can be set - /// only during cloud service creation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cloud service object. - /// - public static CloudService CreateOrUpdate(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService)) - { - return operations.CreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create or update a cloud service. Please note some properties can be set - /// only during cloud service creation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cloud service object. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, cloudServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Resource tags - /// - public static CloudService Update(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary)) - { - return operations.UpdateAsync(resourceGroupName, cloudServiceName, tags).GetAwaiter().GetResult(); - } - - /// - /// Update a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Resource tags - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, cloudServiceName, tags, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - public static void Delete(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) - { - operations.DeleteAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Display information about a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - public static CloudService Get(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) - { - return operations.GetAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Display information about a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the status of a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - public static CloudServiceInstanceView GetInstanceView(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) - { - return operations.GetInstanceViewAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Gets the status of a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task GetInstanceViewAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetInstanceViewWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of all cloud services in the subscription, regardless of the - /// associated resource group. Use nextLink property in the response to get the - /// next page of Cloud Services. Do this till nextLink is null to fetch all the - /// Cloud Services. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this ICloudServicesOperations operations) - { - return operations.ListAllAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all cloud services in the subscription, regardless of the - /// associated resource group. Use nextLink property in the response to get the - /// next page of Cloud Services. Do this till nextLink is null to fetch all the - /// Cloud Services. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this ICloudServicesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of all cloud services under a resource group. Use nextLink - /// property in the response to get the next page of Cloud Services. Do this - /// till nextLink is null to fetch all the Cloud Services. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - public static IPage List(this ICloudServicesOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all cloud services under a resource group. Use nextLink - /// property in the response to get the next page of Cloud Services. Do this - /// till nextLink is null to fetch all the Cloud Services. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ICloudServicesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Starts the cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - public static void Start(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) - { - operations.StartAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Starts the cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task StartAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StartWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Power off the cloud service. Note that resources are still attached and you - /// are getting charged for the resources. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - public static void PowerOff(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) - { - operations.PowerOffAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Power off the cloud service. Note that resources are still attached and you - /// are getting charged for the resources. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task PowerOffAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Restarts one or more role instances in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - public static void Restart(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) - { - operations.RestartAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); - } - - /// - /// Restarts one or more role instances in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task RestartAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RestartWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reimage asynchronous operation reinstalls the operating system on instances - /// of web roles or worker roles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - public static void Reimage(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) - { - operations.ReimageAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); - } - - /// - /// Reimage asynchronous operation reinstalls the operating system on instances - /// of web roles or worker roles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task ReimageAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ReimageWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Rebuild Role Instances reinstalls the operating system on instances of web - /// roles or worker roles and initializes the storage resources that are used - /// by them. If you do not want to initialize storage resources, you can use - /// Reimage Role Instances. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - public static void Rebuild(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) - { - operations.RebuildAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); - } - - /// - /// Rebuild Role Instances reinstalls the operating system on instances of web - /// roles or worker roles and initializes the storage resources that are used - /// by them. If you do not want to initialize storage resources, you can use - /// Reimage Role Instances. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task RebuildAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RebuildWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes role instances in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - public static void DeleteInstances(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) - { - operations.DeleteInstancesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); - } - - /// - /// Deletes role instances in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteInstancesAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteInstancesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create or update a cloud service. Please note some properties can be set - /// only during cloud service creation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cloud service object. - /// - public static CloudService BeginCreateOrUpdate(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService)) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create or update a cloud service. Please note some properties can be set - /// only during cloud service creation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cloud service object. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, cloudServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Resource tags - /// - public static CloudService BeginUpdate(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary)) - { - return operations.BeginUpdateAsync(resourceGroupName, cloudServiceName, tags).GetAwaiter().GetResult(); - } - - /// - /// Update a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Resource tags - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, cloudServiceName, tags, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - public static void BeginDelete(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) - { - operations.BeginDeleteAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Starts the cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - public static void BeginStart(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) - { - operations.BeginStartAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Starts the cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Power off the cloud service. Note that resources are still attached and you - /// are getting charged for the resources. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - public static void BeginPowerOff(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) - { - operations.BeginPowerOffAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Power off the cloud service. Note that resources are still attached and you - /// are getting charged for the resources. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task BeginPowerOffAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Restarts one or more role instances in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - public static void BeginRestart(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) - { - operations.BeginRestartAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); - } - - /// - /// Restarts one or more role instances in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRestartAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRestartWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reimage asynchronous operation reinstalls the operating system on instances - /// of web roles or worker roles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - public static void BeginReimage(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) - { - operations.BeginReimageAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); - } - - /// - /// Reimage asynchronous operation reinstalls the operating system on instances - /// of web roles or worker roles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task BeginReimageAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginReimageWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Rebuild Role Instances reinstalls the operating system on instances of web - /// roles or worker roles and initializes the storage resources that are used - /// by them. If you do not want to initialize storage resources, you can use - /// Reimage Role Instances. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - public static void BeginRebuild(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) - { - operations.BeginRebuildAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); - } - - /// - /// Rebuild Role Instances reinstalls the operating system on instances of web - /// roles or worker roles and initializes the storage resources that are used - /// by them. If you do not want to initialize storage resources, you can use - /// Reimage Role Instances. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRebuildAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRebuildWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes role instances in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - public static void BeginDeleteInstances(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) - { - operations.BeginDeleteInstancesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); - } - - /// - /// Deletes role instances in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will signify all - /// role instances of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteInstancesAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteInstancesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a list of all cloud services in the subscription, regardless of the - /// associated resource group. Use nextLink property in the response to get the - /// next page of Cloud Services. Do this till nextLink is null to fetch all the - /// Cloud Services. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this ICloudServicesOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all cloud services in the subscription, regardless of the - /// associated resource group. Use nextLink property in the response to get the - /// next page of Cloud Services. Do this till nextLink is null to fetch all the - /// Cloud Services. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this ICloudServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of all cloud services under a resource group. Use nextLink - /// property in the response to get the next page of Cloud Services. Do this - /// till nextLink is null to fetch all the Cloud Services. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ICloudServicesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all cloud services under a resource group. Use nextLink - /// property in the response to get the next page of Cloud Services. Do this - /// till nextLink is null to fetch all the Cloud Services. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ICloudServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperations.cs deleted file mode 100644 index be13c0980ab6a..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperations.cs +++ /dev/null @@ -1,839 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CloudServicesUpdateDomainOperations operations. - /// - internal partial class CloudServicesUpdateDomainOperations : IServiceOperations, ICloudServicesUpdateDomainOperations - { - /// - /// Initializes a new instance of the CloudServicesUpdateDomainOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal CloudServicesUpdateDomainOperations(ComputeManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ComputeManagementClient - /// - public ComputeManagementClient Client { get; private set; } - - /// - /// Updates the role instances in the specified update domain. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Specifies an integer value that identifies the update domain. Update - /// domains are identified with a zero-based index: the first update domain has - /// an ID of 0, the second has an ID of 1, and so on. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task WalkUpdateDomainWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, int updateDomain, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginWalkUpdateDomainWithHttpMessagesAsync(resourceGroupName, cloudServiceName, updateDomain, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the specified update domain of a cloud service. Use nextLink property - /// in the response to get the next page of update domains. Do this till - /// nextLink is null to fetch all the update domains. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Specifies an integer value that identifies the update domain. Update - /// domains are identified with a zero-based index: the first update domain has - /// an ID of 0, the second has an ID of 1, and so on. - /// - /// - /// 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> GetUpdateDomainWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, int updateDomain, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("updateDomain", updateDomain); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetUpdateDomain", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{updateDomain}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(updateDomain, Client.SerializationSettings).Trim('"'))); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a list of all update domains in a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// 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>> ListUpdateDomainsWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUpdateDomains", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Updates the role instances in the specified update domain. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Specifies an integer value that identifies the update domain. Update - /// domains are identified with a zero-based index: the first update domain has - /// an ID of 0, the second has an ID of 1, and so on. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginWalkUpdateDomainWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, int updateDomain, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (cloudServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2020-10-01-preview"; - UpdateDomain parameters = default(UpdateDomain); - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("cloudServiceName", cloudServiceName); - tracingParameters.Add("updateDomain", updateDomain); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginWalkUpdateDomain", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); - _url = _url.Replace("{updateDomain}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(updateDomain, Client.SerializationSettings).Trim('"'))); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a list of all update domains in a cloud service. - /// - /// - /// 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>> ListUpdateDomainsNextWithHttpMessagesAsync(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, "ListUpdateDomainsNext", 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/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperationsExtensions.cs deleted file mode 100644 index 9e3226415fe15..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperationsExtensions.cs +++ /dev/null @@ -1,247 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for CloudServicesUpdateDomainOperations. - /// - public static partial class CloudServicesUpdateDomainOperationsExtensions - { - /// - /// Updates the role instances in the specified update domain. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Specifies an integer value that identifies the update domain. Update - /// domains are identified with a zero-based index: the first update domain has - /// an ID of 0, the second has an ID of 1, and so on. - /// - public static void WalkUpdateDomain(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, int updateDomain) - { - operations.WalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain).GetAwaiter().GetResult(); - } - - /// - /// Updates the role instances in the specified update domain. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Specifies an integer value that identifies the update domain. Update - /// domains are identified with a zero-based index: the first update domain has - /// an ID of 0, the second has an ID of 1, and so on. - /// - /// - /// The cancellation token. - /// - public static async Task WalkUpdateDomainAsync(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, int updateDomain, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.WalkUpdateDomainWithHttpMessagesAsync(resourceGroupName, cloudServiceName, updateDomain, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified update domain of a cloud service. Use nextLink property - /// in the response to get the next page of update domains. Do this till - /// nextLink is null to fetch all the update domains. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Specifies an integer value that identifies the update domain. Update - /// domains are identified with a zero-based index: the first update domain has - /// an ID of 0, the second has an ID of 1, and so on. - /// - public static UpdateDomain GetUpdateDomain(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, int updateDomain) - { - return operations.GetUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified update domain of a cloud service. Use nextLink property - /// in the response to get the next page of update domains. Do this till - /// nextLink is null to fetch all the update domains. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Specifies an integer value that identifies the update domain. Update - /// domains are identified with a zero-based index: the first update domain has - /// an ID of 0, the second has an ID of 1, and so on. - /// - /// - /// The cancellation token. - /// - public static async Task GetUpdateDomainAsync(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, int updateDomain, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetUpdateDomainWithHttpMessagesAsync(resourceGroupName, cloudServiceName, updateDomain, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of all update domains in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - public static IPage ListUpdateDomains(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName) - { - return operations.ListUpdateDomainsAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all update domains in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cancellation token. - /// - public static async Task> ListUpdateDomainsAsync(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListUpdateDomainsWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates the role instances in the specified update domain. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Specifies an integer value that identifies the update domain. Update - /// domains are identified with a zero-based index: the first update domain has - /// an ID of 0, the second has an ID of 1, and so on. - /// - public static void BeginWalkUpdateDomain(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, int updateDomain) - { - operations.BeginWalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain).GetAwaiter().GetResult(); - } - - /// - /// Updates the role instances in the specified update domain. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Specifies an integer value that identifies the update domain. Update - /// domains are identified with a zero-based index: the first update domain has - /// an ID of 0, the second has an ID of 1, and so on. - /// - /// - /// The cancellation token. - /// - public static async Task BeginWalkUpdateDomainAsync(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, int updateDomain, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginWalkUpdateDomainWithHttpMessagesAsync(resourceGroupName, cloudServiceName, updateDomain, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a list of all update domains in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListUpdateDomainsNext(this ICloudServicesUpdateDomainOperations operations, string nextPageLink) - { - return operations.ListUpdateDomainsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all update domains in a cloud service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListUpdateDomainsNextAsync(this ICloudServicesUpdateDomainOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListUpdateDomainsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ComputeManagementClient.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ComputeManagementClient.cs index dd8d1f26d9aa8..f62c8107416de 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ComputeManagementClient.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ComputeManagementClient.cs @@ -116,6 +116,11 @@ public partial class ComputeManagementClient : ServiceClient public virtual IVirtualMachineImagesOperations VirtualMachineImages { get; private set; } + /// + /// Gets the IVirtualMachineImagesEdgeZoneOperations. + /// + public virtual IVirtualMachineImagesEdgeZoneOperations VirtualMachineImagesEdgeZone { get; private set; } + /// /// Gets the IUsageOperations. /// @@ -126,6 +131,11 @@ public partial class ComputeManagementClient : ServiceClient public virtual IVirtualMachinesOperations VirtualMachines { get; private set; } + /// + /// Gets the IVirtualMachineScaleSetsOperations. + /// + public virtual IVirtualMachineScaleSetsOperations VirtualMachineScaleSets { get; private set; } + /// /// Gets the IVirtualMachineSizesOperations. /// @@ -136,11 +146,6 @@ public partial class ComputeManagementClient : ServiceClient public virtual IImagesOperations Images { get; private set; } - /// - /// Gets the IVirtualMachineScaleSetsOperations. - /// - public virtual IVirtualMachineScaleSetsOperations VirtualMachineScaleSets { get; private set; } - /// /// Gets the IVirtualMachineScaleSetExtensionsOperations. /// @@ -251,31 +256,6 @@ public partial class ComputeManagementClient : ServiceClient public virtual ISharedGalleryImageVersionsOperations SharedGalleryImageVersions { get; private set; } - /// - /// Gets the IContainerServicesOperations. - /// - public virtual IContainerServicesOperations ContainerServices { get; private set; } - - /// - /// Gets the ICloudServiceRoleInstancesOperations. - /// - public virtual ICloudServiceRoleInstancesOperations CloudServiceRoleInstances { get; private set; } - - /// - /// Gets the ICloudServiceRolesOperations. - /// - public virtual ICloudServiceRolesOperations CloudServiceRoles { get; private set; } - - /// - /// Gets the ICloudServicesOperations. - /// - public virtual ICloudServicesOperations CloudServices { get; private set; } - - /// - /// Gets the ICloudServicesUpdateDomainOperations. - /// - public virtual ICloudServicesUpdateDomainOperations CloudServicesUpdateDomain { get; private set; } - /// /// Initializes a new instance of the ComputeManagementClient class. /// @@ -526,11 +506,12 @@ private void Initialize() VirtualMachineExtensionImages = new VirtualMachineExtensionImagesOperations(this); VirtualMachineExtensions = new VirtualMachineExtensionsOperations(this); VirtualMachineImages = new VirtualMachineImagesOperations(this); + VirtualMachineImagesEdgeZone = new VirtualMachineImagesEdgeZoneOperations(this); Usage = new UsageOperations(this); VirtualMachines = new VirtualMachinesOperations(this); + VirtualMachineScaleSets = new VirtualMachineScaleSetsOperations(this); VirtualMachineSizes = new VirtualMachineSizesOperations(this); Images = new ImagesOperations(this); - VirtualMachineScaleSets = new VirtualMachineScaleSetsOperations(this); VirtualMachineScaleSetExtensions = new VirtualMachineScaleSetExtensionsOperations(this); VirtualMachineScaleSetRollingUpgrades = new VirtualMachineScaleSetRollingUpgradesOperations(this); VirtualMachineScaleSetVMExtensions = new VirtualMachineScaleSetVMExtensionsOperations(this); @@ -553,11 +534,6 @@ private void Initialize() SharedGalleries = new SharedGalleriesOperations(this); SharedGalleryImages = new SharedGalleryImagesOperations(this); SharedGalleryImageVersions = new SharedGalleryImageVersionsOperations(this); - ContainerServices = new ContainerServicesOperations(this); - CloudServiceRoleInstances = new CloudServiceRoleInstancesOperations(this); - CloudServiceRoles = new CloudServiceRolesOperations(this); - CloudServices = new CloudServicesOperations(this); - CloudServicesUpdateDomain = new CloudServicesUpdateDomainOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ContainerServicesOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ContainerServicesOperationsExtensions.cs deleted file mode 100644 index e245c862dd38f..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ContainerServicesOperationsExtensions.cs +++ /dev/null @@ -1,479 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ContainerServicesOperations. - /// - public static partial class ContainerServicesOperationsExtensions - { - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IContainerServicesOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IContainerServicesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - public static ContainerService CreateOrUpdate(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, ContainerService parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, ContainerService parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, containerServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the properties of the specified container service. - /// - /// - /// Gets the properties of the specified container service in the specified - /// subscription and resource group. The operation returns the properties - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - public static ContainerService Get(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName) - { - return operations.GetAsync(resourceGroupName, containerServiceName).GetAwaiter().GetResult(); - } - - /// - /// Gets the properties of the specified container service. - /// - /// - /// Gets the properties of the specified container service in the specified - /// subscription and resource group. The operation returns the properties - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, containerServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - public static void Delete(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName) - { - operations.DeleteAsync(resourceGroupName, containerServiceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, containerServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IContainerServicesOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IContainerServicesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - public static ContainerService BeginCreateOrUpdate(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, ContainerService parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, ContainerService parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, containerServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - public static void BeginDelete(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName) - { - operations.BeginDeleteAsync(resourceGroupName, containerServiceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, containerServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IContainerServicesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IContainerServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IContainerServicesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IContainerServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/DedicatedHostGroupsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/DedicatedHostGroupsOperations.cs index e81752b46337f..076bab87a29d3 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/DedicatedHostGroupsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/DedicatedHostGroupsOperations.cs @@ -107,7 +107,7 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -333,7 +333,7 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -531,7 +531,7 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -712,7 +712,7 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -906,7 +906,7 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1086,7 +1086,7 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/DedicatedHostsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/DedicatedHostsOperations.cs index db530fa653c0e..6bb551e9fc243 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/DedicatedHostsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/DedicatedHostsOperations.cs @@ -186,7 +186,7 @@ internal DedicatedHostsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -389,7 +389,7 @@ internal DedicatedHostsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -601,7 +601,7 @@ internal DedicatedHostsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -836,7 +836,7 @@ internal DedicatedHostsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1043,7 +1043,7 @@ internal DedicatedHostsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRoleInstancesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRoleInstancesOperations.cs deleted file mode 100644 index 5d97a04e5b07a..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRoleInstancesOperations.cs +++ /dev/null @@ -1,362 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.IO; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CloudServiceRoleInstancesOperations operations. - /// - public partial interface ICloudServiceRoleInstancesOperations - { - /// - /// Deletes a role instance from a cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a role instance from a cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The expand expression to apply to the operation. Possible values - /// include: 'instanceView' - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves information about the run-time state of a role instance - /// in a cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// 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> GetInstanceViewWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the list of all role instances in a cloud service. Use - /// nextLink property in the response to get the next page of role - /// instances. Do this till nextLink is null to fetch all the role - /// instances. - /// - /// - /// - /// - /// - /// - /// The expand expression to apply to the operation. Possible values - /// include: 'instanceView' - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// The Reboot Role Instance asynchronous operation requests a reboot - /// of a role instance in the cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task RestartWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// The Reimage Role Instance asynchronous operation reinstalls the - /// operating system on instances of web roles or worker roles. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task ReimageWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// The Rebuild Role Instance asynchronous operation reinstalls the - /// operating system on instances of web roles or worker roles and - /// initializes the storage resources that are used by them. If you do - /// not want to initialize storage resources, you can use Reimage Role - /// Instance. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task RebuildWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a remote desktop file for a role instance in a cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// 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> GetRemoteDesktopFileWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a role instance from a cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// The Reboot Role Instance asynchronous operation requests a reboot - /// of a role instance in the cloud service. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRestartWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// The Reimage Role Instance asynchronous operation reinstalls the - /// operating system on instances of web roles or worker roles. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginReimageWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// The Rebuild Role Instance asynchronous operation reinstalls the - /// operating system on instances of web roles or worker roles and - /// initializes the storage resources that are used by them. If you do - /// not want to initialize storage resources, you can use Reimage Role - /// Instance. - /// - /// - /// Name of the role instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRebuildWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the list of all role instances in a cloud service. Use - /// nextLink property in the response to get the next page of role - /// instances. Do this till nextLink is null to fetch all the role - /// instances. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRolesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRolesOperations.cs deleted file mode 100644 index 16e8d96e5c5ff..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRolesOperations.cs +++ /dev/null @@ -1,102 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CloudServiceRolesOperations operations. - /// - public partial interface ICloudServiceRolesOperations - { - /// - /// Gets a role from a cloud service. - /// - /// - /// Name of the role. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string roleName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of all roles in a cloud service. Use nextLink property - /// in the response to get the next page of roles. Do this till - /// nextLink is null to fetch all the roles. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of all roles in a cloud service. Use nextLink property - /// in the response to get the next page of roles. Do this till - /// nextLink is null to fetch all the roles. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesOperations.cs deleted file mode 100644 index 837bdd793337c..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesOperations.cs +++ /dev/null @@ -1,638 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CloudServicesOperations operations. - /// - public partial interface ICloudServicesOperations - { - /// - /// Create or update a cloud service. Please note some properties can - /// be set only during cloud service creation. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cloud service object. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Update a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Resource tags - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Display information about a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the status of a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// 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> GetInstanceViewWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of all cloud services in the subscription, regardless - /// of the associated resource group. Use nextLink property in the - /// response to get the next page of Cloud Services. Do this till - /// nextLink is null to fetch all the Cloud Services. - /// - /// - /// 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>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of all cloud services under a resource group. Use - /// nextLink property in the response to get the next page of Cloud - /// Services. Do this till nextLink is null to fetch all the Cloud - /// Services. - /// - /// - /// Name of the resource group. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Starts the cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task StartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Power off the cloud service. Note that resources are still attached - /// and you are getting charged for the resources. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Restarts one or more role instances in a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will - /// signify all role instances of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task RestartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Reimage asynchronous operation reinstalls the operating system on - /// instances of web roles or worker roles. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will - /// signify all role instances of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task ReimageWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Rebuild Role Instances reinstalls the operating system on instances - /// of web roles or worker roles and initializes the storage resources - /// that are used by them. If you do not want to initialize storage - /// resources, you can use Reimage Role Instances. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will - /// signify all role instances of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task RebuildWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes role instances in a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will - /// signify all role instances of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Create or update a cloud service. Please note some properties can - /// be set only during cloud service creation. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The cloud service object. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Update a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Resource tags - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Starts the cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Power off the cloud service. Note that resources are still attached - /// and you are getting charged for the resources. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Restarts one or more role instances in a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will - /// signify all role instances of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Reimage asynchronous operation reinstalls the operating system on - /// instances of web roles or worker roles. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will - /// signify all role instances of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Rebuild Role Instances reinstalls the operating system on instances - /// of web roles or worker roles and initializes the storage resources - /// that are used by them. If you do not want to initialize storage - /// resources, you can use Reimage Role Instances. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will - /// signify all role instances of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRebuildWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes role instances in a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// List of cloud service role instance names. Value of '*' will - /// signify all role instances of the cloud service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of all cloud services in the subscription, regardless - /// of the associated resource group. Use nextLink property in the - /// response to get the next page of Cloud Services. Do this till - /// nextLink is null to fetch all the Cloud Services. - /// - /// - /// 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>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of all cloud services under a resource group. Use - /// nextLink property in the response to get the next page of Cloud - /// Services. Do this till nextLink is null to fetch all the Cloud - /// Services. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesUpdateDomainOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesUpdateDomainOperations.cs deleted file mode 100644 index cdac93b47a192..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesUpdateDomainOperations.cs +++ /dev/null @@ -1,160 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CloudServicesUpdateDomainOperations operations. - /// - public partial interface ICloudServicesUpdateDomainOperations - { - /// - /// Updates the role instances in the specified update domain. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Specifies an integer value that identifies the update domain. - /// Update domains are identified with a zero-based index: the first - /// update domain has an ID of 0, the second has an ID of 1, and so on. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task WalkUpdateDomainWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, int updateDomain, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the specified update domain of a cloud service. Use nextLink - /// property in the response to get the next page of update domains. Do - /// this till nextLink is null to fetch all the update domains. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Specifies an integer value that identifies the update domain. - /// Update domains are identified with a zero-based index: the first - /// update domain has an ID of 0, the second has an ID of 1, and so on. - /// - /// - /// 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> GetUpdateDomainWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, int updateDomain, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of all update domains in a cloud service. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// 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>> ListUpdateDomainsWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates the role instances in the specified update domain. - /// - /// - /// Name of the resource group. - /// - /// - /// Name of the cloud service. - /// - /// - /// Specifies an integer value that identifies the update domain. - /// Update domains are identified with a zero-based index: the first - /// update domain has an ID of 0, the second has an ID of 1, and so on. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginWalkUpdateDomainWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, int updateDomain, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of all update domains in a cloud service. - /// - /// - /// 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>> ListUpdateDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IComputeManagementClient.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IComputeManagementClient.cs index de335b737a8a5..ca07daa8f326d 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IComputeManagementClient.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IComputeManagementClient.cs @@ -111,6 +111,11 @@ public partial interface IComputeManagementClient : System.IDisposable /// IVirtualMachineImagesOperations VirtualMachineImages { get; } + /// + /// Gets the IVirtualMachineImagesEdgeZoneOperations. + /// + IVirtualMachineImagesEdgeZoneOperations VirtualMachineImagesEdgeZone { get; } + /// /// Gets the IUsageOperations. /// @@ -121,6 +126,11 @@ public partial interface IComputeManagementClient : System.IDisposable /// IVirtualMachinesOperations VirtualMachines { get; } + /// + /// Gets the IVirtualMachineScaleSetsOperations. + /// + IVirtualMachineScaleSetsOperations VirtualMachineScaleSets { get; } + /// /// Gets the IVirtualMachineSizesOperations. /// @@ -131,11 +141,6 @@ public partial interface IComputeManagementClient : System.IDisposable /// IImagesOperations Images { get; } - /// - /// Gets the IVirtualMachineScaleSetsOperations. - /// - IVirtualMachineScaleSetsOperations VirtualMachineScaleSets { get; } - /// /// Gets the IVirtualMachineScaleSetExtensionsOperations. /// @@ -246,30 +251,5 @@ public partial interface IComputeManagementClient : System.IDisposable /// ISharedGalleryImageVersionsOperations SharedGalleryImageVersions { get; } - /// - /// Gets the IContainerServicesOperations. - /// - IContainerServicesOperations ContainerServices { get; } - - /// - /// Gets the ICloudServiceRoleInstancesOperations. - /// - ICloudServiceRoleInstancesOperations CloudServiceRoleInstances { get; } - - /// - /// Gets the ICloudServiceRolesOperations. - /// - ICloudServiceRolesOperations CloudServiceRoles { get; } - - /// - /// Gets the ICloudServicesOperations. - /// - ICloudServicesOperations CloudServices { get; } - - /// - /// Gets the ICloudServicesUpdateDomainOperations. - /// - ICloudServicesUpdateDomainOperations CloudServicesUpdateDomain { get; } - } } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IContainerServicesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IContainerServicesOperations.cs deleted file mode 100644 index d8293bc2d92d0..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IContainerServicesOperations.cs +++ /dev/null @@ -1,298 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// ContainerServicesOperations operations. - /// - public partial interface IContainerServicesOperations - { - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. - /// The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and - /// FQDNs of masters and agents. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified - /// configuration of orchestrator, masters, and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service - /// operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, ContainerService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the properties of the specified container service. - /// - /// - /// Gets the properties of the specified container service in the - /// specified subscription and resource group. The operation returns - /// the properties including state, orchestrator, number of masters and - /// agents, and FQDNs of masters and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified - /// subscription and resource group. The operation does not delete - /// other resources created as part of creating a container service, - /// including storage accounts, VMs, and availability sets. All the - /// other resources created with the container service are part of the - /// same resource group and can be deleted individually. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container - /// service including state, orchestrator, number of masters and - /// agents, and FQDNs of masters and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified - /// configuration of orchestrator, masters, and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service - /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, ContainerService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified - /// subscription and resource group. The operation does not delete - /// other resources created as part of creating a container service, - /// including storage accounts, VMs, and availability sets. All the - /// other resources created with the container service are part of the - /// same resource group and can be deleted individually. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. - /// The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and - /// FQDNs of masters and agents. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container - /// service including state, orchestrator, number of masters and - /// agents, and FQDNs of masters and agents. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineImagesEdgeZoneOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineImagesEdgeZoneOperations.cs new file mode 100644 index 0000000000000..3beead36a4a6e --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineImagesEdgeZoneOperations.cs @@ -0,0 +1,197 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// VirtualMachineImagesEdgeZoneOperations operations. + /// + public partial interface IVirtualMachineImagesEdgeZoneOperations + { + /// + /// Gets a virtual machine image in an edge zone. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// A valid image SKU version. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, string skus, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of all virtual machine image versions for the specified + /// location, edge zone, publisher, offer, and SKU. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// An integer value specifying the number of images to return that + /// matches supplied values. + /// + /// + /// Specifies the order of the results returned. Formatted as an OData + /// query. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of virtual machine image offers for the specified + /// location, edge zone and publisher. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// 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>> ListOffersWithHttpMessagesAsync(string location, string edgeZone, string publisherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of virtual machine image publishers for the specified + /// Azure location and edge zone. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// 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>> ListPublishersWithHttpMessagesAsync(string location, string edgeZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of virtual machine image SKUs for the specified + /// location, edge zone, publisher, and offer. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// 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>> ListSkusWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineScaleSetVMsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineScaleSetVMsOperations.cs index 24a0c0a583d64..7d01ea2808edb 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineScaleSetVMsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineScaleSetVMsOperations.cs @@ -155,6 +155,10 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// The instance ID of the virtual machine. /// + /// + /// Optional parameter to force delete a virtual machine from a VM + /// scale set. (Feature in Preview) + /// /// /// The headers that will be added to request. /// @@ -167,7 +171,7 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a virtual machine from a VM scale set. /// @@ -617,6 +621,10 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// The instance ID of the virtual machine. /// + /// + /// Optional parameter to force delete a virtual machine from a VM + /// scale set. (Feature in Preview) + /// /// /// The headers that will be added to request. /// @@ -629,7 +637,7 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Power off (stop) a virtual machine in a VM scale set. Note that /// resources are still attached and you are getting charged for the diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineScaleSetsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineScaleSetsOperations.cs index 9ca46d37e2fc2..6af7aab40f00f 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineScaleSetsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineScaleSetsOperations.cs @@ -23,6 +23,30 @@ namespace Microsoft.Azure.Management.Compute /// public partial interface IVirtualMachineScaleSetsOperations { + /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified location. + /// + /// + /// The location for which VM scale sets under the subscription are + /// queried. + /// + /// + /// 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>> ListByLocationWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or update a VM scale set. /// @@ -88,6 +112,10 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// The name of the VM scale set. /// + /// + /// Optional parameter to force delete a VM scale set. (Feature in + /// Preview) + /// /// /// The headers that will be added to request. /// @@ -100,7 +128,7 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Display information about a virtual machine scale set. /// @@ -168,6 +196,10 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// The virtual machine scale set instance ids. /// + /// + /// Optional parameter to force delete virtual machines from the VM + /// scale set. (Feature in Preview) + /// /// /// The headers that will be added to request. /// @@ -180,7 +212,7 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when a required parameter is null /// - Task DeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the status of a VM scale set instance. /// @@ -682,6 +714,10 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// The name of the VM scale set. /// + /// + /// Optional parameter to force delete a VM scale set. (Feature in + /// Preview) + /// /// /// The headers that will be added to request. /// @@ -694,7 +730,7 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deallocates specific virtual machines in a VM scale set. Shuts down /// the virtual machines and releases the compute resources. You are @@ -737,6 +773,10 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// The virtual machine scale set instance ids. /// + /// + /// Optional parameter to force delete virtual machines from the VM + /// scale set. (Feature in Preview) + /// /// /// The headers that will be added to request. /// @@ -749,7 +789,7 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when a required parameter is null /// - Task BeginDeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginDeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Power off (stop) one or more virtual machines in a VM scale set. /// Note that resources are still attached and you are getting charged @@ -1007,6 +1047,29 @@ public partial interface IVirtualMachineScaleSetsOperations /// Task BeginSetOrchestrationServiceStateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified 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>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a list of all VM scale sets under a resource group. /// /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachinesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachinesOperations.cs index bf1285315cf8e..818ce5adb86a0 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachinesOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachinesOperations.cs @@ -615,6 +615,34 @@ public partial interface IVirtualMachinesOperations /// Task> AssessPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Installs patches on the VM. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Input for InstallPatches as directly received by the API + /// + /// + /// 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> InstallPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Run command on the VM. /// /// @@ -996,6 +1024,34 @@ public partial interface IVirtualMachinesOperations /// Task> BeginAssessPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Installs patches on the VM. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Input for InstallPatches as directly received by the API + /// + /// + /// 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> BeginInstallPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Run command on the VM. /// /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ImagesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ImagesOperations.cs index 39a12de9721a2..9ccac6de301c5 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ImagesOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ImagesOperations.cs @@ -169,7 +169,7 @@ internal ImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -361,7 +361,7 @@ internal ImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -541,7 +541,7 @@ internal ImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -742,7 +742,7 @@ internal ImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -968,7 +968,7 @@ internal ImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1184,7 +1184,7 @@ internal ImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/LogAnalyticsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/LogAnalyticsOperations.cs index b31614b702f21..90df713f2e745 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/LogAnalyticsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/LogAnalyticsOperations.cs @@ -152,7 +152,7 @@ internal LogAnalyticsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,7 +363,7 @@ internal LogAnalyticsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/AvailablePatchSummary.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/AvailablePatchSummary.cs index a3968ca587626..322c7909b5926 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/AvailablePatchSummary.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/AvailablePatchSummary.cs @@ -32,9 +32,10 @@ public AvailablePatchSummary() /// /// The overall success or failure status of the /// operation. It remains "InProgress" until the operation completes. - /// At that point it will become "Failed", "Succeeded", or - /// "CompletedWithWarnings.". Possible values include: 'InProgress', - /// 'Failed', 'Succeeded', 'CompletedWithWarnings' + /// At that point it will become "Unknown", "Failed", "Succeeded", or + /// "CompletedWithWarnings.". Possible values include: 'Unknown', + /// 'InProgress', 'Failed', 'Succeeded', + /// 'CompletedWithWarnings' /// The activity ID of the operation /// that produced this result. It is used to correlate across CRP and /// extension logs. @@ -74,9 +75,9 @@ public AvailablePatchSummary() /// /// Gets the overall success or failure status of the operation. It /// remains "InProgress" until the operation completes. At that point - /// it will become "Failed", "Succeeded", or "CompletedWithWarnings.". - /// Possible values include: 'InProgress', 'Failed', 'Succeeded', - /// 'CompletedWithWarnings' + /// it will become "Unknown", "Failed", "Succeeded", or + /// "CompletedWithWarnings.". Possible values include: 'Unknown', + /// 'InProgress', 'Failed', 'Succeeded', 'CompletedWithWarnings' /// [JsonProperty(PropertyName = "status")] public string Status { get; private set; } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudService.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudService.cs deleted file mode 100644 index 2332c9c2f9f2a..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudService.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Describes the cloud service. - /// - public partial class CloudService : IResource - { - /// - /// Initializes a new instance of the CloudService class. - /// - public CloudService() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudService class. - /// - /// Resource location. - /// Resource Id. - /// Resource name. - /// Resource type. - /// Resource tags. - public CloudService(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), CloudServiceProperties properties = default(CloudServiceProperties)) - { - Id = id; - Name = name; - Type = type; - Location = location; - Tags = tags; - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets resource Id. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets resource name. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets resource type. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets or sets resource location. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets resource tags. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties")] - public CloudServiceProperties Properties { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProfile.cs deleted file mode 100644 index 4458559f7cbcc..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProfile.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Describes a cloud service extension profile. - /// - public partial class CloudServiceExtensionProfile - { - /// - /// Initializes a new instance of the CloudServiceExtensionProfile - /// class. - /// - public CloudServiceExtensionProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceExtensionProfile - /// class. - /// - /// List of extensions for the cloud - /// service. - public CloudServiceExtensionProfile(IList extensions = default(IList)) - { - Extensions = extensions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of extensions for the cloud service. - /// - [JsonProperty(PropertyName = "extensions")] - public IList Extensions { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProperties.cs deleted file mode 100644 index 5fbf4d36b05dc..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProperties.cs +++ /dev/null @@ -1,179 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Extension Properties. - /// - public partial class CloudServiceExtensionProperties - { - /// - /// Initializes a new instance of the CloudServiceExtensionProperties - /// class. - /// - public CloudServiceExtensionProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceExtensionProperties - /// class. - /// - /// The name of the extension handler - /// publisher. - /// Specifies the type of the extension. - /// Specifies the version of the - /// extension. Specifies the version of the extension. If this element - /// is not specified or an asterisk (*) is used as the value, the - /// latest version of the extension is used. If the value is specified - /// with a major version number and an asterisk as the minor version - /// number (X.), the latest minor version of the specified major - /// version is selected. If a major version number and a minor version - /// number are specified (X.Y), the specific extension version is - /// selected. If a version is specified, an auto-upgrade is performed - /// on the role instance. - /// Explicitly specify whether - /// platform can automatically upgrade typeHandlerVersion to higher - /// minor versions when they become available. - /// Public settings for the extension. For JSON - /// extensions, this is the JSON settings for the extension. For XML - /// Extension (like RDP), this is the XML setting for the - /// extension. - /// Protected settings for the - /// extension which are encrypted before sent to the role - /// instance. - /// Tag to force apply the provided public - /// and protected settings. - /// Changing the tag value allows for re-running the extension without - /// changing any of the public or protected settings. - /// If forceUpdateTag is not changed, updates to public or protected - /// settings would still be applied by the handler. - /// If neither forceUpdateTag nor any of public or protected settings - /// change, extension would flow to the role instance with the same - /// sequence-number, and - /// it is up to handler implementation whether to re-run it or - /// not - /// The provisioning state, which only - /// appears in the response. - /// Optional list of roles to apply this - /// extension. If property is not specified or '*' is specified, - /// extension is applied to all roles in the cloud service. - public CloudServiceExtensionProperties(string publisher = default(string), string type = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), string settings = default(string), string protectedSettings = default(string), CloudServiceVaultAndSecretReference protectedSettingsFromKeyVault = default(CloudServiceVaultAndSecretReference), string forceUpdateTag = default(string), string provisioningState = default(string), IList rolesAppliedTo = default(IList)) - { - Publisher = publisher; - Type = type; - TypeHandlerVersion = typeHandlerVersion; - AutoUpgradeMinorVersion = autoUpgradeMinorVersion; - Settings = settings; - ProtectedSettings = protectedSettings; - ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; - ForceUpdateTag = forceUpdateTag; - ProvisioningState = provisioningState; - RolesAppliedTo = rolesAppliedTo; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the extension handler publisher. - /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } - - /// - /// Gets or sets specifies the type of the extension. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets specifies the version of the extension. Specifies the - /// version of the extension. If this element is not specified or an - /// asterisk (*) is used as the value, the latest version of the - /// extension is used. If the value is specified with a major version - /// number and an asterisk as the minor version number (X.), the latest - /// minor version of the specified major version is selected. If a - /// major version number and a minor version number are specified - /// (X.Y), the specific extension version is selected. If a version is - /// specified, an auto-upgrade is performed on the role instance. - /// - [JsonProperty(PropertyName = "typeHandlerVersion")] - public string TypeHandlerVersion { get; set; } - - /// - /// Gets or sets explicitly specify whether platform can automatically - /// upgrade typeHandlerVersion to higher minor versions when they - /// become available. - /// - [JsonProperty(PropertyName = "autoUpgradeMinorVersion")] - public bool? AutoUpgradeMinorVersion { get; set; } - - /// - /// Gets or sets public settings for the extension. For JSON - /// extensions, this is the JSON settings for the extension. For XML - /// Extension (like RDP), this is the XML setting for the extension. - /// - [JsonProperty(PropertyName = "settings")] - public string Settings { get; set; } - - /// - /// Gets or sets protected settings for the extension which are - /// encrypted before sent to the role instance. - /// - [JsonProperty(PropertyName = "protectedSettings")] - public string ProtectedSettings { get; set; } - - /// - /// - [JsonProperty(PropertyName = "protectedSettingsFromKeyVault")] - public CloudServiceVaultAndSecretReference ProtectedSettingsFromKeyVault { get; set; } - - /// - /// Gets or sets tag to force apply the provided public and protected - /// settings. - /// Changing the tag value allows for re-running the extension without - /// changing any of the public or protected settings. - /// If forceUpdateTag is not changed, updates to public or protected - /// settings would still be applied by the handler. - /// If neither forceUpdateTag nor any of public or protected settings - /// change, extension would flow to the role instance with the same - /// sequence-number, and - /// it is up to handler implementation whether to re-run it or not - /// - [JsonProperty(PropertyName = "forceUpdateTag")] - public string ForceUpdateTag { get; set; } - - /// - /// Gets the provisioning state, which only appears in the response. - /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets optional list of roles to apply this extension. If - /// property is not specified or '*' is specified, extension is applied - /// to all roles in the cloud service. - /// - [JsonProperty(PropertyName = "rolesAppliedTo")] - public IList RolesAppliedTo { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceInstanceView.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceInstanceView.cs deleted file mode 100644 index 030b6de7ce0be..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceInstanceView.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// InstanceView of CloudService as a whole - /// - public partial class CloudServiceInstanceView - { - /// - /// Initializes a new instance of the CloudServiceInstanceView class. - /// - public CloudServiceInstanceView() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceInstanceView class. - /// - /// The version of the SDK that was used to - /// generate the package for the cloud service. - public CloudServiceInstanceView(InstanceViewStatusesSummary roleInstance = default(InstanceViewStatusesSummary), string sdkVersion = default(string), IList statuses = default(IList)) - { - RoleInstance = roleInstance; - SdkVersion = sdkVersion; - Statuses = statuses; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "roleInstance")] - public InstanceViewStatusesSummary RoleInstance { get; set; } - - /// - /// Gets the version of the SDK that was used to generate the package - /// for the cloud service. - /// - [JsonProperty(PropertyName = "sdkVersion")] - public string SdkVersion { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; private set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceNetworkProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceNetworkProfile.cs deleted file mode 100644 index e3de856fe0bfb..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceNetworkProfile.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Network Profile for the cloud service. - /// - public partial class CloudServiceNetworkProfile - { - /// - /// Initializes a new instance of the CloudServiceNetworkProfile class. - /// - public CloudServiceNetworkProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceNetworkProfile class. - /// - /// The list of load balancer - /// configurations for the cloud service. - public CloudServiceNetworkProfile(IList loadBalancerConfigurations = default(IList), SubResource swappableCloudService = default(SubResource)) - { - LoadBalancerConfigurations = loadBalancerConfigurations; - SwappableCloudService = swappableCloudService; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the list of load balancer configurations for the cloud - /// service. - /// - [JsonProperty(PropertyName = "loadBalancerConfigurations")] - public IList LoadBalancerConfigurations { get; set; } - - /// - /// - [JsonProperty(PropertyName = "swappableCloudService")] - public SubResource SwappableCloudService { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceOsProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceOsProfile.cs deleted file mode 100644 index 012e60e27a47b..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceOsProfile.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Describes the OS profile for the cloud service. - /// - public partial class CloudServiceOsProfile - { - /// - /// Initializes a new instance of the CloudServiceOsProfile class. - /// - public CloudServiceOsProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceOsProfile class. - /// - /// Specifies set of certificates that should be - /// installed onto the role instances. - public CloudServiceOsProfile(IList secrets = default(IList)) - { - Secrets = secrets; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets specifies set of certificates that should be installed - /// onto the role instances. - /// - [JsonProperty(PropertyName = "secrets")] - public IList Secrets { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceProperties.cs deleted file mode 100644 index b44b5b9753a0c..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceProperties.cs +++ /dev/null @@ -1,157 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Cloud service properties - /// - public partial class CloudServiceProperties - { - /// - /// Initializes a new instance of the CloudServiceProperties class. - /// - public CloudServiceProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceProperties class. - /// - /// Specifies a URL that refers to the - /// location of the service package in the Blob service. The service - /// package URL can be Shared Access Signature (SAS) URI from any - /// storage account. - /// This is a write-only property and is not returned in GET - /// calls. - /// Specifies the XML service configuration - /// (.cscfg) for the cloud service. - /// Specifies a URL that refers to the - /// location of the service configuration in the Blob service. The - /// service package URL can be Shared Access Signature (SAS) URI from - /// any storage account. - /// This is a write-only property and is not returned in GET - /// calls. - /// (Optional) Indicates whether to - /// start the cloud service immediately after it is created. The - /// default value is `true`. - /// If false, the service model is still deployed, but the code is not - /// run immediately. Instead, the service is PoweredOff until you call - /// Start, at which time the service will be started. A deployed - /// service still incurs charges, even if it is poweredoff. - /// Possible values include: 'Auto', - /// 'Manual', 'Simultaneous' - /// The provisioning state, which only - /// appears in the response. - /// The unique identifier for the cloud - /// service. - public CloudServiceProperties(string packageUrl = default(string), string configuration = default(string), string configurationUrl = default(string), bool? startCloudService = default(bool?), string upgradeMode = default(string), CloudServiceRoleProfile roleProfile = default(CloudServiceRoleProfile), CloudServiceOsProfile osProfile = default(CloudServiceOsProfile), CloudServiceNetworkProfile networkProfile = default(CloudServiceNetworkProfile), CloudServiceExtensionProfile extensionProfile = default(CloudServiceExtensionProfile), string provisioningState = default(string), string uniqueId = default(string)) - { - PackageUrl = packageUrl; - Configuration = configuration; - ConfigurationUrl = configurationUrl; - StartCloudService = startCloudService; - UpgradeMode = upgradeMode; - RoleProfile = roleProfile; - OsProfile = osProfile; - NetworkProfile = networkProfile; - ExtensionProfile = extensionProfile; - ProvisioningState = provisioningState; - UniqueId = uniqueId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets specifies a URL that refers to the location of the - /// service package in the Blob service. The service package URL can be - /// Shared Access Signature (SAS) URI from any storage account. - /// This is a write-only property and is not returned in GET calls. - /// - [JsonProperty(PropertyName = "packageUrl")] - public string PackageUrl { get; set; } - - /// - /// Gets or sets specifies the XML service configuration (.cscfg) for - /// the cloud service. - /// - [JsonProperty(PropertyName = "configuration")] - public string Configuration { get; set; } - - /// - /// Gets or sets specifies a URL that refers to the location of the - /// service configuration in the Blob service. The service package URL - /// can be Shared Access Signature (SAS) URI from any storage account. - /// This is a write-only property and is not returned in GET calls. - /// - [JsonProperty(PropertyName = "configurationUrl")] - public string ConfigurationUrl { get; set; } - - /// - /// Gets or sets (Optional) Indicates whether to start the cloud - /// service immediately after it is created. The default value is - /// `true`. - /// If false, the service model is still deployed, but the code is not - /// run immediately. Instead, the service is PoweredOff until you call - /// Start, at which time the service will be started. A deployed - /// service still incurs charges, even if it is poweredoff. - /// - [JsonProperty(PropertyName = "startCloudService")] - public bool? StartCloudService { get; set; } - - /// - /// Gets or sets possible values include: 'Auto', 'Manual', - /// 'Simultaneous' - /// - [JsonProperty(PropertyName = "upgradeMode")] - public string UpgradeMode { get; set; } - - /// - /// - [JsonProperty(PropertyName = "roleProfile")] - public CloudServiceRoleProfile RoleProfile { get; set; } - - /// - /// - [JsonProperty(PropertyName = "osProfile")] - public CloudServiceOsProfile OsProfile { get; set; } - - /// - /// - [JsonProperty(PropertyName = "networkProfile")] - public CloudServiceNetworkProfile NetworkProfile { get; set; } - - /// - /// - [JsonProperty(PropertyName = "extensionProfile")] - public CloudServiceExtensionProfile ExtensionProfile { get; set; } - - /// - /// Gets the provisioning state, which only appears in the response. - /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets the unique identifier for the cloud service. - /// - [JsonProperty(PropertyName = "uniqueId")] - public string UniqueId { get; private set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRole.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRole.cs deleted file mode 100644 index ed30d6cb8090f..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRole.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Describes a role of the cloud service. - /// - public partial class CloudServiceRole - { - /// - /// Initializes a new instance of the CloudServiceRole class. - /// - public CloudServiceRole() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceRole class. - /// - /// Resource id - /// Resource name - /// Resource type - /// Resource location - public CloudServiceRole(string id = default(string), string name = default(string), string type = default(string), string location = default(string), CloudServiceRoleSku sku = default(CloudServiceRoleSku), CloudServiceRoleProperties properties = default(CloudServiceRoleProperties)) - { - Id = id; - Name = name; - Type = type; - Location = location; - Sku = sku; - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets resource id - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets resource name - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets resource type - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets resource location - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "sku")] - public CloudServiceRoleSku Sku { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties")] - public CloudServiceRoleProperties Properties { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfile.cs deleted file mode 100644 index 6ec87974a4745..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfile.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Describes the role profile for the cloud service. - /// - public partial class CloudServiceRoleProfile - { - /// - /// Initializes a new instance of the CloudServiceRoleProfile class. - /// - public CloudServiceRoleProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceRoleProfile class. - /// - /// List of roles for the cloud service. - public CloudServiceRoleProfile(IList roles = default(IList)) - { - Roles = roles; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of roles for the cloud service. - /// - [JsonProperty(PropertyName = "roles")] - public IList Roles { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfileProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfileProperties.cs deleted file mode 100644 index 47db1e0408aa3..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfileProperties.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Describes the role properties. - /// - public partial class CloudServiceRoleProfileProperties - { - /// - /// Initializes a new instance of the CloudServiceRoleProfileProperties - /// class. - /// - public CloudServiceRoleProfileProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceRoleProfileProperties - /// class. - /// - /// Resource name. - public CloudServiceRoleProfileProperties(string name = default(string), CloudServiceRoleSku sku = default(CloudServiceRoleSku)) - { - Name = name; - Sku = sku; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource name. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// - [JsonProperty(PropertyName = "sku")] - public CloudServiceRoleSku Sku { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProperties.cs deleted file mode 100644 index 48d0c85661ff2..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProperties.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class CloudServiceRoleProperties - { - /// - /// Initializes a new instance of the CloudServiceRoleProperties class. - /// - public CloudServiceRoleProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceRoleProperties class. - /// - /// Specifies the ID which uniquely identifies a - /// cloud service role. - public CloudServiceRoleProperties(string uniqueId = default(string)) - { - UniqueId = uniqueId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets specifies the ID which uniquely identifies a cloud service - /// role. - /// - [JsonProperty(PropertyName = "uniqueId")] - public string UniqueId { get; private set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleSku.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleSku.cs deleted file mode 100644 index b0bbae8e08a56..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleSku.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Describes the cloud service role sku. - /// - public partial class CloudServiceRoleSku - { - /// - /// Initializes a new instance of the CloudServiceRoleSku class. - /// - public CloudServiceRoleSku() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceRoleSku class. - /// - /// The sku name. NOTE: If the new SKU is not - /// supported on the hardware the cloud service is currently on, you - /// need to delete and recreate the cloud service or move back to the - /// old sku. - /// Specifies the tier of the cloud service. - /// Possible Values are <br /><br /> **Standard** <br - /// /><br /> **Basic** - /// Specifies the number of role instances in - /// the cloud service. - public CloudServiceRoleSku(string name = default(string), string tier = default(string), long? capacity = default(long?)) - { - Name = name; - Tier = tier; - Capacity = capacity; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the sku name. NOTE: If the new SKU is not supported on - /// the hardware the cloud service is currently on, you need to delete - /// and recreate the cloud service or move back to the old sku. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets specifies the tier of the cloud service. Possible - /// Values are &lt;br /&gt;&lt;br /&gt; **Standard** - /// &lt;br /&gt;&lt;br /&gt; **Basic** - /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } - - /// - /// Gets or sets specifies the number of role instances in the cloud - /// service. - /// - [JsonProperty(PropertyName = "capacity")] - public long? Capacity { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpdate.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpdate.cs deleted file mode 100644 index 6d1c6f76be04d..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpdate.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - public partial class CloudServiceUpdate - { - /// - /// Initializes a new instance of the CloudServiceUpdate class. - /// - public CloudServiceUpdate() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceUpdate class. - /// - /// Resource tags - public CloudServiceUpdate(IDictionary tags = default(IDictionary)) - { - Tags = tags; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource tags - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultAndSecretReference.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultAndSecretReference.cs deleted file mode 100644 index 13461382f05c5..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultAndSecretReference.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class CloudServiceVaultAndSecretReference - { - /// - /// Initializes a new instance of the - /// CloudServiceVaultAndSecretReference class. - /// - public CloudServiceVaultAndSecretReference() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CloudServiceVaultAndSecretReference class. - /// - public CloudServiceVaultAndSecretReference(SubResource sourceVault = default(SubResource), string secretUrl = default(string)) - { - SourceVault = sourceVault; - SecretUrl = secretUrl; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "sourceVault")] - public SubResource SourceVault { get; set; } - - /// - /// - [JsonProperty(PropertyName = "secretUrl")] - public string SecretUrl { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultCertificate.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultCertificate.cs deleted file mode 100644 index d5643600aa3c2..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultCertificate.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Describes a single certificate reference in a Key Vault, and where the - /// certificate should reside on the role instance. - /// - public partial class CloudServiceVaultCertificate - { - /// - /// Initializes a new instance of the CloudServiceVaultCertificate - /// class. - /// - public CloudServiceVaultCertificate() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceVaultCertificate - /// class. - /// - /// This is the URL of a certificate that - /// has been uploaded to Key Vault as a secret. - public CloudServiceVaultCertificate(string certificateUrl = default(string)) - { - CertificateUrl = certificateUrl; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets this is the URL of a certificate that has been - /// uploaded to Key Vault as a secret. - /// - [JsonProperty(PropertyName = "certificateUrl")] - public string CertificateUrl { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultSecretGroup.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultSecretGroup.cs deleted file mode 100644 index 38b9d2224c25a..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultSecretGroup.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Describes a set of certificates which are all in the same Key Vault. - /// - public partial class CloudServiceVaultSecretGroup - { - /// - /// Initializes a new instance of the CloudServiceVaultSecretGroup - /// class. - /// - public CloudServiceVaultSecretGroup() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudServiceVaultSecretGroup - /// class. - /// - /// The relative URL of the Key Vault - /// containing all of the certificates in VaultCertificates. - /// The list of key vault references in - /// SourceVault which contain certificates. - public CloudServiceVaultSecretGroup(SubResource sourceVault = default(SubResource), IList vaultCertificates = default(IList)) - { - SourceVault = sourceVault; - VaultCertificates = vaultCertificates; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the relative URL of the Key Vault containing all of - /// the certificates in VaultCertificates. - /// - [JsonProperty(PropertyName = "sourceVault")] - public SubResource SourceVault { get; set; } - - /// - /// Gets or sets the list of key vault references in SourceVault which - /// contain certificates. - /// - [JsonProperty(PropertyName = "vaultCertificates")] - public IList VaultCertificates { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerService.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerService.cs deleted file mode 100644 index e762dad4d1f71..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerService.cs +++ /dev/null @@ -1,192 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Container service. - /// - [Rest.Serialization.JsonTransformation] - public partial class ContainerService : Resource - { - /// - /// Initializes a new instance of the ContainerService class. - /// - public ContainerService() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerService class. - /// - /// Resource location - /// Properties of master agents. - /// Properties of the agent - /// pool. - /// Properties of Linux VMs. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// the current deployment or - /// provisioning state, which only appears in the response. - /// Properties of the - /// orchestrator. - /// Properties for custom clusters. - /// Properties for cluster - /// service principals. - /// Properties of Windows VMs. - /// Properties of the diagnostic - /// agent. - public ContainerService(string location, ContainerServiceMasterProfile masterProfile, IList agentPoolProfiles, ContainerServiceLinuxProfile linuxProfile, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), ContainerServiceOrchestratorProfile orchestratorProfile = default(ContainerServiceOrchestratorProfile), ContainerServiceCustomProfile customProfile = default(ContainerServiceCustomProfile), ContainerServiceServicePrincipalProfile servicePrincipalProfile = default(ContainerServiceServicePrincipalProfile), ContainerServiceWindowsProfile windowsProfile = default(ContainerServiceWindowsProfile), ContainerServiceDiagnosticsProfile diagnosticsProfile = default(ContainerServiceDiagnosticsProfile)) - : base(location, id, name, type, tags) - { - ProvisioningState = provisioningState; - OrchestratorProfile = orchestratorProfile; - CustomProfile = customProfile; - ServicePrincipalProfile = servicePrincipalProfile; - MasterProfile = masterProfile; - AgentPoolProfiles = agentPoolProfiles; - WindowsProfile = windowsProfile; - LinuxProfile = linuxProfile; - DiagnosticsProfile = diagnosticsProfile; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the current deployment or provisioning state, which only - /// appears in the response. - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets properties of the orchestrator. - /// - [JsonProperty(PropertyName = "properties.orchestratorProfile")] - public ContainerServiceOrchestratorProfile OrchestratorProfile { get; set; } - - /// - /// Gets or sets properties for custom clusters. - /// - [JsonProperty(PropertyName = "properties.customProfile")] - public ContainerServiceCustomProfile CustomProfile { get; set; } - - /// - /// Gets or sets properties for cluster service principals. - /// - [JsonProperty(PropertyName = "properties.servicePrincipalProfile")] - public ContainerServiceServicePrincipalProfile ServicePrincipalProfile { get; set; } - - /// - /// Gets or sets properties of master agents. - /// - [JsonProperty(PropertyName = "properties.masterProfile")] - public ContainerServiceMasterProfile MasterProfile { get; set; } - - /// - /// Gets or sets properties of the agent pool. - /// - [JsonProperty(PropertyName = "properties.agentPoolProfiles")] - public IList AgentPoolProfiles { get; set; } - - /// - /// Gets or sets properties of Windows VMs. - /// - [JsonProperty(PropertyName = "properties.windowsProfile")] - public ContainerServiceWindowsProfile WindowsProfile { get; set; } - - /// - /// Gets or sets properties of Linux VMs. - /// - [JsonProperty(PropertyName = "properties.linuxProfile")] - public ContainerServiceLinuxProfile LinuxProfile { get; set; } - - /// - /// Gets or sets properties of the diagnostic agent. - /// - [JsonProperty(PropertyName = "properties.diagnosticsProfile")] - public ContainerServiceDiagnosticsProfile DiagnosticsProfile { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (MasterProfile == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "MasterProfile"); - } - if (AgentPoolProfiles == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AgentPoolProfiles"); - } - if (LinuxProfile == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "LinuxProfile"); - } - if (OrchestratorProfile != null) - { - OrchestratorProfile.Validate(); - } - if (CustomProfile != null) - { - CustomProfile.Validate(); - } - if (ServicePrincipalProfile != null) - { - ServicePrincipalProfile.Validate(); - } - if (MasterProfile != null) - { - MasterProfile.Validate(); - } - if (AgentPoolProfiles != null) - { - foreach (var element in AgentPoolProfiles) - { - if (element != null) - { - element.Validate(); - } - } - } - if (WindowsProfile != null) - { - WindowsProfile.Validate(); - } - if (LinuxProfile != null) - { - LinuxProfile.Validate(); - } - if (DiagnosticsProfile != null) - { - DiagnosticsProfile.Validate(); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceAgentPoolProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceAgentPoolProfile.cs deleted file mode 100644 index df3842392e843..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceAgentPoolProfile.cs +++ /dev/null @@ -1,149 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for the container service agent pool. - /// - public partial class ContainerServiceAgentPoolProfile - { - /// - /// Initializes a new instance of the ContainerServiceAgentPoolProfile - /// class. - /// - public ContainerServiceAgentPoolProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceAgentPoolProfile - /// class. - /// - /// Unique name of the agent pool profile in the - /// context of the subscription and resource group. - /// Number of agents (VMs) to host docker - /// containers. Allowed values must be in the range of 1 to 100 - /// (inclusive). The default value is 1. - /// Size of agent VMs. Possible values include: - /// 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', - /// 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', - /// 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', - /// 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', - /// 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', - /// 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', - /// 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', - /// 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', - /// 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', - /// 'Standard_G5', 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', - /// 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', - /// 'Standard_DS14', 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', - /// 'Standard_GS4', 'Standard_GS5' - /// DNS prefix to be used to create the FQDN - /// for the agent pool. - /// FQDN for the agent pool. - public ContainerServiceAgentPoolProfile(string name, int count, string vmSize, string dnsPrefix, string fqdn = default(string)) - { - Name = name; - Count = count; - VmSize = vmSize; - DnsPrefix = dnsPrefix; - Fqdn = fqdn; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets unique name of the agent pool profile in the context - /// of the subscription and resource group. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets number of agents (VMs) to host docker containers. - /// Allowed values must be in the range of 1 to 100 (inclusive). The - /// default value is 1. - /// - [JsonProperty(PropertyName = "count")] - public int Count { get; set; } - - /// - /// Gets or sets size of agent VMs. Possible values include: - /// 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', - /// 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', - /// 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', - /// 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', - /// 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', - /// 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', - /// 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', - /// 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', - /// 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', - /// 'Standard_G5', 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', - /// 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', - /// 'Standard_DS14', 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', - /// 'Standard_GS4', 'Standard_GS5' - /// - [JsonProperty(PropertyName = "vmSize")] - public string VmSize { get; set; } - - /// - /// Gets or sets DNS prefix to be used to create the FQDN for the agent - /// pool. - /// - [JsonProperty(PropertyName = "dnsPrefix")] - public string DnsPrefix { get; set; } - - /// - /// Gets FQDN for the agent pool. - /// - [JsonProperty(PropertyName = "fqdn")] - public string Fqdn { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (VmSize == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VmSize"); - } - if (DnsPrefix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DnsPrefix"); - } - if (Count > 100) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Count", 100); - } - if (Count < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Count", 1); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceCustomProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceCustomProfile.cs deleted file mode 100644 index d732cb9bd5ec5..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceCustomProfile.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties to configure a custom container service cluster. - /// - public partial class ContainerServiceCustomProfile - { - /// - /// Initializes a new instance of the ContainerServiceCustomProfile - /// class. - /// - public ContainerServiceCustomProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceCustomProfile - /// class. - /// - /// The name of the custom orchestrator to - /// use. - public ContainerServiceCustomProfile(string orchestrator) - { - Orchestrator = orchestrator; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the custom orchestrator to use. - /// - [JsonProperty(PropertyName = "orchestrator")] - public string Orchestrator { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Orchestrator == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Orchestrator"); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceDiagnosticsProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceDiagnosticsProfile.cs deleted file mode 100644 index 9df627f026d7e..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceDiagnosticsProfile.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - public partial class ContainerServiceDiagnosticsProfile - { - /// - /// Initializes a new instance of the - /// ContainerServiceDiagnosticsProfile class. - /// - public ContainerServiceDiagnosticsProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ContainerServiceDiagnosticsProfile class. - /// - /// Profile for the container service VM - /// diagnostic agent. - public ContainerServiceDiagnosticsProfile(ContainerServiceVMDiagnostics vmDiagnostics) - { - VmDiagnostics = vmDiagnostics; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets profile for the container service VM diagnostic agent. - /// - [JsonProperty(PropertyName = "vmDiagnostics")] - public ContainerServiceVMDiagnostics VmDiagnostics { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (VmDiagnostics == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VmDiagnostics"); - } - if (VmDiagnostics != null) - { - VmDiagnostics.Validate(); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceLinuxProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceLinuxProfile.cs deleted file mode 100644 index 0ad1e8815b923..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceLinuxProfile.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for Linux VMs in the container service cluster. - /// - public partial class ContainerServiceLinuxProfile - { - /// - /// Initializes a new instance of the ContainerServiceLinuxProfile - /// class. - /// - public ContainerServiceLinuxProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceLinuxProfile - /// class. - /// - /// The administrator username to use for - /// Linux VMs. - /// The ssh key configuration for Linux VMs. - public ContainerServiceLinuxProfile(string adminUsername, ContainerServiceSshConfiguration ssh) - { - AdminUsername = adminUsername; - Ssh = ssh; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the administrator username to use for Linux VMs. - /// - [JsonProperty(PropertyName = "adminUsername")] - public string AdminUsername { get; set; } - - /// - /// Gets or sets the ssh key configuration for Linux VMs. - /// - [JsonProperty(PropertyName = "ssh")] - public ContainerServiceSshConfiguration Ssh { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AdminUsername == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AdminUsername"); - } - if (Ssh == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Ssh"); - } - if (AdminUsername != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(AdminUsername, "^[a-z][a-z0-9_-]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "AdminUsername", "^[a-z][a-z0-9_-]*$"); - } - } - if (Ssh != null) - { - Ssh.Validate(); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceMasterProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceMasterProfile.cs deleted file mode 100644 index 0c9539edf0341..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceMasterProfile.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for the container service master. - /// - public partial class ContainerServiceMasterProfile - { - /// - /// Initializes a new instance of the ContainerServiceMasterProfile - /// class. - /// - public ContainerServiceMasterProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceMasterProfile - /// class. - /// - /// DNS prefix to be used to create the FQDN - /// for master. - /// Number of masters (VMs) in the container - /// service cluster. Allowed values are 1, 3, and 5. The default value - /// is 1. - /// FQDN for the master. - public ContainerServiceMasterProfile(string dnsPrefix, int? count = default(int?), string fqdn = default(string)) - { - Count = count; - DnsPrefix = dnsPrefix; - Fqdn = fqdn; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets number of masters (VMs) in the container service - /// cluster. Allowed values are 1, 3, and 5. The default value is 1. - /// - [JsonProperty(PropertyName = "count")] - public int? Count { get; set; } - - /// - /// Gets or sets DNS prefix to be used to create the FQDN for master. - /// - [JsonProperty(PropertyName = "dnsPrefix")] - public string DnsPrefix { get; set; } - - /// - /// Gets FQDN for the master. - /// - [JsonProperty(PropertyName = "fqdn")] - public string Fqdn { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DnsPrefix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DnsPrefix"); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorProfile.cs deleted file mode 100644 index 169410d83efb5..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorProfile.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for the container service orchestrator. - /// - public partial class ContainerServiceOrchestratorProfile - { - /// - /// Initializes a new instance of the - /// ContainerServiceOrchestratorProfile class. - /// - public ContainerServiceOrchestratorProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ContainerServiceOrchestratorProfile class. - /// - /// The orchestrator to use to manage - /// container service cluster resources. Valid values are Swarm, DCOS, - /// and Custom. Possible values include: 'Swarm', 'DCOS', 'Custom', - /// 'Kubernetes' - public ContainerServiceOrchestratorProfile(ContainerServiceOrchestratorTypes orchestratorType) - { - OrchestratorType = orchestratorType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the orchestrator to use to manage container service - /// cluster resources. Valid values are Swarm, DCOS, and Custom. - /// Possible values include: 'Swarm', 'DCOS', 'Custom', 'Kubernetes' - /// - [JsonProperty(PropertyName = "orchestratorType")] - public ContainerServiceOrchestratorTypes OrchestratorType { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorTypes.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorTypes.cs deleted file mode 100644 index 390ea4b569c1b..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorTypes.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for ContainerServiceOrchestratorTypes. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum ContainerServiceOrchestratorTypes - { - [EnumMember(Value = "Swarm")] - Swarm, - [EnumMember(Value = "DCOS")] - DCOS, - [EnumMember(Value = "Custom")] - Custom, - [EnumMember(Value = "Kubernetes")] - Kubernetes - } - internal static class ContainerServiceOrchestratorTypesEnumExtension - { - internal static string ToSerializedValue(this ContainerServiceOrchestratorTypes? value) - { - return value == null ? null : ((ContainerServiceOrchestratorTypes)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ContainerServiceOrchestratorTypes value) - { - switch( value ) - { - case ContainerServiceOrchestratorTypes.Swarm: - return "Swarm"; - case ContainerServiceOrchestratorTypes.DCOS: - return "DCOS"; - case ContainerServiceOrchestratorTypes.Custom: - return "Custom"; - case ContainerServiceOrchestratorTypes.Kubernetes: - return "Kubernetes"; - } - return null; - } - - internal static ContainerServiceOrchestratorTypes? ParseContainerServiceOrchestratorTypes(this string value) - { - switch( value ) - { - case "Swarm": - return ContainerServiceOrchestratorTypes.Swarm; - case "DCOS": - return ContainerServiceOrchestratorTypes.DCOS; - case "Custom": - return ContainerServiceOrchestratorTypes.Custom; - case "Kubernetes": - return ContainerServiceOrchestratorTypes.Kubernetes; - } - return null; - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceServicePrincipalProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceServicePrincipalProfile.cs deleted file mode 100644 index f3388c2d38653..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceServicePrincipalProfile.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Information about a service principal identity for the cluster to use - /// for manipulating Azure APIs. - /// - public partial class ContainerServiceServicePrincipalProfile - { - /// - /// Initializes a new instance of the - /// ContainerServiceServicePrincipalProfile class. - /// - public ContainerServiceServicePrincipalProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ContainerServiceServicePrincipalProfile class. - /// - /// The ID for the service principal. - /// The secret password associated with the - /// service principal. - public ContainerServiceServicePrincipalProfile(string clientId, string secret) - { - ClientId = clientId; - Secret = secret; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the ID for the service principal. - /// - [JsonProperty(PropertyName = "clientId")] - public string ClientId { get; set; } - - /// - /// Gets or sets the secret password associated with the service - /// principal. - /// - [JsonProperty(PropertyName = "secret")] - public string Secret { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ClientId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ClientId"); - } - if (Secret == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Secret"); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshConfiguration.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshConfiguration.cs deleted file mode 100644 index 5d3cf56fa1eec..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshConfiguration.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// SSH configuration for Linux-based VMs running on Azure. - /// - public partial class ContainerServiceSshConfiguration - { - /// - /// Initializes a new instance of the ContainerServiceSshConfiguration - /// class. - /// - public ContainerServiceSshConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceSshConfiguration - /// class. - /// - /// the list of SSH public keys used to - /// authenticate with Linux-based VMs. - public ContainerServiceSshConfiguration(IList publicKeys) - { - PublicKeys = publicKeys; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the list of SSH public keys used to authenticate with - /// Linux-based VMs. - /// - [JsonProperty(PropertyName = "publicKeys")] - public IList PublicKeys { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (PublicKeys == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "PublicKeys"); - } - if (PublicKeys != null) - { - foreach (var element in PublicKeys) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshPublicKey.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshPublicKey.cs deleted file mode 100644 index 36d950106abd4..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshPublicKey.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Contains information about SSH certificate public key data. - /// - public partial class ContainerServiceSshPublicKey - { - /// - /// Initializes a new instance of the ContainerServiceSshPublicKey - /// class. - /// - public ContainerServiceSshPublicKey() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceSshPublicKey - /// class. - /// - /// Certificate public key used to authenticate - /// with VMs through SSH. The certificate must be in PEM format with or - /// without headers. - public ContainerServiceSshPublicKey(string keyData) - { - KeyData = keyData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets certificate public key used to authenticate with VMs - /// through SSH. The certificate must be in PEM format with or without - /// headers. - /// - [JsonProperty(PropertyName = "keyData")] - public string KeyData { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (KeyData == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "KeyData"); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMDiagnostics.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMDiagnostics.cs deleted file mode 100644 index 31cb6845c8c09..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMDiagnostics.cs +++ /dev/null @@ -1,74 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for diagnostics on the container service VMs. - /// - public partial class ContainerServiceVMDiagnostics - { - /// - /// Initializes a new instance of the ContainerServiceVMDiagnostics - /// class. - /// - public ContainerServiceVMDiagnostics() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceVMDiagnostics - /// class. - /// - /// Whether the VM diagnostic agent is - /// provisioned on the VM. - /// The URI of the storage account where - /// diagnostics are stored. - public ContainerServiceVMDiagnostics(bool enabled, string storageUri = default(string)) - { - Enabled = enabled; - StorageUri = storageUri; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets whether the VM diagnostic agent is provisioned on the - /// VM. - /// - [JsonProperty(PropertyName = "enabled")] - public bool Enabled { get; set; } - - /// - /// Gets the URI of the storage account where diagnostics are stored. - /// - [JsonProperty(PropertyName = "storageUri")] - public string StorageUri { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - //Nothing to validate - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMSizeTypes.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMSizeTypes.cs deleted file mode 100644 index d31363e9854b2..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMSizeTypes.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - - /// - /// Defines values for ContainerServiceVMSizeTypes. - /// - public static class ContainerServiceVMSizeTypes - { - public const string StandardA0 = "Standard_A0"; - public const string StandardA1 = "Standard_A1"; - public const string StandardA2 = "Standard_A2"; - public const string StandardA3 = "Standard_A3"; - public const string StandardA4 = "Standard_A4"; - public const string StandardA5 = "Standard_A5"; - public const string StandardA6 = "Standard_A6"; - public const string StandardA7 = "Standard_A7"; - public const string StandardA8 = "Standard_A8"; - public const string StandardA9 = "Standard_A9"; - public const string StandardA10 = "Standard_A10"; - public const string StandardA11 = "Standard_A11"; - public const string StandardD1 = "Standard_D1"; - public const string StandardD2 = "Standard_D2"; - public const string StandardD3 = "Standard_D3"; - public const string StandardD4 = "Standard_D4"; - public const string StandardD11 = "Standard_D11"; - public const string StandardD12 = "Standard_D12"; - public const string StandardD13 = "Standard_D13"; - public const string StandardD14 = "Standard_D14"; - public const string StandardD1V2 = "Standard_D1_v2"; - public const string StandardD2V2 = "Standard_D2_v2"; - public const string StandardD3V2 = "Standard_D3_v2"; - public const string StandardD4V2 = "Standard_D4_v2"; - public const string StandardD5V2 = "Standard_D5_v2"; - public const string StandardD11V2 = "Standard_D11_v2"; - public const string StandardD12V2 = "Standard_D12_v2"; - public const string StandardD13V2 = "Standard_D13_v2"; - public const string StandardD14V2 = "Standard_D14_v2"; - public const string StandardG1 = "Standard_G1"; - public const string StandardG2 = "Standard_G2"; - public const string StandardG3 = "Standard_G3"; - public const string StandardG4 = "Standard_G4"; - public const string StandardG5 = "Standard_G5"; - public const string StandardDS1 = "Standard_DS1"; - public const string StandardDS2 = "Standard_DS2"; - public const string StandardDS3 = "Standard_DS3"; - public const string StandardDS4 = "Standard_DS4"; - public const string StandardDS11 = "Standard_DS11"; - public const string StandardDS12 = "Standard_DS12"; - public const string StandardDS13 = "Standard_DS13"; - public const string StandardDS14 = "Standard_DS14"; - public const string StandardGS1 = "Standard_GS1"; - public const string StandardGS2 = "Standard_GS2"; - public const string StandardGS3 = "Standard_GS3"; - public const string StandardGS4 = "Standard_GS4"; - public const string StandardGS5 = "Standard_GS5"; - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceWindowsProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceWindowsProfile.cs deleted file mode 100644 index 671adcedd2144..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceWindowsProfile.cs +++ /dev/null @@ -1,95 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for Windows VMs in the container service cluster. - /// - public partial class ContainerServiceWindowsProfile - { - /// - /// Initializes a new instance of the ContainerServiceWindowsProfile - /// class. - /// - public ContainerServiceWindowsProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceWindowsProfile - /// class. - /// - /// The administrator username to use for - /// Windows VMs. - /// The administrator password to use for - /// Windows VMs. - public ContainerServiceWindowsProfile(string adminUsername, string adminPassword) - { - AdminUsername = adminUsername; - AdminPassword = adminPassword; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the administrator username to use for Windows VMs. - /// - [JsonProperty(PropertyName = "adminUsername")] - public string AdminUsername { get; set; } - - /// - /// Gets or sets the administrator password to use for Windows VMs. - /// - [JsonProperty(PropertyName = "adminPassword")] - public string AdminPassword { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AdminUsername == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AdminUsername"); - } - if (AdminPassword == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AdminPassword"); - } - if (AdminUsername != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(AdminUsername, "^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$")) - { - throw new ValidationException(ValidationRules.Pattern, "AdminUsername", "^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$"); - } - } - if (AdminPassword != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(AdminPassword, "^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$")) - { - throw new ValidationException(ValidationRules.Pattern, "AdminPassword", "^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$"); - } - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/DataDisk.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/DataDisk.cs index 39c430dc88600..e87c5a378f4d0 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/DataDisk.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/DataDisk.cs @@ -75,7 +75,21 @@ public DataDisk() /// UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. /// Can be updated only via updates to the VirtualMachine Scale /// Set. - public DataDisk(int lun, string createOption, string name = default(string), VirtualHardDisk vhd = default(VirtualHardDisk), VirtualHardDisk image = default(VirtualHardDisk), CachingTypes? caching = default(CachingTypes?), bool? writeAcceleratorEnabled = default(bool?), int? diskSizeGB = default(int?), ManagedDiskParameters managedDisk = default(ManagedDiskParameters), bool? toBeDetached = default(bool?), long? diskIOPSReadWrite = default(long?), long? diskMBpsReadWrite = default(long?)) + /// Specifies the detach behavior to be used + /// while detaching a disk or which is already in the process of + /// detachment from the virtual machine. Supported values: + /// **ForceDetach**. <br><br> detachOption: **ForceDetach** + /// is applicable only for managed data disks. If a previous detachment + /// attempt of the data disk did not complete due to an unexpected + /// failure from the virtual machine and the disk is still not released + /// then use force-detach as a last resort option to detach the disk + /// forcibly from the VM. All writes might not have been flushed when + /// using this detach behavior. <br><br> This feature is + /// still in preview mode and is not supported for + /// VirtualMachineScaleSet. To force-detach a data disk update + /// toBeDetached to 'true' along with setting detachOption: + /// 'ForceDetach'. Possible values include: 'ForceDetach' + public DataDisk(int lun, string createOption, string name = default(string), VirtualHardDisk vhd = default(VirtualHardDisk), VirtualHardDisk image = default(VirtualHardDisk), CachingTypes? caching = default(CachingTypes?), bool? writeAcceleratorEnabled = default(bool?), int? diskSizeGB = default(int?), ManagedDiskParameters managedDisk = default(ManagedDiskParameters), bool? toBeDetached = default(bool?), long? diskIOPSReadWrite = default(long?), long? diskMBpsReadWrite = default(long?), string detachOption = default(string)) { Lun = lun; Name = name; @@ -89,6 +103,7 @@ public DataDisk() ToBeDetached = toBeDetached; DiskIOPSReadWrite = diskIOPSReadWrite; DiskMBpsReadWrite = diskMBpsReadWrite; + DetachOption = detachOption; CustomInit(); } @@ -201,6 +216,25 @@ public DataDisk() [JsonProperty(PropertyName = "diskMBpsReadWrite")] public long? DiskMBpsReadWrite { get; private set; } + /// + /// Gets or sets specifies the detach behavior to be used while + /// detaching a disk or which is already in the process of detachment + /// from the virtual machine. Supported values: **ForceDetach**. + /// &lt;br&gt;&lt;br&gt; detachOption: **ForceDetach** + /// is applicable only for managed data disks. If a previous detachment + /// attempt of the data disk did not complete due to an unexpected + /// failure from the virtual machine and the disk is still not released + /// then use force-detach as a last resort option to detach the disk + /// forcibly from the VM. All writes might not have been flushed when + /// using this detach behavior. &lt;br&gt;&lt;br&gt; + /// This feature is still in preview mode and is not supported for + /// VirtualMachineScaleSet. To force-detach a data disk update + /// toBeDetached to 'true' along with setting detachOption: + /// 'ForceDetach'. Possible values include: 'ForceDetach' + /// + [JsonProperty(PropertyName = "detachOption")] + public string DetachOption { get; set; } + /// /// Validate the object. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpgradeMode.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/DiskDetachOptionTypes.cs similarity index 64% rename from sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpgradeMode.cs rename to sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/DiskDetachOptionTypes.cs index 6d25f3f7cd7db..9244426d7ec0f 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpgradeMode.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/DiskDetachOptionTypes.cs @@ -12,12 +12,10 @@ namespace Microsoft.Azure.Management.Compute.Models { /// - /// Defines values for CloudServiceUpgradeMode. + /// Defines values for DiskDetachOptionTypes. /// - public static class CloudServiceUpgradeMode + public static class DiskDetachOptionTypes { - public const string Auto = "Auto"; - public const string Manual = "Manual"; - public const string Simultaneous = "Simultaneous"; + public const string ForceDetach = "ForceDetach"; } } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/Extension.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/Extension.cs deleted file mode 100644 index 66db804aec3fc..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/Extension.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Describes a cloud service Extension. - /// - public partial class Extension - { - /// - /// Initializes a new instance of the Extension class. - /// - public Extension() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Extension class. - /// - /// The name of the extension. - public Extension(string name = default(string), CloudServiceExtensionProperties properties = default(CloudServiceExtensionProperties)) - { - Name = name; - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the extension. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties")] - public CloudServiceExtensionProperties Properties { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryArtifactVersionSource.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryArtifactVersionSource.cs index baa59334f2ab8..ebe95fdfc09b1 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryArtifactVersionSource.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryArtifactVersionSource.cs @@ -34,9 +34,12 @@ public GalleryArtifactVersionSource() /// The id of the gallery artifact version source. Can /// specify a disk uri, snapshot uri, user image or storage account /// resource. - public GalleryArtifactVersionSource(string id = default(string)) + /// The uri of the gallery artifact version source. + /// Currently used to specify vhd/blob source. + public GalleryArtifactVersionSource(string id = default(string), string uri = default(string)) { Id = id; + Uri = uri; CustomInit(); } @@ -53,5 +56,12 @@ public GalleryArtifactVersionSource() [JsonProperty(PropertyName = "id")] public string Id { get; set; } + /// + /// Gets or sets the uri of the gallery artifact version source. + /// Currently used to specify vhd/blob source. + /// + [JsonProperty(PropertyName = "uri")] + public string Uri { get; set; } + } } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryDiskImageSource.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryDiskImageSource.cs deleted file mode 100644 index 70bab384c3c1c..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryDiskImageSource.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The gallery disk image source. - /// - public partial class GalleryDiskImageSource : GalleryArtifactVersionSource - { - /// - /// Initializes a new instance of the GalleryDiskImageSource class. - /// - public GalleryDiskImageSource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GalleryDiskImageSource class. - /// - /// The id of the gallery artifact version source. Can - /// specify a disk uri, snapshot uri, user image or storage account - /// resource. - /// The uri of the gallery artifact version source. - /// Currently used to specify vhd/blob source. - public GalleryDiskImageSource(string id = default(string), string uri = default(string)) - : base(id) - { - Uri = uri; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the uri of the gallery artifact version source. - /// Currently used to specify vhd/blob source. - /// - [JsonProperty(PropertyName = "uri")] - public string Uri { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryImage.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryImage.cs index 62dbb59864dfc..73b908e4e6db3 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryImage.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryImage.cs @@ -59,13 +59,13 @@ public GalleryImage() /// The hypervisor generation of the /// Virtual Machine. Applicable to OS disks only. Possible values /// include: 'V1', 'V2' - /// A list of gallery image features. /// The end of life date of the gallery /// image definition. This property can be used for decommissioning /// purposes. This property is updatable. /// The current state of the gallery /// image definition. - public GalleryImage(string location, OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), string hyperVGeneration = default(string), IList features = default(IList), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string)) + /// A list of gallery image features. + public GalleryImage(string location, OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), string hyperVGeneration = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string), IList features = default(IList)) : base(location, id, name, type, tags) { Description = description; @@ -75,13 +75,13 @@ public GalleryImage() OsType = osType; OsState = osState; HyperVGeneration = hyperVGeneration; - Features = features; EndOfLifeDate = endOfLifeDate; Identifier = identifier; Recommended = recommended; Disallowed = disallowed; PurchasePlan = purchasePlan; ProvisioningState = provisioningState; + Features = features; CustomInit(); } @@ -142,12 +142,6 @@ public GalleryImage() [JsonProperty(PropertyName = "properties.hyperVGeneration")] public string HyperVGeneration { get; set; } - /// - /// Gets or sets a list of gallery image features. - /// - [JsonProperty(PropertyName = "properties.features")] - public IList Features { get; set; } - /// /// Gets or sets the end of life date of the gallery image definition. /// This property can be used for decommissioning purposes. This @@ -187,6 +181,12 @@ public GalleryImage() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets or sets a list of gallery image features. + /// + [JsonProperty(PropertyName = "properties.features")] + public IList Features { get; set; } + /// /// Validate the object. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryImageUpdate.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryImageUpdate.cs index de806c8b415bb..428379ec99f5a 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryImageUpdate.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/GalleryImageUpdate.cs @@ -58,13 +58,13 @@ public GalleryImageUpdate() /// The hypervisor generation of the /// Virtual Machine. Applicable to OS disks only. Possible values /// include: 'V1', 'V2' - /// A list of gallery image features. /// The end of life date of the gallery /// image definition. This property can be used for decommissioning /// purposes. This property is updatable. /// The current state of the gallery /// image definition. - public GalleryImageUpdate(OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), string hyperVGeneration = default(string), IList features = default(IList), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string)) + /// A list of gallery image features. + public GalleryImageUpdate(OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), string hyperVGeneration = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string), IList features = default(IList)) : base(id, name, type, tags) { Description = description; @@ -74,13 +74,13 @@ public GalleryImageUpdate() OsType = osType; OsState = osState; HyperVGeneration = hyperVGeneration; - Features = features; EndOfLifeDate = endOfLifeDate; Identifier = identifier; Recommended = recommended; Disallowed = disallowed; PurchasePlan = purchasePlan; ProvisioningState = provisioningState; + Features = features; CustomInit(); } @@ -141,12 +141,6 @@ public GalleryImageUpdate() [JsonProperty(PropertyName = "properties.hyperVGeneration")] public string HyperVGeneration { get; set; } - /// - /// Gets or sets a list of gallery image features. - /// - [JsonProperty(PropertyName = "properties.features")] - public IList Features { get; set; } - /// /// Gets or sets the end of life date of the gallery image definition. /// This property can be used for decommissioning purposes. This @@ -186,6 +180,12 @@ public GalleryImageUpdate() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets or sets a list of gallery image features. + /// + [JsonProperty(PropertyName = "properties.features")] + public IList Features { get; set; } + /// /// Validate the object. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/HardwareProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/HardwareProfile.cs index ec8e8c5cf92ee..d82198706c791 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/HardwareProfile.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/HardwareProfile.cs @@ -29,36 +29,33 @@ public HardwareProfile() /// /// Initializes a new instance of the HardwareProfile class. /// - /// Specifies the size of the virtual machine. For - /// more information about virtual machine sizes, see [Sizes for - /// virtual - /// machines](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes). - /// <br><br> The available VM sizes depend on region and - /// availability set. For a list of available sizes use these APIs: - /// <br><br> [List all available virtual machine sizes in - /// an availability + /// Specifies the size of the virtual machine. + /// <br><br> The enum data type is currently deprecated and + /// will be removed by December 23rd 2023. <br><br> + /// Recommended way to get the list of available sizes is using these + /// APIs: <br><br> [List all available virtual machine + /// sizes in an availability /// set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) /// <br><br> [List all available virtual machine sizes in a /// region]( /// https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) /// <br><br> [List all available virtual machine sizes for /// resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - /// <br><br> This list of sizes is no longer updated and - /// the **VirtualMachineSizeTypes** string constants will be removed - /// from the subsequent REST API specification. Use [List all available - /// virtual machine sizes in a region]( - /// https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) - /// to get the latest sizes. Possible values include: 'Basic_A0', - /// 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', - /// 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', - /// 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', - /// 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', - /// 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', - /// 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', - /// 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', - /// 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D2', - /// 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', - /// 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', + /// For more information about virtual machine sizes, see [Sizes for + /// virtual + /// machines](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes). + /// <br><br> The available VM sizes depend on region and + /// availability set. Possible values include: 'Basic_A0', 'Basic_A1', + /// 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', 'Standard_A1', + /// 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', + /// 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', + /// 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', + /// 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', + /// 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', + /// 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', + /// 'Standard_B8ms', 'Standard_D1', 'Standard_D2', 'Standard_D3', + /// 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', + /// 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', /// 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', /// 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', /// 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', @@ -110,13 +107,13 @@ public HardwareProfile() partial void CustomInit(); /// - /// Gets or sets specifies the size of the virtual machine. For more - /// information about virtual machine sizes, see [Sizes for virtual - /// machines](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes). - /// &lt;br&gt;&lt;br&gt; The available VM sizes depend - /// on region and availability set. For a list of available sizes use - /// these APIs: &lt;br&gt;&lt;br&gt; [List all - /// available virtual machine sizes in an availability + /// Gets or sets specifies the size of the virtual machine. + /// &lt;br&gt;&lt;br&gt; The enum data type is + /// currently deprecated and will be removed by December 23rd 2023. + /// &lt;br&gt;&lt;br&gt; Recommended way to get the + /// list of available sizes is using these APIs: + /// &lt;br&gt;&lt;br&gt; [List all available virtual + /// machine sizes in an availability /// set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) /// &lt;br&gt;&lt;br&gt; [List all available virtual /// machine sizes in a region]( @@ -124,31 +121,30 @@ public HardwareProfile() /// &lt;br&gt;&lt;br&gt; [List all available virtual /// machine sizes for /// resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - /// &lt;br&gt;&lt;br&gt; This list of sizes is no - /// longer updated and the **VirtualMachineSizeTypes** string constants - /// will be removed from the subsequent REST API specification. Use - /// [List all available virtual machine sizes in a region]( - /// https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) - /// to get the latest sizes. Possible values include: 'Basic_A0', - /// 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', - /// 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', - /// 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', - /// 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', - /// 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', - /// 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', - /// 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', - /// 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D2', - /// 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', - /// 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', - /// 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', - /// 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', - /// 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', - /// 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', - /// 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', - /// 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', - /// 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', - /// 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', - /// 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', + /// For more information about virtual machine sizes, see [Sizes for + /// virtual + /// machines](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes). + /// &lt;br&gt;&lt;br&gt; The available VM sizes depend + /// on region and availability set. Possible values include: + /// 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', + /// 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', + /// 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', + /// 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', + /// 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', + /// 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', + /// 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', + /// 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', + /// 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', + /// 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', + /// 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', + /// 'Standard_D5_v2', 'Standard_D2_v3', 'Standard_D4_v3', + /// 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', + /// 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + /// 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + /// 'Standard_D64s_v3', 'Standard_D11_v2', 'Standard_D12_v2', + /// 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', + /// 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', + /// 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', /// 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', /// 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', /// 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/Image.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/Image.cs index 75c0fef474e34..4916d4ba30079 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/Image.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/Image.cs @@ -49,13 +49,16 @@ public Image() /// Gets the HyperVGenerationType of the /// VirtualMachine created from the image. Possible values include: /// 'V1', 'V2' - public Image(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SubResource sourceVirtualMachine = default(SubResource), ImageStorageProfile storageProfile = default(ImageStorageProfile), string provisioningState = default(string), string hyperVGeneration = default(string)) + /// The extended location of the + /// Image. + public Image(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SubResource sourceVirtualMachine = default(SubResource), ImageStorageProfile storageProfile = default(ImageStorageProfile), string provisioningState = default(string), string hyperVGeneration = default(string), ExtendedLocation extendedLocation = default(ExtendedLocation)) : base(location, id, name, type, tags) { SourceVirtualMachine = sourceVirtualMachine; StorageProfile = storageProfile; ProvisioningState = provisioningState; HyperVGeneration = hyperVGeneration; + ExtendedLocation = extendedLocation; CustomInit(); } @@ -91,6 +94,12 @@ public Image() [JsonProperty(PropertyName = "properties.hyperVGeneration")] public string HyperVGeneration { get; set; } + /// + /// Gets or sets the extended location of the Image. + /// + [JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation { get; set; } + /// /// Validate the object. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceSku.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceSku.cs deleted file mode 100644 index cc6d5e72fe8c6..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceSku.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class InstanceSku - { - /// - /// Initializes a new instance of the InstanceSku class. - /// - public InstanceSku() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the InstanceSku class. - /// - /// The sku name. - /// The tier of the cloud service role - /// instance. - public InstanceSku(string name = default(string), string tier = default(string)) - { - Name = name; - Tier = tier; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the sku name. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets the tier of the cloud service role instance. - /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; private set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceViewStatusesSummary.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceViewStatusesSummary.cs deleted file mode 100644 index 37cee73429f98..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceViewStatusesSummary.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Instance view statuses. - /// - public partial class InstanceViewStatusesSummary - { - /// - /// Initializes a new instance of the InstanceViewStatusesSummary - /// class. - /// - public InstanceViewStatusesSummary() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the InstanceViewStatusesSummary - /// class. - /// - public InstanceViewStatusesSummary(IList statusesSummary = default(IList)) - { - StatusesSummary = statusesSummary; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "statusesSummary")] - public IList StatusesSummary { get; private set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LastPatchInstallationSummary.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LastPatchInstallationSummary.cs index d1f5092726308..3afaee59807a3 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LastPatchInstallationSummary.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LastPatchInstallationSummary.cs @@ -33,24 +33,16 @@ public LastPatchInstallationSummary() /// /// The overall success or failure status of the /// operation. It remains "InProgress" until the operation completes. - /// At that point it will become "Failed", "Succeeded", or - /// "CompletedWithWarnings.". Possible values include: 'InProgress', - /// 'Failed', 'Succeeded', 'CompletedWithWarnings' + /// At that point it will become "Unknown", "Failed", "Succeeded", or + /// "CompletedWithWarnings.". Possible values include: 'Unknown', + /// 'InProgress', 'Failed', 'Succeeded', + /// 'CompletedWithWarnings' /// The activity ID of the /// operation that produced this result. It is used to correlate across /// CRP and extension logs. /// Describes whether the /// operation ran out of time before it completed all its intended /// actions - /// The reboot status of the machine after - /// the patch operation. It will be in "NotNeeded" status if reboot is - /// not needed after the patch operation. "Required" will be the status - /// once the patch is applied and machine is required to reboot. - /// "Started" will be the reboot status when the machine has started to - /// reboot. "Failed" will be the status if the machine is failed to - /// reboot. "Completed" will be the status once the machine is rebooted - /// successfully. Possible values include: 'NotNeeded', 'Required', - /// 'Started', 'Failed', 'Completed' /// The number of all available /// patches but not going to be installed because it didn't match a /// classification or inclusion list entry. @@ -68,17 +60,14 @@ public LastPatchInstallationSummary() /// began. /// The UTC timestamp when the operation /// began. - /// The person or system account that started - /// the operation /// The errors that were encountered during /// execution of the operation. The details array contains the list of /// them. - public LastPatchInstallationSummary(string status = default(string), string installationActivityId = default(string), bool? maintenanceWindowExceeded = default(bool?), string rebootStatus = default(string), int? notSelectedPatchCount = default(int?), int? excludedPatchCount = default(int?), int? pendingPatchCount = default(int?), int? installedPatchCount = default(int?), int? failedPatchCount = default(int?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string startedBy = default(string), ApiError error = default(ApiError)) + public LastPatchInstallationSummary(string status = default(string), string installationActivityId = default(string), bool? maintenanceWindowExceeded = default(bool?), int? notSelectedPatchCount = default(int?), int? excludedPatchCount = default(int?), int? pendingPatchCount = default(int?), int? installedPatchCount = default(int?), int? failedPatchCount = default(int?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), ApiError error = default(ApiError)) { Status = status; InstallationActivityId = installationActivityId; MaintenanceWindowExceeded = maintenanceWindowExceeded; - RebootStatus = rebootStatus; NotSelectedPatchCount = notSelectedPatchCount; ExcludedPatchCount = excludedPatchCount; PendingPatchCount = pendingPatchCount; @@ -86,7 +75,6 @@ public LastPatchInstallationSummary() FailedPatchCount = failedPatchCount; StartTime = startTime; LastModifiedTime = lastModifiedTime; - StartedBy = startedBy; Error = error; CustomInit(); } @@ -99,9 +87,9 @@ public LastPatchInstallationSummary() /// /// Gets the overall success or failure status of the operation. It /// remains "InProgress" until the operation completes. At that point - /// it will become "Failed", "Succeeded", or "CompletedWithWarnings.". - /// Possible values include: 'InProgress', 'Failed', 'Succeeded', - /// 'CompletedWithWarnings' + /// it will become "Unknown", "Failed", "Succeeded", or + /// "CompletedWithWarnings.". Possible values include: 'Unknown', + /// 'InProgress', 'Failed', 'Succeeded', 'CompletedWithWarnings' /// [JsonProperty(PropertyName = "status")] public string Status { get; private set; } @@ -120,20 +108,6 @@ public LastPatchInstallationSummary() [JsonProperty(PropertyName = "maintenanceWindowExceeded")] public bool? MaintenanceWindowExceeded { get; private set; } - /// - /// Gets the reboot status of the machine after the patch operation. It - /// will be in "NotNeeded" status if reboot is not needed after the - /// patch operation. "Required" will be the status once the patch is - /// applied and machine is required to reboot. "Started" will be the - /// reboot status when the machine has started to reboot. "Failed" will - /// be the status if the machine is failed to reboot. "Completed" will - /// be the status once the machine is rebooted successfully. Possible - /// values include: 'NotNeeded', 'Required', 'Started', 'Failed', - /// 'Completed' - /// - [JsonProperty(PropertyName = "rebootStatus")] - public string RebootStatus { get; private set; } - /// /// Gets the number of all available patches but not going to be /// installed because it didn't match a classification or inclusion @@ -180,12 +154,6 @@ public LastPatchInstallationSummary() [JsonProperty(PropertyName = "lastModifiedTime")] public System.DateTime? LastModifiedTime { get; private set; } - /// - /// Gets the person or system account that started the operation - /// - [JsonProperty(PropertyName = "startedBy")] - public string StartedBy { get; private set; } - /// /// Gets the errors that were encountered during execution of the /// operation. The details array contains the list of them. diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LinuxConfiguration.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LinuxConfiguration.cs index 4594ed63cf393..a951eba569c50 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LinuxConfiguration.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LinuxConfiguration.cs @@ -45,11 +45,14 @@ public LinuxConfiguration() /// request body, default behavior is to set it to true. This will /// ensure that VM Agent is installed on the VM so that extensions can /// be added to the VM later. - public LinuxConfiguration(bool? disablePasswordAuthentication = default(bool?), SshConfiguration ssh = default(SshConfiguration), bool? provisionVMAgent = default(bool?)) + /// [Preview Feature] Specifies settings + /// related to VM Guest Patching on Linux. + public LinuxConfiguration(bool? disablePasswordAuthentication = default(bool?), SshConfiguration ssh = default(SshConfiguration), bool? provisionVMAgent = default(bool?), LinuxPatchSettings patchSettings = default(LinuxPatchSettings)) { DisablePasswordAuthentication = disablePasswordAuthentication; Ssh = ssh; ProvisionVMAgent = provisionVMAgent; + PatchSettings = patchSettings; CustomInit(); } @@ -82,5 +85,12 @@ public LinuxConfiguration() [JsonProperty(PropertyName = "provisionVMAgent")] public bool? ProvisionVMAgent { get; set; } + /// + /// Gets or sets [Preview Feature] Specifies settings related to VM + /// Guest Patching on Linux. + /// + [JsonProperty(PropertyName = "patchSettings")] + public LinuxPatchSettings PatchSettings { get; set; } + } } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LinuxParameters.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LinuxParameters.cs new file mode 100644 index 0000000000000..4deea634136d5 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LinuxParameters.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Input for InstallPatches on a Linux VM, as directly received by the API + /// + public partial class LinuxParameters + { + /// + /// Initializes a new instance of the LinuxParameters class. + /// + public LinuxParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinuxParameters class. + /// + /// The update classifications + /// to select when installing patches for Linux. + /// packages to include in the + /// patch operation. Format: packageName_packageVersion + /// packages to exclude in the + /// patch operation. Format: packageName_packageVersion + /// This is used as a maintenance run + /// identifier for Auto VM Guest Patching in Linux. + public LinuxParameters(IList classificationsToInclude = default(IList), IList packageNameMasksToInclude = default(IList), IList packageNameMasksToExclude = default(IList), string maintenanceRunId = default(string)) + { + ClassificationsToInclude = classificationsToInclude; + PackageNameMasksToInclude = packageNameMasksToInclude; + PackageNameMasksToExclude = packageNameMasksToExclude; + MaintenanceRunId = maintenanceRunId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the update classifications to select when installing + /// patches for Linux. + /// + [JsonProperty(PropertyName = "classificationsToInclude")] + public IList ClassificationsToInclude { get; set; } + + /// + /// Gets or sets packages to include in the patch operation. Format: + /// packageName_packageVersion + /// + [JsonProperty(PropertyName = "packageNameMasksToInclude")] + public IList PackageNameMasksToInclude { get; set; } + + /// + /// Gets or sets packages to exclude in the patch operation. Format: + /// packageName_packageVersion + /// + [JsonProperty(PropertyName = "packageNameMasksToExclude")] + public IList PackageNameMasksToExclude { get; set; } + + /// + /// Gets or sets this is used as a maintenance run identifier for Auto + /// VM Guest Patching in Linux. + /// + [JsonProperty(PropertyName = "maintenanceRunId")] + public string MaintenanceRunId { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LinuxPatchSettings.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LinuxPatchSettings.cs new file mode 100644 index 0000000000000..b330cbd7884a8 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LinuxPatchSettings.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Specifies settings related to VM Guest Patching on Linux. + /// + public partial class LinuxPatchSettings + { + /// + /// Initializes a new instance of the LinuxPatchSettings class. + /// + public LinuxPatchSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinuxPatchSettings class. + /// + /// Specifies the mode of VM Guest Patching to + /// IaaS virtual machine.<br /><br /> Possible values + /// are:<br /><br /> **ImageDefault** - The virtual + /// machine's default patching configuration is used. <br + /// /><br /> **AutomaticByPlatform** - The virtual machine + /// will be automatically updated by the platform. The property + /// provisionVMAgent must be true. Possible values include: + /// 'ImageDefault', 'AutomaticByPlatform' + public LinuxPatchSettings(string patchMode = default(string)) + { + PatchMode = patchMode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the mode of VM Guest Patching to IaaS + /// virtual machine.&lt;br /&gt;&lt;br /&gt; Possible + /// values are:&lt;br /&gt;&lt;br /&gt; + /// **ImageDefault** - The virtual machine's default patching + /// configuration is used. &lt;br /&gt;&lt;br /&gt; + /// **AutomaticByPlatform** - The virtual machine will be automatically + /// updated by the platform. The property provisionVMAgent must be + /// true. Possible values include: 'ImageDefault', + /// 'AutomaticByPlatform' + /// + [JsonProperty(PropertyName = "patchMode")] + public string PatchMode { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LinuxVMGuestPatchMode.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LinuxVMGuestPatchMode.cs new file mode 100644 index 0000000000000..403817291610a --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LinuxVMGuestPatchMode.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + + /// + /// Defines values for LinuxVMGuestPatchMode. + /// + public static class LinuxVMGuestPatchMode + { + public const string ImageDefault = "ImageDefault"; + public const string AutomaticByPlatform = "AutomaticByPlatform"; + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfigurationProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfigurationProperties.cs deleted file mode 100644 index 4c91346aecc3a..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfigurationProperties.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - public partial class LoadBalancerConfigurationProperties - { - /// - /// Initializes a new instance of the - /// LoadBalancerConfigurationProperties class. - /// - public LoadBalancerConfigurationProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// LoadBalancerConfigurationProperties class. - /// - /// List of IP - public LoadBalancerConfigurationProperties(IList frontendIPConfigurations = default(IList)) - { - FrontendIPConfigurations = frontendIPConfigurations; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of IP - /// - [JsonProperty(PropertyName = "frontendIPConfigurations")] - public IList FrontendIPConfigurations { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfiguration.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfiguration.cs deleted file mode 100644 index ff6622e4be2a5..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfiguration.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class LoadBalancerFrontendIPConfiguration - { - /// - /// Initializes a new instance of the - /// LoadBalancerFrontendIPConfiguration class. - /// - public LoadBalancerFrontendIPConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// LoadBalancerFrontendIPConfiguration class. - /// - public LoadBalancerFrontendIPConfiguration(string name = default(string), LoadBalancerFrontendIPConfigurationProperties properties = default(LoadBalancerFrontendIPConfigurationProperties)) - { - Name = name; - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties")] - public LoadBalancerFrontendIPConfigurationProperties Properties { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfigurationProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfigurationProperties.cs deleted file mode 100644 index 7187963be8cda..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfigurationProperties.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Describes a cloud service IP Configuration - /// - public partial class LoadBalancerFrontendIPConfigurationProperties - { - /// - /// Initializes a new instance of the - /// LoadBalancerFrontendIPConfigurationProperties class. - /// - public LoadBalancerFrontendIPConfigurationProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// LoadBalancerFrontendIPConfigurationProperties class. - /// - /// The private IP address referenced by - /// the cloud service. - public LoadBalancerFrontendIPConfigurationProperties(SubResource publicIPAddress = default(SubResource), SubResource subnet = default(SubResource), string privateIPAddress = default(string)) - { - PublicIPAddress = publicIPAddress; - Subnet = subnet; - PrivateIPAddress = privateIPAddress; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "publicIPAddress")] - public SubResource PublicIPAddress { get; set; } - - /// - /// - [JsonProperty(PropertyName = "subnet")] - public SubResource Subnet { get; set; } - - /// - /// Gets or sets the private IP address referenced by the cloud - /// service. - /// - [JsonProperty(PropertyName = "privateIPAddress")] - public string PrivateIPAddress { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/OrchestrationMode.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/OrchestrationMode.cs new file mode 100644 index 0000000000000..bf55423160dc6 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/OrchestrationMode.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + + /// + /// Defines values for OrchestrationMode. + /// + public static class OrchestrationMode + { + public const string Uniform = "Uniform"; + public const string Flexible = "Flexible"; + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchAssessmentState.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchAssessmentState.cs index d39f3abf85144..e38d2040f7884 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchAssessmentState.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchAssessmentState.cs @@ -16,11 +16,7 @@ namespace Microsoft.Azure.Management.Compute.Models /// public static class PatchAssessmentState { - public const string Installed = "Installed"; - public const string Failed = "Failed"; - public const string Excluded = "Excluded"; - public const string NotSelected = "NotSelected"; - public const string Pending = "Pending"; + public const string Unknown = "Unknown"; public const string Available = "Available"; } } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchInstallationDetail.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchInstallationDetail.cs new file mode 100644 index 0000000000000..6dc51bd5402f2 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchInstallationDetail.cs @@ -0,0 +1,104 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Information about a specific patch that was encountered during an + /// installation action. + /// + public partial class PatchInstallationDetail + { + /// + /// Initializes a new instance of the PatchInstallationDetail class. + /// + public PatchInstallationDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PatchInstallationDetail class. + /// + /// A unique identifier for the patch. + /// The friendly name of the patch. + /// The version string of the package. It may + /// conform to Semantic Versioning. Only applies to Linux. + /// The KBID of the patch. Only applies to Windows + /// patches. + /// The classification(s) of the patch as + /// provided by the patch publisher. + /// The state of the patch after the + /// installation operation completed. Possible values include: + /// 'Unknown', 'Installed', 'Failed', 'Excluded', 'NotSelected', + /// 'Pending' + public PatchInstallationDetail(string patchId = default(string), string name = default(string), string version = default(string), string kbId = default(string), IList classifications = default(IList), string installationState = default(string)) + { + PatchId = patchId; + Name = name; + Version = version; + KbId = kbId; + Classifications = classifications; + InstallationState = installationState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a unique identifier for the patch. + /// + [JsonProperty(PropertyName = "patchId")] + public string PatchId { get; private set; } + + /// + /// Gets the friendly name of the patch. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the version string of the package. It may conform to Semantic + /// Versioning. Only applies to Linux. + /// + [JsonProperty(PropertyName = "version")] + public string Version { get; private set; } + + /// + /// Gets the KBID of the patch. Only applies to Windows patches. + /// + [JsonProperty(PropertyName = "kbId")] + public string KbId { get; private set; } + + /// + /// Gets the classification(s) of the patch as provided by the patch + /// publisher. + /// + [JsonProperty(PropertyName = "classifications")] + public IList Classifications { get; private set; } + + /// + /// Gets the state of the patch after the installation operation + /// completed. Possible values include: 'Unknown', 'Installed', + /// 'Failed', 'Excluded', 'NotSelected', 'Pending' + /// + [JsonProperty(PropertyName = "installationState")] + public string InstallationState { get; private set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchInstallationState.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchInstallationState.cs new file mode 100644 index 0000000000000..6ca7103442bae --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchInstallationState.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + + /// + /// Defines values for PatchInstallationState. + /// + public static class PatchInstallationState + { + public const string Unknown = "Unknown"; + public const string Installed = "Installed"; + public const string Failed = "Failed"; + public const string Excluded = "Excluded"; + public const string NotSelected = "NotSelected"; + public const string Pending = "Pending"; + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchOperationStatus.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchOperationStatus.cs index 36860e3d42304..0d9c96f755a18 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchOperationStatus.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchOperationStatus.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Management.Compute.Models /// public static class PatchOperationStatus { + public const string Unknown = "Unknown"; public const string InProgress = "InProgress"; public const string Failed = "Failed"; public const string Succeeded = "Succeeded"; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchSettings.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchSettings.cs index 730f6ca2e8065..ce46bd86b2ba8 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchSettings.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/PatchSettings.cs @@ -13,6 +13,9 @@ namespace Microsoft.Azure.Management.Compute.Models using Newtonsoft.Json; using System.Linq; + /// + /// Specifies settings related to VM Guest Patching on Windows. + /// public partial class PatchSettings { /// @@ -26,7 +29,7 @@ public PatchSettings() /// /// Initializes a new instance of the PatchSettings class. /// - /// Specifies the mode of in-guest patching to + /// Specifies the mode of VM Guest Patching to /// IaaS virtual machine.<br /><br /> Possible values /// are:<br /><br /> **Manual** - You control the /// application of patches to a virtual machine. You do this by @@ -36,14 +39,19 @@ public PatchSettings() /// /><br /> **AutomaticByOS** - The virtual machine will /// automatically be updated by the OS. The property /// WindowsConfiguration.enableAutomaticUpdates must be true. <br - /// /><br /> ** AutomaticByPlatform** - the virtual machine + /// /><br /> **AutomaticByPlatform** - the virtual machine /// will automatically updated by the platform. The properties /// provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates /// must be true. Possible values include: 'Manual', 'AutomaticByOS', /// 'AutomaticByPlatform' - public PatchSettings(string patchMode = default(string)) + /// Enables customers to patch their + /// Azure VMs without requiring a reboot. For enableHotpatching, the + /// 'provisionVMAgent' must be set to true and 'patchMode' must be set + /// to 'AutomaticByPlatform'. + public PatchSettings(string patchMode = default(string), bool? enableHotpatching = default(bool?)) { PatchMode = patchMode; + EnableHotpatching = enableHotpatching; CustomInit(); } @@ -53,7 +61,7 @@ public PatchSettings() partial void CustomInit(); /// - /// Gets or sets specifies the mode of in-guest patching to IaaS + /// Gets or sets specifies the mode of VM Guest Patching to IaaS /// virtual machine.&lt;br /&gt;&lt;br /&gt; Possible /// values are:&lt;br /&gt;&lt;br /&gt; **Manual** - /// You control the application of patches to a virtual machine. You @@ -63,7 +71,7 @@ public PatchSettings() /// /&gt;&lt;br /&gt; **AutomaticByOS** - The virtual /// machine will automatically be updated by the OS. The property /// WindowsConfiguration.enableAutomaticUpdates must be true. - /// &lt;br /&gt;&lt;br /&gt; ** AutomaticByPlatform** - + /// &lt;br /&gt;&lt;br /&gt; **AutomaticByPlatform** - /// the virtual machine will automatically updated by the platform. The /// properties provisionVMAgent and /// WindowsConfiguration.enableAutomaticUpdates must be true. Possible @@ -72,5 +80,14 @@ public PatchSettings() [JsonProperty(PropertyName = "patchMode")] public string PatchMode { get; set; } + /// + /// Gets or sets enables customers to patch their Azure VMs without + /// requiring a reboot. For enableHotpatching, the 'provisionVMAgent' + /// must be set to true and 'patchMode' must be set to + /// 'AutomaticByPlatform'. + /// + [JsonProperty(PropertyName = "enableHotpatching")] + public bool? EnableHotpatching { get; set; } + } } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ResourceInstanceViewStatus.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ResourceInstanceViewStatus.cs deleted file mode 100644 index fd6a5d166a6af..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ResourceInstanceViewStatus.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Instance view status. - /// - public partial class ResourceInstanceViewStatus - { - /// - /// Initializes a new instance of the ResourceInstanceViewStatus class. - /// - public ResourceInstanceViewStatus() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ResourceInstanceViewStatus class. - /// - /// The status code. - /// The short localizable label for the - /// status. - /// The detailed status message, including for - /// alerts and error messages. - /// The time of the status. - /// The level code. Possible values include: - /// 'Info', 'Warning', 'Error' - public ResourceInstanceViewStatus(string code = default(string), string displayStatus = default(string), string message = default(string), System.DateTime? time = default(System.DateTime?), StatusLevelTypes? level = default(StatusLevelTypes?)) - { - Code = code; - DisplayStatus = displayStatus; - Message = message; - Time = time; - Level = level; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the status code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } - - /// - /// Gets the short localizable label for the status. - /// - [JsonProperty(PropertyName = "displayStatus")] - public string DisplayStatus { get; private set; } - - /// - /// Gets the detailed status message, including for alerts and error - /// messages. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - /// - /// Gets the time of the status. - /// - [JsonProperty(PropertyName = "time")] - public System.DateTime? Time { get; private set; } - - /// - /// Gets or sets the level code. Possible values include: 'Info', - /// 'Warning', 'Error' - /// - [JsonProperty(PropertyName = "level")] - public StatusLevelTypes? Level { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstance.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstance.cs deleted file mode 100644 index 1dabc78b11da7..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstance.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - public partial class RoleInstance - { - /// - /// Initializes a new instance of the RoleInstance class. - /// - public RoleInstance() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RoleInstance class. - /// - /// Resource Id - /// Resource Name. - /// Resource Type. - /// Resource Location. - /// Resource tags. - public RoleInstance(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), InstanceSku sku = default(InstanceSku), RoleInstanceProperties properties = default(RoleInstanceProperties)) - { - Id = id; - Name = name; - Type = type; - Location = location; - Tags = tags; - Sku = sku; - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets resource Id - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets resource Name. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets resource Type. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets resource Location. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; private set; } - - /// - /// Gets resource tags. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "sku")] - public InstanceSku Sku { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties")] - public RoleInstanceProperties Properties { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceInstanceView.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceInstanceView.cs deleted file mode 100644 index 5897af48e493b..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceInstanceView.cs +++ /dev/null @@ -1,83 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The instance view of the role instance. - /// - public partial class RoleInstanceInstanceView - { - /// - /// Initializes a new instance of the RoleInstanceInstanceView class. - /// - public RoleInstanceInstanceView() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RoleInstanceInstanceView class. - /// - /// The Update Domain. - /// The Fault Domain. - /// Specifies a unique identifier generated - /// internally for the cloud service associated with this role - /// instance. <br /><br /> NOTE: If you are using Azure - /// Diagnostics extension, this property can be used as 'DeploymentId' - /// for querying details. - public RoleInstanceInstanceView(int? platformUpdateDomain = default(int?), int? platformFaultDomain = default(int?), string privateId = default(string), IList statuses = default(IList)) - { - PlatformUpdateDomain = platformUpdateDomain; - PlatformFaultDomain = platformFaultDomain; - PrivateId = privateId; - Statuses = statuses; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the Update Domain. - /// - [JsonProperty(PropertyName = "platformUpdateDomain")] - public int? PlatformUpdateDomain { get; private set; } - - /// - /// Gets the Fault Domain. - /// - [JsonProperty(PropertyName = "platformFaultDomain")] - public int? PlatformFaultDomain { get; private set; } - - /// - /// Gets specifies a unique identifier generated internally for the - /// cloud service associated with this role instance. &lt;br - /// /&gt;&lt;br /&gt; NOTE: If you are using Azure - /// Diagnostics extension, this property can be used as 'DeploymentId' - /// for querying details. - /// - [JsonProperty(PropertyName = "privateId")] - public string PrivateId { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; private set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceNetworkProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceNetworkProfile.cs deleted file mode 100644 index 4a74b02f36107..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceNetworkProfile.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Describes the network profile for the role instance. - /// - public partial class RoleInstanceNetworkProfile - { - /// - /// Initializes a new instance of the RoleInstanceNetworkProfile class. - /// - public RoleInstanceNetworkProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RoleInstanceNetworkProfile class. - /// - /// Specifies the list of resource Ids - /// for the network interfaces associated with the role - /// instance. - public RoleInstanceNetworkProfile(IList networkInterfaces = default(IList)) - { - NetworkInterfaces = networkInterfaces; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets specifies the list of resource Ids for the network interfaces - /// associated with the role instance. - /// - [JsonProperty(PropertyName = "networkInterfaces")] - public IList NetworkInterfaces { get; private set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceProperties.cs deleted file mode 100644 index fb7bd0ef45265..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceProperties.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class RoleInstanceProperties - { - /// - /// Initializes a new instance of the RoleInstanceProperties class. - /// - public RoleInstanceProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RoleInstanceProperties class. - /// - public RoleInstanceProperties(RoleInstanceNetworkProfile networkProfile = default(RoleInstanceNetworkProfile), RoleInstanceInstanceView instanceView = default(RoleInstanceInstanceView)) - { - NetworkProfile = networkProfile; - InstanceView = instanceView; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "networkProfile")] - public RoleInstanceNetworkProfile NetworkProfile { get; set; } - - /// - /// - [JsonProperty(PropertyName = "instanceView")] - public RoleInstanceInstanceView InstanceView { get; set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstances.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstances.cs deleted file mode 100644 index ca428016fc697..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstances.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Specifies a list of role instances from the cloud service. - /// - public partial class RoleInstances - { - /// - /// Initializes a new instance of the RoleInstances class. - /// - public RoleInstances() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RoleInstances class. - /// - /// List of cloud service role - /// instance names. Value of '*' will signify all role instances of the - /// cloud service. - public RoleInstances(IList roleInstancesProperty) - { - RoleInstancesProperty = roleInstancesProperty; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of cloud service role instance names. Value of - /// '*' will signify all role instances of the cloud service. - /// - [JsonProperty(PropertyName = "roleInstances")] - public IList RoleInstancesProperty { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (RoleInstancesProperty == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "RoleInstancesProperty"); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RollingUpgradePolicy.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RollingUpgradePolicy.cs index 2a43f60a0103f..cf56aac6c64fe 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RollingUpgradePolicy.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RollingUpgradePolicy.cs @@ -52,12 +52,20 @@ public RollingUpgradePolicy() /// completing the update for all virtual machines in one batch and /// starting the next batch. The time duration should be specified in /// ISO 8601 format. The default value is 0 seconds (PT0S). - public RollingUpgradePolicy(int? maxBatchInstancePercent = default(int?), int? maxUnhealthyInstancePercent = default(int?), int? maxUnhealthyUpgradedInstancePercent = default(int?), string pauseTimeBetweenBatches = default(string)) + /// Allow VMSS to ignore AZ + /// boundaries when constructing upgrade batches. Take into + /// consideration the Update Domain and maxBatchInstancePercent to + /// determine the batch size. + /// Upgrade all unhealthy + /// instances in a scale set before any healthy instances. + public RollingUpgradePolicy(int? maxBatchInstancePercent = default(int?), int? maxUnhealthyInstancePercent = default(int?), int? maxUnhealthyUpgradedInstancePercent = default(int?), string pauseTimeBetweenBatches = default(string), bool? enableCrossZoneUpgrade = default(bool?), bool? prioritizeUnhealthyInstances = default(bool?)) { MaxBatchInstancePercent = maxBatchInstancePercent; MaxUnhealthyInstancePercent = maxUnhealthyInstancePercent; MaxUnhealthyUpgradedInstancePercent = maxUnhealthyUpgradedInstancePercent; PauseTimeBetweenBatches = pauseTimeBetweenBatches; + EnableCrossZoneUpgrade = enableCrossZoneUpgrade; + PrioritizeUnhealthyInstances = prioritizeUnhealthyInstances; CustomInit(); } @@ -107,6 +115,21 @@ public RollingUpgradePolicy() [JsonProperty(PropertyName = "pauseTimeBetweenBatches")] public string PauseTimeBetweenBatches { get; set; } + /// + /// Gets or sets allow VMSS to ignore AZ boundaries when constructing + /// upgrade batches. Take into consideration the Update Domain and + /// maxBatchInstancePercent to determine the batch size. + /// + [JsonProperty(PropertyName = "enableCrossZoneUpgrade")] + public bool? EnableCrossZoneUpgrade { get; set; } + + /// + /// Gets or sets upgrade all unhealthy instances in a scale set before + /// any healthy instances. + /// + [JsonProperty(PropertyName = "prioritizeUnhealthyInstances")] + public bool? PrioritizeUnhealthyInstances { get; set; } + /// /// Validate the object. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SecurityProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SecurityProfile.cs index 323d109564f29..0be80d5c515a1 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SecurityProfile.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SecurityProfile.cs @@ -30,6 +30,9 @@ public SecurityProfile() /// /// Initializes a new instance of the SecurityProfile class. /// + /// Specifies the security settings like + /// secure boot and vTPM used while creating the virtual machine. + /// <br><br>Minimum api-version: 2020-12-01 /// This property can be used by user in /// the request to enable or disable the Host Encryption for the /// virtual machine or virtual machine scale set. This will enable the @@ -37,9 +40,16 @@ public SecurityProfile() /// itself. <br><br> Default: The Encryption at host will /// be disabled unless this property is set to true for the /// resource. - public SecurityProfile(bool? encryptionAtHost = default(bool?)) + /// Specifies the SecurityType of the + /// virtual machine. It is set as TrustedLaunch to enable UefiSettings. + /// <br><br> Default: UefiSettings will not be enabled + /// unless this property is set as TrustedLaunch. Possible values + /// include: 'TrustedLaunch' + public SecurityProfile(UefiSettings uefiSettings = default(UefiSettings), bool? encryptionAtHost = default(bool?), SecurityTypes? securityType = default(SecurityTypes?)) { + UefiSettings = uefiSettings; EncryptionAtHost = encryptionAtHost; + SecurityType = securityType; CustomInit(); } @@ -48,6 +58,14 @@ public SecurityProfile() /// partial void CustomInit(); + /// + /// Gets or sets specifies the security settings like secure boot and + /// vTPM used while creating the virtual machine. + /// &lt;br&gt;&lt;br&gt;Minimum api-version: 2020-12-01 + /// + [JsonProperty(PropertyName = "uefiSettings")] + public UefiSettings UefiSettings { get; set; } + /// /// Gets or sets this property can be used by user in the request to /// enable or disable the Host Encryption for the virtual machine or @@ -60,5 +78,15 @@ public SecurityProfile() [JsonProperty(PropertyName = "encryptionAtHost")] public bool? EncryptionAtHost { get; set; } + /// + /// Gets or sets specifies the SecurityType of the virtual machine. It + /// is set as TrustedLaunch to enable UefiSettings. + /// &lt;br&gt;&lt;br&gt; Default: UefiSettings will not + /// be enabled unless this property is set as TrustedLaunch. Possible + /// values include: 'TrustedLaunch' + /// + [JsonProperty(PropertyName = "securityType")] + public SecurityTypes? SecurityType { get; set; } + } } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SecurityTypes.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SecurityTypes.cs new file mode 100644 index 0000000000000..aad5bca9275b7 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SecurityTypes.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.Compute.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for SecurityTypes. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum SecurityTypes + { + [EnumMember(Value = "TrustedLaunch")] + TrustedLaunch + } + internal static class SecurityTypesEnumExtension + { + internal static string ToSerializedValue(this SecurityTypes? value) + { + return value == null ? null : ((SecurityTypes)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SecurityTypes value) + { + switch( value ) + { + case SecurityTypes.TrustedLaunch: + return "TrustedLaunch"; + } + return null; + } + + internal static SecurityTypes? ParseSecurityTypes(this string value) + { + switch( value ) + { + case "TrustedLaunch": + return SecurityTypes.TrustedLaunch; + } + return null; + } + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SshPublicKey.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SshPublicKey.cs index c26ca0214e351..129f2e1d9d71f 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SshPublicKey.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SshPublicKey.cs @@ -38,7 +38,7 @@ public SshPublicKey() /// authenticate with the VM through ssh. The key needs to be at least /// 2048-bit and in ssh-rsa format. <br><br> For creating /// ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in - /// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + /// Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). public SshPublicKey(string path = default(string), string keyData = default(string)) { Path = path; @@ -64,7 +64,7 @@ public SshPublicKey() /// the VM through ssh. The key needs to be at least 2048-bit and in /// ssh-rsa format. &lt;br&gt;&lt;br&gt; For creating /// ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in - /// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + /// Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). /// [JsonProperty(PropertyName = "keyData")] public string KeyData { get; set; } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/StatusCodeCount.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/StatusCodeCount.cs deleted file mode 100644 index 58d751d63e8ef..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/StatusCodeCount.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class StatusCodeCount - { - /// - /// Initializes a new instance of the StatusCodeCount class. - /// - public StatusCodeCount() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the StatusCodeCount class. - /// - /// The instance view status code - /// Number of instances having this status - /// code - public StatusCodeCount(string code = default(string), int? count = default(int?)) - { - Code = code; - Count = count; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the instance view status code - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } - - /// - /// Gets number of instances having this status code - /// - [JsonProperty(PropertyName = "count")] - public int? Count { get; private set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/UefiSettings.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/UefiSettings.cs new file mode 100644 index 0000000000000..09b95b6c3d096 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/UefiSettings.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Specifies the security settings like secure boot and vTPM used while + /// creating the virtual machine. <br><br>Minimum api-version: + /// 2020-12-01 + /// + public partial class UefiSettings + { + /// + /// Initializes a new instance of the UefiSettings class. + /// + public UefiSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UefiSettings class. + /// + /// Specifies whether secure boot + /// should be enabled on the virtual machine. + /// <br><br>Minimum api-version: 2020-12-01 + /// Specifies whether vTPM should be enabled + /// on the virtual machine. <br><br>Minimum api-version: + /// 2020-12-01 + public UefiSettings(bool? secureBootEnabled = default(bool?), bool? vTpmEnabled = default(bool?)) + { + SecureBootEnabled = secureBootEnabled; + VTpmEnabled = vTpmEnabled; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies whether secure boot should be enabled on the + /// virtual machine. &lt;br&gt;&lt;br&gt;Minimum + /// api-version: 2020-12-01 + /// + [JsonProperty(PropertyName = "secureBootEnabled")] + public bool? SecureBootEnabled { get; set; } + + /// + /// Gets or sets specifies whether vTPM should be enabled on the + /// virtual machine. &lt;br&gt;&lt;br&gt;Minimum + /// api-version: 2020-12-01 + /// + [JsonProperty(PropertyName = "vTpmEnabled")] + public bool? VTpmEnabled { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/UpdateDomain.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/UpdateDomain.cs deleted file mode 100644 index a70bab5d5e0df..0000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/UpdateDomain.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Defines an update domain for the cloud service. - /// - public partial class UpdateDomain - { - /// - /// Initializes a new instance of the UpdateDomain class. - /// - public UpdateDomain() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the UpdateDomain class. - /// - /// Resource Id - /// Resource Name - public UpdateDomain(string id = default(string), string name = default(string)) - { - Id = id; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets resource Id - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets resource Name - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchClassificationLinux.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchClassificationLinux.cs new file mode 100644 index 0000000000000..0cc53c8e44fca --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchClassificationLinux.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + + /// + /// Defines values for VMGuestPatchClassificationLinux. + /// + public static class VMGuestPatchClassificationLinux + { + public const string Critical = "Critical"; + public const string Security = "Security"; + public const string Other = "Other"; + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchClassificationWindows.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchClassificationWindows.cs new file mode 100644 index 0000000000000..e98f65e64153f --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchClassificationWindows.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + + /// + /// Defines values for VMGuestPatchClassificationWindows. + /// + public static class VMGuestPatchClassificationWindows + { + public const string Critical = "Critical"; + public const string Security = "Security"; + public const string UpdateRollUp = "UpdateRollUp"; + public const string FeaturePack = "FeaturePack"; + public const string ServicePack = "ServicePack"; + public const string Definition = "Definition"; + public const string Tools = "Tools"; + public const string Updates = "Updates"; + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SoftwareUpdateRebootBehavior.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchRebootBehavior.cs similarity index 80% rename from sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SoftwareUpdateRebootBehavior.cs rename to sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchRebootBehavior.cs index de78bf037aca7..87a76dded6d92 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/SoftwareUpdateRebootBehavior.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchRebootBehavior.cs @@ -12,10 +12,11 @@ namespace Microsoft.Azure.Management.Compute.Models { /// - /// Defines values for SoftwareUpdateRebootBehavior. + /// Defines values for VMGuestPatchRebootBehavior. /// - public static class SoftwareUpdateRebootBehavior + public static class VMGuestPatchRebootBehavior { + public const string Unknown = "Unknown"; public const string NeverReboots = "NeverReboots"; public const string AlwaysRequiresReboot = "AlwaysRequiresReboot"; public const string CanRequestReboot = "CanRequestReboot"; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchRebootSetting.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchRebootSetting.cs new file mode 100644 index 0000000000000..ebfef92400a41 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchRebootSetting.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + + /// + /// Defines values for VMGuestPatchRebootSetting. + /// + public static class VMGuestPatchRebootSetting + { + public const string IfRequired = "IfRequired"; + public const string Never = "Never"; + public const string Always = "Always"; + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RebootStatus.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchRebootStatus.cs similarity index 82% rename from sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RebootStatus.cs rename to sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchRebootStatus.cs index b04c6371134e3..f9bf1a04138e6 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RebootStatus.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VMGuestPatchRebootStatus.cs @@ -12,10 +12,11 @@ namespace Microsoft.Azure.Management.Compute.Models { /// - /// Defines values for RebootStatus. + /// Defines values for VMGuestPatchRebootStatus. /// - public static class RebootStatus + public static class VMGuestPatchRebootStatus { + public const string Unknown = "Unknown"; public const string NotNeeded = "NotNeeded"; public const string Required = "Required"; public const string Started = "Started"; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachine.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachine.cs index 53cc695fea8b5..b2a2fe9d7b9cb 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachine.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachine.cs @@ -139,12 +139,26 @@ public VirtualMachine() /// minutes and 120 minutes (inclusive) and should be specified in ISO /// 8601 format. The default value is 90 minutes (PT1H30M). /// <br><br> Minimum api-version: 2020-06-01 + /// Specifies the scale set logical + /// fault domain into which the Virtual Machine will be created. By + /// default, the Virtual Machine will by automatically assigned to a + /// fault domain that best maintains balance across available fault + /// domains.<br><li>This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.<li>The Virtual Machine Scale Set that is referenced, + /// must have 'platformFaultDomainCount' &gt; 1.<li>This + /// property cannot be updated once the Virtual Machine is + /// created.<li>Fault domain assignment can be viewed in the + /// Virtual Machine Instance View.<br><br>Minimum + /// api‐version: 2020‐12‐01 /// The virtual machine child extension /// resources. /// The identity of the virtual machine, if /// configured. /// The virtual machine zones. - public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), IList resources = default(IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) + /// The extended location of the Virtual + /// Machine. + public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), IList resources = default(IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList), ExtendedLocation extendedLocation = default(ExtendedLocation)) : base(location, id, name, type, tags) { Plan = plan; @@ -168,9 +182,11 @@ public VirtualMachine() LicenseType = licenseType; VmId = vmId; ExtensionsTimeBudget = extensionsTimeBudget; + PlatformFaultDomain = platformFaultDomain; Resources = resources; Identity = identity; Zones = zones; + ExtendedLocation = extendedLocation; CustomInit(); } @@ -388,6 +404,24 @@ public VirtualMachine() [JsonProperty(PropertyName = "properties.extensionsTimeBudget")] public string ExtensionsTimeBudget { get; set; } + /// + /// Gets or sets specifies the scale set logical fault domain into + /// which the Virtual Machine will be created. By default, the Virtual + /// Machine will by automatically assigned to a fault domain that best + /// maintains balance across available fault + /// domains.&lt;br&gt;&lt;li&gt;This is applicable only + /// if the 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.&lt;li&gt;The Virtual Machine Scale Set that is + /// referenced, must have 'platformFaultDomainCount' &amp;gt; + /// 1.&lt;li&gt;This property cannot be updated once the + /// Virtual Machine is created.&lt;li&gt;Fault domain + /// assignment can be viewed in the Virtual Machine Instance + /// View.&lt;br&gt;&lt;br&gt;Minimum api‐version: + /// 2020‐12‐01 + /// + [JsonProperty(PropertyName = "properties.platformFaultDomain")] + public int? PlatformFaultDomain { get; set; } + /// /// Gets the virtual machine child extension resources. /// @@ -406,6 +440,12 @@ public VirtualMachine() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } + /// + /// Gets or sets the extended location of the Virtual Machine. + /// + [JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation { get; set; } + /// /// Validate the object. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineAssessPatchesResult.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineAssessPatchesResult.cs index 3547230ce763f..9bb2a7c3e50cf 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineAssessPatchesResult.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineAssessPatchesResult.cs @@ -35,9 +35,10 @@ public VirtualMachineAssessPatchesResult() /// /// The overall success or failure status of the /// operation. It remains "InProgress" until the operation completes. - /// At that point it will become "Failed", "Succeeded", or - /// "CompletedWithWarnings.". Possible values include: 'InProgress', - /// 'Failed', 'Succeeded', 'CompletedWithWarnings' + /// At that point it will become "Unknown", "Failed", "Succeeded", or + /// "CompletedWithWarnings.". Possible values include: 'Unknown', + /// 'InProgress', 'Failed', 'Succeeded', + /// 'CompletedWithWarnings' /// The activity ID of the operation /// that produced this result. It is used to correlate across CRP and /// extension logs. @@ -51,12 +52,12 @@ public VirtualMachineAssessPatchesResult() /// excluding critical and security. /// The UTC timestamp when the operation /// began. - /// The list of patches that have been detected - /// as available for installation. + /// The list of patches that have been + /// detected as available for installation. /// The errors that were encountered during /// execution of the operation. The details array contains the list of /// them. - public VirtualMachineAssessPatchesResult(string status = default(string), string assessmentActivityId = default(string), bool? rebootPending = default(bool?), int? criticalAndSecurityPatchCount = default(int?), int? otherPatchCount = default(int?), System.DateTime? startDateTime = default(System.DateTime?), IList patches = default(IList), ApiError error = default(ApiError)) + public VirtualMachineAssessPatchesResult(string status = default(string), string assessmentActivityId = default(string), bool? rebootPending = default(bool?), int? criticalAndSecurityPatchCount = default(int?), int? otherPatchCount = default(int?), System.DateTime? startDateTime = default(System.DateTime?), IList availablePatches = default(IList), ApiError error = default(ApiError)) { Status = status; AssessmentActivityId = assessmentActivityId; @@ -64,7 +65,7 @@ public VirtualMachineAssessPatchesResult() CriticalAndSecurityPatchCount = criticalAndSecurityPatchCount; OtherPatchCount = otherPatchCount; StartDateTime = startDateTime; - Patches = patches; + AvailablePatches = availablePatches; Error = error; CustomInit(); } @@ -77,9 +78,9 @@ public VirtualMachineAssessPatchesResult() /// /// Gets the overall success or failure status of the operation. It /// remains "InProgress" until the operation completes. At that point - /// it will become "Failed", "Succeeded", or "CompletedWithWarnings.". - /// Possible values include: 'InProgress', 'Failed', 'Succeeded', - /// 'CompletedWithWarnings' + /// it will become "Unknown", "Failed", "Succeeded", or + /// "CompletedWithWarnings.". Possible values include: 'Unknown', + /// 'InProgress', 'Failed', 'Succeeded', 'CompletedWithWarnings' /// [JsonProperty(PropertyName = "status")] public string Status { get; private set; } @@ -123,8 +124,8 @@ public VirtualMachineAssessPatchesResult() /// Gets the list of patches that have been detected as available for /// installation. /// - [JsonProperty(PropertyName = "patches")] - public IList Patches { get; private set; } + [JsonProperty(PropertyName = "availablePatches")] + public IList AvailablePatches { get; private set; } /// /// Gets the errors that were encountered during execution of the diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineImage.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineImage.cs index 8a2b6409b7e49..a938c57910a20 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineImage.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineImage.cs @@ -42,12 +42,14 @@ public VirtualMachineImage() /// virtual machine. For more information about using tags, see [Using /// tags to organize your Azure /// resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + /// The extended location of the Virtual + /// Machine. /// Possible values include: 'V1', /// 'V2' /// Specifies disallowed configuration for the /// VirtualMachine created from the image - public VirtualMachineImage(string name, string location, string id = default(string), IDictionary tags = default(IDictionary), PurchasePlan plan = default(PurchasePlan), OSDiskImage osDiskImage = default(OSDiskImage), IList dataDiskImages = default(IList), AutomaticOSUpgradeProperties automaticOSUpgradeProperties = default(AutomaticOSUpgradeProperties), string hyperVGeneration = default(string), DisallowedConfiguration disallowed = default(DisallowedConfiguration)) - : base(name, location, id, tags) + public VirtualMachineImage(string name, string location, string id = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), PurchasePlan plan = default(PurchasePlan), OSDiskImage osDiskImage = default(OSDiskImage), IList dataDiskImages = default(IList), AutomaticOSUpgradeProperties automaticOSUpgradeProperties = default(AutomaticOSUpgradeProperties), string hyperVGeneration = default(string), DisallowedConfiguration disallowed = default(DisallowedConfiguration), IList features = default(IList)) + : base(name, location, id, tags, extendedLocation) { Plan = plan; OsDiskImage = osDiskImage; @@ -55,6 +57,7 @@ public VirtualMachineImage() AutomaticOSUpgradeProperties = automaticOSUpgradeProperties; HyperVGeneration = hyperVGeneration; Disallowed = disallowed; + Features = features; CustomInit(); } @@ -96,6 +99,11 @@ public VirtualMachineImage() [JsonProperty(PropertyName = "properties.disallowed")] public DisallowedConfiguration Disallowed { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.features")] + public IList Features { get; set; } + /// /// Validate the object. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfiguration.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineImageFeature.cs similarity index 56% rename from sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfiguration.cs rename to sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineImageFeature.cs index 1965c9fc649f0..5b38dfe6711a9 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfiguration.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineImageFeature.cs @@ -14,26 +14,28 @@ namespace Microsoft.Azure.Management.Compute.Models using System.Linq; /// - /// Describes the load balancer configuration. + /// Specifies additional capabilities supported by the image /// - public partial class LoadBalancerConfiguration + public partial class VirtualMachineImageFeature { /// - /// Initializes a new instance of the LoadBalancerConfiguration class. + /// Initializes a new instance of the VirtualMachineImageFeature class. /// - public LoadBalancerConfiguration() + public VirtualMachineImageFeature() { CustomInit(); } /// - /// Initializes a new instance of the LoadBalancerConfiguration class. + /// Initializes a new instance of the VirtualMachineImageFeature class. /// - /// Resource Name - public LoadBalancerConfiguration(string name = default(string), LoadBalancerConfigurationProperties properties = default(LoadBalancerConfigurationProperties)) + /// The name of the feature. + /// The corresponding value for the + /// feature. + public VirtualMachineImageFeature(string name = default(string), string value = default(string)) { Name = name; - Properties = properties; + Value = value; CustomInit(); } @@ -43,15 +45,16 @@ public LoadBalancerConfiguration() partial void CustomInit(); /// - /// Gets or sets resource Name + /// Gets or sets the name of the feature. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// + /// Gets or sets the corresponding value for the feature. /// - [JsonProperty(PropertyName = "properties")] - public LoadBalancerConfigurationProperties Properties { get; set; } + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } } } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineImageResource.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineImageResource.cs index 880249a5672c0..f7adc3819051f 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineImageResource.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineImageResource.cs @@ -42,12 +42,15 @@ public VirtualMachineImageResource() /// virtual machine. For more information about using tags, see [Using /// tags to organize your Azure /// resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). - public VirtualMachineImageResource(string name, string location, string id = default(string), IDictionary tags = default(IDictionary)) + /// The extended location of the Virtual + /// Machine. + public VirtualMachineImageResource(string name, string location, string id = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation)) : base(id) { Name = name; Location = location; Tags = tags; + ExtendedLocation = extendedLocation; CustomInit(); } @@ -77,6 +80,12 @@ public VirtualMachineImageResource() [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } + /// + /// Gets or sets the extended location of the Virtual Machine. + /// + [JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation { get; set; } + /// /// Validate the object. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineInstallPatchesParameters.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineInstallPatchesParameters.cs new file mode 100644 index 0000000000000..e7170d046d5b0 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineInstallPatchesParameters.cs @@ -0,0 +1,107 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Input for InstallPatches as directly received by the API + /// + public partial class VirtualMachineInstallPatchesParameters + { + /// + /// Initializes a new instance of the + /// VirtualMachineInstallPatchesParameters class. + /// + public VirtualMachineInstallPatchesParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// VirtualMachineInstallPatchesParameters class. + /// + /// Specifies the maximum amount of time + /// that the operation will run. It must be an ISO 8601-compliant + /// duration string such as PT4H (4 hours) + /// Defines when it is acceptable to reboot + /// a VM during a software update operation. Possible values include: + /// 'IfRequired', 'Never', 'Always' + /// Input for InstallPatches on a + /// Windows VM, as directly received by the API + /// Input for InstallPatches on a Linux + /// VM, as directly received by the API + public VirtualMachineInstallPatchesParameters(string maximumDuration, string rebootSetting, WindowsParameters windowsParameters = default(WindowsParameters), LinuxParameters linuxParameters = default(LinuxParameters)) + { + MaximumDuration = maximumDuration; + RebootSetting = rebootSetting; + WindowsParameters = windowsParameters; + LinuxParameters = linuxParameters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the maximum amount of time that the + /// operation will run. It must be an ISO 8601-compliant duration + /// string such as PT4H (4 hours) + /// + [JsonProperty(PropertyName = "maximumDuration")] + public string MaximumDuration { get; set; } + + /// + /// Gets or sets defines when it is acceptable to reboot a VM during a + /// software update operation. Possible values include: 'IfRequired', + /// 'Never', 'Always' + /// + [JsonProperty(PropertyName = "rebootSetting")] + public string RebootSetting { get; set; } + + /// + /// Gets or sets input for InstallPatches on a Windows VM, as directly + /// received by the API + /// + [JsonProperty(PropertyName = "windowsParameters")] + public WindowsParameters WindowsParameters { get; set; } + + /// + /// Gets or sets input for InstallPatches on a Linux VM, as directly + /// received by the API + /// + [JsonProperty(PropertyName = "linuxParameters")] + public LinuxParameters LinuxParameters { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (MaximumDuration == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "MaximumDuration"); + } + if (RebootSetting == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "RebootSetting"); + } + } + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineInstallPatchesResult.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineInstallPatchesResult.cs new file mode 100644 index 0000000000000..53d2c65fe0274 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineInstallPatchesResult.cs @@ -0,0 +1,179 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The result summary of an installation operation. + /// + public partial class VirtualMachineInstallPatchesResult + { + /// + /// Initializes a new instance of the + /// VirtualMachineInstallPatchesResult class. + /// + public VirtualMachineInstallPatchesResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// VirtualMachineInstallPatchesResult class. + /// + /// The overall success or failure status of the + /// operation. It remains "InProgress" until the operation completes. + /// At that point it will become "Failed", "Succeeded", "Unknown" or + /// "CompletedWithWarnings.". Possible values include: 'Unknown', + /// 'InProgress', 'Failed', 'Succeeded', + /// 'CompletedWithWarnings' + /// The activity ID of the + /// operation that produced this result. It is used to correlate across + /// CRP and extension logs. + /// The reboot state of the VM following + /// completion of the operation. Possible values include: 'Unknown', + /// 'NotNeeded', 'Required', 'Started', 'Failed', 'Completed' + /// Whether the operation ran + /// out of time before it completed all its intended actions. + /// The number of patches that were + /// not installed due to the user blocking their installation. + /// The number of patches that were + /// detected as available for install, but did not meet the operation's + /// criteria. + /// The number of patches that were + /// identified as meeting the installation criteria, but were not able + /// to be installed. Typically this happens when + /// maintenanceWindowExceeded == true. + /// The number of patches + /// successfully installed. + /// The number of patches that could not + /// be installed due to some issue. See errors for details. + /// The patches that were installed during the + /// operation. + /// The UTC timestamp when the operation + /// began. + /// The errors that were encountered during + /// execution of the operation. The details array contains the list of + /// them. + public VirtualMachineInstallPatchesResult(string status = default(string), string installationActivityId = default(string), string rebootStatus = default(string), bool? maintenanceWindowExceeded = default(bool?), int? excludedPatchCount = default(int?), int? notSelectedPatchCount = default(int?), int? pendingPatchCount = default(int?), int? installedPatchCount = default(int?), int? failedPatchCount = default(int?), IList patches = default(IList), System.DateTime? startDateTime = default(System.DateTime?), ApiError error = default(ApiError)) + { + Status = status; + InstallationActivityId = installationActivityId; + RebootStatus = rebootStatus; + MaintenanceWindowExceeded = maintenanceWindowExceeded; + ExcludedPatchCount = excludedPatchCount; + NotSelectedPatchCount = notSelectedPatchCount; + PendingPatchCount = pendingPatchCount; + InstalledPatchCount = installedPatchCount; + FailedPatchCount = failedPatchCount; + Patches = patches; + StartDateTime = startDateTime; + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the overall success or failure status of the operation. It + /// remains "InProgress" until the operation completes. At that point + /// it will become "Failed", "Succeeded", "Unknown" or + /// "CompletedWithWarnings.". Possible values include: 'Unknown', + /// 'InProgress', 'Failed', 'Succeeded', 'CompletedWithWarnings' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; private set; } + + /// + /// Gets the activity ID of the operation that produced this result. It + /// is used to correlate across CRP and extension logs. + /// + [JsonProperty(PropertyName = "installationActivityId")] + public string InstallationActivityId { get; private set; } + + /// + /// Gets the reboot state of the VM following completion of the + /// operation. Possible values include: 'Unknown', 'NotNeeded', + /// 'Required', 'Started', 'Failed', 'Completed' + /// + [JsonProperty(PropertyName = "rebootStatus")] + public string RebootStatus { get; private set; } + + /// + /// Gets whether the operation ran out of time before it completed all + /// its intended actions. + /// + [JsonProperty(PropertyName = "maintenanceWindowExceeded")] + public bool? MaintenanceWindowExceeded { get; private set; } + + /// + /// Gets the number of patches that were not installed due to the user + /// blocking their installation. + /// + [JsonProperty(PropertyName = "excludedPatchCount")] + public int? ExcludedPatchCount { get; private set; } + + /// + /// Gets the number of patches that were detected as available for + /// install, but did not meet the operation's criteria. + /// + [JsonProperty(PropertyName = "notSelectedPatchCount")] + public int? NotSelectedPatchCount { get; private set; } + + /// + /// Gets the number of patches that were identified as meeting the + /// installation criteria, but were not able to be installed. Typically + /// this happens when maintenanceWindowExceeded == true. + /// + [JsonProperty(PropertyName = "pendingPatchCount")] + public int? PendingPatchCount { get; private set; } + + /// + /// Gets the number of patches successfully installed. + /// + [JsonProperty(PropertyName = "installedPatchCount")] + public int? InstalledPatchCount { get; private set; } + + /// + /// Gets the number of patches that could not be installed due to some + /// issue. See errors for details. + /// + [JsonProperty(PropertyName = "failedPatchCount")] + public int? FailedPatchCount { get; private set; } + + /// + /// Gets the patches that were installed during the operation. + /// + [JsonProperty(PropertyName = "patches")] + public IList Patches { get; private set; } + + /// + /// Gets the UTC timestamp when the operation began. + /// + [JsonProperty(PropertyName = "startDateTime")] + public System.DateTime? StartDateTime { get; private set; } + + /// + /// Gets the errors that were encountered during execution of the + /// operation. The details array contains the list of them. + /// + [JsonProperty(PropertyName = "error")] + public ApiError Error { get; private set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineInstanceView.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineInstanceView.cs index d0140ccba2555..133010dfe51af 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineInstanceView.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineInstanceView.cs @@ -64,8 +64,8 @@ public VirtualMachineInstanceView() /// that has automatic placement enabled. <br><br>Minimum /// api-version: 2020-06-01. /// The resource status information. - /// The status of virtual machine patch - /// operations. + /// [Preview Feature] The status of virtual + /// machine patch operations. public VirtualMachineInstanceView(int? platformUpdateDomain = default(int?), int? platformFaultDomain = default(int?), string computerName = default(string), string osName = default(string), string osVersion = default(string), string hyperVGeneration = default(string), string rdpThumbPrint = default(string), VirtualMachineAgentInstanceView vmAgent = default(VirtualMachineAgentInstanceView), MaintenanceRedeployStatus maintenanceRedeployStatus = default(MaintenanceRedeployStatus), IList disks = default(IList), IList extensions = default(IList), VirtualMachineHealthStatus vmHealth = default(VirtualMachineHealthStatus), BootDiagnosticsInstanceView bootDiagnostics = default(BootDiagnosticsInstanceView), string assignedHost = default(string), IList statuses = default(IList), VirtualMachinePatchStatus patchStatus = default(VirtualMachinePatchStatus)) { PlatformUpdateDomain = platformUpdateDomain; @@ -195,7 +195,8 @@ public VirtualMachineInstanceView() public IList Statuses { get; set; } /// - /// Gets or sets the status of virtual machine patch operations. + /// Gets or sets [Preview Feature] The status of virtual machine patch + /// operations. /// [JsonProperty(PropertyName = "patchStatus")] public VirtualMachinePatchStatus PatchStatus { get; set; } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachinePatchStatus.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachinePatchStatus.cs index bc09fb9fe98cc..bd1b95c7f6352 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachinePatchStatus.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachinePatchStatus.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.Management.Compute.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -34,10 +36,13 @@ public VirtualMachinePatchStatus() /// The installation summary /// of the latest installation operation for the virtual /// machine. - public VirtualMachinePatchStatus(AvailablePatchSummary availablePatchSummary = default(AvailablePatchSummary), LastPatchInstallationSummary lastPatchInstallationSummary = default(LastPatchInstallationSummary)) + /// The enablement status of the + /// specified patchMode + public VirtualMachinePatchStatus(AvailablePatchSummary availablePatchSummary = default(AvailablePatchSummary), LastPatchInstallationSummary lastPatchInstallationSummary = default(LastPatchInstallationSummary), IList configurationStatuses = default(IList)) { AvailablePatchSummary = availablePatchSummary; LastPatchInstallationSummary = lastPatchInstallationSummary; + ConfigurationStatuses = configurationStatuses; CustomInit(); } @@ -60,5 +65,11 @@ public VirtualMachinePatchStatus() [JsonProperty(PropertyName = "lastPatchInstallationSummary")] public LastPatchInstallationSummary LastPatchInstallationSummary { get; set; } + /// + /// Gets the enablement status of the specified patchMode + /// + [JsonProperty(PropertyName = "configurationStatuses")] + public IList ConfigurationStatuses { get; private set; } + } } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSet.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSet.cs index a6592646caf39..f2c95f765b74e 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSet.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSet.cs @@ -88,12 +88,17 @@ public VirtualMachineScaleSet() /// Specifies the scale-in policy that /// decides which virtual machines are chosen for removal when a /// Virtual Machine Scale Set is scaled-in. + /// Specifies the orchestration mode + /// for the virtual machine scale set. Possible values include: + /// 'Uniform', 'Flexible' /// The identity of the virtual machine scale /// set, if configured. /// The virtual machine scale set zones. NOTE: /// Availability zones can only be set when you create the scale /// set - public VirtualMachineScaleSet(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), Plan plan = default(Plan), UpgradePolicy upgradePolicy = default(UpgradePolicy), AutomaticRepairsPolicy automaticRepairsPolicy = default(AutomaticRepairsPolicy), VirtualMachineScaleSetVMProfile virtualMachineProfile = default(VirtualMachineScaleSetVMProfile), string provisioningState = default(string), bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVMs = default(bool?), string uniqueId = default(string), bool? singlePlacementGroup = default(bool?), bool? zoneBalance = default(bool?), int? platformFaultDomainCount = default(int?), SubResource proximityPlacementGroup = default(SubResource), SubResource hostGroup = default(SubResource), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), ScaleInPolicy scaleInPolicy = default(ScaleInPolicy), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity), IList zones = default(IList)) + /// The extended location of the Virtual + /// Machine Scale Set. + public VirtualMachineScaleSet(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), Plan plan = default(Plan), UpgradePolicy upgradePolicy = default(UpgradePolicy), AutomaticRepairsPolicy automaticRepairsPolicy = default(AutomaticRepairsPolicy), VirtualMachineScaleSetVMProfile virtualMachineProfile = default(VirtualMachineScaleSetVMProfile), string provisioningState = default(string), bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVMs = default(bool?), string uniqueId = default(string), bool? singlePlacementGroup = default(bool?), bool? zoneBalance = default(bool?), int? platformFaultDomainCount = default(int?), SubResource proximityPlacementGroup = default(SubResource), SubResource hostGroup = default(SubResource), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), ScaleInPolicy scaleInPolicy = default(ScaleInPolicy), string orchestrationMode = default(string), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity), IList zones = default(IList), ExtendedLocation extendedLocation = default(ExtendedLocation)) : base(location, id, name, type, tags) { Sku = sku; @@ -112,8 +117,10 @@ public VirtualMachineScaleSet() HostGroup = hostGroup; AdditionalCapabilities = additionalCapabilities; ScaleInPolicy = scaleInPolicy; + OrchestrationMode = orchestrationMode; Identity = identity; Zones = zones; + ExtendedLocation = extendedLocation; CustomInit(); } @@ -245,6 +252,13 @@ public VirtualMachineScaleSet() [JsonProperty(PropertyName = "properties.scaleInPolicy")] public ScaleInPolicy ScaleInPolicy { get; set; } + /// + /// Gets or sets specifies the orchestration mode for the virtual + /// machine scale set. Possible values include: 'Uniform', 'Flexible' + /// + [JsonProperty(PropertyName = "properties.orchestrationMode")] + public string OrchestrationMode { get; set; } + /// /// Gets or sets the identity of the virtual machine scale set, if /// configured. @@ -259,6 +273,13 @@ public VirtualMachineScaleSet() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } + /// + /// Gets or sets the extended location of the Virtual Machine Scale + /// Set. + /// + [JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation { get; set; } + /// /// Validate the object. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineSoftwarePatchProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineSoftwarePatchProperties.cs index 274c3f085e3c6..bc709ce1f948c 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineSoftwarePatchProperties.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineSoftwarePatchProperties.cs @@ -37,12 +37,12 @@ public VirtualMachineSoftwarePatchProperties() /// The friendly name of the patch. /// The version number of the patch. This /// property applies only to Linux patches. - /// The KBID of the patch. Only applies to Windows + /// The KBID of the patch. Only applies to Windows /// patches. /// The classification(s) of the patch as /// provided by the patch publisher. /// Describes the reboot requirements of - /// the patch. Possible values include: 'NeverReboots', + /// the patch. Possible values include: 'Unknown', 'NeverReboots', /// 'AlwaysRequiresReboot', 'CanRequestReboot' /// The activity ID of the operation that /// produced this result. It is used to correlate across CRP and @@ -51,15 +51,14 @@ public VirtualMachineSoftwarePatchProperties() /// published this patch. /// The UTC timestamp of the last /// update to this patch record. - /// Describes the outcome of an install - /// operation for a given patch. Possible values include: 'Installed', - /// 'Failed', 'Excluded', 'NotSelected', 'Pending', 'Available' - public VirtualMachineSoftwarePatchProperties(string patchId = default(string), string name = default(string), string version = default(string), string kbid = default(string), IList classifications = default(IList), string rebootBehavior = default(string), string activityId = default(string), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? lastModifiedDateTime = default(System.DateTime?), string assessmentState = default(string)) + /// Describes the availability of a given + /// patch. Possible values include: 'Unknown', 'Available' + public VirtualMachineSoftwarePatchProperties(string patchId = default(string), string name = default(string), string version = default(string), string kbId = default(string), IList classifications = default(IList), string rebootBehavior = default(string), string activityId = default(string), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? lastModifiedDateTime = default(System.DateTime?), string assessmentState = default(string)) { PatchId = patchId; Name = name; Version = version; - Kbid = kbid; + KbId = kbId; Classifications = classifications; RebootBehavior = rebootBehavior; ActivityId = activityId; @@ -96,8 +95,8 @@ public VirtualMachineSoftwarePatchProperties() /// /// Gets the KBID of the patch. Only applies to Windows patches. /// - [JsonProperty(PropertyName = "kbid")] - public string Kbid { get; private set; } + [JsonProperty(PropertyName = "kbId")] + public string KbId { get; private set; } /// /// Gets the classification(s) of the patch as provided by the patch @@ -108,7 +107,7 @@ public VirtualMachineSoftwarePatchProperties() /// /// Gets describes the reboot requirements of the patch. Possible - /// values include: 'NeverReboots', 'AlwaysRequiresReboot', + /// values include: 'Unknown', 'NeverReboots', 'AlwaysRequiresReboot', /// 'CanRequestReboot' /// [JsonProperty(PropertyName = "rebootBehavior")] @@ -134,9 +133,8 @@ public VirtualMachineSoftwarePatchProperties() public System.DateTime? LastModifiedDateTime { get; private set; } /// - /// Gets describes the outcome of an install operation for a given - /// patch. Possible values include: 'Installed', 'Failed', 'Excluded', - /// 'NotSelected', 'Pending', 'Available' + /// Gets describes the availability of a given patch. Possible values + /// include: 'Unknown', 'Available' /// [JsonProperty(PropertyName = "assessmentState")] public string AssessmentState { get; private set; } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineUpdate.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineUpdate.cs index 5a4f79543b848..b91aa7a099bf6 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineUpdate.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineUpdate.cs @@ -135,10 +135,22 @@ public VirtualMachineUpdate() /// minutes and 120 minutes (inclusive) and should be specified in ISO /// 8601 format. The default value is 90 minutes (PT1H30M). /// <br><br> Minimum api-version: 2020-06-01 + /// Specifies the scale set logical + /// fault domain into which the Virtual Machine will be created. By + /// default, the Virtual Machine will by automatically assigned to a + /// fault domain that best maintains balance across available fault + /// domains.<br><li>This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.<li>The Virtual Machine Scale Set that is referenced, + /// must have 'platformFaultDomainCount' &gt; 1.<li>This + /// property cannot be updated once the Virtual Machine is + /// created.<li>Fault domain assignment can be viewed in the + /// Virtual Machine Instance View.<br><br>Minimum + /// api‐version: 2020‐12‐01 /// The identity of the virtual machine, if /// configured. /// The virtual machine zones. - public VirtualMachineUpdate(IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) + public VirtualMachineUpdate(IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) : base(tags) { Plan = plan; @@ -162,6 +174,7 @@ public VirtualMachineUpdate() LicenseType = licenseType; VmId = vmId; ExtensionsTimeBudget = extensionsTimeBudget; + PlatformFaultDomain = platformFaultDomain; Identity = identity; Zones = zones; CustomInit(); @@ -381,6 +394,24 @@ public VirtualMachineUpdate() [JsonProperty(PropertyName = "properties.extensionsTimeBudget")] public string ExtensionsTimeBudget { get; set; } + /// + /// Gets or sets specifies the scale set logical fault domain into + /// which the Virtual Machine will be created. By default, the Virtual + /// Machine will by automatically assigned to a fault domain that best + /// maintains balance across available fault + /// domains.&lt;br&gt;&lt;li&gt;This is applicable only + /// if the 'virtualMachineScaleSet' property of this Virtual Machine is + /// set.&lt;li&gt;The Virtual Machine Scale Set that is + /// referenced, must have 'platformFaultDomainCount' &amp;gt; + /// 1.&lt;li&gt;This property cannot be updated once the + /// Virtual Machine is created.&lt;li&gt;Fault domain + /// assignment can be viewed in the Virtual Machine Instance + /// View.&lt;br&gt;&lt;br&gt;Minimum api‐version: + /// 2020‐12‐01 + /// + [JsonProperty(PropertyName = "properties.platformFaultDomain")] + public int? PlatformFaultDomain { get; set; } + /// /// Gets or sets the identity of the virtual machine, if configured. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/WindowsConfiguration.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/WindowsConfiguration.cs index 615ddbafcfb60..809b8955c76a9 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/WindowsConfiguration.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/WindowsConfiguration.cs @@ -51,8 +51,8 @@ public WindowsConfiguration() /// Specifies additional /// base-64 encoded XML formatted information that can be included in /// the Unattend.xml file, which is used by Windows Setup. - /// Specifies settings related to in-guest - /// patching (KBs). + /// [Preview Feature] Specifies settings + /// related to VM Guest Patching on Windows. /// Specifies the Windows Remote Management /// listeners. This enables remote Windows PowerShell. public WindowsConfiguration(bool? provisionVMAgent = default(bool?), bool? enableAutomaticUpdates = default(bool?), string timeZone = default(string), IList additionalUnattendContent = default(IList), PatchSettings patchSettings = default(PatchSettings), WinRMConfiguration winRM = default(WinRMConfiguration)) @@ -112,7 +112,8 @@ public WindowsConfiguration() public IList AdditionalUnattendContent { get; set; } /// - /// Gets or sets specifies settings related to in-guest patching (KBs). + /// Gets or sets [Preview Feature] Specifies settings related to VM + /// Guest Patching on Windows. /// [JsonProperty(PropertyName = "patchSettings")] public PatchSettings PatchSettings { get; set; } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/WindowsParameters.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/WindowsParameters.cs new file mode 100644 index 0000000000000..230533edc19de --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/WindowsParameters.cs @@ -0,0 +1,97 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Input for InstallPatches on a Windows VM, as directly received by the + /// API + /// + public partial class WindowsParameters + { + /// + /// Initializes a new instance of the WindowsParameters class. + /// + public WindowsParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WindowsParameters class. + /// + /// The update classifications + /// to select when installing patches for Windows. + /// Kbs to include in the patch + /// operation + /// Kbs to exclude in the patch + /// operation + /// Filters out Kbs that don't + /// have an InstallationRebootBehavior of 'NeverReboots' when this is + /// set to true. + /// This is used to install patches + /// that were published on or before this given max published + /// date. + public WindowsParameters(IList classificationsToInclude = default(IList), IList kbNumbersToInclude = default(IList), IList kbNumbersToExclude = default(IList), bool? excludeKbsRequiringReboot = default(bool?), System.DateTime? maxPatchPublishDate = default(System.DateTime?)) + { + ClassificationsToInclude = classificationsToInclude; + KbNumbersToInclude = kbNumbersToInclude; + KbNumbersToExclude = kbNumbersToExclude; + ExcludeKbsRequiringReboot = excludeKbsRequiringReboot; + MaxPatchPublishDate = maxPatchPublishDate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the update classifications to select when installing + /// patches for Windows. + /// + [JsonProperty(PropertyName = "classificationsToInclude")] + public IList ClassificationsToInclude { get; set; } + + /// + /// Gets or sets kbs to include in the patch operation + /// + [JsonProperty(PropertyName = "kbNumbersToInclude")] + public IList KbNumbersToInclude { get; set; } + + /// + /// Gets or sets kbs to exclude in the patch operation + /// + [JsonProperty(PropertyName = "kbNumbersToExclude")] + public IList KbNumbersToExclude { get; set; } + + /// + /// Gets or sets filters out Kbs that don't have an + /// InstallationRebootBehavior of 'NeverReboots' when this is set to + /// true. + /// + [JsonProperty(PropertyName = "excludeKbsRequiringReboot")] + public bool? ExcludeKbsRequiringReboot { get; set; } + + /// + /// Gets or sets this is used to install patches that were published on + /// or before this given max published date. + /// + [JsonProperty(PropertyName = "maxPatchPublishDate")] + public System.DateTime? MaxPatchPublishDate { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InGuestPatchMode.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/WindowsVMGuestPatchMode.cs similarity index 86% rename from sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InGuestPatchMode.cs rename to sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/WindowsVMGuestPatchMode.cs index 42af3578b1533..e3c4970c7b0f3 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InGuestPatchMode.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/WindowsVMGuestPatchMode.cs @@ -12,9 +12,9 @@ namespace Microsoft.Azure.Management.Compute.Models { /// - /// Defines values for InGuestPatchMode. + /// Defines values for WindowsVMGuestPatchMode. /// - public static class InGuestPatchMode + public static class WindowsVMGuestPatchMode { public const string Manual = "Manual"; public const string AutomaticByOS = "AutomaticByOS"; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Operations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Operations.cs index 53367987b6678..3e58df5747bc1 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Operations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Operations.cs @@ -70,7 +70,7 @@ internal Operations(ComputeManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ProximityPlacementGroupsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ProximityPlacementGroupsOperations.cs index 6372cbdc612a4..5026ed7ba8236 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ProximityPlacementGroupsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ProximityPlacementGroupsOperations.cs @@ -105,7 +105,7 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -327,7 +327,7 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; ProximityPlacementGroupUpdate parameters = new ProximityPlacementGroupUpdate(); if (tags != null) { @@ -530,7 +530,7 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -710,7 +710,7 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -895,7 +895,7 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1078,7 +1078,7 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs index 6678215733f6c..0549a1c958e6a 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs @@ -19,55 +19,45 @@ public static IEnumerable> ApiInfo_ComputeManageme { return new Tuple[] { - new Tuple("Compute", "AvailabilitySets", "2020-06-01"), - new Tuple("Compute", "CloudServiceRoleInstances", "2020-10-01-preview"), - new Tuple("Compute", "CloudServiceRoles", "2020-10-01-preview"), - new Tuple("Compute", "CloudServices", "2020-10-01-preview"), - new Tuple("Compute", "CloudServicesUpdateDomain", "2020-10-01-preview"), - new Tuple("Compute", "DedicatedHostGroups", "2020-06-01"), - new Tuple("Compute", "DedicatedHosts", "2020-06-01"), + new Tuple("Compute", "AvailabilitySets", "2020-12-01"), + new Tuple("Compute", "DedicatedHostGroups", "2020-12-01"), + new Tuple("Compute", "DedicatedHosts", "2020-12-01"), new Tuple("Compute", "DiskAccesses", "2020-09-30"), new Tuple("Compute", "DiskEncryptionSets", "2020-09-30"), new Tuple("Compute", "DiskRestorePoint", "2020-09-30"), new Tuple("Compute", "Disks", "2020-09-30"), - new Tuple("Compute", "Galleries", "2019-12-01"), - new Tuple("Compute", "GalleryApplicationVersions", "2019-12-01"), - new Tuple("Compute", "GalleryApplications", "2019-12-01"), - new Tuple("Compute", "GalleryImageVersions", "2019-12-01"), - new Tuple("Compute", "GalleryImages", "2019-12-01"), - new Tuple("Compute", "Images", "2020-06-01"), - new Tuple("Compute", "LogAnalytics", "2020-06-01"), - new Tuple("Compute", "Operations", "2020-06-01"), - new Tuple("Compute", "ProximityPlacementGroups", "2020-06-01"), + new Tuple("Compute", "Galleries", "2020-09-30"), + new Tuple("Compute", "GalleryApplicationVersions", "2020-09-30"), + new Tuple("Compute", "GalleryApplications", "2020-09-30"), + new Tuple("Compute", "GalleryImageVersions", "2020-09-30"), + new Tuple("Compute", "GalleryImages", "2020-09-30"), + new Tuple("Compute", "GallerySharingProfile", "2020-09-30"), + new Tuple("Compute", "Images", "2020-12-01"), + new Tuple("Compute", "LogAnalytics", "2020-12-01"), + new Tuple("Compute", "Operations", "2020-12-01"), + new Tuple("Compute", "ProximityPlacementGroups", "2020-12-01"), new Tuple("Compute", "ResourceSkus", "2019-04-01"), + new Tuple("Compute", "SharedGalleries", "2020-09-30"), + new Tuple("Compute", "SharedGalleryImageVersions", "2020-09-30"), + new Tuple("Compute", "SharedGalleryImages", "2020-09-30"), new Tuple("Compute", "Snapshots", "2020-09-30"), - new Tuple("Compute", "SshPublicKeys", "2020-06-01"), - new Tuple("Compute", "Usage", "2020-06-01"), - new Tuple("Compute", "VirtualMachineExtensionImages", "2020-06-01"), - new Tuple("Compute", "VirtualMachineExtensions", "2020-06-01"), - new Tuple("Compute", "VirtualMachineImages", "2020-06-01"), - new Tuple("Compute", "VirtualMachineRunCommands", "2020-06-01"), - new Tuple("Compute", "VirtualMachineScaleSetExtensions", "2020-06-01"), - new Tuple("Compute", "VirtualMachineScaleSetRollingUpgrades", "2020-06-01"), - new Tuple("Compute", "VirtualMachineScaleSetVMExtensions", "2020-06-01"), - new Tuple("Compute", "VirtualMachineScaleSetVMRunCommands", "2020-06-01"), - new Tuple("Compute", "VirtualMachineScaleSetVMs", "2020-06-01"), - new Tuple("Compute", "VirtualMachineScaleSets", "2020-06-01"), - new Tuple("Compute", "VirtualMachineSizes", "2020-06-01"), - new Tuple("Compute", "VirtualMachines", "2020-06-01"), - new Tuple("ContainerService", "ContainerServices", "2017-01-31"), + new Tuple("Compute", "SshPublicKeys", "2020-12-01"), + new Tuple("Compute", "Usage", "2020-12-01"), + new Tuple("Compute", "VirtualMachineExtensionImages", "2020-12-01"), + new Tuple("Compute", "VirtualMachineExtensions", "2020-12-01"), + new Tuple("Compute", "VirtualMachineImages", "2020-12-01"), + new Tuple("Compute", "VirtualMachineImagesEdgeZone", "2020-12-01"), + new Tuple("Compute", "VirtualMachineRunCommands", "2020-12-01"), + new Tuple("Compute", "VirtualMachineScaleSetExtensions", "2020-12-01"), + new Tuple("Compute", "VirtualMachineScaleSetRollingUpgrades", "2020-12-01"), + new Tuple("Compute", "VirtualMachineScaleSetVMExtensions", "2020-12-01"), + new Tuple("Compute", "VirtualMachineScaleSetVMRunCommands", "2020-12-01"), + new Tuple("Compute", "VirtualMachineScaleSetVMs", "2020-12-01"), + new Tuple("Compute", "VirtualMachineScaleSets", "2020-12-01"), + new Tuple("Compute", "VirtualMachineSizes", "2020-12-01"), + new Tuple("Compute", "VirtualMachines", "2020-12-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "a35bddecf81df1a1a3030dbaee0b73c777aeb0db"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SshPublicKeysOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SshPublicKeysOperations.cs index bfb79ef0f201d..9897a18878eb1 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SshPublicKeysOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SshPublicKeysOperations.cs @@ -81,7 +81,7 @@ internal SshPublicKeysOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -265,7 +265,7 @@ internal SshPublicKeysOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -468,7 +468,7 @@ internal SshPublicKeysOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -694,7 +694,7 @@ internal SshPublicKeysOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -892,7 +892,7 @@ internal SshPublicKeysOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1068,7 +1068,7 @@ internal SshPublicKeysOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1265,7 +1265,7 @@ internal SshPublicKeysOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/UsageOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/UsageOperations.cs index 03b03c068a012..e0c198b712e83 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/UsageOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/UsageOperations.cs @@ -96,7 +96,7 @@ internal UsageOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineExtensionImagesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineExtensionImagesOperations.cs index 61a6ba57f579f..214564a54e88a 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineExtensionImagesOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineExtensionImagesOperations.cs @@ -106,7 +106,7 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -303,7 +303,7 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -505,7 +505,7 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineExtensionsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineExtensionsOperations.cs index 0d80e4c732e61..8e20e220f5350 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineExtensionsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineExtensionsOperations.cs @@ -186,7 +186,7 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -390,7 +390,7 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -608,7 +608,7 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -843,7 +843,7 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1050,7 +1050,7 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ContainerServicesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineImagesEdgeZoneOperations.cs similarity index 59% rename from sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ContainerServicesOperations.cs rename to sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineImagesEdgeZoneOperations.cs index 2a997351885a6..b4f675fffcaff 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ContainerServicesOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineImagesEdgeZoneOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Compute using System.Threading.Tasks; /// - /// ContainerServicesOperations operations. + /// VirtualMachineImagesEdgeZoneOperations operations. /// - internal partial class ContainerServicesOperations : IServiceOperations, IContainerServicesOperations + internal partial class VirtualMachineImagesEdgeZoneOperations : IServiceOperations, IVirtualMachineImagesEdgeZoneOperations { /// - /// Initializes a new instance of the ContainerServicesOperations class. + /// Initializes a new instance of the VirtualMachineImagesEdgeZoneOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class ContainerServicesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ContainerServicesOperations(ComputeManagementClient client) + internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) { if (client == null) { @@ -51,14 +51,26 @@ internal ContainerServicesOperations(ComputeManagementClient client) public ComputeManagementClient Client { get; private set; } /// - /// Gets a list of container services in the specified subscription. + /// Gets a virtual machine image in an edge zone. /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// A valid image SKU version. + /// /// /// Headers that will be added to request. /// @@ -80,13 +92,37 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, string skus, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (edgeZone == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "edgeZone"); + } + if (publisherName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + } + if (offer == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "offer"); + } + if (skus == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "skus"); + } + if (version == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "version"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-01-31"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -94,13 +130,25 @@ internal ContainerServicesOperations(ComputeManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("edgeZone", edgeZone); + tracingParameters.Add("publisherName", publisherName); + tracingParameters.Add("offer", offer); + tracingParameters.Add("skus", skus); + tracingParameters.Add("version", version); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{edgeZone}", System.Uri.EscapeDataString(edgeZone)); + _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); + _url = _url.Replace("{offer}", System.Uri.EscapeDataString(offer)); + _url = _url.Replace("{skus}", System.Uri.EscapeDataString(skus)); + _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -200,7 +248,7 @@ internal ContainerServicesOperations(ComputeManagementClient 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")) @@ -213,7 +261,7 @@ internal ContainerServicesOperations(ComputeManagementClient 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) { @@ -233,50 +281,33 @@ internal ContainerServicesOperations(ComputeManagementClient client) } /// - /// Creates or updates a container service. + /// Gets a list of all virtual machine image versions for the specified + /// location, edge zone, publisher, offer, and SKU. /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The name of the resource group. + /// + /// The name of a supported Azure region. /// - /// - /// The name of the container service in the specified subscription and - /// resource group. + /// + /// The name of the edge zone. /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. + /// + /// A valid image publisher. /// - /// - /// The headers that will be added to request. + /// + /// A valid image publisher offer. /// - /// - /// The cancellation token. + /// + /// A valid image SKU. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, ContainerService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, containerServiceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the properties of the specified container service. - /// - /// - /// Gets the properties of the specified container service in the specified - /// subscription and resource group. The operation returns the properties - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The name of the resource group. + /// + /// The expand expression to apply on the operation. + /// + /// + /// An integer value specifying the number of images to return that matches + /// supplied values. /// - /// - /// The name of the container service in the specified subscription and - /// resource group. + /// + /// Specifies the order of the results returned. Formatted as an OData query. /// /// /// Headers that will be added to request. @@ -299,21 +330,33 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - if (containerServiceName == null) + if (edgeZone == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "containerServiceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "edgeZone"); + } + if (publisherName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + } + if (offer == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "offer"); + } + if (skus == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "skus"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-01-31"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,19 +364,40 @@ internal ContainerServicesOperations(ComputeManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("containerServiceName", containerServiceName); + tracingParameters.Add("location", location); + tracingParameters.Add("edgeZone", edgeZone); + tracingParameters.Add("publisherName", publisherName); + tracingParameters.Add("offer", offer); + tracingParameters.Add("skus", skus); + tracingParameters.Add("expand", expand); + tracingParameters.Add("top", top); + tracingParameters.Add("orderby", orderby); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{containerServiceName}", System.Uri.EscapeDataString(containerServiceName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{edgeZone}", System.Uri.EscapeDataString(edgeZone)); + _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); + _url = _url.Replace("{offer}", System.Uri.EscapeDataString(offer)); + _url = _url.Replace("{skus}", System.Uri.EscapeDataString(skus)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -431,7 +495,7 @@ internal ContainerServicesOperations(ComputeManagementClient 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")) @@ -444,7 +508,7 @@ internal ContainerServicesOperations(ComputeManagementClient 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) { @@ -464,47 +528,17 @@ internal ContainerServicesOperations(ComputeManagementClient client) } /// - /// Deletes the specified container service. + /// Gets a list of virtual machine image offers for the specified location, + /// edge zone and publisher. /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The name of the resource group. + /// + /// The name of a supported Azure region. /// - /// - /// The name of the container service in the specified subscription and - /// resource group. + /// + /// The name of the edge zone. /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, containerServiceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The name of the resource group. + /// + /// A valid image publisher. /// /// /// Headers that will be added to request. @@ -527,17 +561,25 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListOffersWithHttpMessagesAsync(string location, string edgeZone, string publisherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (edgeZone == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "edgeZone"); + } + if (publisherName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-01-31"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -545,15 +587,19 @@ internal ContainerServicesOperations(ComputeManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("location", location); + tracingParameters.Add("edgeZone", edgeZone); + tracingParameters.Add("publisherName", publisherName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListOffers", 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.ContainerService/containerServices").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{edgeZone}", System.Uri.EscapeDataString(edgeZone)); + _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -653,7 +699,7 @@ internal ContainerServicesOperations(ComputeManagementClient 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")) @@ -666,7 +712,7 @@ internal ContainerServicesOperations(ComputeManagementClient 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) { @@ -686,21 +732,14 @@ internal ContainerServicesOperations(ComputeManagementClient client) } /// - /// Creates or updates a container service. + /// Gets a list of virtual machine image publishers for the specified Azure + /// location and edge zone. /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. + /// + /// The name of a supported Azure region. /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. + /// + /// The name of the edge zone. /// /// /// Headers that will be added to request. @@ -723,29 +762,21 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, ContainerService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPublishersWithHttpMessagesAsync(string location, string edgeZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - if (containerServiceName == null) + if (edgeZone == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "containerServiceName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "edgeZone"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-01-31"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -753,18 +784,17 @@ internal ContainerServicesOperations(ComputeManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("containerServiceName", containerServiceName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("location", location); + tracingParameters.Add("edgeZone", edgeZone); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublishers", 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.ContainerService/containerServices/{containerServiceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{containerServiceName}", System.Uri.EscapeDataString(containerServiceName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{edgeZone}", System.Uri.EscapeDataString(edgeZone)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -778,7 +808,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -809,12 +839,6 @@ internal ContainerServicesOperations(ComputeManagementClient 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) { @@ -835,7 +859,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -870,7 +894,7 @@ internal ContainerServicesOperations(ComputeManagementClient 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")) @@ -883,43 +907,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _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) { @@ -939,198 +927,20 @@ internal ContainerServicesOperations(ComputeManagementClient client) } /// - /// Deletes the specified container service. + /// Gets a list of virtual machine image SKUs for the specified location, edge + /// zone, publisher, and offer. /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The name of the resource group. + /// + /// The name of a supported Azure region. /// - /// - /// The name of the container service in the specified subscription and - /// resource group. + /// + /// The name of the edge zone. /// - /// - /// Headers that will be added to request. + /// + /// A valid image publisher. /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (containerServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "containerServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2017-01-31"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("containerServiceName", containerServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{containerServiceName}", System.Uri.EscapeDataString(containerServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// A valid image publisher offer. /// /// /// Headers that will be added to request. @@ -1153,191 +963,29 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSkusWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) + if (edgeZone == null) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + throw new ValidationException(ValidationRules.CannotBeNull, "edgeZone"); } - // 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 (publisherName == null) { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); } - - - if (customHeaders != null) + if (offer == 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); + throw new ValidationException(ValidationRules.CannotBeNull, "offer"); } - 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 a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1345,14 +993,27 @@ internal ContainerServicesOperations(ComputeManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("location", location); + tracingParameters.Add("edgeZone", edgeZone); + tracingParameters.Add("publisherName", publisherName); + tracingParameters.Add("offer", offer); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSkus", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{edgeZone}", System.Uri.EscapeDataString(edgeZone)); + _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); + _url = _url.Replace("{offer}", System.Uri.EscapeDataString(offer)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -1446,7 +1107,7 @@ internal ContainerServicesOperations(ComputeManagementClient 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")) @@ -1459,7 +1120,7 @@ internal ContainerServicesOperations(ComputeManagementClient 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) { diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineImagesEdgeZoneOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineImagesEdgeZoneOperationsExtensions.cs new file mode 100644 index 0000000000000..b7c0df8deb58f --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineImagesEdgeZoneOperationsExtensions.cs @@ -0,0 +1,315 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for VirtualMachineImagesEdgeZoneOperations. + /// + public static partial class VirtualMachineImagesEdgeZoneOperationsExtensions + { + /// + /// Gets a virtual machine image in an edge zone. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// A valid image SKU version. + /// + public static VirtualMachineImage Get(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, string skus, string version) + { + return operations.GetAsync(location, edgeZone, publisherName, offer, skus, version).GetAwaiter().GetResult(); + } + + /// + /// Gets a virtual machine image in an edge zone. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// A valid image SKU version. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, string skus, string version, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, edgeZone, publisherName, offer, skus, version, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of all virtual machine image versions for the specified + /// location, edge zone, publisher, offer, and SKU. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// An integer value specifying the number of images to return that matches + /// supplied values. + /// + /// + /// Specifies the order of the results returned. Formatted as an OData query. + /// + public static IList List(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string)) + { + return operations.ListAsync(location, edgeZone, publisherName, offer, skus, expand, top, orderby).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all virtual machine image versions for the specified + /// location, edge zone, publisher, offer, and SKU. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// An integer value specifying the number of images to return that matches + /// supplied values. + /// + /// + /// Specifies the order of the results returned. Formatted as an OData query. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, edgeZone, publisherName, offer, skus, expand, top, orderby, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of virtual machine image offers for the specified location, + /// edge zone and publisher. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + public static IList ListOffers(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName) + { + return operations.ListOffersAsync(location, edgeZone, publisherName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of virtual machine image offers for the specified location, + /// edge zone and publisher. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// The cancellation token. + /// + public static async Task> ListOffersAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOffersWithHttpMessagesAsync(location, edgeZone, publisherName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of virtual machine image publishers for the specified Azure + /// location and edge zone. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + public static IList ListPublishers(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone) + { + return operations.ListPublishersAsync(location, edgeZone).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of virtual machine image publishers for the specified Azure + /// location and edge zone. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// The cancellation token. + /// + public static async Task> ListPublishersAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListPublishersWithHttpMessagesAsync(location, edgeZone, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of virtual machine image SKUs for the specified location, edge + /// zone, publisher, and offer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + public static IList ListSkus(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer) + { + return operations.ListSkusAsync(location, edgeZone, publisherName, offer).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of virtual machine image SKUs for the specified location, edge + /// zone, publisher, and offer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// The cancellation token. + /// + public static async Task> ListSkusAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSkusWithHttpMessagesAsync(location, edgeZone, publisherName, offer, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineImagesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineImagesOperations.cs index 3310becdc2ae0..c5580e85ffac1 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineImagesOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineImagesOperations.cs @@ -115,7 +115,7 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -337,7 +337,7 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -739,7 +739,7 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -939,7 +939,7 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineRunCommandsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineRunCommandsOperations.cs index faf49cb6233f6..92eefae7737ca 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineRunCommandsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineRunCommandsOperations.cs @@ -94,7 +94,7 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -293,7 +293,7 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -579,7 +579,7 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -783,7 +783,7 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1001,7 +1001,7 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1236,7 +1236,7 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1443,7 +1443,7 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetExtensionsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetExtensionsOperations.cs index a84c409c13938..597afb7122f8c 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetExtensionsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetExtensionsOperations.cs @@ -186,7 +186,7 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -387,7 +387,7 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -596,7 +596,7 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -831,7 +831,7 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1056,7 +1056,7 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetRollingUpgradesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetRollingUpgradesOperations.cs index 4259bf51041bc..6ad75c560b4cf 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetRollingUpgradesOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetRollingUpgradesOperations.cs @@ -164,7 +164,7 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -355,7 +355,7 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -530,7 +530,7 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -705,7 +705,7 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMExtensionsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMExtensionsOperations.cs index 0447703927e21..c9e8eba487427 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMExtensionsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMExtensionsOperations.cs @@ -201,7 +201,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -415,7 +415,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -637,7 +637,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -881,7 +881,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1097,7 +1097,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMRunCommandsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMRunCommandsOperations.cs index ad9e635116835..fa0fd3d5f8556 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMRunCommandsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMRunCommandsOperations.cs @@ -201,7 +201,7 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -415,7 +415,7 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -641,7 +641,7 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -885,7 +885,7 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1101,7 +1101,7 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMsOperations.cs index 7a513780a284c..496e00e7def5c 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMsOperations.cs @@ -177,16 +177,20 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The instance ID of the virtual machine. /// + /// + /// Optional parameter to force delete a virtual machine from a VM scale set. + /// (Feature in Preview) + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -245,7 +249,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -453,7 +457,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -656,7 +660,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -985,7 +989,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1216,7 +1220,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1432,7 +1436,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters); if (tempDisk != null) { @@ -1628,7 +1632,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1813,7 +1817,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2010,7 +2014,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2199,6 +2203,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The instance ID of the virtual machine. /// + /// + /// Optional parameter to force delete a virtual machine from a VM scale set. + /// (Feature in Preview) + /// /// /// Headers that will be added to request. /// @@ -2217,7 +2225,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2235,7 +2243,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2246,6 +2254,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("forceDeletion", forceDeletion); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); @@ -2258,6 +2267,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (forceDeletion != null) + { + _queryParameters.Add(string.Format("forceDeletion={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDeletion, Client.SerializationSettings).Trim('"')))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2424,7 +2437,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2611,7 +2624,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2793,7 +2806,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2976,7 +2989,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3158,7 +3171,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3354,7 +3367,7 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMsOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMsOperationsExtensions.cs index 41dc7e73a6056..888c670a294fa 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMsOperationsExtensions.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMsOperationsExtensions.cs @@ -240,9 +240,13 @@ public static VirtualMachineScaleSetVM Update(this IVirtualMachineScaleSetVMsOpe /// /// The instance ID of the virtual machine. /// - public static void Delete(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + /// + /// Optional parameter to force delete a virtual machine from a VM scale set. + /// (Feature in Preview) + /// + public static void Delete(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?)) { - operations.DeleteAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion).GetAwaiter().GetResult(); } /// @@ -260,12 +264,16 @@ public static void Delete(this IVirtualMachineScaleSetVMsOperations operations, /// /// The instance ID of the virtual machine. /// + /// + /// Optional parameter to force delete a virtual machine from a VM scale set. + /// (Feature in Preview) + /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -1026,9 +1034,13 @@ public static VirtualMachineScaleSetVM BeginUpdate(this IVirtualMachineScaleSetV /// /// The instance ID of the virtual machine. /// - public static void BeginDelete(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + /// + /// Optional parameter to force delete a virtual machine from a VM scale set. + /// (Feature in Preview) + /// + public static void BeginDelete(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?)) { - operations.BeginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + operations.BeginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion).GetAwaiter().GetResult(); } /// @@ -1046,12 +1058,16 @@ public static void BeginDelete(this IVirtualMachineScaleSetVMsOperations operati /// /// The instance ID of the virtual machine. /// + /// + /// Optional parameter to force delete a virtual machine from a VM scale set. + /// (Feature in Preview) + /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetsOperations.cs index f1a9b826a5f73..b0287372faf8b 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetsOperations.cs @@ -50,6 +50,199 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// public ComputeManagementClient Client { get; private set; } + /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified location. + /// + /// + /// The location for which VM scale sets under the subscription are queried. + /// + /// + /// 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>> ListByLocationWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-12-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByLocation", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Create or update a VM scale set. /// @@ -109,16 +302,19 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The name of the VM scale set. /// + /// + /// Optional parameter to force delete a VM scale set. (Feature in Preview) + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, forceDeletion, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -166,7 +362,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -357,16 +553,20 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The virtual machine scale set instance ids. /// + /// + /// Optional parameter to force delete virtual machines from the VM scale set. + /// (Feature in Preview) + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginDeleteInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -414,7 +614,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -601,7 +801,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -782,7 +982,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -973,7 +1173,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1167,7 +1367,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1592,7 +1792,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1792,7 +1992,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; VMScaleSetConvertToSinglePlacementGroupInput parameters = new VMScaleSetConvertToSinglePlacementGroupInput(); if (activePlacementGroupId != null) { @@ -2016,7 +2216,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2242,7 +2442,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2408,6 +2608,9 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The name of the VM scale set. /// + /// + /// Optional parameter to force delete a VM scale set. (Feature in Preview) + /// /// /// Headers that will be added to request. /// @@ -2426,7 +2629,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2440,7 +2643,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2450,6 +2653,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("forceDeletion", forceDeletion); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); @@ -2461,6 +2665,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (forceDeletion != null) + { + _queryParameters.Add(string.Format("forceDeletion={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDeletion, Client.SerializationSettings).Trim('"')))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2620,7 +2828,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { @@ -2777,6 +2985,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The virtual machine scale set instance ids. /// + /// + /// Optional parameter to force delete virtual machines from the VM scale set. + /// (Feature in Preview) + /// /// /// Headers that will be added to request. /// @@ -2795,7 +3007,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2813,7 +3025,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceIds"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); if (instanceIds != null) { @@ -2828,6 +3040,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("forceDeletion", forceDeletion); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vmInstanceIDs", vmInstanceIDs); tracingParameters.Add("cancellationToken", cancellationToken); @@ -2840,6 +3053,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (forceDeletion != null) + { + _queryParameters.Add(string.Format("forceDeletion={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDeletion, Client.SerializationSettings).Trim('"')))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3010,7 +3227,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { @@ -3206,7 +3423,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { @@ -3397,7 +3614,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { @@ -3589,7 +3806,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { @@ -3783,7 +4000,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { @@ -3977,7 +4194,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceIds"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); if (instanceIds != null) { @@ -4167,7 +4384,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4353,7 +4570,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); if (instanceIds != null) { @@ -4550,7 +4767,7 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4689,6 +4906,180 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) return _result; } + /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified 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>> ListByLocationNextWithHttpMessagesAsync(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, "ListByLocationNext", 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 a list of all VM scale sets under a resource group. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetsOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetsOperationsExtensions.cs index d4f6d015812f7..ae311ab9e0c50 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetsOperationsExtensions.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetsOperationsExtensions.cs @@ -23,6 +23,42 @@ namespace Microsoft.Azure.Management.Compute /// public static partial class VirtualMachineScaleSetsOperationsExtensions { + /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for which VM scale sets under the subscription are queried. + /// + public static IPage ListByLocation(this IVirtualMachineScaleSetsOperations operations, string location) + { + return operations.ListByLocationAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for which VM scale sets under the subscription are queried. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByLocationAsync(this IVirtualMachineScaleSetsOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByLocationWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Create or update a VM scale set. /// @@ -127,9 +163,12 @@ public static VirtualMachineScaleSet Update(this IVirtualMachineScaleSetsOperati /// /// The name of the VM scale set. /// - public static void Delete(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName) + /// + /// Optional parameter to force delete a VM scale set. (Feature in Preview) + /// + public static void Delete(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?)) { - operations.DeleteAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, vmScaleSetName, forceDeletion).GetAwaiter().GetResult(); } /// @@ -144,12 +183,15 @@ public static void Delete(this IVirtualMachineScaleSetsOperations operations, st /// /// The name of the VM scale set. /// + /// + /// Optional parameter to force delete a VM scale set. (Feature in Preview) + /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -258,9 +300,13 @@ public static VirtualMachineScaleSet Get(this IVirtualMachineScaleSetsOperations /// /// The virtual machine scale set instance ids. /// - public static void DeleteInstances(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds) + /// + /// Optional parameter to force delete virtual machines from the VM scale set. + /// (Feature in Preview) + /// + public static void DeleteInstances(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?)) { - operations.DeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + operations.DeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion).GetAwaiter().GetResult(); } /// @@ -278,12 +324,16 @@ public static void DeleteInstances(this IVirtualMachineScaleSetsOperations opera /// /// The virtual machine scale set instance ids. /// + /// + /// Optional parameter to force delete virtual machines from the VM scale set. + /// (Feature in Preview) + /// /// /// The cancellation token. /// - public static async Task DeleteInstancesAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteInstancesAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -1120,9 +1170,12 @@ public static VirtualMachineScaleSet BeginUpdate(this IVirtualMachineScaleSetsOp /// /// The name of the VM scale set. /// - public static void BeginDelete(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName) + /// + /// Optional parameter to force delete a VM scale set. (Feature in Preview) + /// + public static void BeginDelete(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?)) { - operations.BeginDeleteAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + operations.BeginDeleteAsync(resourceGroupName, vmScaleSetName, forceDeletion).GetAwaiter().GetResult(); } /// @@ -1137,12 +1190,15 @@ public static void BeginDelete(this IVirtualMachineScaleSetsOperations operation /// /// The name of the VM scale set. /// + /// + /// Optional parameter to force delete a VM scale set. (Feature in Preview) + /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -1211,9 +1267,13 @@ public static void BeginDelete(this IVirtualMachineScaleSetsOperations operation /// /// The virtual machine scale set instance ids. /// - public static void BeginDeleteInstances(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds) + /// + /// Optional parameter to force delete virtual machines from the VM scale set. + /// (Feature in Preview) + /// + public static void BeginDeleteInstances(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?)) { - operations.BeginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + operations.BeginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion).GetAwaiter().GetResult(); } /// @@ -1231,12 +1291,16 @@ public static void BeginDeleteInstances(this IVirtualMachineScaleSetsOperations /// /// The virtual machine scale set instance ids. /// + /// + /// Optional parameter to force delete virtual machines from the VM scale set. + /// (Feature in Preview) + /// /// /// The cancellation token. /// - public static async Task BeginDeleteInstancesAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteInstancesAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.BeginDeleteInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -1680,6 +1744,42 @@ public static void BeginSetOrchestrationServiceState(this IVirtualMachineScaleSe (await operations.BeginSetOrchestrationServiceStateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByLocationNext(this IVirtualMachineScaleSetsOperations operations, string nextPageLink) + { + return operations.ListByLocationNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified 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> ListByLocationNextAsync(this IVirtualMachineScaleSetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByLocationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a list of all VM scale sets under a resource group. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineSizesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineSizesOperations.cs index 92ec0f79c93e0..11ae9680fcb11 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineSizesOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineSizesOperations.cs @@ -95,7 +95,7 @@ internal VirtualMachineSizesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperations.cs index 6c241ff79b1ec..e722b9908b881 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperations.cs @@ -95,7 +95,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -394,7 +394,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -593,7 +593,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -836,7 +836,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1006,7 +1006,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1189,7 +1189,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1385,7 +1385,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1731,7 +1731,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1949,7 +1949,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2103,6 +2103,31 @@ internal VirtualMachinesOperations(ComputeManagementClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Installs patches on the VM. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Input for InstallPatches as directly received by the API + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> InstallPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginInstallPatchesWithHttpMessagesAsync(resourceGroupName, vmName, installPatchesInput, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Run command on the VM. /// @@ -2184,7 +2209,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2397,7 +2422,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2623,7 +2648,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2713,7 +2738,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2773,24 +2798,6 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -2842,7 +2849,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3021,7 +3028,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3195,7 +3202,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3375,7 +3382,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3553,7 +3560,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3726,7 +3733,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3899,7 +3906,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4073,7 +4080,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4252,7 +4259,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters); if (tempDisk != null) { @@ -4438,7 +4445,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4614,7 +4621,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4764,6 +4771,218 @@ internal VirtualMachinesOperations(ComputeManagementClient client) return _result; } + /// + /// Installs patches on the VM. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Input for InstallPatches as directly received by the API + /// + /// + /// 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> BeginInstallPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (vmName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + } + if (installPatchesInput == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "installPatchesInput"); + } + if (installPatchesInput != null) + { + installPatchesInput.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-12-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vmName", vmName); + tracingParameters.Add("installPatchesInput", installPatchesInput); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginInstallPatches", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("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(installPatchesInput != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(installPatchesInput, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Run command on the VM. /// @@ -4819,7 +5038,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-06-01"; + string apiVersion = "2020-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperationsExtensions.cs index ff38e874b9816..1c7bc104a93cf 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperationsExtensions.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperationsExtensions.cs @@ -993,6 +993,52 @@ public static VirtualMachineAssessPatchesResult AssessPatches(this IVirtualMachi } } + /// + /// Installs patches on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Input for InstallPatches as directly received by the API + /// + public static VirtualMachineInstallPatchesResult InstallPatches(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput) + { + return operations.InstallPatchesAsync(resourceGroupName, vmName, installPatchesInput).GetAwaiter().GetResult(); + } + + /// + /// Installs patches on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Input for InstallPatches as directly received by the API + /// + /// + /// The cancellation token. + /// + public static async Task InstallPatchesAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.InstallPatchesWithHttpMessagesAsync(resourceGroupName, vmName, installPatchesInput, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Run command on the VM. /// @@ -1629,6 +1675,52 @@ public static VirtualMachineAssessPatchesResult BeginAssessPatches(this IVirtual } } + /// + /// Installs patches on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Input for InstallPatches as directly received by the API + /// + public static VirtualMachineInstallPatchesResult BeginInstallPatches(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput) + { + return operations.BeginInstallPatchesAsync(resourceGroupName, vmName, installPatchesInput).GetAwaiter().GetResult(); + } + + /// + /// Installs patches on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Input for InstallPatches as directly received by the API + /// + /// + /// The cancellation token. + /// + public static async Task BeginInstallPatchesAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginInstallPatchesWithHttpMessagesAsync(resourceGroupName, vmName, installPatchesInput, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Run command on the VM. ///