Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Compute 2021-11-01 version #26370

Merged
merged 32 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f8ab326
update with api version 2021-11-01
grizzlytheodore Oct 28, 2021
33a9764
update with api version 2021-11-01
grizzlytheodore Oct 28, 2021
fd5e03e
Merge branch 'feature/cplat-2021-11-01' of https://github.com/Azure/a…
grizzlytheodore Nov 2, 2021
ab0fabf
update virtualmachine to virtualMachine in swagger
grizzlytheodore Nov 5, 2021
0ac0707
update test to preserve resource group until finally block
grizzlytheodore Nov 30, 2021
ebf6183
test updates and new recordings
grizzlytheodore Dec 2, 2021
f6c07d9
Merge branch 'feature/cplat-2021-11-01' of https://github.com/Azure/a…
grizzlytheodore Dec 2, 2021
5a5a96b
update from swagger sync
grizzlytheodore Dec 2, 2021
b77c378
Added SDK changes for scaling VMSS with PublicIpPrefix (patch updates…
karthikka4820 Jan 14, 2022
4ff3c91
Add RepairAction property to VMSS AutoRepairs feature (#25095)
frank-pang-msft Jan 14, 2022
00602fa
sdk gen (#25670)
chasevanb Jan 14, 2022
5278e55
Added sdk changes for vmss vm customization (#25785)
raktdas Jan 14, 2022
2f450af
init (#25620)
kamusta-msft Jan 14, 2022
0128233
Initial commit (#25383)
sukodava Jan 14, 2022
11375ec
SDK changes for CVM for api-version 2021-11-01 (#25645)
ms-saypaul Jan 14, 2022
67d080f
DedicatedHost Reboot Feature SDK (#25258)
vbhasker-msft Jan 14, 2022
dc9a75a
Adding the new paramaters zone/placementGroupId to ForceRecoveryServi…
avjai Jan 14, 2022
a3d532e
add filter for List VMSS operations (#25802)
grizzlytheodore Jan 14, 2022
c8300fa
add customizations
grizzlytheodore Jan 14, 2022
dc0d42e
Merge branch 'feature/cplat-2021-11-01' of https://github.com/Azure/a…
grizzlytheodore Jan 14, 2022
e0d06c1
fix errors
grizzlytheodore Jan 19, 2022
5711993
regenerated from master
grizzlytheodore Jan 19, 2022
5f9c7cd
fix customization
grizzlytheodore Jan 19, 2022
312323c
merge main to this branch
grizzlytheodore Jan 19, 2022
fae522a
fix customization
grizzlytheodore Jan 19, 2022
7beb839
fix a test
grizzlytheodore Jan 19, 2022
58b2caf
new test recordings
grizzlytheodore Jan 20, 2022
cc07de0
change version name
grizzlytheodore Jan 20, 2022
68762a2
remove unnecessary variable
grizzlytheodore Jan 20, 2022
a60d41a
update recording test
grizzlytheodore Jan 21, 2022
c67e0eb
Merge branch 'feature/cplat-2021-11-01' of https://github.com/Azure/a…
grizzlytheodore Jan 21, 2022
f2d164b
fix changes
grizzlytheodore Jan 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 92b58eb71fd5eb2ce5600e9233541074ecabf851
Commit: 27d77494b1c78b2547e603f1c96a3de4a95784f5
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-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-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,20 @@
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 = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Lists all available virtual machine sizes to which the specified
/// virtual machine can be resized.

/// <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