Class: Azure::ARM::Web::Global

Inherits:
Object
  • Object
show all
Includes:
Models, MsRestAzure
Defined in:
lib/generated/azure_mgmt_web/global.rb

Overview

Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see <a href=“msdn.microsoft.com/en-us/library/azure/dn790557.aspx”>Authenticating Azure Resource Manager requests.</a>

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Global

Creates and initializes a new instance of the Global class.

Parameters:

  • client

    service class for accessing basic functionality.



25
26
27
# File 'lib/generated/azure_mgmt_web/global.rb', line 25

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientWebSiteManagementClient (readonly)

Returns reference to the WebSiteManagementClient.

Returns:



30
31
32
# File 'lib/generated/azure_mgmt_web/global.rb', line 30

def client
  @client
end

Instance Method Details

#check_name_availability(request, custom_headers = nil) ⇒ ResourceNameAvailability

Check if resource name is available

will be added to the HTTP request.

Parameters:

  • request (ResourceNameAvailabilityRequest)

    Name availability request

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

    A hash of custom headers that

Returns:



1219
1220
1221
1222
# File 'lib/generated/azure_mgmt_web/global.rb', line 1219

def check_name_availability(request, custom_headers = nil)
  response = check_name_availability_async(request, custom_headers).value!
  response.body unless response.nil?
end

#check_name_availability_async(request, custom_headers = nil) ⇒ Concurrent::Promise

Check if resource name is available

to the HTTP request.

Parameters:

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
# File 'lib/generated/azure_mgmt_web/global.rb', line 1246

def check_name_availability_async(request, custom_headers = nil)
  fail ArgumentError, 'request is nil' if request.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 = {}

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

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

  # Serialize Request
  request_mapper = ResourceNameAvailabilityRequest.mapper()
  request_content = @client.serialize(request_mapper,  request, 'request')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = ResourceNameAvailability.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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

#check_name_availability_with_http_info(request, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Check if resource name is available

will be added to the HTTP request.

Parameters:

  • request (ResourceNameAvailabilityRequest)

    Name availability request

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1233
1234
1235
# File 'lib/generated/azure_mgmt_web/global.rb', line 1233

def check_name_availability_with_http_info(request, custom_headers = nil)
  check_name_availability_async(request, custom_headers).value!
end

#get_all_certificates(custom_headers = nil) ⇒ Array<Certificate>

Get all certificates 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:



355
356
357
358
# File 'lib/generated/azure_mgmt_web/global.rb', line 355

def get_all_certificates(custom_headers = nil)
  first_page = get_all_certificates_as_lazy(custom_headers)
  first_page.get_all_items
end

#get_all_certificates_as_lazy(custom_headers = nil) ⇒ CertificateCollection

Get all certificates for a subscription

will be added to the HTTP request.

response.

Parameters:

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

    A hash of custom headers that

Returns:



336
337
338
339
340
341
342
343
344
345
# File 'lib/generated/azure_mgmt_web/global.rb', line 336

