-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <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
1 parent
240cfa9
commit 6e05fea
Showing
250 changed files
with
156,278 additions
and
121,024 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
24 changes: 24 additions & 0 deletions
24
sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/CapacityReservation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ompute/Microsoft.Azure.Management.Compute/src/Customizations/CapacityReservationUpdate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...compute/Microsoft.Azure.Management.Compute/src/Customizations/IRestorePointsOperations.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
187 changes: 187 additions & 0 deletions
187
sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/RestorePointsOperations.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
Oops, something went wrong.