Skip to content

Commit 6e05fea

Browse files
grizzlytheodorekarthikka4820frank-pang-msftchasevanbcvanbuskirk-microsoft
authored
Update for Compute 2021-11-01 version (#26370)
* 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 <[email protected]> * sdk gen (#25670) Co-authored-by: Chase Van Buskirk <[email protected]> * 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 <[email protected]> * 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 <[email protected]> Co-authored-by: xielexie <[email protected]> * 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 <[email protected]> Co-authored-by: frank-pang-msft <[email protected]> Co-authored-by: Chase VanBuskirk <[email protected]> Co-authored-by: Chase Van Buskirk <[email protected]> Co-authored-by: Raktima Das <[email protected]> Co-authored-by: kamusta-msft <[email protected]> Co-authored-by: sukodava <[email protected]> Co-authored-by: ms-saypaul <[email protected]> Co-authored-by: vbhasker-msft <[email protected]> Co-authored-by: avjai <[email protected]> Co-authored-by: LexieXie <[email protected]> Co-authored-by: xielexie <[email protected]>
1 parent 240cfa9 commit 6e05fea

File tree

250 files changed

+156278
-121024
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+156278
-121024
lines changed

eng/mgmt/mgmtmetadata/compute_resource-manager.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Generating CSharp code
55
Executing AutoRest command
66
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
77
Autorest CSharp Version: 2.3.82
8-
2021-09-09 19:16:30 UTC
8+
2021-10-20 19:24:00 UTC
99
Azure-rest-api-specs repository information
1010
GitHub fork: Azure
1111
Branch: master
12-
Commit: ccc4906c1184d674b8bbd2710643d7c9e167a6f4
12+
Commit: c4a86872d4f2297597260c5968d2f50a0298db01
1313
AutoRest information
1414
Requested version: v2
1515
Bootstrapper version: [email protected]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<!--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-->
33
<PropertyGroup>
4-
<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>
4+
<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>
55
<PackageTags>$(PackageTags);$(CommonTags);$(AzureApiTag);</PackageTags>
66
</PropertyGroup>
77
</Project>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Microsoft.Azure.Management.Compute.Models
8+
{
9+
public partial class CapacityReservation : Resource
10+
{
11+
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)
12+
: base(location, id, name, type, tags)
13+
{
14+
ReservationId = reservationId;
15+
VirtualMachinesAssociated = virtualMachinesAssociated;
16+
ProvisioningTime = provisioningTime;
17+
ProvisioningState = provisioningState;
18+
InstanceView = instanceView;
19+
Sku = sku;
20+
Zones = zones;
21+
CustomInit();
22+
}
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
namespace Microsoft.Azure.Management.Compute.Models
2+
{
3+
using Microsoft.Rest;
4+
using Microsoft.Rest.Serialization;
5+
using Newtonsoft.Json;
6+
using System.Collections;
7+
using System.Collections.Generic;
8+
using System.Linq;
9+
10+
public partial class CapacityReservationUpdate : UpdateResource
11+
{
12+
public CapacityReservationUpdate(IDictionary<string, string> tags, string reservationId, IList<SubResourceReadOnly> virtualMachinesAssociated, System.DateTime? provisioningTime, string provisioningState, CapacityReservationInstanceView instanceView, Sku sku)
13+
: base(tags)
14+
{
15+
ReservationId = reservationId;
16+
VirtualMachinesAssociated = virtualMachinesAssociated;
17+
ProvisioningTime = provisioningTime;
18+
ProvisioningState = provisioningState;
19+
InstanceView = instanceView;
20+
Sku = sku;
21+
CustomInit();
22+
}
23+
}
24+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace Microsoft.Azure.Management.Compute
2+
{
3+
using Microsoft.Rest;
4+
using Microsoft.Rest.Azure;
5+
using Models;
6+
using System.Collections;
7+
using System.Collections.Generic;
8+
using System.Threading;
9+
using System.Threading.Tasks;
10+
11+
public partial interface IRestorePointsOperations
12+
{
13+
Task<AzureOperationResponse<RestorePoint>> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken = default(CancellationToken));
14+
}
15+
}

sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/IVirtualMachineScaleSetsOperations.cs

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,32 @@ namespace Microsoft.Azure.Management.Compute
1313
/// </summary>
1414
public partial interface IVirtualMachineScaleSetsOperations
1515
{
16-
/// <summary>
17-
/// Display information about a virtual machine scale set.
18-
/// </summary>
19-
/// <param name='resourceGroupName'>
20-
/// The name of the resource group.
21-
/// </param>
22-
/// <param name='vmScaleSetName'>
23-
/// The name of the VM scale set.
24-
/// </param>
25-
/// <param name='customHeaders'>
26-
/// The headers that will be added to request.
27-
/// </param>
28-
/// <param name='cancellationToken'>
29-
/// The cancellation token.
30-
/// </param>
31-
/// <exception cref="Microsoft.Rest.Azure.CloudException">
32-
/// Thrown when the operation returned an invalid status code
33-
/// </exception>
34-
/// <exception cref="Microsoft.Rest.SerializationException">
35-
/// Thrown when unable to deserialize the response
36-
/// </exception>
37-
/// <exception cref="Microsoft.Rest.ValidationException">
38-
/// Thrown when a required parameter is null
39-
/// </exception>
40-
Task<AzureOperationResponse<VirtualMachineScaleSet>> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken);
16+
Task<AzureOperationResponse<RecoveryWalkResponse>> ForceRecoveryServiceFabricPlatformUpdateDomainWalkWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, int platformUpdateDomain, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken);
17+
/// <summary>
18+
/// Display information about a virtual machine scale set.
19+
/// </summary>
20+
/// <param name='resourceGroupName'>
21+
/// The name of the resource group.
22+
/// </param>
23+
/// <param name='vmScaleSetName'>
24+
/// The name of the VM scale set.
25+
/// </param>
26+
/// <param name='customHeaders'>
27+
/// The headers that will be added to request.
28+
/// </param>
29+
/// <param name='cancellationToken'>
30+
/// The cancellation token.
31+
/// </param>
32+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
33+
/// Thrown when the operation returned an invalid status code
34+
/// </exception>
35+
/// <exception cref="Microsoft.Rest.SerializationException">
36+
/// Thrown when unable to deserialize the response
37+
/// </exception>
38+
/// <exception cref="Microsoft.Rest.ValidationException">
39+
/// Thrown when a required parameter is null
40+
/// </exception>
41+
Task<AzureOperationResponse<VirtualMachineScaleSet>> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken);
4142

4243
/// <summary>
4344
/// Display information about a virtual machine scale set.

sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/IVirtualMachinesOperations.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
using System.Threading;
55
using System.Threading.Tasks;
66
using Microsoft.Rest.Azure;
7+
using Microsoft.Azure.Management.Compute.Models;
78

89
/// <summary>
910
/// VirtualMachinesOperations operations.
1011
/// </summary>
1112
public partial interface IVirtualMachinesOperations
1213
{
14+
Task<AzureOperationResponse<IPage<VirtualMachine>>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken = default(CancellationToken));
15+
Task<AzureOperationResponse<IPage<VirtualMachine>>> ListAllWithHttpMessagesAsync(string statusOnly, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken = default(CancellationToken));
1316
/// <summary>
1417
/// The operation to delete a virtual machine.
1518
/// </summary>
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
namespace Microsoft.Azure.Management.Compute
2+
{
3+
using Microsoft.Rest;
4+
using Microsoft.Rest.Azure;
5+
using Models;
6+
using Newtonsoft.Json;
7+
using System.Collections;
8+
using System.Collections.Generic;
9+
using System.Linq;
10+
using System.Net;
11+
using System.Net.Http;
12+
using System.Threading;
13+
using System.Threading.Tasks;
14+
15+
internal partial class RestorePointsOperations : IServiceOperations<ComputeManagementClient>, IRestorePointsOperations
16+
{
17+
public async Task<AzureOperationResponse<RestorePoint>> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken = default(CancellationToken))
18+
{
19+
if (Client.SubscriptionId == null)
20+
{
21+
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
22+
}
23+
if (resourceGroupName == null)
24+
{
25+
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
26+
}
27+
if (restorePointCollectionName == null)
28+
{
29+
throw new ValidationException(ValidationRules.CannotBeNull, "restorePointCollectionName");
30+
}
31+
if (restorePointName == null)
32+
{
33+
throw new ValidationException(ValidationRules.CannotBeNull, "restorePointName");
34+
}
35+
string apiVersion = "2021-11-01";
36+
// Tracing
37+
bool _shouldTrace = ServiceClientTracing.IsEnabled;
38+
string _invocationId = null;
39+
if (_shouldTrace)
40+
{
41+
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
42+
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
43+
tracingParameters.Add("resourceGroupName", resourceGroupName);
44+
tracingParameters.Add("restorePointCollectionName", restorePointCollectionName);
45+
tracingParameters.Add("restorePointName", restorePointName);
46+
tracingParameters.Add("apiVersion", apiVersion);
47+
tracingParameters.Add("cancellationToken", cancellationToken);
48+
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
49+
}
50+
// Construct URL
51+
var _baseUrl = Client.BaseUri.AbsoluteUri;
52+
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}").ToString();
53+
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
54+
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
55+
_url = _url.Replace("{restorePointCollectionName}", System.Uri.EscapeDataString(restorePointCollectionName));
56+
_url = _url.Replace("{restorePointName}", System.Uri.EscapeDataString(restorePointName));
57+
List<string> _queryParameters = new List<string>();
58+
if (apiVersion != null)
59+
{
60+
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
61+
}
62+
if (_queryParameters.Count > 0)
63+
{
64+
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
65+
}
66+
// Create HTTP transport objects
67+
var _httpRequest = new HttpRequestMessage();
68+
HttpResponseMessage _httpResponse = null;
69+
_httpRequest.Method = new HttpMethod("GET");
70+
_httpRequest.RequestUri = new System.Uri(_url);
71+
// Set Headers
72+
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
73+
{
74+
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
75+
}
76+
if (Client.AcceptLanguage != null)
77+
{
78+
if (_httpRequest.Headers.Contains("accept-language"))
79+
{
80+
_httpRequest.Headers.Remove("accept-language");
81+
}
82+
_httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
83+
}
84+
85+
86+
if (customHeaders != null)
87+
{
88+
foreach (var _header in customHeaders)
89+
{
90+
if (_httpRequest.Headers.Contains(_header.Key))
91+
{
92+
_httpRequest.Headers.Remove(_header.Key);
93+
}
94+
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
95+
}
96+
}
97+
98+
// Serialize Request
99+
string _requestContent = null;
100+
// Set Credentials
101+
if (Client.Credentials != null)
102+
{
103+
cancellationToken.ThrowIfCancellationRequested();
104+
await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
105+
}
106+
// Send Request
107+
if (_shouldTrace)
108+
{
109+
ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
110+
}
111+
cancellationToken.ThrowIfCancellationRequested();
112+
_httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
113+
if (_shouldTrace)
114+
{
115+
ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
116+
}
117+
HttpStatusCode _statusCode = _httpResponse.StatusCode;
118+
cancellationToken.ThrowIfCancellationRequested();
119+
string _responseContent = null;
120+
if ((int)_statusCode != 200)
121+
{
122+
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
123+
try
124+
{
125+
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
126+
CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings);
127+
if (_errorBody != null)
128+
{
129+
ex = new CloudException(_errorBody.Message);
130+
ex.Body = _errorBody;
131+
}
132+
}
133+
catch (JsonException)
134+
{
135+
// Ignore the exception
136+
}
137+
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
138+
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
139+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
140+
{
141+
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
142+
}
143+
if (_shouldTrace)
144+
{
145+
ServiceClientTracing.Error(_invocationId, ex);
146+
}
147+
_httpRequest.Dispose();
148+
if (_httpResponse != null)
149+
{
150+
_httpResponse.Dispose();
151+
}
152+
throw ex;
153+
}
154+
// Create Result
155+
var _result = new AzureOperationResponse<RestorePoint>();
156+
_result.Request = _httpRequest;
157+
_result.Response = _httpResponse;
158+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
159+
{
160+
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
161+
}
162+
// Deserialize Response
163+
if ((int)_statusCode == 200)
164+
{
165+
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
166+
try
167+
{
168+
_result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<RestorePoint>(_responseContent, Client.DeserializationSettings);
169+
}
170+
catch (JsonException ex)
171+
{
172+
_httpRequest.Dispose();
173+
if (_httpResponse != null)
174+
{
175+
_httpResponse.Dispose();
176+
}
177+
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
178+
}
179+
}
180+
if (_shouldTrace)
181+
{
182+
ServiceClientTracing.Exit(_invocationId, _result);
183+
}
184+
return _result;
185+
}
186+
}
187+
}

0 commit comments

Comments
 (0)