From a53b11fe65adf2bce7b50ff7dcf844e06c758fea Mon Sep 17 00:00:00 2001 From: Pavel P Zelinsky Date: Wed, 21 Mar 2018 17:49:43 -0700 Subject: [PATCH 1/2] WebSites ResourceHealthMetadata APIs and Tests Adding the Microsoft.Web ResourceHealthMetadata APIs as well as new test cases for these APIs --- .../IResourceHealthMetadataOperations.cs | 310 +++ .../Generated/IWebSiteManagementClient.cs | 5 + .../Generated/Models/DefaultErrorResponse.cs | 64 + .../Models/DefaultErrorResponseError.cs | 105 + .../DefaultErrorResponseErrorDetailsItem.cs | 82 + .../Models/DefaultErrorResponseException.cs | 62 + .../Models/ResourceHealthMetadata.cs | 70 + .../ResourceHealthMetadataOperations.cs | 1970 +++++++++++++++++ ...ourceHealthMetadataOperationsExtensions.cs | 483 ++++ .../SdkInfo_WebSiteManagementClient.cs | 1 + .../Generated/WebSiteManagementClient.cs | 6 + ...Microsoft.Azure.Management.Websites.csproj | 2 +- .../ResourceHealthMetadata.ScenarioTests.cs | 138 ++ .../GetResourceHealthMetadata.json | 507 +++++ .../ListResourceHealthMetadata.json | 507 +++++ src/SDKs/_metadata/web_resource-manager.txt | 6 +- 16 files changed, 4314 insertions(+), 4 deletions(-) create mode 100644 src/SDKs/WebSites/Management.Websites/Generated/IResourceHealthMetadataOperations.cs create mode 100644 src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponse.cs create mode 100644 src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponseError.cs create mode 100644 src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs create mode 100644 src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponseException.cs create mode 100644 src/SDKs/WebSites/Management.Websites/Generated/Models/ResourceHealthMetadata.cs create mode 100644 src/SDKs/WebSites/Management.Websites/Generated/ResourceHealthMetadataOperations.cs create mode 100644 src/SDKs/WebSites/Management.Websites/Generated/ResourceHealthMetadataOperationsExtensions.cs create mode 100644 src/SDKs/WebSites/WebSites.Tests/ScenarioTests/ResourceHealthMetadata.ScenarioTests.cs create mode 100644 src/SDKs/WebSites/WebSites.Tests/SessionRecords/WebSites.Tests.ScenarioTests.ResourceHealthMetadataTests/GetResourceHealthMetadata.json create mode 100644 src/SDKs/WebSites/WebSites.Tests/SessionRecords/WebSites.Tests.ScenarioTests.ResourceHealthMetadataTests/ListResourceHealthMetadata.json diff --git a/src/SDKs/WebSites/Management.Websites/Generated/IResourceHealthMetadataOperations.cs b/src/SDKs/WebSites/Management.Websites/Generated/IResourceHealthMetadataOperations.cs new file mode 100644 index 000000000000..027fd752a793 --- /dev/null +++ b/src/SDKs/WebSites/Management.Websites/Generated/IResourceHealthMetadataOperations.cs @@ -0,0 +1,310 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ResourceHealthMetadataOperations operations. + /// + public partial interface IResourceHealthMetadataOperations + { + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all ResourceHealthMetadata for all sites in the resource group + /// in the subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the resource group + /// in the subscription. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the category of ResourceHealthMetadata to use for the given + /// site as a collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given + /// site as a collection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the category of ResourceHealthMetadata to use for the given + /// site + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given + /// site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetBySiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the category of ResourceHealthMetadata to use for the given + /// site as a collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given + /// site as a collection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Name of web app slot. If not specified then will default to + /// production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySiteSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the category of ResourceHealthMetadata to use for the given + /// site + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given + /// site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app + /// + /// + /// Name of web app slot. If not specified then will default to + /// production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetBySiteSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all ResourceHealthMetadata for all sites in the resource group + /// in the subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the resource group + /// in the subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the category of ResourceHealthMetadata to use for the given + /// site as a collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given + /// site as a collection + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySiteNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the category of ResourceHealthMetadata to use for the given + /// site as a collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given + /// site as a collection + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySiteSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/WebSites/Management.Websites/Generated/IWebSiteManagementClient.cs b/src/SDKs/WebSites/Management.Websites/Generated/IWebSiteManagementClient.cs index 2febddf93448..4679d3ffa601 100644 --- a/src/SDKs/WebSites/Management.Websites/Generated/IWebSiteManagementClient.cs +++ b/src/SDKs/WebSites/Management.Websites/Generated/IWebSiteManagementClient.cs @@ -103,6 +103,11 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// IRecommendationsOperations Recommendations { get; } + /// + /// Gets the IResourceHealthMetadataOperations. + /// + IResourceHealthMetadataOperations ResourceHealthMetadata { get; } + /// /// Gets the IWebAppsOperations. /// diff --git a/src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponse.cs b/src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponse.cs new file mode 100644 index 000000000000..fa0ad92f7cf1 --- /dev/null +++ b/src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponse.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// App Service error response. + /// + public partial class DefaultErrorResponse + { + /// + /// Initializes a new instance of the DefaultErrorResponse class. + /// + public DefaultErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DefaultErrorResponse class. + /// + /// Error model. + public DefaultErrorResponse(DefaultErrorResponseError error = default(DefaultErrorResponseError)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets error model. + /// + [JsonProperty(PropertyName = "error")] + public DefaultErrorResponseError Error { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Error != null) + { + Error.Validate(); + } + } + } +} diff --git a/src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponseError.cs b/src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponseError.cs new file mode 100644 index 000000000000..0ce541abbfc7 --- /dev/null +++ b/src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponseError.cs @@ -0,0 +1,105 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Error model. + /// + public partial class DefaultErrorResponseError + { + /// + /// Initializes a new instance of the DefaultErrorResponseError class. + /// + public DefaultErrorResponseError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DefaultErrorResponseError class. + /// + /// Standardized string to programmatically identify + /// the error. + /// Detailed error description and debugging + /// information. + /// Detailed error description and debugging + /// information. + /// More information to debug error. + public DefaultErrorResponseError(string code, string message, string target = default(string), IList details = default(IList), string innererror = default(string)) + { + Code = code; + Message = message; + Target = target; + Details = details; + Innererror = innererror; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets standardized string to programmatically identify the error. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets detailed error description and debugging information. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets detailed error description and debugging information. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; set; } + + /// + /// Gets more information to debug error. + /// + [JsonProperty(PropertyName = "innererror")] + public string Innererror { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Details != null) + { + foreach (var element in Details) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs b/src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs new file mode 100644 index 000000000000..4a5138005a07 --- /dev/null +++ b/src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Detailed errors. + /// + public partial class DefaultErrorResponseErrorDetailsItem + { + /// + /// Initializes a new instance of the + /// DefaultErrorResponseErrorDetailsItem class. + /// + public DefaultErrorResponseErrorDetailsItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// DefaultErrorResponseErrorDetailsItem class. + /// + /// Standardized string to programmatically identify + /// the error. + /// Detailed error description and debugging + /// information. + /// Detailed error description and debugging + /// information. + public DefaultErrorResponseErrorDetailsItem(string code, string message, string target = default(string)) + { + Code = code; + Message = message; + Target = target; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets standardized string to programmatically identify the error. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets detailed error description and debugging information. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets detailed error description and debugging information. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponseException.cs b/src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponseException.cs new file mode 100644 index 000000000000..d2605d3468fb --- /dev/null +++ b/src/SDKs/WebSites/Management.Websites/Generated/Models/DefaultErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with DefaultErrorResponse + /// information. + /// + public partial class DefaultErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public DefaultErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the DefaultErrorResponseException class. + /// + public DefaultErrorResponseException() + { + } + + /// + /// Initializes a new instance of the DefaultErrorResponseException class. + /// + /// The exception message. + public DefaultErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the DefaultErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public DefaultErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/SDKs/WebSites/Management.Websites/Generated/Models/ResourceHealthMetadata.cs b/src/SDKs/WebSites/Management.Websites/Generated/Models/ResourceHealthMetadata.cs new file mode 100644 index 000000000000..d27a122a6915 --- /dev/null +++ b/src/SDKs/WebSites/Management.Websites/Generated/Models/ResourceHealthMetadata.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Used for getting ResourceHealthCheck settings. + /// + [Rest.Serialization.JsonTransformation] + public partial class ResourceHealthMetadata : ProxyOnlyResource + { + /// + /// Initializes a new instance of the ResourceHealthMetadata class. + /// + public ResourceHealthMetadata() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceHealthMetadata class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The category that the resource matches in + /// the RHC Policy File + /// Is there a health signal for the + /// resource + public ResourceHealthMetadata(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string category = default(string), bool? signalAvailability = default(bool?)) + : base(id, name, kind, type) + { + Category = category; + SignalAvailability = signalAvailability; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the category that the resource matches in the RHC + /// Policy File + /// + [JsonProperty(PropertyName = "properties.category")] + public string Category { get; set; } + + /// + /// Gets or sets is there a health signal for the resource + /// + [JsonProperty(PropertyName = "properties.signalAvailability")] + public bool? SignalAvailability { get; set; } + + } +} diff --git a/src/SDKs/WebSites/Management.Websites/Generated/ResourceHealthMetadataOperations.cs b/src/SDKs/WebSites/Management.Websites/Generated/ResourceHealthMetadataOperations.cs new file mode 100644 index 000000000000..1f40523aba65 --- /dev/null +++ b/src/SDKs/WebSites/Management.Websites/Generated/ResourceHealthMetadataOperations.cs @@ -0,0 +1,1970 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites +{ + 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; + + /// + /// ResourceHealthMetadataOperations operations. + /// + internal partial class ResourceHealthMetadataOperations : IServiceOperations, IResourceHealthMetadataOperations + { + /// + /// Initializes a new instance of the ResourceHealthMetadataOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ResourceHealthMetadataOperations(WebSiteManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the WebSiteManagementClient + /// + public WebSiteManagementClient Client { get; private set; } + + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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>(_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; + } + + /// + /// List all ResourceHealthMetadata for all sites in the resource group in the + /// subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the resource group in the + /// subscription. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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.Web/resourceHealthMetadata").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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>(_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; + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySite", 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.Web/sites/{name}/resourceHealthMetadata").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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>(_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; + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetBySiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetBySite", 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.Web/sites/{name}/resourceHealthMetadata/default").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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(_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; + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySiteSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySiteSlot", 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.Web/sites/{name}/slots/{slot}/resourceHealthMetadata").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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>(_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; + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetBySiteSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetBySiteSlot", 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.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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(_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; + } + + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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>(_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; + } + + /// + /// List all ResourceHealthMetadata for all sites in the resource group in the + /// subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the resource group in the + /// subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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>(_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; + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySiteNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySiteNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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>(_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; + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySiteSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySiteSlotNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _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>(_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; + } + + } +} diff --git a/src/SDKs/WebSites/Management.Websites/Generated/ResourceHealthMetadataOperationsExtensions.cs b/src/SDKs/WebSites/Management.Websites/Generated/ResourceHealthMetadataOperationsExtensions.cs new file mode 100644 index 000000000000..b6c10f559545 --- /dev/null +++ b/src/SDKs/WebSites/Management.Websites/Generated/ResourceHealthMetadataOperationsExtensions.cs @@ -0,0 +1,483 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ResourceHealthMetadataOperations. + /// + public static partial class ResourceHealthMetadataOperationsExtensions + { + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IResourceHealthMetadataOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IResourceHealthMetadataOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all ResourceHealthMetadata for all sites in the resource group in the + /// subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the resource group in the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + public static IPage ListByResourceGroup(this IResourceHealthMetadataOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// List all ResourceHealthMetadata for all sites in the resource group in the + /// subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the resource group in the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IResourceHealthMetadataOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + public static IPage ListBySite(this IResourceHealthMetadataOperations operations, string resourceGroupName, string name) + { + return operations.ListBySiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySiteAsync(this IResourceHealthMetadataOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app + /// + public static ResourceHealthMetadata GetBySite(this IResourceHealthMetadataOperations operations, string resourceGroupName, string name) + { + return operations.GetBySiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app + /// + /// + /// The cancellation token. + /// + public static async Task GetBySiteAsync(this IResourceHealthMetadataOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetBySiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + public static IPage ListBySiteSlot(this IResourceHealthMetadataOperations operations, string resourceGroupName, string name, string slot) + { + return operations.ListBySiteSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySiteSlotAsync(this IResourceHealthMetadataOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySiteSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + public static ResourceHealthMetadata GetBySiteSlot(this IResourceHealthMetadataOperations operations, string resourceGroupName, string name, string slot) + { + return operations.GetBySiteSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// The cancellation token. + /// + public static async Task GetBySiteSlotAsync(this IResourceHealthMetadataOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetBySiteSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IResourceHealthMetadataOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IResourceHealthMetadataOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all ResourceHealthMetadata for all sites in the resource group in the + /// subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the resource group in the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IResourceHealthMetadataOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all ResourceHealthMetadata for all sites in the resource group in the + /// subscription. + /// + /// + /// List all ResourceHealthMetadata for all sites in the resource group in the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IResourceHealthMetadataOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySiteNext(this IResourceHealthMetadataOperations operations, string nextPageLink) + { + return operations.ListBySiteNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySiteNextAsync(this IResourceHealthMetadataOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySiteNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySiteSlotNext(this IResourceHealthMetadataOperations operations, string nextPageLink) + { + return operations.ListBySiteSlotNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// Gets the category of ResourceHealthMetadata to use for the given site as a + /// collection + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySiteSlotNextAsync(this IResourceHealthMetadataOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySiteSlotNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/WebSites/Management.Websites/Generated/SdkInfo_WebSiteManagementClient.cs b/src/SDKs/WebSites/Management.Websites/Generated/SdkInfo_WebSiteManagementClient.cs index 353c1d1677ff..778cd108c689 100644 --- a/src/SDKs/WebSites/Management.Websites/Generated/SdkInfo_WebSiteManagementClient.cs +++ b/src/SDKs/WebSites/Management.Websites/Generated/SdkInfo_WebSiteManagementClient.cs @@ -32,6 +32,7 @@ public static IEnumerable> ApiInfo_WebSiteManageme new Tuple("Web", "ListSourceControls", "2016-03-01"), new Tuple("Web", "Provider", "2016-03-01"), new Tuple("Web", "Recommendations", "2016-03-01"), + new Tuple("Web", "ResourceHealthMetadata", "2016-03-01"), new Tuple("Web", "UpdatePublishingUser", "2016-03-01"), new Tuple("Web", "UpdateSourceControl", "2016-03-01"), new Tuple("Web", "Validate", "2016-03-01"), diff --git a/src/SDKs/WebSites/Management.Websites/Generated/WebSiteManagementClient.cs b/src/SDKs/WebSites/Management.Websites/Generated/WebSiteManagementClient.cs index 5dc88900e058..b3f12db4eb5d 100644 --- a/src/SDKs/WebSites/Management.Websites/Generated/WebSiteManagementClient.cs +++ b/src/SDKs/WebSites/Management.Websites/Generated/WebSiteManagementClient.cs @@ -106,6 +106,11 @@ public partial class WebSiteManagementClient : ServiceClient public virtual IRecommendationsOperations Recommendations { get; private set; } + /// + /// Gets the IResourceHealthMetadataOperations. + /// + public virtual IResourceHealthMetadataOperations ResourceHealthMetadata { get; private set; } + /// /// Gets the IWebAppsOperations. /// @@ -329,6 +334,7 @@ private void Initialize() DeletedWebApps = new DeletedWebAppsOperations(this); Provider = new ProviderOperations(this); Recommendations = new RecommendationsOperations(this); + ResourceHealthMetadata = new ResourceHealthMetadataOperations(this); WebApps = new WebAppsOperations(this); AppServiceEnvironments = new AppServiceEnvironmentsOperations(this); AppServicePlans = new AppServicePlansOperations(this); diff --git a/src/SDKs/WebSites/Management.Websites/Microsoft.Azure.Management.Websites.csproj b/src/SDKs/WebSites/Management.Websites/Microsoft.Azure.Management.Websites.csproj index 9a9b890b969d..6a38710380ee 100644 --- a/src/SDKs/WebSites/Management.Websites/Microsoft.Azure.Management.Websites.csproj +++ b/src/SDKs/WebSites/Management.Websites/Microsoft.Azure.Management.Websites.csproj @@ -10,7 +10,7 @@ 1.8.0-preview Microsoft Azure website management;website management; - + diff --git a/src/SDKs/WebSites/WebSites.Tests/ScenarioTests/ResourceHealthMetadata.ScenarioTests.cs b/src/SDKs/WebSites/WebSites.Tests/ScenarioTests/ResourceHealthMetadata.ScenarioTests.cs new file mode 100644 index 000000000000..a807013bfae9 --- /dev/null +++ b/src/SDKs/WebSites/WebSites.Tests/ScenarioTests/ResourceHealthMetadata.ScenarioTests.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Linq; +using System.Net; +using Microsoft.Azure.Management.Resources; +using Microsoft.Azure.Management.Resources.Models; +using Microsoft.Azure.Management.WebSites; +using Microsoft.Azure.Management.WebSites.Models; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using WebSites.Tests.Helpers; +using Xunit; + +namespace WebSites.Tests.ScenarioTests +{ + public class ResourceHealthMetadataTests : TestBase + { + [Fact] + public void ListResourceHealthMetadata() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var webSitesClient = this.GetWebSiteManagementClient(context); + var resourcesClient = this.GetResourceManagementClient(context); + + string farmName = TestUtilities.GenerateName("csmsf"); + string resourceGroupName = TestUtilities.GenerateName("csmrg"); + + string locationName = "West US"; + string siteName = TestUtilities.GenerateName("csmws"); + + resourcesClient.ResourceGroups.CreateOrUpdate(resourceGroupName, + new ResourceGroup + { + Location = locationName + }); + + webSitesClient.AppServicePlans.CreateOrUpdate(resourceGroupName, farmName, new AppServicePlan + { + Location = locationName, + Sku = new SkuDescription + { + Name = "S1", + Tier = "Standard", + Capacity = 1 + } + }); + + var serverfarmId = ResourceGroupHelper.GetServerFarmId(webSitesClient.SubscriptionId, resourceGroupName, farmName); + webSitesClient.WebApps.CreateOrUpdate(resourceGroupName, siteName, new Site + { + Location = locationName, + ServerFarmId = serverfarmId + }); + + var resourceHealthMetadataResponse = webSitesClient.ResourceHealthMetadata.ListBySite(resourceGroupName, siteName); + + Assert.NotEmpty(resourceHealthMetadataResponse); + if (resourceHealthMetadataResponse != null) { + Assert.Single(resourceHealthMetadataResponse); + } + + var metadata = resourceHealthMetadataResponse.FirstOrDefault(); + + if (metadata != null) + { + Assert.Equal("default", metadata.Name); + Assert.Equal("Microsoft.Web/sites/resourceHealthMetadata", metadata.Type); + } + + webSitesClient.WebApps.Delete(resourceGroupName, siteName, deleteMetrics: true); + + webSitesClient.AppServicePlans.Delete(resourceGroupName, farmName); + + var serverFarmResponse = webSitesClient.AppServicePlans.ListByResourceGroup(resourceGroupName); + + Assert.Empty(serverFarmResponse); + } + } + + [Fact] + public void GetResourceHealthMetadata() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var webSitesClient = this.GetWebSiteManagementClient(context); + var resourcesClient = this.GetResourceManagementClient(context); + + string farmName = TestUtilities.GenerateName("csmsf"); + string resourceGroupName = TestUtilities.GenerateName("csmrg"); + + string locationName = "West US"; + string siteName = TestUtilities.GenerateName("csmws"); + + resourcesClient.ResourceGroups.CreateOrUpdate(resourceGroupName, + new ResourceGroup + { + Location = locationName + }); + + webSitesClient.AppServicePlans.CreateOrUpdate(resourceGroupName, farmName, new AppServicePlan + { + Location = locationName, + Sku = new SkuDescription + { + Name = "S1", + Tier = "Standard", + Capacity = 1 + } + }); + + var serverfarmId = ResourceGroupHelper.GetServerFarmId(webSitesClient.SubscriptionId, resourceGroupName, farmName); + webSitesClient.WebApps.CreateOrUpdate(resourceGroupName, siteName, new Site + { + Location = locationName, + ServerFarmId = serverfarmId + }); + + var resourceHealthMetadataResponse = webSitesClient.ResourceHealthMetadata.GetBySite(resourceGroupName, siteName); + + if (resourceHealthMetadataResponse != null) + { + Assert.Equal("default", resourceHealthMetadataResponse.Name); + Assert.Equal("Microsoft.Web/sites/resourceHealthMetadata", resourceHealthMetadataResponse.Type); + } + + webSitesClient.WebApps.Delete(resourceGroupName, siteName, deleteMetrics: true); + + webSitesClient.AppServicePlans.Delete(resourceGroupName, farmName); + + var serverFarmResponse = webSitesClient.AppServicePlans.ListByResourceGroup(resourceGroupName); + + Assert.Empty(serverFarmResponse); + } + } + } +} diff --git a/src/SDKs/WebSites/WebSites.Tests/SessionRecords/WebSites.Tests.ScenarioTests.ResourceHealthMetadataTests/GetResourceHealthMetadata.json b/src/SDKs/WebSites/WebSites.Tests/SessionRecords/WebSites.Tests.ScenarioTests.ResourceHealthMetadataTests/GetResourceHealthMetadata.json new file mode 100644 index 000000000000..2992abc0311d --- /dev/null +++ b/src/SDKs/WebSites/WebSites.Tests/SessionRecords/WebSites.Tests.ScenarioTests.ResourceHealthMetadataTests/GetResourceHealthMetadata.json @@ -0,0 +1,507 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourcegroups/csmrg9761?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlZ3JvdXBzL2NzbXJnOTc2MT9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "29" + ], + "x-ms-client-request-id": [ + "f56dd904-86e8-4508-9cc9-5c2e728bf060" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg9761\",\r\n \"name\": \"csmrg9761\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "171" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:24:40 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-request-id": [ + "d0ddd461-fbe3-4eea-b4b4-c0f5079b62f2" + ], + "x-ms-correlation-request-id": [ + "d0ddd461-fbe3-4eea-b4b4-c0f5079b62f2" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002441Z:d0ddd461-fbe3-4eea-b4b4-c0f5079b62f2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg9761/providers/Microsoft.Web/serverfarms/csmsf7649?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlR3JvdXBzL2NzbXJnOTc2MS9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zZXJ2ZXJmYXJtcy9jc21zZjc2NDk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"capacity\": 1\r\n },\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "110" + ], + "x-ms-client-request-id": [ + "424c07a6-c251-4d69-840e-f6d030e772da" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg9761/providers/Microsoft.Web/serverfarms/csmsf7649\",\r\n \"name\": \"csmsf7649\",\r\n \"type\": \"Microsoft.Web/serverfarms\",\r\n \"kind\": \"app\",\r\n \"location\": \"West US\",\r\n \"properties\": {\r\n \"serverFarmId\": 0,\r\n \"name\": \"csmsf7649\",\r\n \"workerSize\": \"Default\",\r\n \"workerSizeId\": 0,\r\n \"workerTierName\": null,\r\n \"numberOfWorkers\": 1,\r\n \"currentWorkerSize\": \"Default\",\r\n \"currentWorkerSizeId\": 0,\r\n \"currentNumberOfWorkers\": 1,\r\n \"status\": \"Ready\",\r\n \"webSpace\": \"csmrg9761-WestUSwebspace\",\r\n \"subscription\": \"0d3ae56c-deaf-4982-b514-33d016d4a683\",\r\n \"adminSiteName\": null,\r\n \"hostingEnvironment\": null,\r\n \"hostingEnvironmentProfile\": null,\r\n \"maximumNumberOfWorkers\": 10,\r\n \"planName\": \"VirtualDedicatedPlan\",\r\n \"adminRuntimeSiteName\": null,\r\n \"computeMode\": \"Shared\",\r\n \"siteMode\": null,\r\n \"geoRegion\": \"West US\",\r\n \"perSiteScaling\": false,\r\n \"numberOfSites\": 0,\r\n \"hostingEnvironmentId\": null,\r\n \"isSpot\": false,\r\n \"spotExpirationTime\": null,\r\n \"tags\": null,\r\n \"kind\": \"app\",\r\n \"resourceGroup\": \"csmrg9761\",\r\n \"reserved\": false,\r\n \"mdmId\": \"waws-prod-bay-057_15678\",\r\n \"targetWorkerCount\": 0,\r\n \"targetWorkerSizeId\": 0,\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"size\": \"S1\",\r\n \"family\": \"S\",\r\n \"capacity\": 1\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:24:48 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "bc3bcca4-fb09-4923-81fc-2291bfd43147" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "92f7536d-19b3-4b55-8d2d-59ed758b79a5" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002449Z:92f7536d-19b3-4b55-8d2d-59ed758b79a5" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg9761/providers/Microsoft.Web/sites/csmws9402?api-version=2016-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlR3JvdXBzL2NzbXJnOTc2MS9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zaXRlcy9jc213czk0MDI/YXBpLXZlcnNpb249MjAxNi0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"serverFarmId\": \"/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourcegroups/csmrg9761/providers/Microsoft.Web/serverfarms/csmsf7649\"\r\n },\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "200" + ], + "x-ms-client-request-id": [ + "3cfe5044-dbd8-4573-ae1d-cff5c1fdf295" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg9761/providers/Microsoft.Web/sites/csmws9402\",\r\n \"name\": \"csmws9402\",\r\n \"type\": \"Microsoft.Web/sites\",\r\n \"kind\": \"app\",\r\n \"location\": \"West US\",\r\n \"properties\": {\r\n \"name\": \"csmws9402\",\r\n \"state\": \"Running\",\r\n \"hostNames\": [\r\n \"csmws9402.azurewebsites.net\"\r\n ],\r\n \"webSpace\": \"csmrg9761-WestUSwebspace\",\r\n \"selfLink\": \"https://waws-prod-bay-057.api.azurewebsites.windows.net:454/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/webspaces/csmrg9761-WestUSwebspace/sites/csmws9402\",\r\n \"repositorySiteName\": \"csmws9402\",\r\n \"owner\": null,\r\n \"usageState\": \"Normal\",\r\n \"enabled\": true,\r\n \"adminEnabled\": true,\r\n \"enabledHostNames\": [\r\n \"csmws9402.azurewebsites.net\",\r\n \"csmws9402.scm.azurewebsites.net\"\r\n ],\r\n \"siteProperties\": {\r\n \"metadata\": null,\r\n \"properties\": [\r\n {\r\n \"name\": \"LinuxFxVersion\",\r\n \"value\": \"\"\r\n }\r\n ],\r\n \"appSettings\": null\r\n },\r\n \"availabilityState\": \"Normal\",\r\n \"sslCertificates\": null,\r\n \"csrs\": [],\r\n \"cers\": null,\r\n \"siteMode\": null,\r\n \"hostNameSslStates\": [\r\n {\r\n \"name\": \"csmws9402.azurewebsites.net\",\r\n \"sslState\": \"Disabled\",\r\n \"ipBasedSslResult\": null,\r\n \"virtualIP\": null,\r\n \"thumbprint\": null,\r\n \"toUpdate\": null,\r\n \"toUpdateIpBasedSsl\": null,\r\n \"ipBasedSslState\": \"NotConfigured\",\r\n \"hostType\": \"Standard\"\r\n },\r\n {\r\n \"name\": \"csmws9402.scm.azurewebsites.net\",\r\n \"sslState\": \"Disabled\",\r\n \"ipBasedSslResult\": null,\r\n \"virtualIP\": null,\r\n \"thumbprint\": null,\r\n \"toUpdate\": null,\r\n \"toUpdateIpBasedSsl\": null,\r\n \"ipBasedSslState\": \"NotConfigured\",\r\n \"hostType\": \"Repository\"\r\n }\r\n ],\r\n \"computeMode\": null,\r\n \"serverFarm\": null,\r\n \"serverFarmId\": \"/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg9761/providers/Microsoft.Web/serverfarms/csmsf7649\",\r\n \"reserved\": false,\r\n \"lastModifiedTimeUtc\": \"2018-03-22T00:24:49.94\",\r\n \"storageRecoveryDefaultState\": \"Running\",\r\n \"contentAvailabilityState\": \"Normal\",\r\n \"runtimeAvailabilityState\": \"Normal\",\r\n \"siteConfig\": null,\r\n \"deploymentId\": \"csmws9402\",\r\n \"trafficManagerHostNames\": null,\r\n \"sku\": \"Standard\",\r\n \"scmSiteAlsoStopped\": false,\r\n \"targetSwapSlot\": null,\r\n \"hostingEnvironment\": null,\r\n \"hostingEnvironmentProfile\": null,\r\n \"clientAffinityEnabled\": true,\r\n \"clientCertEnabled\": false,\r\n \"hostNamesDisabled\": false,\r\n \"domainVerificationIdentifiers\": null,\r\n \"kind\": \"app\",\r\n \"outboundIpAddresses\": \"13.91.42.207,13.91.44.111,13.91.40.156,13.91.41.150\",\r\n \"possibleOutboundIpAddresses\": \"13.91.42.207,13.91.44.111,13.91.40.156,13.91.41.150\",\r\n \"containerSize\": 0,\r\n \"dailyMemoryTimeQuota\": 0,\r\n \"suspendedTill\": null,\r\n \"siteDisabledReason\": 0,\r\n \"functionExecutionUnitsCache\": null,\r\n \"maxNumberOfWorkers\": null,\r\n \"homeStamp\": \"waws-prod-bay-057\",\r\n \"cloningInfo\": null,\r\n \"snapshotInfo\": null,\r\n \"hostingEnvironmentId\": null,\r\n \"tags\": null,\r\n \"resourceGroup\": \"csmrg9761\",\r\n \"defaultHostName\": \"csmws9402.azurewebsites.net\",\r\n \"slotSwapStatus\": null,\r\n \"httpsOnly\": false\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:24:54 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "\"1D3C17430C832B0\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "9cb4ae20-207e-474c-af36-49ddcb725f9d" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "f00fb710-b525-48f9-b843-d381ad42eebf" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002454Z:f00fb710-b525-48f9-b843-d381ad42eebf" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg9761/providers/Microsoft.Web/sites/csmws9402/resourceHealthMetadata/default?api-version=2016-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlR3JvdXBzL2NzbXJnOTc2MS9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zaXRlcy9jc213czk0MDIvcmVzb3VyY2VIZWFsdGhNZXRhZGF0YS9kZWZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDMtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "8dbfacae-e034-4493-ad09-4e4655fdaae0" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg9761/providers/Microsoft.Web/sites/csmws9402/resourceHealthMetadata/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Web/sites/resourceHealthMetadata\",\r\n \"location\": \"West US\",\r\n \"properties\": {\r\n \"category\": \"Dedicated\",\r\n \"signalAvailability\": true\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:24:54 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "\"1D3C17430C832B0\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "14d5e204-8f11-45b7-afda-c1fbd6731de9" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14962" + ], + "x-ms-correlation-request-id": [ + "40672361-467b-401a-946b-c20ab9a8172b" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002454Z:40672361-467b-401a-946b-c20ab9a8172b" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg9761/providers/Microsoft.Web/sites/csmws9402?deleteMetrics=true&api-version=2016-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlR3JvdXBzL2NzbXJnOTc2MS9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zaXRlcy9jc213czk0MDI/ZGVsZXRlTWV0cmljcz10cnVlJmFwaS12ZXJzaW9uPTIwMTYtMDgtMDE=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "cd437962-9b58-4485-90ac-4c0524165a11" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:24:58 GMT" + ], + "Pragma": [ + "no-cache" + ], + "ETag": [ + "\"1D3C17430C832B0\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "0ad63954-c326-4ff8-8fdd-227929f788c3" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-correlation-request-id": [ + "04fe3d97-5d13-4ec0-92ee-5520a5bba6e5" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002458Z:04fe3d97-5d13-4ec0-92ee-5520a5bba6e5" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg9761/providers/Microsoft.Web/serverfarms/csmsf7649?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlR3JvdXBzL2NzbXJnOTc2MS9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zZXJ2ZXJmYXJtcy9jc21zZjc2NDk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "de5c8607-6ce5-46f9-ace0-9fcba36ffdbf" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:24:59 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "b17f2d19-0846-48f9-b84e-6c986037da16" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "8eb0950a-e3d9-4457-bf4a-98e0c02a5d34" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002459Z:8eb0950a-e3d9-4457-bf4a-98e0c02a5d34" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg9761/providers/Microsoft.Web/serverfarms?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlR3JvdXBzL2NzbXJnOTc2MS9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zZXJ2ZXJmYXJtcz9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e2ea272d-bb6d-478e-a52b-6fcdbd3d58c3" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [],\r\n \"nextLink\": null,\r\n \"id\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:24:59 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "8e2bdb0a-454d-46cf-b5c8-0f77d9d9533d" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14961" + ], + "x-ms-correlation-request-id": [ + "b8c9fdae-a52e-4006-99d4-79018f744ab0" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002459Z:b8c9fdae-a52e-4006-99d4-79018f744ab0" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "GetResourceHealthMetadata": [ + "csmsf7649", + "csmrg9761", + "csmws9402" + ] + }, + "Variables": { + "SubscriptionId": "0d3ae56c-deaf-4982-b514-33d016d4a683" + } +} \ No newline at end of file diff --git a/src/SDKs/WebSites/WebSites.Tests/SessionRecords/WebSites.Tests.ScenarioTests.ResourceHealthMetadataTests/ListResourceHealthMetadata.json b/src/SDKs/WebSites/WebSites.Tests/SessionRecords/WebSites.Tests.ScenarioTests.ResourceHealthMetadataTests/ListResourceHealthMetadata.json new file mode 100644 index 000000000000..00288a81cc22 --- /dev/null +++ b/src/SDKs/WebSites/WebSites.Tests/SessionRecords/WebSites.Tests.ScenarioTests.ResourceHealthMetadataTests/ListResourceHealthMetadata.json @@ -0,0 +1,507 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourcegroups/csmrg4890?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlZ3JvdXBzL2NzbXJnNDg5MD9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "29" + ], + "x-ms-client-request-id": [ + "a7f3807e-fab5-4ecf-8769-d5ba4f83d83a" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg4890\",\r\n \"name\": \"csmrg4890\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "171" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:23:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-request-id": [ + "8d268ce3-72bf-46a8-8281-58fc0a9c1177" + ], + "x-ms-correlation-request-id": [ + "8d268ce3-72bf-46a8-8281-58fc0a9c1177" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002343Z:8d268ce3-72bf-46a8-8281-58fc0a9c1177" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg4890/providers/Microsoft.Web/serverfarms/csmsf7969?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlR3JvdXBzL2NzbXJnNDg5MC9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zZXJ2ZXJmYXJtcy9jc21zZjc5Njk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"capacity\": 1\r\n },\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "110" + ], + "x-ms-client-request-id": [ + "aea0de28-248d-4c46-8fd0-c70719a98d58" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg4890/providers/Microsoft.Web/serverfarms/csmsf7969\",\r\n \"name\": \"csmsf7969\",\r\n \"type\": \"Microsoft.Web/serverfarms\",\r\n \"kind\": \"app\",\r\n \"location\": \"West US\",\r\n \"properties\": {\r\n \"serverFarmId\": 0,\r\n \"name\": \"csmsf7969\",\r\n \"workerSize\": \"Default\",\r\n \"workerSizeId\": 0,\r\n \"workerTierName\": null,\r\n \"numberOfWorkers\": 1,\r\n \"currentWorkerSize\": \"Default\",\r\n \"currentWorkerSizeId\": 0,\r\n \"currentNumberOfWorkers\": 1,\r\n \"status\": \"Ready\",\r\n \"webSpace\": \"csmrg4890-WestUSwebspace\",\r\n \"subscription\": \"0d3ae56c-deaf-4982-b514-33d016d4a683\",\r\n \"adminSiteName\": null,\r\n \"hostingEnvironment\": null,\r\n \"hostingEnvironmentProfile\": null,\r\n \"maximumNumberOfWorkers\": 10,\r\n \"planName\": \"VirtualDedicatedPlan\",\r\n \"adminRuntimeSiteName\": null,\r\n \"computeMode\": \"Shared\",\r\n \"siteMode\": null,\r\n \"geoRegion\": \"West US\",\r\n \"perSiteScaling\": false,\r\n \"numberOfSites\": 0,\r\n \"hostingEnvironmentId\": null,\r\n \"isSpot\": false,\r\n \"spotExpirationTime\": null,\r\n \"tags\": null,\r\n \"kind\": \"app\",\r\n \"resourceGroup\": \"csmrg4890\",\r\n \"reserved\": false,\r\n \"mdmId\": \"waws-prod-bay-095_1821\",\r\n \"targetWorkerCount\": 0,\r\n \"targetWorkerSizeId\": 0,\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"sku\": {\r\n \"name\": \"S1\",\r\n \"tier\": \"Standard\",\r\n \"size\": \"S1\",\r\n \"family\": \"S\",\r\n \"capacity\": 1\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:23:54 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "4019cc60-704a-415c-8254-e8cc602f433c" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "f461f7ec-2302-4bc7-8482-ed92bc61ade2" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002354Z:f461f7ec-2302-4bc7-8482-ed92bc61ade2" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg4890/providers/Microsoft.Web/sites/csmws6164?api-version=2016-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlR3JvdXBzL2NzbXJnNDg5MC9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zaXRlcy9jc213czYxNjQ/YXBpLXZlcnNpb249MjAxNi0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"serverFarmId\": \"/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourcegroups/csmrg4890/providers/Microsoft.Web/serverfarms/csmsf7969\"\r\n },\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "200" + ], + "x-ms-client-request-id": [ + "61bda2ab-ab37-41b7-bc40-bab3d4b738b6" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg4890/providers/Microsoft.Web/sites/csmws6164\",\r\n \"name\": \"csmws6164\",\r\n \"type\": \"Microsoft.Web/sites\",\r\n \"kind\": \"app\",\r\n \"location\": \"West US\",\r\n \"properties\": {\r\n \"name\": \"csmws6164\",\r\n \"state\": \"Running\",\r\n \"hostNames\": [\r\n \"csmws6164.azurewebsites.net\"\r\n ],\r\n \"webSpace\": \"csmrg4890-WestUSwebspace\",\r\n \"selfLink\": \"https://waws-prod-bay-095.api.azurewebsites.windows.net:454/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/webspaces/csmrg4890-WestUSwebspace/sites/csmws6164\",\r\n \"repositorySiteName\": \"csmws6164\",\r\n \"owner\": null,\r\n \"usageState\": \"Normal\",\r\n \"enabled\": true,\r\n \"adminEnabled\": true,\r\n \"enabledHostNames\": [\r\n \"csmws6164.azurewebsites.net\",\r\n \"csmws6164.scm.azurewebsites.net\"\r\n ],\r\n \"siteProperties\": {\r\n \"metadata\": null,\r\n \"properties\": [\r\n {\r\n \"name\": \"LinuxFxVersion\",\r\n \"value\": \"\"\r\n }\r\n ],\r\n \"appSettings\": null\r\n },\r\n \"availabilityState\": \"Normal\",\r\n \"sslCertificates\": null,\r\n \"csrs\": [],\r\n \"cers\": null,\r\n \"siteMode\": null,\r\n \"hostNameSslStates\": [\r\n {\r\n \"name\": \"csmws6164.azurewebsites.net\",\r\n \"sslState\": \"Disabled\",\r\n \"ipBasedSslResult\": null,\r\n \"virtualIP\": null,\r\n \"thumbprint\": null,\r\n \"toUpdate\": null,\r\n \"toUpdateIpBasedSsl\": null,\r\n \"ipBasedSslState\": \"NotConfigured\",\r\n \"hostType\": \"Standard\"\r\n },\r\n {\r\n \"name\": \"csmws6164.scm.azurewebsites.net\",\r\n \"sslState\": \"Disabled\",\r\n \"ipBasedSslResult\": null,\r\n \"virtualIP\": null,\r\n \"thumbprint\": null,\r\n \"toUpdate\": null,\r\n \"toUpdateIpBasedSsl\": null,\r\n \"ipBasedSslState\": \"NotConfigured\",\r\n \"hostType\": \"Repository\"\r\n }\r\n ],\r\n \"computeMode\": null,\r\n \"serverFarm\": null,\r\n \"serverFarmId\": \"/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg4890/providers/Microsoft.Web/serverfarms/csmsf7969\",\r\n \"reserved\": false,\r\n \"lastModifiedTimeUtc\": \"2018-03-22T00:23:56.3833333\",\r\n \"storageRecoveryDefaultState\": \"Running\",\r\n \"contentAvailabilityState\": \"Normal\",\r\n \"runtimeAvailabilityState\": \"Normal\",\r\n \"siteConfig\": null,\r\n \"deploymentId\": \"csmws6164\",\r\n \"trafficManagerHostNames\": null,\r\n \"sku\": \"Standard\",\r\n \"scmSiteAlsoStopped\": false,\r\n \"targetSwapSlot\": null,\r\n \"hostingEnvironment\": null,\r\n \"hostingEnvironmentProfile\": null,\r\n \"clientAffinityEnabled\": true,\r\n \"clientCertEnabled\": false,\r\n \"hostNamesDisabled\": false,\r\n \"domainVerificationIdentifiers\": null,\r\n \"kind\": \"app\",\r\n \"outboundIpAddresses\": \"13.93.158.16,52.160.98.75,13.64.78.195,13.64.73.242,13.64.72.148\",\r\n \"possibleOutboundIpAddresses\": \"13.93.158.16,52.160.98.75,13.64.78.195,13.64.73.242,13.64.72.148,13.64.75.221,13.64.78.152\",\r\n \"containerSize\": 0,\r\n \"dailyMemoryTimeQuota\": 0,\r\n \"suspendedTill\": null,\r\n \"siteDisabledReason\": 0,\r\n \"functionExecutionUnitsCache\": null,\r\n \"maxNumberOfWorkers\": null,\r\n \"homeStamp\": \"waws-prod-bay-095\",\r\n \"cloningInfo\": null,\r\n \"snapshotInfo\": null,\r\n \"hostingEnvironmentId\": null,\r\n \"tags\": null,\r\n \"resourceGroup\": \"csmrg4890\",\r\n \"defaultHostName\": \"csmws6164.azurewebsites.net\",\r\n \"slotSwapStatus\": null,\r\n \"httpsOnly\": false\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:24:29 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "\"1D3C17410B5E6C0\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "ed3a21c3-1651-4584-bea9-eaf79e33a662" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "c5e90153-4308-41ba-9778-7d4b7bb818ae" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002430Z:c5e90153-4308-41ba-9778-7d4b7bb818ae" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg4890/providers/Microsoft.Web/sites/csmws6164/resourceHealthMetadata?api-version=2016-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlR3JvdXBzL2NzbXJnNDg5MC9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zaXRlcy9jc213czYxNjQvcmVzb3VyY2VIZWFsdGhNZXRhZGF0YT9hcGktdmVyc2lvbj0yMDE2LTAzLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "bc336463-ddb2-4cb5-a9da-70b76bf627a6" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg4890/providers/Microsoft.Web/sites/csmws6164/resourceHealthMetadata/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Web/sites/resourceHealthMetadata\",\r\n \"location\": \"West US\",\r\n \"properties\": {\r\n \"category\": \"Dedicated\",\r\n \"signalAvailability\": true\r\n }\r\n }\r\n ],\r\n \"nextLink\": null,\r\n \"id\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:24:31 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "\"1D3C17410B5E6C0\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "7c75a0eb-92d5-457a-a2b6-649f1345cc22" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14950" + ], + "x-ms-correlation-request-id": [ + "0417f953-57cd-4d2e-bc62-d3e3e0e6fefe" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002431Z:0417f953-57cd-4d2e-bc62-d3e3e0e6fefe" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg4890/providers/Microsoft.Web/sites/csmws6164?deleteMetrics=true&api-version=2016-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlR3JvdXBzL2NzbXJnNDg5MC9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zaXRlcy9jc213czYxNjQ/ZGVsZXRlTWV0cmljcz10cnVlJmFwaS12ZXJzaW9uPTIwMTYtMDgtMDE=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "4f7c8748-dd3a-49c7-ba96-6c051eddb8c0" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:24:33 GMT" + ], + "Pragma": [ + "no-cache" + ], + "ETag": [ + "\"1D3C17410B5E6C0\"" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "a34baba5-cc8d-41f6-81b5-3f3c8f63f3f6" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-correlation-request-id": [ + "a79753fc-941c-4a5d-9cd7-82e867749022" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002433Z:a79753fc-941c-4a5d-9cd7-82e867749022" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg4890/providers/Microsoft.Web/serverfarms/csmsf7969?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlR3JvdXBzL2NzbXJnNDg5MC9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zZXJ2ZXJmYXJtcy9jc21zZjc5Njk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0db52585-8e12-45f4-98cf-c1359a4e36c3" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:24:34 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "9ecdba21-960e-43aa-9231-05f9ad0b0554" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "21288a71-d20c-4935-a263-df6cfc194efa" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002434Z:21288a71-d20c-4935-a263-df6cfc194efa" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/0d3ae56c-deaf-4982-b514-33d016d4a683/resourceGroups/csmrg4890/providers/Microsoft.Web/serverfarms?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGQzYWU1NmMtZGVhZi00OTgyLWI1MTQtMzNkMDE2ZDRhNjgzL3Jlc291cmNlR3JvdXBzL2NzbXJnNDg5MC9wcm92aWRlcnMvTWljcm9zb2Z0LldlYi9zZXJ2ZXJmYXJtcz9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9d0df7c5-b1d9-4bcb-b8d4-adfb5f685cd9" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.WebSites.WebSiteManagementClient/1.7.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [],\r\n \"nextLink\": null,\r\n \"id\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Mar 2018 00:24:34 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "c7c27b17-4784-4034-b6c2-90e8cfb30203" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14949" + ], + "x-ms-correlation-request-id": [ + "d1d92124-4e24-458b-8eb5-54dd73992e0a" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180322T002434Z:d1d92124-4e24-458b-8eb5-54dd73992e0a" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "ListResourceHealthMetadata": [ + "csmsf7969", + "csmrg4890", + "csmws6164" + ] + }, + "Variables": { + "SubscriptionId": "0d3ae56c-deaf-4982-b514-33d016d4a683" + } +} \ No newline at end of file diff --git a/src/SDKs/_metadata/web_resource-manager.txt b/src/SDKs/_metadata/web_resource-manager.txt index 14bee140be1c..2f313e593cad 100644 --- a/src/SDKs/_metadata/web_resource-manager.txt +++ b/src/SDKs/_metadata/web_resource-manager.txt @@ -1,11 +1,11 @@ -2018-03-07 00:41:58 UTC +2018-03-21 18:44:19 UTC 1) azure-rest-api-specs repository information GitHub user: Azure Branch: master -Commit: 6413da9d67978175f4252ed15d82b79f341b6385 +Commit: 5858b97e9d42f5610b078b3a10b211c7773898cc 2) AutoRest information Requested version: latest -Bootstrapper version: C:\Users\mikono\AppData\Roaming\npm `-- autorest@2.0.4245 +Bootstrapper version: C:\Users\pavelzel\AppData\Roaming\npm `-- autorest@2.0.4245 Latest installed version: From b6028e8dc624e52cb7c463cf2667093387b988b1 Mon Sep 17 00:00:00 2001 From: Pavel P Zelinsky Date: Wed, 21 Mar 2018 18:18:05 -0700 Subject: [PATCH 2/2] Updating WebSites SDK versions Updating WebSites SDK versions --- .../Microsoft.Azure.Management.Websites.csproj | 2 +- .../WebSites/Management.Websites/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SDKs/WebSites/Management.Websites/Microsoft.Azure.Management.Websites.csproj b/src/SDKs/WebSites/Management.Websites/Microsoft.Azure.Management.Websites.csproj index 6a38710380ee..dc82f5603715 100644 --- a/src/SDKs/WebSites/Management.Websites/Microsoft.Azure.Management.Websites.csproj +++ b/src/SDKs/WebSites/Management.Websites/Microsoft.Azure.Management.Websites.csproj @@ -7,7 +7,7 @@ Microsoft.Azure.Management.Websites Provides website management capabilities for Microsoft Azure. Microsoft.Azure.Management.Websites - 1.8.0-preview + 1.9.0-preview Microsoft Azure website management;website management; diff --git a/src/SDKs/WebSites/Management.Websites/Properties/AssemblyInfo.cs b/src/SDKs/WebSites/Management.Websites/Properties/AssemblyInfo.cs index c55bf564c388..9d8185e57c52 100644 --- a/src/SDKs/WebSites/Management.Websites/Properties/AssemblyInfo.cs +++ b/src/SDKs/WebSites/Management.Websites/Properties/AssemblyInfo.cs @@ -9,7 +9,7 @@ [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Web Sites.")] [assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("1.7.0")] +[assembly: AssemblyFileVersion("1.8.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Azure .NET SDK")]