Skip to content

Commit

Permalink
Gallery 2021-10-01 release (#26658)
Browse files Browse the repository at this point in the history
* generated with new version reference for gallery

* re-geenerate with communityGallery and sharedGallery removed from new version

* re-record tests

* Gallery 10-01 sdk (#25941)

* save

* add test for community gallery publishing

* update

* save (#25940)

* updated

* add customization

* fix, record tests

* update version

* re gen

* update

* Update GalleryApplicationVersion_CRUD_Tests.json

Co-authored-by: kangsun-ctrl <69279251+kangsun-ctrl@users.noreply.github.com>
  • Loading branch information
grizzlytheodore and kangsun-ctrl authored Feb 11, 2022
1 parent f17a8e0 commit 9abbd3e
Show file tree
Hide file tree
Showing 47 changed files with 6,260 additions and 3,377 deletions.
2 changes: 1 addition & 1 deletion eng/mgmt/mgmtmetadata/compute_resource-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Autorest CSharp Version: 2.3.82
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: c4a86872d4f2297597260c5968d2f50a0298db01
Commit: 9673e2239f4f8257b2e916df2d15e1ef41c5bfd1
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-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>
<AzureApiTag>Compute_2021-11-01;Compute_2021-10-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
Expand Up @@ -17,6 +17,174 @@
/// </summary>
internal partial class GalleriesOperations : IServiceOperations<ComputeManagementClient>, IGalleriesOperations
{
public async Task<AzureOperationResponse<Gallery>> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string select, 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 (galleryName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "galleryName");
}
string apiVersion = "2021-10-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("galleryName", galleryName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("select", select);
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/galleries/{galleryName}").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName));
List<string> _queryParameters = new List<string>();
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
if (select != null)
{
_queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select)));
}
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<Gallery>();
_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<Gallery>(_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;
}
/// <summary>
/// Retrieves information about a Shared Image Gallery.
/// </summary>
Expand Down Expand Up @@ -113,4 +281,4 @@ public async Task<AzureOperationResponse<Gallery>> GetWithHttpMessagesAsync(stri
return await GetWithHttpMessagesAsync(resourceGroupName, galleryName, default(string), customHeaders, cancellationToken);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
/// </summary>
public static partial class GalleriesOperationsExtensions
{
public static async Task<Gallery> GetAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, string select, CancellationToken cancellationToken)
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, select, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Retrieves information about a Shared Image Gallery.
/// </summary>
Expand Down Expand Up @@ -48,4 +55,4 @@ public static async Task<Gallery> GetAsync(this IGalleriesOperations operations,
return await GetAsync(operations, resourceGroupName, galleryName, default(string), cancellationToken);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace Microsoft.Azure.Management.Compute.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

/// <summary>
/// The publishing profile of a gallery image version.
/// </summary>
public partial class GalleryApplicationVersionPublishingProfile : GalleryArtifactPublishingProfileBase
{
public GalleryApplicationVersionPublishingProfile(UserArtifactSource source, IList<TargetRegion> targetRegions, int? replicaCount, bool? excludeFromLatest, System.DateTime? publishedDate, System.DateTime? endOfLifeDate, string storageAccountType, string replicationMode, UserArtifactManage manageActions, bool? enableHealthCheck = default(bool?))
: base(targetRegions, replicaCount, excludeFromLatest, publishedDate, endOfLifeDate, storageAccountType, replicationMode)
{
Source = source;
ManageActions = manageActions;
EnableHealthCheck = enableHealthCheck;
CustomInit();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/// </summary>
public partial interface IGalleriesOperations
{
Task<AzureOperationResponse<Gallery>> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string select, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Retrieves information about a Shared Image Gallery.
/// </summary>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9abbd3e

Please sign in to comment.