def get_all_certificates_as_lazy(custom_headers = nil)
  response = get_all_certificates_async(custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_all_certificates_next_async(next_link, custom_headers)
    end
    page
  end
end

#get_all_certificates_async(custom_headers = nil) ⇒ Concurrent::Promise

Get all certificates 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.



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
# File 'lib/generated/azure_mgmt_web/global.rb', line 380

def get_all_certificates_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 = {}

  # 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/certificates'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = CertificateCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_certificates_next(next_page_link, custom_headers = nil) ⇒ CertificateCollection

Get all certificates for a subscription

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



1409
1410
1411
1412
# File 'lib/generated/azure_mgmt_web/global.rb', line 1409

def get_all_certificates_next(next_page_link, custom_headers = nil)
  response = get_all_certificates_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#get_all_certificates_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Get all certificates for a subscription

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
# File 'lib/generated/azure_mgmt_web/global.rb', line 1438

def get_all_certificates_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  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 = '{nextLink}'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = CertificateCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_certificates_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get all certificates for a subscription

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1424
1425
1426
# File 'lib/generated/azure_mgmt_web/global.rb', line 1424

def get_all_certificates_next_with_http_info(next_page_link, custom_headers = nil)
  get_all_certificates_next_async(next_page_link, custom_headers).value!
end

#get_all_certificates_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get all certificates 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.



368
369
370
# File 'lib/generated/azure_mgmt_web/global.rb', line 368

def get_all_certificates_with_http_info(custom_headers = nil)
  get_all_certificates_async(custom_headers).value!
end

#get_all_classic_mobile_services(custom_headers = nil) ⇒ Array<ClassicMobileService>

Gets all mobile services 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:



896
897
898
899
# File 'lib/generated/azure_mgmt_web/global.rb', line 896

def get_all_classic_mobile_services(custom_headers = nil)
  first_page = get_all_classic_mobile_services_as_lazy(custom_headers)
  first_page.get_all_items
end

#get_all_classic_mobile_services_as_lazy(custom_headers = nil) ⇒ ClassicMobileServiceCollection

Gets all mobile services for a subscription

will be added to the HTTP request.

of the response.

Parameters:

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

    A hash of custom headers that

Returns:



877
878
879
880
881
882
883
884
885
886
# File 'lib/generated/azure_mgmt_web/global.rb', line 877

def get_all_classic_mobile_services_as_lazy(custom_headers = nil)
  response = get_all_classic_mobile_services_async(custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_all_classic_mobile_services_next_async(next_link, custom_headers)
    end
    page
  end
end

#get_all_classic_mobile_services_async(custom_headers = nil) ⇒ Concurrent::Promise

Gets all mobile services 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.



921
922
923
924
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/generated/azure_mgmt_web/global.rb', line 921

def get_all_classic_mobile_services_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 = {}

  # 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/classicMobileServices'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = ClassicMobileServiceCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_classic_mobile_services_next(next_page_link, custom_headers = nil) ⇒ ClassicMobileServiceCollection

Gets all mobile services for a subscription

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



1859
1860
1861
1862
# File 'lib/generated/azure_mgmt_web/global.rb', line 1859

def get_all_classic_mobile_services_next(next_page_link, custom_headers = nil)
  response = get_all_classic_mobile_services_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#get_all_classic_mobile_services_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Gets all mobile services for a subscription

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
# File 'lib/generated/azure_mgmt_web/global.rb', line 1888

def get_all_classic_mobile_services_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  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 = '{nextLink}'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = ClassicMobileServiceCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_classic_mobile_services_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all mobile services for a subscription

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1874
1875
1876
# File 'lib/generated/azure_mgmt_web/global.rb', line 1874

def get_all_classic_mobile_services_next_with_http_info(next_page_link, custom_headers = nil)
  get_all_classic_mobile_services_next_async(next_page_link, custom_headers).value!
end

#get_all_classic_mobile_services_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all mobile services 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.



909
910
911
# File 'lib/generated/azure_mgmt_web/global.rb', line 909

def get_all_classic_mobile_services_with_http_info(custom_headers = nil)
  get_all_classic_mobile_services_async(custom_headers).value!
end

#get_all_hosting_environments(custom_headers = nil) ⇒ Array<HostingEnvironment>

Gets all hostingEnvironments (App Service Environment) 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:



684
685
686
687
# File 'lib/generated/azure_mgmt_web/global.rb', line 684

def get_all_hosting_environments(custom_headers = nil)
  first_page = get_all_hosting_environments_as_lazy(custom_headers)
  first_page.get_all_items
end

#get_all_hosting_environments_as_lazy(custom_headers = nil) ⇒ HostingEnvironmentCollection

Gets all hostingEnvironments (App Service Environment) for a subscription

will be added to the HTTP request.

the response.

Parameters:

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

    A hash of custom headers that

Returns:



665
666
667
668
669
670
671
672
673
674
# File 'lib/generated/azure_mgmt_web/global.rb', line 665

def get_all_hosting_environments_as_lazy(custom_headers = nil)
  response = get_all_hosting_environments_async(custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_all_hosting_environments_next_async(next_link, custom_headers)
    end
    page
  end
end

#get_all_hosting_environments_async(custom_headers = nil) ⇒ Concurrent::Promise

Gets all hostingEnvironments (App Service Environment) 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.



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
752
753
754
755
756
757
758
759
760
# File 'lib/generated/azure_mgmt_web/global.rb', line 709

def get_all_hosting_environments_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 = {}

  # 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/hostingEnvironments'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = HostingEnvironmentCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_hosting_environments_next(next_page_link, custom_headers = nil) ⇒ HostingEnvironmentCollection

Gets all hostingEnvironments (App Service Environment) for a subscription

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



1679
1680
1681
1682
# File 'lib/generated/azure_mgmt_web/global.rb', line 1679

def get_all_hosting_environments_next(next_page_link, custom_headers = nil)
  response = get_all_hosting_environments_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#get_all_hosting_environments_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Gets all hostingEnvironments (App Service Environment) for a subscription

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
# File 'lib/generated/azure_mgmt_web/global.rb', line 1708

def get_all_hosting_environments_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  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 = '{nextLink}'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = HostingEnvironmentCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_hosting_environments_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all hostingEnvironments (App Service Environment) for a subscription

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1694
1695
1696
# File 'lib/generated/azure_mgmt_web/global.rb', line 1694

def get_all_hosting_environments_next_with_http_info(next_page_link, custom_headers = nil)
  get_all_hosting_environments_next_async(next_page_link, custom_headers).value!
end

#get_all_hosting_environments_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all hostingEnvironments (App Service Environment) 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.



697
698
699
# File 'lib/generated/azure_mgmt_web/global.rb', line 697

def get_all_hosting_environments_with_http_info(custom_headers = nil)
  get_all_hosting_environments_async(custom_headers).value!
end

#get_all_managed_hosting_environments(custom_headers = nil) ⇒ Array<ManagedHostingEnvironment>

Gets all managed hosting environments 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:



790
791
792
793
# File 'lib/generated/azure_mgmt_web/global.rb', line 790

def get_all_managed_hosting_environments(custom_headers = nil)
  first_page = get_all_managed_hosting_environments_as_lazy(custom_headers)
  first_page.get_all_items
end

#get_all_managed_hosting_environments_as_lazy(custom_headers = nil) ⇒ ManagedHostingEnvironmentCollection

Gets all managed hosting environments for a subscription

will be added to the HTTP request.

pages of the response.

Parameters:

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

    A hash of custom headers that

Returns:



771
772
773
774
775
776
777
778
779
780
# File 'lib/generated/azure_mgmt_web/global.rb', line 771

def get_all_managed_hosting_environments_as_lazy(custom_headers = nil)
  response = get_all_managed_hosting_environments_async(custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_all_managed_hosting_environments_next_async(next_link, custom_headers)
    end
    page
  end
end

#get_all_managed_hosting_environments_async(custom_headers = nil) ⇒ Concurrent::Promise

Gets all managed hosting environments 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.



815
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
# File 'lib/generated/azure_mgmt_web/global.rb', line 815

def get_all_managed_hosting_environments_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 = {}

  # 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/managedHostingEnvironments'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = ManagedHostingEnvironmentCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_managed_hosting_environments_next(next_page_link, custom_headers = nil) ⇒ ManagedHostingEnvironmentCollection

Gets all managed hosting environments for a subscription

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



1769
1770
1771
1772
# File 'lib/generated/azure_mgmt_web/global.rb', line 1769

def get_all_managed_hosting_environments_next(next_page_link, custom_headers = nil)
  response = get_all_managed_hosting_environments_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#get_all_managed_hosting_environments_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Gets all managed hosting environments for a subscription

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
# File 'lib/generated/azure_mgmt_web/global.rb', line 1798

def get_all_managed_hosting_environments_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  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 = '{nextLink}'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = ManagedHostingEnvironmentCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_managed_hosting_environments_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all managed hosting environments for a subscription

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1784
1785
1786
# File 'lib/generated/azure_mgmt_web/global.rb', line 1784

def get_all_managed_hosting_environments_next_with_http_info(next_page_link, custom_headers = nil)
  get_all_managed_hosting_environments_next_async(next_page_link, custom_headers).value!
end

#get_all_managed_hosting_environments_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all managed hosting environments 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.



803
804
805
# File 'lib/generated/azure_mgmt_web/global.rb', line 803

def get_all_managed_hosting_environments_with_http_info(custom_headers = nil)
  get_all_managed_hosting_environments_async(custom_headers).value!
end

#get_all_server_farms(detailed = nil, custom_headers = nil) ⇒ Array<ServerFarmWithRichSku>

Gets all App Service Plans for a subcription

properties, true to return all of the properties. Retrieval of all properties may increase the API latency. will be added to the HTTP request.

Parameters:

  • detailed (Boolean) (defaults to: nil)

    False to return a subset of App Service Plan

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

    A hash of custom headers that

Returns:



467
468
469
470
# File 'lib/generated/azure_mgmt_web/global.rb', line 467

def get_all_server_farms(detailed = nil, custom_headers = nil)
  first_page = get_all_server_farms_as_lazy(detailed, custom_headers)
  first_page.get_all_items
end

#get_all_server_farms_as_lazy(detailed = nil, custom_headers = nil) ⇒ ServerFarmCollection

Gets all App Service Plans for a subcription

properties, true to return all of the properties. Retrieval of all properties may increase the API latency. will be added to the HTTP request.

response.

Parameters:

  • detailed (Boolean) (defaults to: nil)

    False to return a subset of App Service Plan

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

    A hash of custom headers that

Returns:



445
446
447
448
449
450
451
452
453
454
# File 'lib/generated/azure_mgmt_web/global.rb', line 445

def get_all_server_farms_as_lazy(detailed = nil, custom_headers = nil)
  response = get_all_server_farms_async(detailed, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_all_server_farms_next_async(next_link, custom_headers)
    end
    page
  end
end

#get_all_server_farms_async(detailed = nil, custom_headers = nil) ⇒ Concurrent::Promise

Gets all App Service Plans for a subcription

properties, true to return all of the properties. Retrieval of all properties may increase the API latency. to the HTTP request.

Parameters:

  • detailed (Boolean) (defaults to: nil)

    False to return a subset of App Service Plan

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



498
499
500
501
502
503
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
# File 'lib/generated/azure_mgmt_web/global.rb', line 498

def get_all_server_farms_async(detailed = 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 = {}

  # 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/serverfarms'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'detailed' => detailed,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = ServerFarmCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_server_farms_next(next_page_link, custom_headers = nil) ⇒ ServerFarmCollection

Gets all App Service Plans for a subcription

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



1499
1500
1501
1502
# File 'lib/generated/azure_mgmt_web/global.rb', line 1499

def get_all_server_farms_next(next_page_link, custom_headers = nil)
  response = get_all_server_farms_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#get_all_server_farms_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Gets all App Service Plans for a subcription

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
# File 'lib/generated/azure_mgmt_web/global.rb', line 1528

def get_all_server_farms_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  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 = '{nextLink}'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = ServerFarmCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_server_farms_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all App Service Plans for a subcription

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1514
1515
1516
# File 'lib/generated/azure_mgmt_web/global.rb', line 1514

def get_all_server_farms_next_with_http_info(next_page_link, custom_headers = nil)
  get_all_server_farms_next_async(next_page_link, custom_headers).value!
end

#get_all_server_farms_with_http_info(detailed = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all App Service Plans for a subcription

properties, true to return all of the properties. Retrieval of all properties may increase the API latency. will be added to the HTTP request.

Parameters:

  • detailed (Boolean) (defaults to: nil)

    False to return a subset of App Service Plan

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



483
484
485
# File 'lib/generated/azure_mgmt_web/global.rb', line 483

def get_all_server_farms_with_http_info(detailed = nil, custom_headers = nil)
  get_all_server_farms_async(detailed, custom_headers).value!
end

#get_all_sites(custom_headers = nil) ⇒ Array<Site>

Gets all Web Apps 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:

  • (Array<Site>)

    operation results.



578
579
580
581
# File 'lib/generated/azure_mgmt_web/global.rb', line 578

def get_all_sites(custom_headers = nil)
  first_page = get_all_sites_as_lazy(custom_headers)
  first_page.get_all_items
end

#get_all_sites_as_lazy(custom_headers = nil) ⇒ SiteCollection

Gets all Web Apps 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:

  • (SiteCollection)

    which provide lazy access to pages of the response.



559
560
561
562
563
564
565
566
567
568
# File 'lib/generated/azure_mgmt_web/global.rb', line 559

def get_all_sites_as_lazy(custom_headers = nil)
  response = get_all_sites_async(custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_all_sites_next_async(next_link, custom_headers)
    end
    page
  end
end

#get_all_sites_async(custom_headers = nil) ⇒ Concurrent::Promise

Gets all Web Apps 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.



603
604
605
606
607
608
609
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
# File 'lib/generated/azure_mgmt_web/global.rb', line 603

def get_all_sites_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 = {}

  # 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/sites'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = SiteCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_sites_next(next_page_link, custom_headers = nil) ⇒ SiteCollection

Gets all Web Apps for a subscription

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



1589
1590
1591
1592
# File 'lib/generated/azure_mgmt_web/global.rb', line 1589

def get_all_sites_next(next_page_link, custom_headers = nil)
  response = get_all_sites_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#get_all_sites_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Gets all Web Apps for a subscription

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
# File 'lib/generated/azure_mgmt_web/global.rb', line 1618

def get_all_sites_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  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 = '{nextLink}'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = SiteCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_sites_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all Web Apps for a subscription

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1604
1605
1606
# File 'lib/generated/azure_mgmt_web/global.rb', line 1604

def get_all_sites_next_with_http_info(next_page_link, custom_headers = nil)
  get_all_sites_next_async(next_page_link, custom_headers).value!
end

#get_all_sites_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all Web Apps 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.



591
592
593
# File 'lib/generated/azure_mgmt_web/global.rb', line 591

def get_all_sites_with_http_info(custom_headers = nil)
  get_all_sites_async(custom_headers).value!
end

#get_subscription_geo_regions(sku = nil, custom_headers = nil) ⇒ Array<GeoRegion>

Gets list of available geo regions

will be added to the HTTP request.

Parameters:

  • sku (String) (defaults to: nil)

    Filter only to regions that support this sku

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

    A hash of custom headers that

Returns:



247
248
249
250
# File 'lib/generated/azure_mgmt_web/global.rb', line 247

def get_subscription_geo_regions(sku = nil, custom_headers = nil)
  first_page = get_subscription_geo_regions_as_lazy(sku, custom_headers)
  first_page.get_all_items
end

#get_subscription_geo_regions_as_lazy(sku = nil, custom_headers = nil) ⇒ GeoRegionCollection

Gets list of available geo regions

will be added to the HTTP request.

response.

Parameters:

  • sku (String) (defaults to: nil)

    Filter only to regions that support this sku

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

    A hash of custom headers that

Returns:



227
228
229
230
231
232
233
234
235
236
# File 'lib/generated/azure_mgmt_web/global.rb', line 227

def get_subscription_geo_regions_as_lazy(sku = nil, custom_headers = nil)
  response = get_subscription_geo_regions_async(sku, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_subscription_geo_regions_next_async(next_link, custom_headers)
    end
    page
  end
end

#get_subscription_geo_regions_async(sku = nil, custom_headers = nil) ⇒ Concurrent::Promise

Gets list of available geo regions

to the HTTP request.

Parameters:

  • sku (String) (defaults to: nil)

    Filter only to regions that support this sku

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/generated/azure_mgmt_web/global.rb', line 274

def get_subscription_geo_regions_async(sku = 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 = {}

  # 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/geoRegions'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'sku' => sku,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = GeoRegionCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_subscription_geo_regions_next(next_page_link, custom_headers = nil) ⇒ GeoRegionCollection

Gets list of available geo regions

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



1319
1320
1321
1322
# File 'lib/generated/azure_mgmt_web/global.rb', line 1319

def get_subscription_geo_regions_next(next_page_link, custom_headers = nil)
  response = get_subscription_geo_regions_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#get_subscription_geo_regions_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Gets list of available geo regions

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
# File 'lib/generated/azure_mgmt_web/global.rb', line 1348

def get_subscription_geo_regions_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  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 = '{nextLink}'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = GeoRegionCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_subscription_geo_regions_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets list of available geo regions

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1334
1335
1336
# File 'lib/generated/azure_mgmt_web/global.rb', line 1334

def get_subscription_geo_regions_next_with_http_info(next_page_link, custom_headers = nil)
  get_subscription_geo_regions_next_async(next_page_link, custom_headers).value!
end

#get_subscription_geo_regions_with_http_info(sku = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets list of available geo regions

will be added to the HTTP request.

Parameters:

  • sku (String) (defaults to: nil)

    Filter only to regions that support this sku

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



261
262
263
# File 'lib/generated/azure_mgmt_web/global.rb', line 261

def get_subscription_geo_regions_with_http_info(sku = nil, custom_headers = nil)
  get_subscription_geo_regions_async(sku, custom_headers).value!
end

#get_subscription_publishing_credentials(custom_headers = nil) ⇒ User

Gets publishing credentials for the subscription owner

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (User)

    operation results.



40
41
42
43
# File 'lib/generated/azure_mgmt_web/global.rb', line 40

def get_subscription_publishing_credentials(custom_headers = nil)
  response = get_subscription_publishing_credentials_async(custom_headers).value!
  response.body unless response.nil?
end

#get_subscription_publishing_credentials_async(custom_headers = nil) ⇒ Concurrent::Promise

Gets publishing credentials for the subscription owner

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.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
# File 'lib/generated/azure_mgmt_web/global.rb', line 65

def get_subscription_publishing_credentials_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 = {}

  # 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/publishingCredentials'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = User.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_subscription_publishing_credentials_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets publishing credentials for the subscription owner

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.



53
54
55
# File 'lib/generated/azure_mgmt_web/global.rb', line 53

def get_subscription_publishing_credentials_with_http_info(custom_headers = nil)
  get_subscription_publishing_credentials_async(custom_headers).value!
end

#is_hosting_environment_name_available(name, custom_headers = nil) ⇒ Object

Whether hosting environment name is available

will be added to the HTTP request.

Parameters:

  • name (String)

    Hosting environment name

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



1059
1060
1061
1062
# File 'lib/generated/azure_mgmt_web/global.rb', line 1059

def is_hosting_environment_name_available(name, custom_headers = nil)
  response = is_hosting_environment_name_available_async(name, custom_headers).value!
  response.body unless response.nil?
end

#is_hosting_environment_name_available_async(name, custom_headers = nil) ⇒ Concurrent::Promise

Whether hosting environment name is available

to the HTTP request.

Parameters:

  • name (String)

    Hosting environment name

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
# File 'lib/generated/azure_mgmt_web/global.rb', line 1086

def is_hosting_environment_name_available_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 = {}

  # 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/ishostingenvironmentnameavailable'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'name' => name,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#is_hosting_environment_name_available_with_http_info(name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Whether hosting environment name is available

will be added to the HTTP request.

Parameters:

  • name (String)

    Hosting environment name

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1073
1074
1075
# File 'lib/generated/azure_mgmt_web/global.rb', line 1073

def is_hosting_environment_name_available_with_http_info(name, custom_headers = nil)
  is_hosting_environment_name_available_async(name, custom_headers).value!
end

#is_hosting_environment_with_legacy_name_available(name, custom_headers = nil) ⇒ Object

Whether hosting environment name is available

will be added to the HTTP request.

Parameters:

  • name (String)

    Hosting environment name

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



1139
1140
1141
1142
# File 'lib/generated/azure_mgmt_web/global.rb', line 1139

def is_hosting_environment_with_legacy_name_available(name, custom_headers = nil)
  response = is_hosting_environment_with_legacy_name_available_async(name, custom_headers).value!
  response.body unless response.nil?
end

#is_hosting_environment_with_legacy_name_available_async(name, custom_headers = nil) ⇒ Concurrent::Promise

Whether hosting environment name is available

to the HTTP request.

Parameters:

  • name (String)

    Hosting environment name

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
# File 'lib/generated/azure_mgmt_web/global.rb', line 1166

def is_hosting_environment_with_legacy_name_available_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 = {}

  # 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/ishostingenvironmentnameavailable/{name}'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#is_hosting_environment_with_legacy_name_available_with_http_info(name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Whether hosting environment name is available

will be added to the HTTP request.

Parameters:

  • name (String)

    Hosting environment name

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1153
1154
1155
# File 'lib/generated/azure_mgmt_web/global.rb', line 1153

def is_hosting_environment_with_legacy_name_available_with_http_info(name, custom_headers = nil)
  is_hosting_environment_with_legacy_name_available_async(name, custom_headers).value!
end

#list_premier_add_on_offers(custom_headers = nil) ⇒ Object

List premier add on offers

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



982
983
984
985
# File 'lib/generated/azure_mgmt_web/global.rb', line 982

def list_premier_add_on_offers(custom_headers = nil)
  response = list_premier_add_on_offers_async(custom_headers).value!
  response.body unless response.nil?
end

#list_premier_add_on_offers_async(custom_headers = nil) ⇒ Concurrent::Promise

List premier add on offers

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.



1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
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
# File 'lib/generated/azure_mgmt_web/global.rb', line 1007

def list_premier_add_on_offers_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 = {}

  # 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/premieraddonoffers'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#list_premier_add_on_offers_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

List premier add on offers

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.



995
996
997
# File 'lib/generated/azure_mgmt_web/global.rb', line 995

def list_premier_add_on_offers_with_http_info(custom_headers = nil)
  list_premier_add_on_offers_async(custom_headers).value!
end

#update_subscription_publishing_credentials(request_message, custom_headers = nil) ⇒ User

Updates publishing credentials for the subscription owner

will be added to the HTTP request.

Parameters:

  • request_message (User)

    requestMessage with new publishing credentials

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

    A hash of custom headers that

Returns:

  • (User)

    operation results.



127
128
129
130
# File 'lib/generated/azure_mgmt_web/global.rb', line 127

def update_subscription_publishing_credentials(request_message, custom_headers = nil)
  response = update_subscription_publishing_credentials_async(request_message, custom_headers).value!
  response.body unless response.nil?
end

#update_subscription_publishing_credentials_async(request_message, custom_headers = nil) ⇒ Concurrent::Promise

Updates publishing credentials for the subscription owner

to the HTTP request.

Parameters:

  • request_message (User)

    requestMessage with new publishing credentials

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
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
# File 'lib/generated/azure_mgmt_web/global.rb', line 154

def update_subscription_publishing_credentials_async(request_message, custom_headers = nil)
  fail ArgumentError, 'request_message is nil' if request_message.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 = {}

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

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

  # Serialize Request
  request_mapper = User.mapper()
  request_content = @client.serialize(request_mapper,  request_message, 'request_message')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Web/publishingCredentials'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    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 = User.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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

#update_subscription_publishing_credentials_with_http_info(request_message, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Updates publishing credentials for the subscription owner

will be added to the HTTP request.

Parameters:

  • request_message (User)

    requestMessage with new publishing credentials

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



141
142
143
# File 'lib/generated/azure_mgmt_web/global.rb', line 141

def update_subscription_publishing_credentials_with_http_info(request_message, custom_headers = nil)
  update_subscription_publishing_credentials_async(request_message, custom_headers).value!
end