Skip to content

Commit

Permalink
Update for Compute 2021-11-01 version (#26370)
Browse files Browse the repository at this point in the history
* update with api version 2021-11-01

* update with api version 2021-11-01

* update virtualmachine to virtualMachine in swagger

* update test to preserve resource group until finally block

* test updates and new recordings

* update from swagger sync

* Added SDK changes for scaling VMSS with PublicIpPrefix (patch updates) (#26031)

* Add RepairAction property to VMSS AutoRepairs feature (#25095)

* Add RepairAction property to VMSS AutoRepairs feature

* Include metadata file

* Add session record and updated test

* Update TestVMScaleSetScenarioOperations_OrchestrationService.json

* Restore files that shouldn't have been changed

* Add orchestration service record

* Delete compute_resource-manager.txt

Co-authored-by: Theodore Chang <thchan@microsoft.com>

* sdk gen (#25670)

Co-authored-by: Chase Van Buskirk <cvanbuskirk@microsoft.com>

* Added sdk changes for vmss vm customization (#25785)

* Added sdk changes for vmss vm customization

* Added sdk changes for vmss vm customization

* init (#25620)

Co-authored-by: Theodore Chang <thchan@microsoft.com>

* Initial commit (#25383)

* SDK changes for CVM for api-version 2021-11-01 (#25645)

* sdk changes for CVM

* save changes for securityType and diskSecurityprofile

Add PMK scenario

* Added recorded file

* DedicatedHost Reboot Feature SDK (#25258)

* ran autorest on azure-rest-api-specs after adding dhreboot to compute.json

* ran autorest again, since i made some swagger changes

* created test

* renamed reboot to restart

* updated swagger, and ran the generate command again to update the sdk

* restart test passing. Added recorded test as well

* rebuilt sdk with async=true, removed unnecessary line in test, and reran test after change

* Adding the new paramaters zone/placementGroupId to ForceRecoveryServiceFabricPlatformUpdateDomainWalk (#25897)

* add filter for List VMSS operations  (#25802)

* fdsaf

* generated change

* Adding VMScaleSet Flex Filter Test

* Update generate.ps1

* add recording

Co-authored-by: LexieXie <lexiexie@microsoft.com>
Co-authored-by: xielexie <94083876+xielexie@users.noreply.github.com>

* add customizations

* fix errors

* regenerated from master

* fix customization

* fix customization

* fix a test

* new test recordings

* change version name

* remove unnecessary variable

* update recording test

* fix changes

Co-authored-by: karthikka4820 <88366202+karthikka4820@users.noreply.github.com>
Co-authored-by: frank-pang-msft <92764154+frank-pang-msft@users.noreply.github.com>
Co-authored-by: Chase VanBuskirk <chasevanb@gmail.com>
Co-authored-by: Chase Van Buskirk <cvanbuskirk@microsoft.com>
Co-authored-by: Raktima Das <raktdas@microsoft.com>
Co-authored-by: kamusta-msft <56413142+kamusta-msft@users.noreply.github.com>
Co-authored-by: sukodava <78733210+sukodava@users.noreply.github.com>
Co-authored-by: ms-saypaul <67093296+ms-saypaul@users.noreply.github.com>
Co-authored-by: vbhasker-msft <93355049+vbhasker-msft@users.noreply.github.com>
Co-authored-by: avjai <34567499+avjai@users.noreply.github.com>
Co-authored-by: LexieXie <lexiexie@microsoft.com>
Co-authored-by: xielexie <94083876+xielexie@users.noreply.github.com>
  • Loading branch information
13 people authored Jan 27, 2022
1 parent 240cfa9 commit 6e05fea
Show file tree
Hide file tree
Showing 250 changed files with 156,278 additions and 121,024 deletions.
4 changes: 2 additions & 2 deletions eng/mgmt/mgmtmetadata/compute_resource-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ Generating CSharp code
Executing AutoRest command
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:\work\azure-sdk-for-net\sdk
Autorest CSharp Version: 2.3.82
2021-09-09 19:16:30 UTC
2021-10-20 19:24:00 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: ccc4906c1184d674b8bbd2710643d7c9e167a6f4
Commit: c4a86872d4f2297597260c5968d2f50a0298db01
AutoRest information
Requested version: v2
Bootstrapper version: autorest@2.0.4413
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--This file and it's contents are updated at build time moving or editing might result in build failure. Take due deligence while editing this file-->
<PropertyGroup>
<AzureApiTag>Compute_2021-08-01;Compute_2021-07-01;Compute_2021-04-01;Compute_2021-03-01;Compute_2020-12-01;Compute_2020-06-30;Compute_2020-05-01;Compute_2019-12-01;Compute_2019-11-01;Compute_2019-04-01;</AzureApiTag>
<AzureApiTag>Compute_2021-11-01;Compute_2021-08-01;Compute_2021-07-01;Compute_2021-04-01;Compute_2021-03-01;Compute_2020-12-01;Compute_2020-06-30;Compute_2020-05-01;Compute_2019-12-01;Compute_2019-11-01;Compute_2019-04-01;</AzureApiTag>
<PackageTags>$(PackageTags);$(CommonTags);$(AzureApiTag);</PackageTags>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Microsoft.Azure.Management.Compute.Models
{
public partial class CapacityReservation : Resource
{
public CapacityReservation(string location, Sku sku, string id, string name, string type, IDictionary<string, string> tags, string reservationId, IList<SubResourceReadOnly> virtualMachinesAssociated, System.DateTime? provisioningTime, string provisioningState, CapacityReservationInstanceView instanceView, IList<string> zones)
: base(location, id, name, type, tags)
{
ReservationId = reservationId;
VirtualMachinesAssociated = virtualMachinesAssociated;
ProvisioningTime = provisioningTime;
ProvisioningState = provisioningState;
InstanceView = instanceView;
Sku = sku;
Zones = zones;
CustomInit();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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;

public partial class CapacityReservationUpdate : UpdateResource
{
public CapacityReservationUpdate(IDictionary<string, string> tags, string reservationId, IList<SubResourceReadOnly> virtualMachinesAssociated, System.DateTime? provisioningTime, string provisioningState, CapacityReservationInstanceView instanceView, Sku sku)
: base(tags)
{
ReservationId = reservationId;
VirtualMachinesAssociated = virtualMachinesAssociated;
ProvisioningTime = provisioningTime;
ProvisioningState = provisioningState;
InstanceView = instanceView;
Sku = sku;
CustomInit();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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;

public partial interface IRestorePointsOperations
{
Task<AzureOperationResponse<RestorePoint>> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken = default(CancellationToken));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,32 @@ namespace Microsoft.Azure.Management.Compute
/// </summary>
public partial interface IVirtualMachineScaleSetsOperations
{
/// <summary>
/// Display information about a virtual machine scale set.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmScaleSetName'>
/// The name of the VM scale set.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<VirtualMachineScaleSet>> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken);
Task<AzureOperationResponse<RecoveryWalkResponse>> ForceRecoveryServiceFabricPlatformUpdateDomainWalkWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, int platformUpdateDomain, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken);
/// <summary>
/// Display information about a virtual machine scale set.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmScaleSetName'>
/// The name of the VM scale set.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<VirtualMachineScaleSet>> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken);

/// <summary>
/// Display information about a virtual machine scale set.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Rest.Azure;
using Microsoft.Azure.Management.Compute.Models;

/// <summary>
/// VirtualMachinesOperations operations.
/// </summary>
public partial interface IVirtualMachinesOperations
{
Task<AzureOperationResponse<IPage<VirtualMachine>>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<IPage<VirtualMachine>>> ListAllWithHttpMessagesAsync(string statusOnly, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to delete a virtual machine.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
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;

internal partial class RestorePointsOperations : IServiceOperations<ComputeManagementClient>, IRestorePointsOperations
{
public async Task<AzureOperationResponse<RestorePoint>> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (restorePointCollectionName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "restorePointCollectionName");
}
if (restorePointName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "restorePointName");
}
string apiVersion = "2021-11-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("restorePointCollectionName", restorePointCollectionName);
tracingParameters.Add("restorePointName", restorePointName);
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/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{restorePointCollectionName}", System.Uri.EscapeDataString(restorePointCollectionName));
_url = _url.Replace("{restorePointName}", System.Uri.EscapeDataString(restorePointName));
List<string> _queryParameters = new List<string>();
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<CloudError>(_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<RestorePoint>();
_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<RestorePoint>(_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;
}
}
}
Loading

0 comments on commit 6e05fea

Please sign in to comment.