/// <summary> /// Initiates the recommendation generation or computation process for a /// subscription. This operation is asynchronous. The generated recommendations /// are stored in a cache in the Advisor service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RecommendationsGenerateHeaders> GenerateAsync(this IRecommendationsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GenerateWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Headers); } }
/// <summary> /// Get past recommendations for an app, optionally specified by the time /// range. /// </summary> /// <remarks> /// Get past recommendations for an app, optionally specified by the time /// range. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the resource group to which the resource belongs. /// </param> /// <param name='siteName'> /// Name of the app. /// </param> /// <param name='filter'> /// Filter is specified by using OData syntax. Example: $filter=channels eq /// 'Api' or channel eq 'Notification' and startTime eq '2014-01-01T00:00:00Z' /// and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq /// duration'[PT1H|PT1M|P1D] /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Recommendation> > ListHistoryForWebAppAsync(this IRecommendationsOperations operations, string resourceGroupName, string siteName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListHistoryForWebAppWithHttpMessagesAsync(resourceGroupName, siteName, filter, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Obtains details of a cached recommendation. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceUri'> /// The fully qualified Azure Resource Manager identifier of the resource to /// which the recommendation applies. /// </param> /// <param name='recommendationId'> /// The recommendation ID. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ResourceRecommendationBase> GetAsync(this IRecommendationsOperations operations, string resourceUri, string recommendationId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, recommendationId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Obtains cached recommendations for a subscription. The recommendations are /// generated or computed by invoking generateRecommendations. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <ResourceRecommendationBase> > ListNextAsync(this IRecommendationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List all recommendations for a subscription. /// </summary> /// <remarks> /// List all recommendations for a subscription. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='featured'> /// Specify <code>true</code> to return only the most critical /// recommendations. The default is <code>false</code>, which /// returns all recommendations. /// </param> /// <param name='filter'> /// Filter is specified by using OData syntax. Example: $filter=channels eq /// 'Api' or channel eq 'Notification' and startTime eq '2014-01-01T00:00:00Z' /// and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq /// duration'[PT1H|PT1M|P1D] /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <RecommendationInner> > ListAsync(this IRecommendationsOperations operations, bool?featured = default(bool?), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(featured, filter, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the detailed properties of the recommendation object for the /// specified web site. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='siteName'> /// Site name /// </param> /// <param name='name'> /// Recommendation rule name /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RecommendationRule> GetRuleDetailsBySiteNameAsync(this IRecommendationsOperations operations, string resourceGroupName, string siteName, string name, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetRuleDetailsBySiteNameWithHttpMessagesAsync(resourceGroupName, siteName, name, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Obtains cached recommendations for a subscription. The recommendations are /// generated or computed by invoking generateRecommendations. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='filter'> /// The filter to apply to the recommendations. /// </param> /// <param name='top'> /// The number of recommendations per page if a paged version of this API is /// being used. /// </param> /// <param name='skipToken'> /// The page-continuation token to use with a paged version of this API. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <ResourceRecommendationBase> > ListAsync(this IRecommendationsOperations operations, string filter = default(string), int?top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(filter, top, skipToken, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Disables the specified rule so it will not apply to a subscription in the /// future. /// </summary> /// <remarks> /// Disables the specified rule so it will not apply to a subscription in the /// future. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='name'> /// Rule name /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DisableRecommendationForSubscriptionAsync(this IRecommendationsOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DisableRecommendationForSubscriptionWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Reset all recommendation opt-out settings for a subscription. /// </summary> /// <remarks> /// Reset all recommendation opt-out settings for a subscription. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task ResetAllFiltersAsync(this IRecommendationsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.ResetAllFiltersWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Disables the specific rule for a web site permanently. /// </summary> /// <remarks> /// Disables the specific rule for a web site permanently. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the resource group to which the resource belongs. /// </param> /// <param name='siteName'> /// Site name /// </param> /// <param name='name'> /// Rule name /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DisableRecommendationForSiteAsync(this IRecommendationsOperations operations, string resourceGroupName, string siteName, string name, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DisableRecommendationForSiteWithHttpMessagesAsync(resourceGroupName, siteName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Get all recommendations for an app. /// </summary> /// <remarks> /// Get all recommendations for an app. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <Recommendation> ListRecommendedRulesForWebAppNext(this IRecommendationsOperations operations, string nextPageLink) { return(operations.ListRecommendedRulesForWebAppNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Get all recommendations for an app. /// </summary> /// <remarks> /// Get all recommendations for an app. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the resource group to which the resource belongs. /// </param> /// <param name='hostingEnvironmentName'> /// Name of the app. /// </param> /// <param name='featured'> /// Specify <code>true</code> to return only the most critical /// recommendations. The default is <code>false</code>, which /// returns all recommendations. /// </param> /// <param name='filter'> /// Return only channels specified in the filter. Filter is specified by using /// OData syntax. Example: $filter=channel eq 'Api' or channel eq /// 'Notification' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <RecommendationInner> > ListRecommendedRulesForHostingEnvironmentAsync(this IRecommendationsOperations operations, string resourceGroupName, string hostingEnvironmentName, bool?featured = default(bool?), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListRecommendedRulesForHostingEnvironmentWithHttpMessagesAsync(resourceGroupName, hostingEnvironmentName, featured, filter, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Obtains details of a cached recommendation. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceUri'> /// The fully qualified Azure Resource Manager identifier of the resource to /// which the recommendation applies. /// </param> /// <param name='recommendationId'> /// The recommendation ID. /// </param> public static ResourceRecommendationBase Get(this IRecommendationsOperations operations, string resourceUri, string recommendationId) { return(operations.GetAsync(resourceUri, recommendationId).GetAwaiter().GetResult()); }
/// <summary> /// Gets a list of recommendations associated with the specified subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='featured'> /// If set, this API returns only the most critical recommendation among the /// others. Otherwise this API returns all recommendations available /// </param> /// <param name='filter'> /// Return only channels specified in the filter. Filter is specified by using /// OData syntax. Example: $filter=channels eq 'Api' or channel eq /// 'Notification' /// </param> public static IList <Recommendation> GetRecommendationBySubscription(this IRecommendationsOperations operations, bool?featured = default(bool?), string filter = default(string)) { return(Task.Factory.StartNew(s => ((IRecommendationsOperations)s).GetRecommendationBySubscriptionAsync(featured, filter), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Gets the list of past recommendations optionally specified by the time /// range. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='siteName'> /// Site name /// </param> /// <param name='startTime'> /// The start time of a time range to query, e.g. $filter=startTime eq /// '2015-01-01T00:00:00Z' and endTime eq '2015-01-02T00:00:00Z' /// </param> /// <param name='endTime'> /// The end time of a time range to query, e.g. $filter=startTime eq /// '2015-01-01T00:00:00Z' and endTime eq '2015-01-02T00:00:00Z' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IList <Recommendation> > GetRecommendationHistoryForSiteAsync(this IRecommendationsOperations operations, string resourceGroupName, string siteName, string startTime = default(string), string endTime = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetRecommendationHistoryForSiteWithHttpMessagesAsync(resourceGroupName, siteName, startTime, endTime, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the list of past recommendations optionally specified by the time /// range. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='siteName'> /// Site name /// </param> /// <param name='startTime'> /// The start time of a time range to query, e.g. $filter=startTime eq /// '2015-01-01T00:00:00Z' and endTime eq '2015-01-02T00:00:00Z' /// </param> /// <param name='endTime'> /// The end time of a time range to query, e.g. $filter=startTime eq /// '2015-01-01T00:00:00Z' and endTime eq '2015-01-02T00:00:00Z' /// </param> public static IList <Recommendation> GetRecommendationHistoryForSite(this IRecommendationsOperations operations, string resourceGroupName, string siteName, string startTime = default(string), string endTime = default(string)) { return(Task.Factory.StartNew(s => ((IRecommendationsOperations)s).GetRecommendationHistoryForSiteAsync(resourceGroupName, siteName, startTime, endTime), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Gets a list of recommendations associated with the specified web site. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='siteName'> /// Site name /// </param> /// <param name='featured'> /// If set, this API returns only the most critical recommendation among the /// others. Otherwise this API returns all recommendations available /// </param> /// <param name='siteSku'> /// The name of site SKU. /// </param> /// <param name='numSlots'> /// The number of site slots associated to the site /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IList <Recommendation> > GetRecommendedRulesForSiteAsync(this IRecommendationsOperations operations, string resourceGroupName, string siteName, bool?featured = default(bool?), string siteSku = default(string), int?numSlots = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetRecommendedRulesForSiteWithHttpMessagesAsync(resourceGroupName, siteName, featured, siteSku, numSlots, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets a list of recommendations associated with the specified web site. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='siteName'> /// Site name /// </param> /// <param name='featured'> /// If set, this API returns only the most critical recommendation among the /// others. Otherwise this API returns all recommendations available /// </param> /// <param name='siteSku'> /// The name of site SKU. /// </param> /// <param name='numSlots'> /// The number of site slots associated to the site /// </param> public static IList <Recommendation> GetRecommendedRulesForSite(this IRecommendationsOperations operations, string resourceGroupName, string siteName, bool?featured = default(bool?), string siteSku = default(string), int?numSlots = default(int?)) { return(Task.Factory.StartNew(s => ((IRecommendationsOperations)s).GetRecommendedRulesForSiteAsync(resourceGroupName, siteName, featured, siteSku, numSlots), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Reset all recommendation opt-out settings for an app. /// </summary> /// <remarks> /// Reset all recommendation opt-out settings for an app. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the resource group to which the resource belongs. /// </param> /// <param name='environmentName'> /// Name of the app. /// </param> /// <param name='hostingEnvironmentName'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task ResetAllFiltersForHostingEnvironmentAsync(this IRecommendationsOperations operations, string resourceGroupName, string environmentName, string hostingEnvironmentName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.ResetAllFiltersForHostingEnvironmentWithHttpMessagesAsync(resourceGroupName, environmentName, hostingEnvironmentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Obtains cached recommendations for a subscription. The recommendations are /// generated or computed by invoking generateRecommendations. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='filter'> /// The filter to apply to the recommendations. /// </param> /// <param name='top'> /// The number of recommendations per page if a paged version of this API is /// being used. /// </param> /// <param name='skipToken'> /// The page-continuation token to use with a paged version of this API. /// </param> public static IPage <ResourceRecommendationBase> List(this IRecommendationsOperations operations, string filter = default(string), int?top = default(int?), string skipToken = default(string)) { return(operations.ListAsync(filter, top, skipToken).GetAwaiter().GetResult()); }
/// <summary> /// Obtains cached recommendations for a subscription. The recommendations are /// generated or computed by invoking generateRecommendations. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <ResourceRecommendationBase> ListNext(this IRecommendationsOperations operations, string nextPageLink) { return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Initiates the recommendation generation or computation process for a /// subscription. This operation is asynchronous. The generated recommendations /// are stored in a cache in the Advisor service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static RecommendationsGenerateHeaders Generate(this IRecommendationsOperations operations) { return(operations.GenerateAsync().GetAwaiter().GetResult()); }
/// <summary> /// Gets the detailed properties of the recommendation object for the /// specified web site. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='siteName'> /// Site name /// </param> /// <param name='name'> /// Recommendation rule name /// </param> public static RecommendationRule GetRuleDetailsBySiteName(this IRecommendationsOperations operations, string resourceGroupName, string siteName, string name) { return(Task.Factory.StartNew(s => ((IRecommendationsOperations)s).GetRuleDetailsBySiteNameAsync(resourceGroupName, siteName, name), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Reset all recommendation opt-out settings for a subscription. /// </summary> /// <remarks> /// Reset all recommendation opt-out settings for a subscription. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static void ResetAllFilters(this IRecommendationsOperations operations) { operations.ResetAllFiltersAsync().GetAwaiter().GetResult(); }
/// <summary> /// Retrieves the status of the recommendation computation or generation /// process. Invoke this API after calling the generation recommendation. The /// URI of this API is returned in the Location field of the response header. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='operationId'> /// The operation ID, which can be found from the Location field in the /// generate recommendation response header. /// </param> public static void GetGenerateStatus(this IRecommendationsOperations operations, System.Guid operationId) { operations.GetGenerateStatusAsync(operationId).GetAwaiter().GetResult(); }
/// <summary> /// List all recommendations for a subscription. /// </summary> /// <remarks> /// List all recommendations for a subscription. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='featured'> /// Specify <code>true</code> to return only the most critical /// recommendations. The default is <code>false</code>, which /// returns all recommendations. /// </param> /// <param name='filter'> /// Filter is specified by using OData syntax. Example: $filter=channels eq /// 'Api' or channel eq 'Notification' and startTime eq '2014-01-01T00:00:00Z' /// and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq /// duration'[PT1H|PT1M|P1D] /// </param> public static IPage <Recommendation> List(this IRecommendationsOperations operations, bool?featured = default(bool?), string filter = default(string)) { return(operations.ListAsync(featured, filter).GetAwaiter().GetResult()); }
/// <summary> /// Reset all recommendation opt-out settings for an app. /// </summary> /// <remarks> /// Reset all recommendation opt-out settings for an app. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the resource group to which the resource belongs. /// </param> /// <param name='siteName'> /// Name of the app. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task ResetAllFiltersForWebAppAsync(this IRecommendationsOperations operations, string resourceGroupName, string siteName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.ResetAllFiltersForWebAppWithHttpMessagesAsync(resourceGroupName, siteName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Disables the specific rule for a web site permanently. /// </summary> /// <remarks> /// Disables the specific rule for a web site permanently. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the resource group to which the resource belongs. /// </param> /// <param name='siteName'> /// Site name /// </param> /// <param name='name'> /// Rule name /// </param> public static void DisableRecommendationForSite(this IRecommendationsOperations operations, string resourceGroupName, string siteName, string name) { operations.DisableRecommendationForSiteAsync(resourceGroupName, siteName, name).GetAwaiter().GetResult(); }
/// <summary> /// Retrieves the status of the recommendation computation or generation /// process. Invoke this API after calling the generation recommendation. The /// URI of this API is returned in the Location field of the response header. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='operationId'> /// The operation ID, which can be found from the Location field in the /// generate recommendation response header. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task GetGenerateStatusAsync(this IRecommendationsOperations operations, System.Guid operationId, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.GetGenerateStatusWithHttpMessagesAsync(operationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Get a recommendation rule for an app. /// </summary> /// <remarks> /// Get a recommendation rule for an app. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the resource group to which the resource belongs. /// </param> /// <param name='siteName'> /// Name of the app. /// </param> /// <param name='name'> /// Name of the recommendation. /// </param> /// <param name='updateSeen'> /// Specify <code>true</code> to update the last-seen timestamp of /// the recommendation object. /// </param> /// <param name='recommendationId'> /// The GUID of the recommedation object if you query an expired one. You don't /// need to specify it to query an active entry. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RecommendationRuleInner> GetRuleDetailsByWebAppAsync(this IRecommendationsOperations operations, string resourceGroupName, string siteName, string name, bool?updateSeen = default(bool?), string recommendationId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetRuleDetailsByWebAppWithHttpMessagesAsync(resourceGroupName, siteName, name, updateSeen, recommendationId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }