Class: Azure::ARM::Web::Recommendations

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/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/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/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



499
500
501
502
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 499

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).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.



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
562
563
564
565
566
567
568
569
570
571
572
573
574
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 534

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, 'site_name is nil' if site_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  api_version = '2016-03-01'


  request_headers = {}

  # 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' => 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
  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.



517
518
519
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 517

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).value!
end

#get_rule_details_by_web_app(resource_group_name, site_name, name, update_seen = 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. 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

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

    A hash of custom headers that

Returns:

  • (RecommendationRule)

    operation results.



681
682
683
684
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 681

def get_rule_details_by_web_app(resource_group_name, site_name, name, update_seen = nil, custom_headers = nil)
  response = get_rule_details_by_web_app_async(resource_group_name, site_name, name, update_seen, 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, 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. 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

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 722

def get_rule_details_by_web_app_async(resource_group_name, site_name, name, update_seen = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.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?
  api_version = '2016-03-01'


  request_headers = {}

  # 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,'api-version' => 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 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ARM::Web::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, 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. 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

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



702
703
704
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 702

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

#list(featured = nil, filter = nil, custom_headers = nil) ⇒ Array

List all recommendations for a subscription.

List all recommendations for a subscription.

critical recommendations. The default is false, which returns all recommendations. $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’ 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)

    operation results.



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

def list(featured = nil, filter = nil, custom_headers = nil)
  response = list_async(featured, filter, custom_headers).value!
  response.body unless response.nil?
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=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’ 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
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/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?
  api_version = '2016-03-01'


  request_headers = {}

  # 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' => 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 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serialized_name: 'RecommendationElementType',
                type: {
                  name: 'Composite',
                  class_name: 'Recommendation'
                }
            }
          }
        }
        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, filter = nil, custom_headers = nil) ⇒ Array

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. $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’ 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.

  • 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)

    operation results.



244
245
246
247
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 244

def list_history_for_web_app(resource_group_name, site_name, filter = nil, custom_headers = nil)
  response = list_history_for_web_app_async(resource_group_name, site_name, filter, custom_headers).value!
  response.body unless response.nil?
end

#list_history_for_web_app_async(resource_group_name, site_name, 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. $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’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • site_name (String)

    Name of the app.

  • 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.



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 287

def list_history_for_web_app_async(resource_group_name, site_name, filter = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'site_name is nil' if site_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  api_version = '2016-03-01'


  request_headers = {}

  # 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: {'api-version' => 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 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serialized_name: 'RecommendationElementType',
                type: {
                  name: 'Composite',
                  class_name: 'Recommendation'
                }
            }
          }
        }
        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_with_http_info(resource_group_name, site_name, 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. $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’ 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.

  • 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.



266
267
268
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 266

def list_history_for_web_app_with_http_info(resource_group_name, site_name, filter = nil, custom_headers = nil)
  list_history_for_web_app_async(resource_group_name, site_name, filter, 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=channels 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)

    operation results.



373
374
375
376
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 373

def list_recommended_rules_for_web_app(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, filter, custom_headers).value!
  response.body unless response.nil?
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=channels 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.



420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 420

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, 'site_name is nil' if site_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  api_version = '2016-03-01'


  request_headers = {}

  # 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' => 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 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serialized_name: 'RecommendationElementType',
                type: {
                  name: 'Composite',
                  class_name: 'Recommendation'
                }
            }
          }
        }
        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.

resource belongs. critical recommendations. The default is false, which returns all recommendations. is specified by using OData syntax. Example: $filter=channels 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.



397
398
399
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 397

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, filter, 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=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’ 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/generated/azure_mgmt_web/recommendations.rb', line 63

def list_with_http_info(featured = nil, filter = nil, custom_headers = nil)
  list_async(featured, filter, 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



158
159
160
161
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 158

def reset_all_filters(custom_headers = nil)
  response = reset_all_filters_async(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.



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
218
219
220
221
222
223
224
225
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 187

def reset_all_filters_async(custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  api_version = '2016-03-01'


  request_headers = {}

  # 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' => 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
  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



588
589
590
591
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 588

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).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.



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
657
658
659
660
661
662
663
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 623

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, 'site_name is nil' if site_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  api_version = '2016-03-01'


  request_headers = {}

  # 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' => 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
  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.



606
607
608
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 606

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).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.



173
174
175
# File 'lib/generated/azure_mgmt_web/recommendations.rb', line 173

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