Class: Azure::Web::Mgmt::V2018_02_01::Recommendations

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb

Overview

WebSite Management Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Recommendations

Creates and initializes a new instance of the Recommendations class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientWebSiteManagementClient (readonly)

Returns reference to the WebSiteManagementClient.

Returns:



22
23
24
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 22

def client
  @client
end

Instance Method Details

#disable_all_for_web_app(resource_group_name, site_name, custom_headers: nil) ⇒ Object

Disable all recommendations for an app.

Disable all recommendations for an app.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



575
576
577
578
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 575

def disable_all_for_web_app(resource_group_name, site_name, custom_headers:nil)
  response = disable_all_for_web_app_async(resource_group_name, site_name, custom_headers:custom_headers).value!
  nil
end

#disable_all_for_web_app_async(resource_group_name, site_name, custom_headers: nil) ⇒ Concurrent::Promise

Disable all recommendations for an app.

Disable all recommendations for an app.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 610

def disable_all_for_web_app_async(resource_group_name, site_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'site_name is nil' if site_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/disable'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#disable_all_for_web_app_with_http_info(resource_group_name, site_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Disable all recommendations for an app.

Disable all recommendations for an app.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



593
594
595
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 593

def disable_all_for_web_app_with_http_info(resource_group_name, site_name, custom_headers:nil)
  disable_all_for_web_app_async(resource_group_name, site_name, custom_headers:custom_headers).value!
end

#disable_recommendation_for_site(resource_group_name, site_name, name, custom_headers: nil) ⇒ Object

Disables the specific rule for a web site permanently.

Disables the specific rule for a web site permanently.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Site name

  • name (String)

    Rule name

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



888
889
890
891
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 888

def disable_recommendation_for_site(resource_group_name, site_name, name, custom_headers:nil)
  response = disable_recommendation_for_site_async(resource_group_name, site_name, name, custom_headers:custom_headers).value!
  nil
end

#disable_recommendation_for_site_async(resource_group_name, site_name, name, custom_headers: nil) ⇒ Concurrent::Promise

Disables the specific rule for a web site permanently.

Disables the specific rule for a web site permanently.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Site name

  • name (String)

    Rule name

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 925

def disable_recommendation_for_site_async(resource_group_name, site_name, name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'site_name is nil' if site_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#disable_recommendation_for_site_with_http_info(resource_group_name, site_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Disables the specific rule for a web site permanently.

Disables the specific rule for a web site permanently.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Site name

  • name (String)

    Rule name

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



907
908
909
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 907

def disable_recommendation_for_site_with_http_info(resource_group_name, site_name, name, custom_headers:nil)
  disable_recommendation_for_site_async(resource_group_name, site_name, name, custom_headers:custom_headers).value!
end

#disable_recommendation_for_subscription(name, custom_headers: nil) ⇒ Object

Disables the specified rule so it will not apply to a subscription in the future.

Disables the specified rule so it will not apply to a subscription in the future.

will be added to the HTTP request.

Parameters:

  • name (String)

    Rule name

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



231
232
233
234
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 231

def disable_recommendation_for_subscription(name, custom_headers:nil)
  response = disable_recommendation_for_subscription_async(name, custom_headers:custom_headers).value!
  nil
end

#disable_recommendation_for_subscription_async(name, custom_headers: nil) ⇒ Concurrent::Promise

Disables the specified rule so it will not apply to a subscription in the future.

Disables the specified rule so it will not apply to a subscription in the future.

to the HTTP request.

Parameters:

  • name (String)

    Rule name

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 266

def disable_recommendation_for_subscription_async(name, custom_headers:nil)
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#disable_recommendation_for_subscription_with_http_info(name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Disables the specified rule so it will not apply to a subscription in the future.

Disables the specified rule so it will not apply to a subscription in the future.

will be added to the HTTP request.

Parameters:

  • name (String)

    Rule name

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



249
250
251
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 249

def disable_recommendation_for_subscription_with_http_info(name, custom_headers:nil)
  disable_recommendation_for_subscription_async(name, custom_headers:custom_headers).value!
end

#get_rule_details_by_web_app(resource_group_name, site_name, name, update_seen: nil, recommendation_id: nil, custom_headers: nil) ⇒ RecommendationRule

Get a recommendation rule for an app.

Get a recommendation rule for an app.

resource belongs. last-seen timestamp of the recommendation object. query an expired one. You don’t need to specify it to query an active entry. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • name (String)

    Name of the recommendation.

  • update_seen (Boolean) (defaults to: nil)

    Specify true to update the

  • recommendation_id (String) (defaults to: nil)

    The GUID of the recommedation object if you

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (RecommendationRule)

    operation results.



771
772
773
774
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 771

def get_rule_details_by_web_app(resource_group_name, site_name, name, update_seen:nil, recommendation_id:nil, custom_headers:nil)
  response = get_rule_details_by_web_app_async(resource_group_name, site_name, name, update_seen:update_seen, recommendation_id:recommendation_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_rule_details_by_web_app_async(resource_group_name, site_name, name, update_seen: nil, recommendation_id: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get a recommendation rule for an app.

Get a recommendation rule for an app.

resource belongs. last-seen timestamp of the recommendation object. query an expired one. You don’t need to specify it to query an active entry. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • name (String)

    Name of the recommendation.

  • update_seen (Boolean) (defaults to: nil)

    Specify true to update the

  • recommendation_id (String) (defaults to: nil)

    The GUID of the recommedation object if you

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 816

def get_rule_details_by_web_app_async(resource_group_name, site_name, name, update_seen:nil, recommendation_id:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'site_name is nil' if site_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'updateSeen' => update_seen,'recommendationId' => recommendation_id,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::RecommendationRule.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_rule_details_by_web_app_with_http_info(resource_group_name, site_name, name, update_seen: nil, recommendation_id: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a recommendation rule for an app.

Get a recommendation rule for an app.

resource belongs. last-seen timestamp of the recommendation object. query an expired one. You don’t need to specify it to query an active entry. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • name (String)

    Name of the recommendation.

  • update_seen (Boolean) (defaults to: nil)

    Specify true to update the

  • recommendation_id (String) (defaults to: nil)

    The GUID of the recommedation object if you

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



794
795
796
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 794

def get_rule_details_by_web_app_with_http_info(resource_group_name, site_name, name, update_seen:nil, recommendation_id:nil, custom_headers:nil)
  get_rule_details_by_web_app_async(resource_group_name, site_name, name, update_seen:update_seen, recommendation_id:recommendation_id, custom_headers:custom_headers).value!
end

#list(featured: nil, filter: nil, custom_headers: nil) ⇒ Array<Recommendation>

List all recommendations for a subscription.

List all recommendations for a subscription.

critical recommendations. The default is false, which returns all recommendations. $filter=channel 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’ will be added to the HTTP request.

Parameters:

  • featured (Boolean) (defaults to: nil)

    Specify true to return only the most

  • filter (String) (defaults to: nil)

    Filter is specified by using OData syntax. Example:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<Recommendation>)

    operation results.



41
42
43
44
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 41

def list(featured:nil, filter:nil, custom_headers:nil)
  first_page = list_as_lazy(featured:featured, filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_as_lazy(featured: nil, filter: nil, custom_headers: nil) ⇒ RecommendationCollection

List all recommendations for a subscription.

List all recommendations for a subscription.

critical recommendations. The default is false, which returns all recommendations. $filter=channel 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’ will be added to the HTTP request.

response.

Parameters:

  • featured (Boolean) (defaults to: nil)

    Specify true to return only the most

  • filter (String) (defaults to: nil)

    Filter is specified by using OData syntax. Example:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (RecommendationCollection)

    which provide lazy access to pages of the



1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 1280

def list_as_lazy(featured:nil, filter:nil, custom_headers:nil)
  response = list_async(featured:featured, filter:filter, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_async(featured: nil, filter: nil, custom_headers: nil) ⇒ Concurrent::Promise

List all recommendations for a subscription.

List all recommendations for a subscription.

critical recommendations. The default is false, which returns all recommendations. $filter=channel 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’ to the HTTP request.

Parameters:

  • featured (Boolean) (defaults to: nil)

    Specify true to return only the most

  • filter (String) (defaults to: nil)

    Filter is specified by using OData syntax. Example:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 84

def list_async(featured:nil, filter:nil, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'featured' => featured,'api-version' => @client.api_version},
      skip_encoding_query_params: {'$filter' => filter},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::RecommendationCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_history_for_web_app(resource_group_name, site_name, expired_only: nil, filter: nil, custom_headers: nil) ⇒ Array<Recommendation>

Get past recommendations for an app, optionally specified by the time range.

Get past recommendations for an app, optionally specified by the time range.

resource belongs. recommendations. The default is true, which returns only expired recommendations. $filter=channel 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’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • expired_only (Boolean) (defaults to: nil)

    Specify false to return all

  • filter (String) (defaults to: nil)

    Filter is specified by using OData syntax. Example:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<Recommendation>)

    operation results.



330
331
332
333
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 330

def list_history_for_web_app(resource_group_name, site_name, expired_only:nil, filter:nil, custom_headers:nil)
  first_page = list_history_for_web_app_as_lazy(resource_group_name, site_name, expired_only:expired_only, filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_history_for_web_app_as_lazy(resource_group_name, site_name, expired_only: nil, filter: nil, custom_headers: nil) ⇒ RecommendationCollection

Get past recommendations for an app, optionally specified by the time range.

Get past recommendations for an app, optionally specified by the time range.

resource belongs. recommendations. The default is true, which returns only expired recommendations. $filter=channel 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’ will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • expired_only (Boolean) (defaults to: nil)

    Specify false to return all

  • filter (String) (defaults to: nil)

    Filter is specified by using OData syntax. Example:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (RecommendationCollection)

    which provide lazy access to pages of the



1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 1312

def list_history_for_web_app_as_lazy(resource_group_name, site_name, expired_only:nil, filter:nil, custom_headers:nil)
  response = list_history_for_web_app_async(resource_group_name, site_name, expired_only:expired_only, filter:filter, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_history_for_web_app_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_history_for_web_app_async(resource_group_name, site_name, expired_only: nil, filter: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get past recommendations for an app, optionally specified by the time range.

Get past recommendations for an app, optionally specified by the time range.

resource belongs. recommendations. The default is true, which returns only expired recommendations. $filter=channel 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’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • expired_only (Boolean) (defaults to: nil)

    Specify false to return all

  • filter (String) (defaults to: nil)

    Filter is specified by using OData syntax. Example:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 379

def list_history_for_web_app_async(resource_group_name, site_name, expired_only:nil, filter:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'site_name is nil' if site_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_name,'subscriptionId' => @client.subscription_id},
      query_params: {'expiredOnly' => expired_only,'api-version' => @client.api_version},
      skip_encoding_query_params: {'$filter' => filter},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::RecommendationCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_history_for_web_app_next(next_page_link, custom_headers: nil) ⇒ RecommendationCollection

Get past recommendations for an app, optionally specified by the time range.

Get past recommendations for an app, optionally specified by the time range.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (RecommendationCollection)

    operation results.



1082
1083
1084
1085
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 1082

def list_history_for_web_app_next(next_page_link, custom_headers:nil)
  response = list_history_for_web_app_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_history_for_web_app_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get past recommendations for an app, optionally specified by the time range.

Get past recommendations for an app, optionally specified by the time range.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 1115

def list_history_for_web_app_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::RecommendationCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_history_for_web_app_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get past recommendations for an app, optionally specified by the time range.

Get past recommendations for an app, optionally specified by the time range.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1099
1100
1101
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 1099

def list_history_for_web_app_next_with_http_info(next_page_link, custom_headers:nil)
  list_history_for_web_app_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_history_for_web_app_with_http_info(resource_group_name, site_name, expired_only: nil, filter: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get past recommendations for an app, optionally specified by the time range.

Get past recommendations for an app, optionally specified by the time range.

resource belongs. recommendations. The default is true, which returns only expired recommendations. $filter=channel 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’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • expired_only (Boolean) (defaults to: nil)

    Specify false to return all

  • filter (String) (defaults to: nil)

    Filter is specified by using OData syntax. Example:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



355
356
357
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 355

def list_history_for_web_app_with_http_info(resource_group_name, site_name, expired_only:nil, filter:nil, custom_headers:nil)
  list_history_for_web_app_async(resource_group_name, site_name, expired_only:expired_only, filter:filter, custom_headers:custom_headers).value!
end

#list_next(next_page_link, custom_headers: nil) ⇒ RecommendationCollection

List all recommendations for a subscription.

List all recommendations for a subscription.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (RecommendationCollection)

    operation results.



986
987
988
989
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 986

def list_next(next_page_link, custom_headers:nil)
  response = list_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

List all recommendations for a subscription.

List all recommendations for a subscription.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 1019

def list_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::RecommendationCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List all recommendations for a subscription.

List all recommendations for a subscription.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1003
1004
1005
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 1003

def list_next_with_http_info(next_page_link, custom_headers:nil)
  list_next_async(next_page_link, custom_headers:custom_headers).value!
end

Get all recommendations for an app.

Get all recommendations for an app.

resource belongs. critical recommendations. The default is false, which returns all recommendations. is specified by using OData syntax. Example: $filter=channel eq ‘Api’ or channel eq ‘Notification’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • featured (Boolean) (defaults to: nil)

    Specify true to return only the most

  • filter (String) (defaults to: nil)

    Return only channels specified in the filter. Filter

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<Recommendation>)

    operation results.



457
458
459
460
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 457

def list_recommended_rules_for_web_app(resource_group_name, site_name, featured:nil, filter:nil, custom_headers:nil)
  first_page = list_recommended_rules_for_web_app_as_lazy(resource_group_name, site_name, featured:featured, filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

Get all recommendations for an app.

Get all recommendations for an app.

resource belongs. critical recommendations. The default is false, which returns all recommendations. is specified by using OData syntax. Example: $filter=channel eq ‘Api’ or channel eq ‘Notification’ will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • featured (Boolean) (defaults to: nil)

    Specify true to return only the most

  • filter (String) (defaults to: nil)

    Return only channels specified in the filter. Filter

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (RecommendationCollection)

    which provide lazy access to pages of the



1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 1343

def list_recommended_rules_for_web_app_as_lazy(resource_group_name, site_name, featured:nil, filter:nil, custom_headers:nil)
  response = list_recommended_rules_for_web_app_async(resource_group_name, site_name, featured:featured, filter:filter, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_recommended_rules_for_web_app_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

Get all recommendations for an app.

Get all recommendations for an app.

resource belongs. critical recommendations. The default is false, which returns all recommendations. is specified by using OData syntax. Example: $filter=channel eq ‘Api’ or channel eq ‘Notification’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • featured (Boolean) (defaults to: nil)

    Specify true to return only the most

  • filter (String) (defaults to: nil)

    Return only channels specified in the filter. Filter

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 504

def list_recommended_rules_for_web_app_async(resource_group_name, site_name, featured:nil, filter:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'site_name is nil' if site_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_name,'subscriptionId' => @client.subscription_id},
      query_params: {'featured' => featured,'api-version' => @client.api_version},
      skip_encoding_query_params: {'$filter' => filter},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::RecommendationCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

Get all recommendations for an app.

Get all recommendations for an app.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (RecommendationCollection)

    operation results.



1178
1179
1180
1181
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 1178

def list_recommended_rules_for_web_app_next(next_page_link, custom_headers:nil)
  response = list_recommended_rules_for_web_app_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

Get all recommendations for an app.

Get all recommendations for an app.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 1211

def list_recommended_rules_for_web_app_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::RecommendationCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

Get all recommendations for an app.

Get all recommendations for an app.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1195
1196
1197
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 1195

def list_recommended_rules_for_web_app_next_with_http_info(next_page_link, custom_headers:nil)
  list_recommended_rules_for_web_app_next_async(next_page_link, custom_headers:custom_headers).value!
end

Get all recommendations for an app.

Get all recommendations for an app.

resource belongs. critical recommendations. The default is false, which returns all recommendations. is specified by using OData syntax. Example: $filter=channel eq ‘Api’ or channel eq ‘Notification’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • featured (Boolean) (defaults to: nil)

    Specify true to return only the most

  • filter (String) (defaults to: nil)

    Return only channels specified in the filter. Filter

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



481
482
483
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 481

def list_recommended_rules_for_web_app_with_http_info(resource_group_name, site_name, featured:nil, filter:nil, custom_headers:nil)
  list_recommended_rules_for_web_app_async(resource_group_name, site_name, featured:featured, filter:filter, custom_headers:custom_headers).value!
end

#list_with_http_info(featured: nil, filter: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List all recommendations for a subscription.

List all recommendations for a subscription.

critical recommendations. The default is false, which returns all recommendations. $filter=channel 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’ will be added to the HTTP request.

Parameters:

  • featured (Boolean) (defaults to: nil)

    Specify true to return only the most

  • filter (String) (defaults to: nil)

    Filter is specified by using OData syntax. Example:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



63
64
65
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 63

def list_with_http_info(featured:nil, filter:nil, custom_headers:nil)
  list_async(featured:featured, filter:filter, custom_headers:custom_headers).value!
end

#reset_all_filters(custom_headers: nil) ⇒ Object

Reset all recommendation opt-out settings for a subscription.

Reset all recommendation opt-out settings for a subscription.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



147
148
149
150
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 147

def reset_all_filters(custom_headers:nil)
  response = reset_all_filters_async(custom_headers:custom_headers).value!
  nil
end

#reset_all_filters_async(custom_headers: nil) ⇒ Concurrent::Promise

Reset all recommendation opt-out settings for a subscription.

Reset all recommendation opt-out settings for a subscription.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 176

def reset_all_filters_async(custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#reset_all_filters_for_web_app(resource_group_name, site_name, custom_headers: nil) ⇒ Object

Reset all recommendation opt-out settings for an app.

Reset all recommendation opt-out settings for an app.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



670
671
672
673
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 670

def reset_all_filters_for_web_app(resource_group_name, site_name, custom_headers:nil)
  response = reset_all_filters_for_web_app_async(resource_group_name, site_name, custom_headers:custom_headers).value!
  nil
end

#reset_all_filters_for_web_app_async(resource_group_name, site_name, custom_headers: nil) ⇒ Concurrent::Promise

Reset all recommendation opt-out settings for an app.

Reset all recommendation opt-out settings for an app.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 705

def reset_all_filters_for_web_app_async(resource_group_name, site_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'site_name is nil' if site_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/reset'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#reset_all_filters_for_web_app_with_http_info(resource_group_name, site_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Reset all recommendation opt-out settings for an app.

Reset all recommendation opt-out settings for an app.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



688
689
690
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 688

def reset_all_filters_for_web_app_with_http_info(resource_group_name, site_name, custom_headers:nil)
  reset_all_filters_for_web_app_async(resource_group_name, site_name, custom_headers:custom_headers).value!
end

#reset_all_filters_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Reset all recommendation opt-out settings for a subscription.

Reset all recommendation opt-out settings for a subscription.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



162
163
164
# File 'lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb', line 162

def reset_all_filters_with_http_info(custom_headers:nil)
  reset_all_filters_async(custom_headers:custom_headers).value!
end