Class: Azure::Web::Mgmt::V2018_02_01::AppServiceEnvironments

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

Overview

WebSite Management Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ AppServiceEnvironments

Creates and initializes a new instance of the AppServiceEnvironments class.

Parameters:

  • client

    service class for accessing basic functionality.



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

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientWebSiteManagementClient (readonly)

Returns reference to the WebSiteManagementClient.

Returns:



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

def client
  @client
end

Instance Method Details

#begin_change_vnet(resource_group_name, name, vnet_info, custom_headers: nil) ⇒ Array<Site>

Move an App Service Environment to a different VNET.

Move an App Service Environment to a different VNET.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • vnet_info (VirtualNetworkProfile)

    Details for the new virtual network.

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

    A hash of custom headers that

Returns:

  • (Array<Site>)

    operation results.



4453
4454
4455
4456
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4453

def begin_change_vnet(resource_group_name, name, vnet_info, custom_headers:nil)
  first_page = begin_change_vnet_as_lazy(resource_group_name, name, vnet_info, custom_headers:custom_headers)
  first_page.get_all_items
end

#begin_change_vnet_as_lazy(resource_group_name, name, vnet_info, custom_headers: nil) ⇒ WebAppCollection

Move an App Service Environment to a different VNET.

Move an App Service Environment to a different VNET.

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • vnet_info (VirtualNetworkProfile)

    Details for the new virtual network.

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

    A hash of custom headers that

Returns:

  • (WebAppCollection)

    which provide lazy access to pages of the



8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 8155

def begin_change_vnet_as_lazy(resource_group_name, name, vnet_info, custom_headers:nil)
  response = begin_change_vnet_async(resource_group_name, name, vnet_info, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      begin_change_vnet_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#begin_change_vnet_async(resource_group_name, name, vnet_info, custom_headers: nil) ⇒ Concurrent::Promise

Move an App Service Environment to a different VNET.

Move an App Service Environment to a different VNET.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • vnet_info (VirtualNetworkProfile)

    Details for the new virtual network.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4490

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


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

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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VirtualNetworkProfile.mapper()
  request_content = @client.serialize(request_mapper,  vnet_info)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.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
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.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

#begin_change_vnet_next(next_page_link, custom_headers: nil) ⇒ WebAppCollection

Move an App Service Environment to a different VNET.

Move an App Service Environment to a different VNET.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (WebAppCollection)

    operation results.



7258
7259
7260
7261
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7258

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

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

Move an App Service Environment to a different VNET.

Move an App Service Environment to a different VNET.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7291

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.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
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.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

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

Move an App Service Environment to a different VNET.

Move an App Service Environment to a different VNET.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



7275
7276
7277
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7275

def begin_change_vnet_next_with_http_info(next_page_link, custom_headers:nil)
  begin_change_vnet_next_async(next_page_link, custom_headers:custom_headers).value!
end

#begin_change_vnet_with_http_info(resource_group_name, name, vnet_info, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Move an App Service Environment to a different VNET.

Move an App Service Environment to a different VNET.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • vnet_info (VirtualNetworkProfile)

    Details for the new virtual network.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4472
4473
4474
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4472

def begin_change_vnet_with_http_info(resource_group_name, name, vnet_info, custom_headers:nil)
  begin_change_vnet_async(resource_group_name, name, vnet_info, custom_headers:custom_headers).value!
end

#begin_create_or_update(resource_group_name, name, hosting_environment_envelope, custom_headers: nil) ⇒ AppServiceEnvironmentResource

Create or update an App Service Environment.

Create or update an App Service Environment.

resource belongs. Configuration details of the App Service Environment. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (AppServiceEnvironmentResource)

    operation results.



4220
4221
4222
4223
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4220

def begin_create_or_update(resource_group_name, name, hosting_environment_envelope, custom_headers:nil)
  response = begin_create_or_update_async(resource_group_name, name, hosting_environment_envelope, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_async(resource_group_name, name, hosting_environment_envelope, custom_headers: nil) ⇒ Concurrent::Promise

Create or update an App Service Environment.

Create or update an App Service Environment.

resource belongs. Configuration details of the App Service Environment. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • hosting_environment_envelope (AppServiceEnvironmentResource)
  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4259

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


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

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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServiceEnvironmentResource.mapper()
  request_content = @client.serialize(request_mapper,  hosting_environment_envelope)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{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,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, 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 || status_code == 202 || status_code == 400 || status_code == 404 || status_code == 409
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServiceEnvironmentResource.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
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServiceEnvironmentResource.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

#begin_create_or_update_multi_role_pool(resource_group_name, name, multi_role_pool_envelope, custom_headers: nil) ⇒ WorkerPoolResource

Create or update a multi-role pool.

Create or update a multi-role pool.

resource belongs. multi-role pool. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • multi_role_pool_envelope (WorkerPoolResource)

    Properties of the

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

    A hash of custom headers that

Returns:

  • (WorkerPoolResource)

    operation results.



4581
4582
4583
4584
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4581

def begin_create_or_update_multi_role_pool(resource_group_name, name, multi_role_pool_envelope, custom_headers:nil)
  response = begin_create_or_update_multi_role_pool_async(resource_group_name, name, multi_role_pool_envelope, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_multi_role_pool_async(resource_group_name, name, multi_role_pool_envelope, custom_headers: nil) ⇒ Concurrent::Promise

Create or update a multi-role pool.

Create or update a multi-role pool.

resource belongs. multi-role pool. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • multi_role_pool_envelope (WorkerPoolResource)

    Properties of the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4620

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


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

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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.mapper()
  request_content = @client.serialize(request_mapper,  multi_role_pool_envelope)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, 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 || status_code == 202 || status_code == 400 || status_code == 404 || status_code == 409
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.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
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.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

#begin_create_or_update_multi_role_pool_with_http_info(resource_group_name, name, multi_role_pool_envelope, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update a multi-role pool.

Create or update a multi-role pool.

resource belongs. multi-role pool. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • multi_role_pool_envelope (WorkerPoolResource)

    Properties of the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4601
4602
4603
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4601

def begin_create_or_update_multi_role_pool_with_http_info(resource_group_name, name, multi_role_pool_envelope, custom_headers:nil)
  begin_create_or_update_multi_role_pool_async(resource_group_name, name, multi_role_pool_envelope, custom_headers:custom_headers).value!
end

#begin_create_or_update_with_http_info(resource_group_name, name, hosting_environment_envelope, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update an App Service Environment.

Create or update an App Service Environment.

resource belongs. Configuration details of the App Service Environment. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4240
4241
4242
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4240

def begin_create_or_update_with_http_info(resource_group_name, name, hosting_environment_envelope, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, name, hosting_environment_envelope, custom_headers:custom_headers).value!
end

#begin_create_or_update_worker_pool(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers: nil) ⇒ WorkerPoolResource

Create or update a worker pool.

Create or update a worker pool.

resource belongs. pool. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • worker_pool_envelope (WorkerPoolResource)

    Properties of the worker

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

    A hash of custom headers that

Returns:

  • (WorkerPoolResource)

    operation results.



4944
4945
4946
4947
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4944

def begin_create_or_update_worker_pool(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:nil)
  response = begin_create_or_update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers: nil) ⇒ Concurrent::Promise

Create or update a worker pool.

Create or update a worker pool.

resource belongs. pool. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • worker_pool_envelope (WorkerPoolResource)

    Properties of the worker

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4985

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


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

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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.mapper()
  request_content = @client.serialize(request_mapper,  worker_pool_envelope)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerPoolName' => worker_pool_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, 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 || status_code == 202 || status_code == 400 || status_code == 404 || status_code == 409
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.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
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.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

#begin_create_or_update_worker_pool_with_http_info(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update a worker pool.

Create or update a worker pool.

resource belongs. pool. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • worker_pool_envelope (WorkerPoolResource)

    Properties of the worker

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4965
4966
4967
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4965

def begin_create_or_update_worker_pool_with_http_info(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:nil)
  begin_create_or_update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:custom_headers).value!
end

#begin_delete(resource_group_name, name, force_delete: nil, custom_headers: nil) ⇒ Object

Delete an App Service Environment.

Delete an App Service Environment.

resource belongs. even if the App Service Environment contains resources. The default is false. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • force_delete (Boolean) (defaults to: nil)

    Specify true to force the deletion

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

    A hash of custom headers that



4350
4351
4352
4353
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4350

def begin_delete(resource_group_name, name, force_delete:nil, custom_headers:nil)
  response = begin_delete_async(resource_group_name, name, force_delete:force_delete, custom_headers:custom_headers).value!
  nil
end

#begin_delete_async(resource_group_name, name, force_delete: nil, custom_headers: nil) ⇒ Concurrent::Promise

Delete an App Service Environment.

Delete an App Service Environment.

resource belongs. even if the App Service Environment contains resources. The default is false. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • force_delete (Boolean) (defaults to: nil)

    Specify true to force the deletion

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4391

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


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{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,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'forceDelete' => force_delete,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, 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 == 202 || status_code == 204 || status_code == 400 || status_code == 404 || status_code == 409
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end

#begin_delete_with_http_info(resource_group_name, name, force_delete: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Delete an App Service Environment.

Delete an App Service Environment.

resource belongs. even if the App Service Environment contains resources. The default is false. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • force_delete (Boolean) (defaults to: nil)

    Specify true to force the deletion

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4371
4372
4373
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4371

def begin_delete_with_http_info(resource_group_name, name, force_delete:nil, custom_headers:nil)
  begin_delete_async(resource_group_name, name, force_delete:force_delete, custom_headers:custom_headers).value!
end

#begin_resume(resource_group_name, name, custom_headers: nil) ⇒ Array<Site>

Resume an App Service Environment.

Resume an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Array<Site>)

    operation results.



4709
4710
4711
4712
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4709

def begin_resume(resource_group_name, name, custom_headers:nil)
  first_page = begin_resume_as_lazy(resource_group_name, name, custom_headers:custom_headers)
  first_page.get_all_items
end

#begin_resume_as_lazy(resource_group_name, name, custom_headers: nil) ⇒ WebAppCollection

Resume an App Service Environment.

Resume an App Service Environment.

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (WebAppCollection)

    which provide lazy access to pages of the



8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 8180

def begin_resume_as_lazy(resource_group_name, name, custom_headers:nil)
  response = begin_resume_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      begin_resume_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Resume an App Service Environment.

Resume an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4744

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.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
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.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

#begin_resume_next(next_page_link, custom_headers: nil) ⇒ WebAppCollection

Resume an App Service Environment.

Resume an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (WebAppCollection)

    operation results.



7364
7365
7366
7367
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7364

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

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

Resume an App Service Environment.

Resume an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7397

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.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
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.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

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

Resume an App Service Environment.

Resume an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



7381
7382
7383
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7381

def begin_resume_next_with_http_info(next_page_link, custom_headers:nil)
  begin_resume_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Resume an App Service Environment.

Resume an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4727
4728
4729
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4727

def begin_resume_with_http_info(resource_group_name, name, custom_headers:nil)
  begin_resume_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#begin_suspend(resource_group_name, name, custom_headers: nil) ⇒ Array<Site>

Suspend an App Service Environment.

Suspend an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Array<Site>)

    operation results.



4825
4826
4827
4828
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4825

def begin_suspend(resource_group_name, name, custom_headers:nil)
  first_page = begin_suspend_as_lazy(resource_group_name, name, custom_headers:custom_headers)
  first_page.get_all_items
end

#begin_suspend_as_lazy(resource_group_name, name, custom_headers: nil) ⇒ WebAppCollection

Suspend an App Service Environment.

Suspend an App Service Environment.

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (WebAppCollection)

    which provide lazy access to pages of the



8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 8205

def begin_suspend_as_lazy(resource_group_name, name, custom_headers:nil)
  response = begin_suspend_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      begin_suspend_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Suspend an App Service Environment.

Suspend an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4860

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.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
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.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

#begin_suspend_next(next_page_link, custom_headers: nil) ⇒ WebAppCollection

Suspend an App Service Environment.

Suspend an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (WebAppCollection)

    operation results.



7470
7471
7472
7473
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7470

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

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

Suspend an App Service Environment.

Suspend an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7503

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.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
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.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

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

Suspend an App Service Environment.

Suspend an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



7487
7488
7489
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7487

def begin_suspend_next_with_http_info(next_page_link, custom_headers:nil)
  begin_suspend_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Suspend an App Service Environment.

Suspend an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4843
4844
4845
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4843

def begin_suspend_with_http_info(resource_group_name, name, custom_headers:nil)
  begin_suspend_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#change_vnet(resource_group_name, name, vnet_info, custom_headers: nil) ⇒ Array<Site>

Move an App Service Environment to a different VNET.

Move an App Service Environment to a different VNET.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • vnet_info (VirtualNetworkProfile)

    Details for the new virtual network.

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

    A hash of custom headers that

Returns:

  • (Array<Site>)

    operation results.



784
785
786
787
788
789
790
791
792
793
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 784

def change_vnet(resource_group_name, name, vnet_info, custom_headers:nil)
  response = change_vnet_async(resource_group_name, name, vnet_info, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      change_vnet_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#change_vnet_async(resource_group_name, name, vnet_info, custom_headers: nil) ⇒ Concurrent::Promise

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • vnet_info (VirtualNetworkProfile)

    Details for the new virtual network.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 824

def change_vnet_async(resource_group_name, name, vnet_info, custom_headers:nil)
  # Send request
  promise = begin_change_vnet_async(resource_group_name, name, vnet_info, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#change_vnet_next(next_page_link, custom_headers: nil) ⇒ WebAppCollection

Move an App Service Environment to a different VNET.

Move an App Service Environment to a different VNET.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (WebAppCollection)

    operation results.



5368
5369
5370
5371
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5368

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

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

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

response.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5382

def change_vnet_next_async(next_page_link, custom_headers:nil)
  # Send request
  promise = begin_change_vnet_next_async(next_page_link, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#create_or_update(resource_group_name, name, hosting_environment_envelope, custom_headers: nil) ⇒ AppServiceEnvironmentResource

Create or update an App Service Environment.

Create or update an App Service Environment.

resource belongs. Configuration details of the App Service Environment. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (AppServiceEnvironmentResource)

    operation results.



339
340
341
342
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 339

def create_or_update(resource_group_name, name, hosting_environment_envelope, custom_headers:nil)
  response = create_or_update_async(resource_group_name, name, hosting_environment_envelope, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, name, hosting_environment_envelope, custom_headers: nil) ⇒ Concurrent::Promise

resource belongs. Configuration details of the App Service Environment. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 356

def create_or_update_async(resource_group_name, name, hosting_environment_envelope, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, name, hosting_environment_envelope, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServiceEnvironmentResource.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#create_or_update_multi_role_pool(resource_group_name, name, multi_role_pool_envelope, custom_headers: nil) ⇒ WorkerPoolResource

Create or update a multi-role pool.

Create or update a multi-role pool.

resource belongs. multi-role pool. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • multi_role_pool_envelope (WorkerPoolResource)

    Properties of the

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

    A hash of custom headers that

Returns:

  • (WorkerPoolResource)

    operation results.



1532
1533
1534
1535
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1532

def create_or_update_multi_role_pool(resource_group_name, name, multi_role_pool_envelope, custom_headers:nil)
  response = create_or_update_multi_role_pool_async(resource_group_name, name, multi_role_pool_envelope, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_multi_role_pool_async(resource_group_name, name, multi_role_pool_envelope, custom_headers: nil) ⇒ Concurrent::Promise

resource belongs. multi-role pool. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • multi_role_pool_envelope (WorkerPoolResource)

    Properties of the

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1549

def create_or_update_multi_role_pool_async(resource_group_name, name, multi_role_pool_envelope, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_multi_role_pool_async(resource_group_name, name, multi_role_pool_envelope, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#create_or_update_worker_pool(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers: nil) ⇒ WorkerPoolResource

Create or update a worker pool.

Create or update a worker pool.

resource belongs. pool. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • worker_pool_envelope (WorkerPoolResource)

    Properties of the worker

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

    A hash of custom headers that

Returns:

  • (WorkerPoolResource)

    operation results.



3311
3312
3313
3314
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3311

def create_or_update_worker_pool(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:nil)
  response = create_or_update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers: nil) ⇒ Concurrent::Promise

resource belongs. pool. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • worker_pool_envelope (WorkerPoolResource)

    Properties of the worker

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3329

def create_or_update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete(resource_group_name, name, force_delete: nil, custom_headers: nil) ⇒ Object

Delete an App Service Environment.

Delete an App Service Environment.

resource belongs. even if the App Service Environment contains resources. The default is false. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • force_delete (Boolean) (defaults to: nil)

    Specify true to force the deletion

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

    A hash of custom headers that



388
389
390
391
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 388

def delete(resource_group_name, name, force_delete:nil, custom_headers:nil)
  response = delete_async(resource_group_name, name, force_delete:force_delete, custom_headers:custom_headers).value!
  nil
end

#delete_async(resource_group_name, name, force_delete: nil, custom_headers: nil) ⇒ Concurrent::Promise

resource belongs. even if the App Service Environment contains resources. The default is false. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • force_delete (Boolean) (defaults to: nil)

    Specify true to force the deletion

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 406

def delete_async(resource_group_name, name, force_delete:nil, custom_headers:nil)
  # Send request
  promise = begin_delete_async(resource_group_name, name, force_delete:force_delete, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#get(resource_group_name, name, custom_headers: nil) ⇒ AppServiceEnvironmentResource

Get the properties of an App Service Environment.

Get the properties of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (AppServiceEnvironmentResource)

    operation results.



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

def get(resource_group_name, name, custom_headers:nil)
  response = get_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Get the properties of an App Service Environment.

Get the properties of an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 266

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


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{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,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServiceEnvironmentResource.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_diagnostics_item(resource_group_name, name, diagnostics_name, custom_headers: nil) ⇒ HostingEnvironmentDiagnostics

Get a diagnostics item for an App Service Environment.

Get a diagnostics item for an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • diagnostics_name (String)

    Name of the diagnostics item.

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

    A hash of custom headers that

Returns:

  • (HostingEnvironmentDiagnostics)

    operation results.



978
979
980
981
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 978

def get_diagnostics_item(resource_group_name, name, diagnostics_name, custom_headers:nil)
  response = get_diagnostics_item_async(resource_group_name, name, diagnostics_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_diagnostics_item_async(resource_group_name, name, diagnostics_name, custom_headers: nil) ⇒ Concurrent::Promise

Get a diagnostics item for an App Service Environment.

Get a diagnostics item for an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • diagnostics_name (String)

    Name of the diagnostics item.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1015

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::HostingEnvironmentDiagnostics.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_diagnostics_item_with_http_info(resource_group_name, name, diagnostics_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a diagnostics item for an App Service Environment.

Get a diagnostics item for an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • diagnostics_name (String)

    Name of the diagnostics item.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



997
998
999
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 997

def get_diagnostics_item_with_http_info(resource_group_name, name, diagnostics_name, custom_headers:nil)
  get_diagnostics_item_async(resource_group_name, name, diagnostics_name, custom_headers:custom_headers).value!
end

#get_multi_role_pool(resource_group_name, name, custom_headers: nil) ⇒ WorkerPoolResource

Get properties of a multi-role pool.

Get properties of a multi-role pool.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (WorkerPoolResource)

    operation results.



1424
1425
1426
1427
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1424

def get_multi_role_pool(resource_group_name, name, custom_headers:nil)
  response = get_multi_role_pool_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Get properties of a multi-role pool.

Get properties of a multi-role pool.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1459

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.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_multi_role_pool_with_http_info(resource_group_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get properties of a multi-role pool.

Get properties of a multi-role pool.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1442
1443
1444
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1442

def get_multi_role_pool_with_http_info(resource_group_name, name, custom_headers:nil)
  get_multi_role_pool_async(resource_group_name, name, custom_headers:custom_headers).value!
end

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

Get the properties of an App Service Environment.

Get the properties of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



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

def get_with_http_info(resource_group_name, name, custom_headers:nil)
  get_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#get_worker_pool(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ WorkerPoolResource

Get properties of a worker pool.

Get properties of a worker pool.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

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

    A hash of custom headers that

Returns:

  • (WorkerPoolResource)

    operation results.



3199
3200
3201
3202
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3199

def get_worker_pool(resource_group_name, name, worker_pool_name, custom_headers:nil)
  response = get_worker_pool_async(resource_group_name, name, worker_pool_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_worker_pool_async(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ Concurrent::Promise

Get properties of a worker pool.

Get properties of a worker pool.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3236

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.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_worker_pool_with_http_info(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get properties of a worker pool.

Get properties of a worker pool.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3218
3219
3220
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3218

def get_worker_pool_with_http_info(resource_group_name, name, worker_pool_name, custom_headers:nil)
  get_worker_pool_async(resource_group_name, name, worker_pool_name, custom_headers:custom_headers).value!
end

#list(custom_headers: nil) ⇒ Array<AppServiceEnvironmentResource>

Get all App Service Environments for a subscription.

Get all App Service 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:

  • (Array<AppServiceEnvironmentResource>)

    operation results.



34
35
36
37
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 34

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

#list_app_service_plans(resource_group_name, name, custom_headers: nil) ⇒ Array<AppServicePlan>

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Array<AppServicePlan>)

    operation results.



2686
2687
2688
2689
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2686

def list_app_service_plans(resource_group_name, name, custom_headers:nil)
  first_page = list_app_service_plans_as_lazy(resource_group_name, name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_app_service_plans_as_lazy(resource_group_name, name, custom_headers: nil) ⇒ AppServicePlanCollection

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (AppServicePlanCollection)

    which provide lazy access to pages of the



7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7873

def list_app_service_plans_as_lazy(resource_group_name, name, custom_headers:nil)
  response = list_app_service_plans_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_app_service_plans_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2721

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_app_service_plans_next(next_page_link, custom_headers: nil) ⇒ AppServicePlanCollection

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (AppServicePlanCollection)

    operation results.



6236
6237
6238
6239
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6236

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

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

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6269

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



6253
6254
6255
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6253

def list_app_service_plans_next_with_http_info(next_page_link, custom_headers:nil)
  list_app_service_plans_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2704
2705
2706
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2704

def list_app_service_plans_with_http_info(resource_group_name, name, custom_headers:nil)
  list_app_service_plans_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_as_lazy(custom_headers: nil) ⇒ AppServiceEnvironmentCollection

Get all App Service Environments for a subscription.

Get all App Service Environments 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:

  • (AppServiceEnvironmentCollection)

    which provide lazy access to pages



7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7575

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

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

Get all App Service Environments for a subscription.

Get all App Service 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.



63
64
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
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 63

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_by_resource_group(resource_group_name, custom_headers: nil) ⇒ Array<AppServiceEnvironmentResource>

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

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

    A hash of custom headers that

Returns:

  • (Array<AppServiceEnvironmentResource>)

    operation results.



128
129
130
131
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 128

def list_by_resource_group(resource_group_name, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_resource_group_as_lazy(resource_group_name, custom_headers: nil) ⇒ AppServiceEnvironmentCollection

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

resource belongs. will be added to the HTTP request.

of the response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

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

    A hash of custom headers that

Returns:

  • (AppServiceEnvironmentCollection)

    which provide lazy access to pages



7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7599

def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_resource_group_async(resource_group_name, custom_headers: nil) ⇒ Concurrent::Promise

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
216
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 161

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ AppServiceEnvironmentCollection

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (AppServiceEnvironmentCollection)

    operation results.



5170
5171
5172
5173
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5170

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

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

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5203

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5187
5188
5189
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5187

def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_resource_group_with_http_info(resource_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



145
146
147
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 145

def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
end

#list_capacities(resource_group_name, name, custom_headers: nil) ⇒ Array<StampCapacity>

Get the used, available, and total worker capacity an App Service Environment.

Get the used, available, and total worker capacity an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Array<StampCapacity>)

    operation results.



567
568
569
570
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 567

def list_capacities(resource_group_name, name, custom_headers:nil)
  first_page = list_capacities_as_lazy(resource_group_name, name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_capacities_as_lazy(resource_group_name, name, custom_headers: nil) ⇒ StampCapacityCollection

Get the used, available, and total worker capacity an App Service Environment.

Get the used, available, and total worker capacity an App Service Environment.

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (StampCapacityCollection)

    which provide lazy access to pages of the



7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7626

def list_capacities_as_lazy(resource_group_name, name, custom_headers:nil)
  response = list_capacities_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_capacities_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Get the used, available, and total worker capacity an App Service Environment.

Get the used, available, and total worker capacity an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
655
656
657
658
659
660
661
662
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 606

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_capacities_next(next_page_link, custom_headers: nil) ⇒ StampCapacityCollection

Get the used, available, and total worker capacity an App Service Environment.

Get the used, available, and total worker capacity an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (StampCapacityCollection)

    operation results.



5268
5269
5270
5271
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5268

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

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

Get the used, available, and total worker capacity an App Service Environment.

Get the used, available, and total worker capacity an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5305

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get the used, available, and total worker capacity an App Service Environment.

Get the used, available, and total worker capacity an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5287
5288
5289
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5287

def list_capacities_next_with_http_info(next_page_link, custom_headers:nil)
  list_capacities_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Get the used, available, and total worker capacity an App Service Environment.

Get the used, available, and total worker capacity an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



587
588
589
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 587

def list_capacities_with_http_info(resource_group_name, name, custom_headers:nil)
  list_capacities_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_diagnostics(resource_group_name, name, custom_headers: nil) ⇒ Array

Get diagnostic information for an App Service Environment.

Get diagnostic information for an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



855
856
857
858
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 855

def list_diagnostics(resource_group_name, name, custom_headers:nil)
  response = list_diagnostics_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Get diagnostic information for an App Service Environment.

Get diagnostic information for an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
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
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 890

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'HostingEnvironmentDiagnosticsElementType',
                type: {
                  name: 'Composite',
                  class_name: 'HostingEnvironmentDiagnostics'
                }
            }
          }
        }
        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_diagnostics_with_http_info(resource_group_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get diagnostic information for an App Service Environment.

Get diagnostic information for an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



873
874
875
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 873

def list_diagnostics_with_http_info(resource_group_name, name, custom_headers:nil)
  list_diagnostics_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_metric_definitions(resource_group_name, name, custom_headers: nil) ⇒ MetricDefinition

Get global metric definitions of an App Service Environment.

Get global metric definitions of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MetricDefinition)

    operation results.



1087
1088
1089
1090
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1087

def list_metric_definitions(resource_group_name, name, custom_headers:nil)
  response = list_metric_definitions_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Get global metric definitions of an App Service Environment.

Get global metric definitions of an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1122

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get global metric definitions of an App Service Environment.

Get global metric definitions of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1105
1106
1107
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1105

def list_metric_definitions_with_http_info(resource_group_name, name, custom_headers:nil)
  list_metric_definitions_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_metrics(resource_group_name, name, details: nil, filter: nil, custom_headers: nil) ⇒ Array<ResourceMetric>

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (Array<ResourceMetric>)

    operation results.



1199
1200
1201
1202
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1199

def list_metrics(resource_group_name, name, details:nil, filter:nil, custom_headers:nil)
  first_page = list_metrics_as_lazy(resource_group_name, name, details:details, filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_metrics_as_lazy(resource_group_name, name, details: nil, filter: nil, custom_headers: nil) ⇒ ResourceMetricCollection

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration’‘. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (ResourceMetricCollection)

    which provide lazy access to pages of the



7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7657

def list_metrics_as_lazy(resource_group_name, name, details:nil, filter:nil, custom_headers:nil)
  response = list_metrics_async(resource_group_name, name, details:details, filter:filter, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_metrics_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_metrics_async(resource_group_name, name, details: nil, filter: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

  • A (Hash{String => String})

    hash of custom headers that will be added

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
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1246

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_metrics_next(next_page_link, custom_headers: nil) ⇒ ResourceMetricCollection

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ResourceMetricCollection)

    operation results.



5412
5413
5414
5415
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5412

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

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

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5445

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5429
5430
5431
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5429

def list_metrics_next_with_http_info(next_page_link, custom_headers:nil)
  list_metrics_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_metrics_with_http_info(resource_group_name, name, details: nil, filter: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1223
1224
1225
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1223

def list_metrics_with_http_info(resource_group_name, name, details:nil, filter:nil, custom_headers:nil)
  list_metrics_async(resource_group_name, name, details:details, filter:filter, custom_headers:custom_headers).value!
end

#list_multi_role_metric_definitions(resource_group_name, name, custom_headers: nil) ⇒ Array<ResourceMetricDefinition>

Get metric definitions for a multi-role pool of an App Service Environment.

Get metric definitions for a multi-role pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Array<ResourceMetricDefinition>)

    operation results.



1948
1949
1950
1951
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1948

def list_multi_role_metric_definitions(resource_group_name, name, custom_headers:nil)
  first_page = list_multi_role_metric_definitions_as_lazy(resource_group_name, name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_multi_role_metric_definitions_as_lazy(resource_group_name, name, custom_headers: nil) ⇒ ResourceMetricDefinitionCollection

Get metric definitions for a multi-role pool of an App Service Environment.

Get metric definitions for a multi-role pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

pages of the response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (ResourceMetricDefinitionCollection)

    which provide lazy access to



7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7765

def list_multi_role_metric_definitions_as_lazy(resource_group_name, name, custom_headers:nil)
  response = list_multi_role_metric_definitions_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_multi_role_metric_definitions_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Get metric definitions for a multi-role pool of an App Service Environment.

Get metric definitions for a multi-role pool of an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1983

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_multi_role_metric_definitions_next(next_page_link, custom_headers: nil) ⇒ ResourceMetricDefinitionCollection

Get metric definitions for a multi-role pool of an App Service Environment.

Get metric definitions for a multi-role pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ResourceMetricDefinitionCollection)

    operation results.



5808
5809
5810
5811
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5808

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

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

Get metric definitions for a multi-role pool of an App Service Environment.

Get metric definitions for a multi-role pool of an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5841

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get metric definitions for a multi-role pool of an App Service Environment.

Get metric definitions for a multi-role pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5825
5826
5827
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5825

def list_multi_role_metric_definitions_next_with_http_info(next_page_link, custom_headers:nil)
  list_multi_role_metric_definitions_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Get metric definitions for a multi-role pool of an App Service Environment.

Get metric definitions for a multi-role pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1966
1967
1968
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1966

def list_multi_role_metric_definitions_with_http_info(resource_group_name, name, custom_headers:nil)
  list_multi_role_metric_definitions_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_multi_role_metrics(resource_group_name, name, start_time: nil, end_time: nil, time_grain: nil, details: nil, filter: nil, custom_headers: nil) ⇒ Array<ResourceMetric>

Get metrics for a multi-role pool of an App Service Environment.

Get metrics for a multi-role pool of an App Service Environment.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • start_time (String) (defaults to: nil)

    Beginning time of the metrics query.

  • end_time (String) (defaults to: nil)

    End time of the metrics query.

  • time_grain (String) (defaults to: nil)

    Time granularity of the metrics query.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (Array<ResourceMetric>)

    operation results.



2063
2064
2065
2066
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2063

def list_multi_role_metrics(resource_group_name, name, start_time:nil, end_time:nil, time_grain:nil, details:nil, filter:nil, custom_headers:nil)
  first_page = list_multi_role_metrics_as_lazy(resource_group_name, name, start_time:start_time, end_time:end_time, time_grain:time_grain, details:details, filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_multi_role_metrics_as_lazy(resource_group_name, name, start_time: nil, end_time: nil, time_grain: nil, details: nil, filter: nil, custom_headers: nil) ⇒ ResourceMetricCollection

Get metrics for a multi-role pool of an App Service Environment.

Get metrics for a multi-role pool of an App Service Environment.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration’‘. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • start_time (String) (defaults to: nil)

    Beginning time of the metrics query.

  • end_time (String) (defaults to: nil)

    End time of the metrics query.

  • time_grain (String) (defaults to: nil)

    Time granularity of the metrics query.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (ResourceMetricCollection)

    which provide lazy access to pages of the



7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7799

def list_multi_role_metrics_as_lazy(resource_group_name, name, start_time:nil, end_time:nil, time_grain:nil, details:nil, filter:nil, custom_headers:nil)
  response = list_multi_role_metrics_async(resource_group_name, name, start_time:start_time, end_time:end_time, time_grain:time_grain, details:details, filter:filter, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_multi_role_metrics_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_multi_role_metrics_async(resource_group_name, name, start_time: nil, end_time: nil, time_grain: nil, details: nil, filter: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get metrics for a multi-role pool of an App Service Environment.

Get metrics for a multi-role pool of an App Service Environment.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • start_time (String) (defaults to: nil)

    Beginning time of the metrics query.

  • end_time (String) (defaults to: nil)

    End time of the metrics query.

  • time_grain (String) (defaults to: nil)

    Time granularity of the metrics query.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2116

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_multi_role_metrics_next(next_page_link, custom_headers: nil) ⇒ ResourceMetricCollection

Get metrics for a multi-role pool of an App Service Environment.

Get metrics for a multi-role pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ResourceMetricCollection)

    operation results.



5904
5905
5906
5907
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5904

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

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

Get metrics for a multi-role pool of an App Service Environment.

Get metrics for a multi-role pool of an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5937

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get metrics for a multi-role pool of an App Service Environment.

Get metrics for a multi-role pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5921
5922
5923
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5921

def list_multi_role_metrics_next_with_http_info(next_page_link, custom_headers:nil)
  list_multi_role_metrics_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_multi_role_metrics_with_http_info(resource_group_name, name, start_time: nil, end_time: nil, time_grain: nil, details: nil, filter: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get metrics for a multi-role pool of an App Service Environment.

Get metrics for a multi-role pool of an App Service Environment.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • start_time (String) (defaults to: nil)

    Beginning time of the metrics query.

  • end_time (String) (defaults to: nil)

    End time of the metrics query.

  • time_grain (String) (defaults to: nil)

    Time granularity of the metrics query.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2090
2091
2092
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2090

def list_multi_role_metrics_with_http_info(resource_group_name, name, start_time:nil, end_time:nil, time_grain:nil, details:nil, filter:nil, custom_headers:nil)
  list_multi_role_metrics_async(resource_group_name, name, start_time:start_time, end_time:end_time, time_grain:time_grain, details:details, filter:filter, custom_headers:custom_headers).value!
end

#list_multi_role_pool_instance_metric_definitions(resource_group_name, name, instance, custom_headers: nil) ⇒ Array<ResourceMetricDefinition>

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • instance (String)

    Name of the instance in the multi-role pool.

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

    A hash of custom headers that

Returns:

  • (Array<ResourceMetricDefinition>)

    operation results.



1713
1714
1715
1716
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1713

def list_multi_role_pool_instance_metric_definitions(resource_group_name, name, instance, custom_headers:nil)
  first_page = list_multi_role_pool_instance_metric_definitions_as_lazy(resource_group_name, name, instance, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_multi_role_pool_instance_metric_definitions_as_lazy(resource_group_name, name, instance, custom_headers: nil) ⇒ ResourceMetricDefinitionCollection

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

pages of the response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • instance (String)

    Name of the instance in the multi-role pool.

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

    A hash of custom headers that

Returns:

  • (ResourceMetricDefinitionCollection)

    which provide lazy access to



7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7710

def list_multi_role_pool_instance_metric_definitions_as_lazy(resource_group_name, name, instance, custom_headers:nil)
  response = list_multi_role_pool_instance_metric_definitions_async(resource_group_name, name, instance, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_multi_role_pool_instance_metric_definitions_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_multi_role_pool_instance_metric_definitions_async(resource_group_name, name, instance, custom_headers: nil) ⇒ Concurrent::Promise

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • instance (String)

    Name of the instance in the multi-role pool.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1754

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_multi_role_pool_instance_metric_definitions_next(next_page_link, custom_headers: nil) ⇒ ResourceMetricDefinitionCollection

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ResourceMetricDefinitionCollection)

    operation results.



5606
5607
5608
5609
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5606

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

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

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5643

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5625
5626
5627
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5625

def list_multi_role_pool_instance_metric_definitions_next_with_http_info(next_page_link, custom_headers:nil)
  list_multi_role_pool_instance_metric_definitions_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_multi_role_pool_instance_metric_definitions_with_http_info(resource_group_name, name, instance, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

Get metric definitions for a specific instance of a multi-role pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • instance (String)

    Name of the instance in the multi-role pool.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1734
1735
1736
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1734

def list_multi_role_pool_instance_metric_definitions_with_http_info(resource_group_name, name, instance, custom_headers:nil)
  list_multi_role_pool_instance_metric_definitions_async(resource_group_name, name, instance, custom_headers:custom_headers).value!
end

#list_multi_role_pool_instance_metrics(resource_group_name, name, instance, details: nil, custom_headers: nil) ⇒ Array<ResourceMetric>

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

resource belongs. details. The default is false. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • instance (String)

    Name of the instance in the multi-role pool.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

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

    A hash of custom headers that

Returns:

  • (Array<ResourceMetric>)

    operation results.



1831
1832
1833
1834
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1831

def list_multi_role_pool_instance_metrics(resource_group_name, name, instance, details:nil, custom_headers:nil)
  first_page = list_multi_role_pool_instance_metrics_as_lazy(resource_group_name, name, instance, details:details, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_multi_role_pool_instance_metrics_as_lazy(resource_group_name, name, instance, details: nil, custom_headers: nil) ⇒ ResourceMetricCollection

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

resource belongs. details. The default is false. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • instance (String)

    Name of the instance in the multi-role pool.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

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

    A hash of custom headers that

Returns:

  • (ResourceMetricCollection)

    which provide lazy access to pages of the



7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7740

def list_multi_role_pool_instance_metrics_as_lazy(resource_group_name, name, instance, details:nil, custom_headers:nil)
  response = list_multi_role_pool_instance_metrics_async(resource_group_name, name, instance, details:details, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_multi_role_pool_instance_metrics_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_multi_role_pool_instance_metrics_async(resource_group_name, name, instance, details: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

resource belongs. details. The default is false. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • instance (String)

    Name of the instance in the multi-role pool.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
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
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1876

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_multi_role_pool_instance_metrics_next(next_page_link, custom_headers: nil) ⇒ ResourceMetricCollection

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ResourceMetricCollection)

    operation results.



5708
5709
5710
5711
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5708

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

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

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5745

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5727
5728
5729
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5727

def list_multi_role_pool_instance_metrics_next_with_http_info(next_page_link, custom_headers:nil)
  list_multi_role_pool_instance_metrics_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_multi_role_pool_instance_metrics_with_http_info(resource_group_name, name, instance, details: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

Get metrics for a specific instance of a multi-role pool of an App Service Environment.

resource belongs. details. The default is false. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • instance (String)

    Name of the instance in the multi-role pool.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1854
1855
1856
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1854

def list_multi_role_pool_instance_metrics_with_http_info(resource_group_name, name, instance, details:nil, custom_headers:nil)
  list_multi_role_pool_instance_metrics_async(resource_group_name, name, instance, details:details, custom_headers:custom_headers).value!
end

#list_multi_role_pool_skus(resource_group_name, name, custom_headers: nil) ⇒ Array<SkuInfo>

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Array<SkuInfo>)

    operation results.



2188
2189
2190
2191
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2188

def list_multi_role_pool_skus(resource_group_name, name, custom_headers:nil)
  first_page = list_multi_role_pool_skus_as_lazy(resource_group_name, name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_multi_role_pool_skus_as_lazy(resource_group_name, name, custom_headers: nil) ⇒ SkuInfoCollection

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (SkuInfoCollection)

    which provide lazy access to pages of the



7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7824

def list_multi_role_pool_skus_as_lazy(resource_group_name, name, custom_headers:nil)
  response = list_multi_role_pool_skus_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_multi_role_pool_skus_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2223

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_multi_role_pool_skus_next(next_page_link, custom_headers: nil) ⇒ SkuInfoCollection

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (SkuInfoCollection)

    operation results.



6000
6001
6002
6003
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6000

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

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

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6033

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



6017
6018
6019
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6017

def list_multi_role_pool_skus_next_with_http_info(next_page_link, custom_headers:nil)
  list_multi_role_pool_skus_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2206
2207
2208
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2206

def list_multi_role_pool_skus_with_http_info(resource_group_name, name, custom_headers:nil)
  list_multi_role_pool_skus_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_multi_role_pools(resource_group_name, name, custom_headers: nil) ⇒ Array<WorkerPoolResource>

Get all multi-role pools.

Get all multi-role pools.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Array<WorkerPoolResource>)

    operation results.



1318
1319
1320
1321
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1318

def list_multi_role_pools(resource_group_name, name, custom_headers:nil)
  first_page = list_multi_role_pools_as_lazy(resource_group_name, name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_multi_role_pools_as_lazy(resource_group_name, name, custom_headers: nil) ⇒ WorkerPoolCollection

Get all multi-role pools.

Get all multi-role pools.

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (WorkerPoolCollection)

    which provide lazy access to pages of the



7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7682

def list_multi_role_pools_as_lazy(resource_group_name, name, custom_headers:nil)
  response = list_multi_role_pools_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_multi_role_pools_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Get all multi-role pools.

Get all multi-role pools.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1353

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_multi_role_pools_next(next_page_link, custom_headers: nil) ⇒ WorkerPoolCollection

Get all multi-role pools.

Get all multi-role pools.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (WorkerPoolCollection)

    operation results.



5508
5509
5510
5511
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5508

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

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

Get all multi-role pools.

Get all multi-role pools.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5541

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get all multi-role pools.

Get all multi-role pools.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5525
5526
5527
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5525

def list_multi_role_pools_next_with_http_info(next_page_link, custom_headers:nil)
  list_multi_role_pools_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Get all multi-role pools.

Get all multi-role pools.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1336
1337
1338
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1336

def list_multi_role_pools_with_http_info(resource_group_name, name, custom_headers:nil)
  list_multi_role_pools_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_multi_role_usages(resource_group_name, name, custom_headers: nil) ⇒ Array<Usage>

Get usage metrics for a multi-role pool of an App Service Environment.

Get usage metrics for a multi-role pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Array<Usage>)

    operation results.



2294
2295
2296
2297
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2294

def list_multi_role_usages(resource_group_name, name, custom_headers:nil)
  first_page = list_multi_role_usages_as_lazy(resource_group_name, name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_multi_role_usages_as_lazy(resource_group_name, name, custom_headers: nil) ⇒ UsageCollection

Get usage metrics for a multi-role pool of an App Service Environment.

Get usage metrics for a multi-role pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (UsageCollection)

    which provide lazy access to pages of the response.



7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7848

def list_multi_role_usages_as_lazy(resource_group_name, name, custom_headers:nil)
  response = list_multi_role_usages_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_multi_role_usages_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Get usage metrics for a multi-role pool of an App Service Environment.

Get usage metrics for a multi-role pool of an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2329

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_multi_role_usages_next(next_page_link, custom_headers: nil) ⇒ UsageCollection

Get usage metrics for a multi-role pool of an App Service Environment.

Get usage metrics for a multi-role pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (UsageCollection)

    operation results.



6096
6097
6098
6099
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6096

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

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

Get usage metrics for a multi-role pool of an App Service Environment.

Get usage metrics for a multi-role pool of an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6129

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get usage metrics for a multi-role pool of an App Service Environment.

Get usage metrics for a multi-role pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



6113
6114
6115
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6113

def list_multi_role_usages_next_with_http_info(next_page_link, custom_headers:nil)
  list_multi_role_usages_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Get usage metrics for a multi-role pool of an App Service Environment.

Get usage metrics for a multi-role pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2312
2313
2314
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2312

def list_multi_role_usages_with_http_info(resource_group_name, name, custom_headers:nil)
  list_multi_role_usages_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_next(next_page_link, custom_headers: nil) ⇒ AppServiceEnvironmentCollection

Get all App Service Environments for a subscription.

Get all App Service Environments for a subscription.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (AppServiceEnvironmentCollection)

    operation results.



5074
5075
5076
5077
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5074

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

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

Get all App Service Environments for a subscription.

Get all App Service Environments for a subscription.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5107

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get all App Service Environments for a subscription.

Get all App Service Environments for a subscription.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



5091
5092
5093
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 5091

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

#list_operations(resource_group_name, name, custom_headers: nil) ⇒ Array

List all currently running operations on the App Service Environment.

List all currently running operations on the App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



2400
2401
2402
2403
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2400

def list_operations(resource_group_name, name, custom_headers:nil)
  response = list_operations_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

List all currently running operations on the App Service Environment.

List all currently running operations on the App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2435

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'OperationElementType',
                type: {
                  name: 'Composite',
                  class_name: 'Operation'
                }
            }
          }
        }
        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_operations_with_http_info(resource_group_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List all currently running operations on the App Service Environment.

List all currently running operations on the App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2418
2419
2420
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2418

def list_operations_with_http_info(resource_group_name, name, custom_headers:nil)
  list_operations_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_usages(resource_group_name, name, filter: nil, custom_headers: nil) ⇒ Array<CsmUsageQuota>

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

resource belongs. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (Array<CsmUsageQuota>)

    operation results.



2977
2978
2979
2980
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2977

def list_usages(resource_group_name, name, filter:nil, custom_headers:nil)
  first_page = list_usages_as_lazy(resource_group_name, name, filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_usages_as_lazy(resource_group_name, name, filter: nil, custom_headers: nil) ⇒ CsmUsageQuotaCollection

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

resource belongs. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration’‘. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (CsmUsageQuotaCollection)

    which provide lazy access to pages of the



7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7929

def list_usages_as_lazy(resource_group_name, name, filter:nil, custom_headers:nil)
  response = list_usages_async(resource_group_name, name, filter:filter, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_usages_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_usages_async(resource_group_name, name, filter: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

resource belongs. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3020

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_usages_next(next_page_link, custom_headers: nil) ⇒ CsmUsageQuotaCollection

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (CsmUsageQuotaCollection)

    operation results.



6472
6473
6474
6475
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6472

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

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

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6505

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



6489
6490
6491
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6489

def list_usages_next_with_http_info(next_page_link, custom_headers:nil)
  list_usages_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_usages_with_http_info(resource_group_name, name, filter: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

resource belongs. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2999
3000
3001
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2999

def list_usages_with_http_info(resource_group_name, name, filter:nil, custom_headers:nil)
  list_usages_async(resource_group_name, name, filter:filter, custom_headers:custom_headers).value!
end

#list_vips(resource_group_name, name, custom_headers: nil) ⇒ AddressResponse

Get IP addresses assigned to an App Service Environment.

Get IP addresses assigned to an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (AddressResponse)

    operation results.



677
678
679
680
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 677

def list_vips(resource_group_name, name, custom_headers:nil)
  response = list_vips_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Get IP addresses assigned to an App Service Environment.

Get IP addresses assigned to an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
761
762
763
764
765
766
767
768
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 712

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get IP addresses assigned to an App Service Environment.

Get IP addresses assigned to an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



695
696
697
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 695

def list_vips_with_http_info(resource_group_name, name, custom_headers:nil)
  list_vips_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_web_apps(resource_group_name, name, properties_to_include: nil, custom_headers: nil) ⇒ Array<Site>

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

resource belongs. to include. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • properties_to_include (String) (defaults to: nil)

    Comma separated list of app properties

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

    A hash of custom headers that

Returns:

  • (Array<Site>)

    operation results.



2794
2795
2796
2797
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2794

def list_web_apps(resource_group_name, name, properties_to_include:nil, custom_headers:nil)
  first_page = list_web_apps_as_lazy(resource_group_name, name, properties_to_include:properties_to_include, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_web_apps_as_lazy(resource_group_name, name, properties_to_include: nil, custom_headers: nil) ⇒ WebAppCollection

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

resource belongs. to include. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • properties_to_include (String) (defaults to: nil)

    Comma separated list of app properties

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

    A hash of custom headers that

Returns:

  • (WebAppCollection)

    which provide lazy access to pages of the



7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7900

def list_web_apps_as_lazy(resource_group_name, name, properties_to_include:nil, custom_headers:nil)
  response = list_web_apps_async(resource_group_name, name, properties_to_include:properties_to_include, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_web_apps_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_web_apps_async(resource_group_name, name, properties_to_include: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

resource belongs. to include. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • properties_to_include (String) (defaults to: nil)

    Comma separated list of app properties

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2833

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_web_apps_next(next_page_link, custom_headers: nil) ⇒ WebAppCollection

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (WebAppCollection)

    operation results.



6332
6333
6334
6335
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6332

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

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

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6365

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



6349
6350
6351
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6349

def list_web_apps_next_with_http_info(next_page_link, custom_headers:nil)
  list_web_apps_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_web_apps_with_http_info(resource_group_name, name, properties_to_include: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

resource belongs. to include. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • properties_to_include (String) (defaults to: nil)

    Comma separated list of app properties

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2814
2815
2816
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2814

def list_web_apps_with_http_info(resource_group_name, name, properties_to_include:nil, custom_headers:nil)
  list_web_apps_async(resource_group_name, name, properties_to_include:properties_to_include, custom_headers:custom_headers).value!
end

#list_web_worker_metric_definitions(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ Array<ResourceMetricDefinition>

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

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

    A hash of custom headers that

Returns:

  • (Array<ResourceMetricDefinition>)

    operation results.



3754
3755
3756
3757
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3754

def list_web_worker_metric_definitions(resource_group_name, name, worker_pool_name, custom_headers:nil)
  first_page = list_web_worker_metric_definitions_as_lazy(resource_group_name, name, worker_pool_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_web_worker_metric_definitions_as_lazy(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ ResourceMetricDefinitionCollection

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

pages of the response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

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

    A hash of custom headers that

Returns:

  • (ResourceMetricDefinitionCollection)

    which provide lazy access to



8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 8044

def list_web_worker_metric_definitions_as_lazy(resource_group_name, name, worker_pool_name, custom_headers:nil)
  response = list_web_worker_metric_definitions_async(resource_group_name, name, worker_pool_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_web_worker_metric_definitions_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_web_worker_metric_definitions_async(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ Concurrent::Promise

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3791

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_web_worker_metric_definitions_next(next_page_link, custom_headers: nil) ⇒ ResourceMetricDefinitionCollection

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ResourceMetricDefinitionCollection)

    operation results.



6868
6869
6870
6871
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6868

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

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

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6901

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



6885
6886
6887
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6885

def list_web_worker_metric_definitions_next_with_http_info(next_page_link, custom_headers:nil)
  list_web_worker_metric_definitions_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_web_worker_metric_definitions_with_http_info(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3773
3774
3775
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3773

def list_web_worker_metric_definitions_with_http_info(resource_group_name, name, worker_pool_name, custom_headers:nil)
  list_web_worker_metric_definitions_async(resource_group_name, name, worker_pool_name, custom_headers:custom_headers).value!
end

#list_web_worker_metrics(resource_group_name, name, worker_pool_name, details: nil, filter: nil, custom_headers: nil) ⇒ Array<ResourceMetric>

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of worker pool

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (Array<ResourceMetric>)

    operation results.



3872
3873
3874
3875
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3872

def list_web_worker_metrics(resource_group_name, name, worker_pool_name, details:nil, filter:nil, custom_headers:nil)
  first_page = list_web_worker_metrics_as_lazy(resource_group_name, name, worker_pool_name, details:details, filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_web_worker_metrics_as_lazy(resource_group_name, name, worker_pool_name, details: nil, filter: nil, custom_headers: nil) ⇒ ResourceMetricCollection

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration’‘. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of worker pool

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (ResourceMetricCollection)

    which provide lazy access to pages of the



8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 8078

def list_web_worker_metrics_as_lazy(resource_group_name, name, worker_pool_name, details:nil, filter:nil, custom_headers:nil)
  response = list_web_worker_metrics_async(resource_group_name, name, worker_pool_name, details:details, filter:filter, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_web_worker_metrics_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_web_worker_metrics_async(resource_group_name, name, worker_pool_name, details: nil, filter: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of worker pool

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3925

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_web_worker_metrics_next(next_page_link, custom_headers: nil) ⇒ ResourceMetricCollection

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ResourceMetricCollection)

    operation results.



6966
6967
6968
6969
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6966

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

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

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7003

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



6985
6986
6987
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6985

def list_web_worker_metrics_next_with_http_info(next_page_link, custom_headers:nil)
  list_web_worker_metrics_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_web_worker_metrics_with_http_info(resource_group_name, name, worker_pool_name, details: nil, filter: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of worker pool

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3899
3900
3901
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3899

def list_web_worker_metrics_with_http_info(resource_group_name, name, worker_pool_name, details:nil, filter:nil, custom_headers:nil)
  list_web_worker_metrics_async(resource_group_name, name, worker_pool_name, details:details, filter:filter, custom_headers:custom_headers).value!
end

#list_web_worker_usages(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ Array<Usage>

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

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

    A hash of custom headers that

Returns:

  • (Array<Usage>)

    operation results.



4109
4110
4111
4112
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4109

def list_web_worker_usages(resource_group_name, name, worker_pool_name, custom_headers:nil)
  first_page = list_web_worker_usages_as_lazy(resource_group_name, name, worker_pool_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_web_worker_usages_as_lazy(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ UsageCollection

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

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

    A hash of custom headers that

Returns:

  • (UsageCollection)

    which provide lazy access to pages of the response.



8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 8129

def list_web_worker_usages_as_lazy(resource_group_name, name, worker_pool_name, custom_headers:nil)
  response = list_web_worker_usages_async(resource_group_name, name, worker_pool_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_web_worker_usages_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_web_worker_usages_async(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ Concurrent::Promise

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4146

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_web_worker_usages_next(next_page_link, custom_headers: nil) ⇒ UsageCollection

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (UsageCollection)

    operation results.



7162
7163
7164
7165
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7162

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

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

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7195

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



7179
7180
7181
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7179

def list_web_worker_usages_next_with_http_info(next_page_link, custom_headers:nil)
  list_web_worker_usages_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_web_worker_usages_with_http_info(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4128
4129
4130
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4128

def list_web_worker_usages_with_http_info(resource_group_name, name, worker_pool_name, custom_headers:nil)
  list_web_worker_usages_async(resource_group_name, name, worker_pool_name, custom_headers:custom_headers).value!
end

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

Get all App Service Environments for a subscription.

Get all App Service 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.



49
50
51
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 49

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

#list_worker_pool_instance_metric_definitions(resource_group_name, name, worker_pool_name, instance, custom_headers: nil) ⇒ Array<ResourceMetricDefinition>

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • instance (String)

    Name of the instance in the worker pool.

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

    A hash of custom headers that

Returns:

  • (Array<ResourceMetricDefinition>)

    operation results.



3498
3499
3500
3501
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3498

def list_worker_pool_instance_metric_definitions(resource_group_name, name, worker_pool_name, instance, custom_headers:nil)
  first_page = list_worker_pool_instance_metric_definitions_as_lazy(resource_group_name, name, worker_pool_name, instance, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_worker_pool_instance_metric_definitions_as_lazy(resource_group_name, name, worker_pool_name, instance, custom_headers: nil) ⇒ ResourceMetricDefinitionCollection

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

pages of the response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • instance (String)

    Name of the instance in the worker pool.

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

    A hash of custom headers that

Returns:

  • (ResourceMetricDefinitionCollection)

    which provide lazy access to



7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7983

def list_worker_pool_instance_metric_definitions_as_lazy(resource_group_name, name, worker_pool_name, instance, custom_headers:nil)
  response = list_worker_pool_instance_metric_definitions_async(resource_group_name, name, worker_pool_name, instance, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_worker_pool_instance_metric_definitions_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_worker_pool_instance_metric_definitions_async(resource_group_name, name, worker_pool_name, instance, custom_headers: nil) ⇒ Concurrent::Promise

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • instance (String)

    Name of the instance in the worker pool.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3541

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_worker_pool_instance_metric_definitions_next(next_page_link, custom_headers: nil) ⇒ ResourceMetricDefinitionCollection

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ResourceMetricDefinitionCollection)

    operation results.



6666
6667
6668
6669
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6666

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

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

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6703

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



6685
6686
6687
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6685

def list_worker_pool_instance_metric_definitions_next_with_http_info(next_page_link, custom_headers:nil)
  list_worker_pool_instance_metric_definitions_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_worker_pool_instance_metric_definitions_with_http_info(resource_group_name, name, worker_pool_name, instance, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

Get metric definitions for a specific instance of a worker pool of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • instance (String)

    Name of the instance in the worker pool.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3520
3521
3522
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3520

def list_worker_pool_instance_metric_definitions_with_http_info(resource_group_name, name, worker_pool_name, instance, custom_headers:nil)
  list_worker_pool_instance_metric_definitions_async(resource_group_name, name, worker_pool_name, instance, custom_headers:custom_headers).value!
end

#list_worker_pool_instance_metrics(resource_group_name, name, worker_pool_name, instance, details: nil, filter: nil, custom_headers: nil) ⇒ Array<ResourceMetric>

Get metrics for a specific instance of a worker pool of an App Service Environment.

Get metrics for a specific instance of a worker pool of an App Service Environment.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • instance (String)

    Name of the instance in the worker pool.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (Array<ResourceMetric>)

    operation results.



3624
3625
3626
3627
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3624

def list_worker_pool_instance_metrics(resource_group_name, name, worker_pool_name, instance, details:nil, filter:nil, custom_headers:nil)
  first_page = list_worker_pool_instance_metrics_as_lazy(resource_group_name, name, worker_pool_name, instance, details:details, filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_worker_pool_instance_metrics_as_lazy(resource_group_name, name, worker_pool_name, instance, details: nil, filter: nil, custom_headers: nil) ⇒ ResourceMetricCollection

Get metrics for a specific instance of a worker pool of an App Service Environment.

Get metrics for a specific instance of a worker pool of an App Service Environment.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration’‘. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • instance (String)

    Name of the instance in the worker pool.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (ResourceMetricCollection)

    which provide lazy access to pages of the



8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 8018

def list_worker_pool_instance_metrics_as_lazy(resource_group_name, name, worker_pool_name, instance, details:nil, filter:nil, custom_headers:nil)
  response = list_worker_pool_instance_metrics_async(resource_group_name, name, worker_pool_name, instance, details:details, filter:filter, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_worker_pool_instance_metrics_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_worker_pool_instance_metrics_async(resource_group_name, name, worker_pool_name, instance, details: nil, filter: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get metrics for a specific instance of a worker pool of an App Service Environment.

Get metrics for a specific instance of a worker pool of an App Service Environment.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • instance (String)

    Name of the instance in the worker pool.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3679

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_worker_pool_instance_metrics_next(next_page_link, custom_headers: nil) ⇒ ResourceMetricCollection

Get metrics for a specific instance of a worker pool of an App Service Environment.

Get metrics for a specific instance of a worker pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ResourceMetricCollection)

    operation results.



6768
6769
6770
6771
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6768

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

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

Get metrics for a specific instance of a worker pool of an App Service Environment.

Get metrics for a specific instance of a worker pool of an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6805

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get metrics for a specific instance of a worker pool of an App Service Environment.

Get metrics for a specific instance of a worker pool of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



6787
6788
6789
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6787

def list_worker_pool_instance_metrics_next_with_http_info(next_page_link, custom_headers:nil)
  list_worker_pool_instance_metrics_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_worker_pool_instance_metrics_with_http_info(resource_group_name, name, worker_pool_name, instance, details: nil, filter: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get metrics for a specific instance of a worker pool of an App Service Environment.

Get metrics for a specific instance of a worker pool of an App Service Environment.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) 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

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • instance (String)

    Name of the instance in the worker pool.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3652
3653
3654
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3652

def list_worker_pool_instance_metrics_with_http_info(resource_group_name, name, worker_pool_name, instance, details:nil, filter:nil, custom_headers:nil)
  list_worker_pool_instance_metrics_async(resource_group_name, name, worker_pool_name, instance, details:details, filter:filter, custom_headers:custom_headers).value!
end

#list_worker_pool_skus(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ Array<SkuInfo>

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

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

    A hash of custom headers that

Returns:

  • (Array<SkuInfo>)

    operation results.



3999
4000
4001
4002
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3999

def list_worker_pool_skus(resource_group_name, name, worker_pool_name, custom_headers:nil)
  first_page = list_worker_pool_skus_as_lazy(resource_group_name, name, worker_pool_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_worker_pool_skus_as_lazy(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ SkuInfoCollection

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

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

    A hash of custom headers that

Returns:

  • (SkuInfoCollection)

    which provide lazy access to pages of the



8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 8104

def list_worker_pool_skus_as_lazy(resource_group_name, name, worker_pool_name, custom_headers:nil)
  response = list_worker_pool_skus_async(resource_group_name, name, worker_pool_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_worker_pool_skus_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_worker_pool_skus_async(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ Concurrent::Promise

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4036

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_worker_pool_skus_next(next_page_link, custom_headers: nil) ⇒ SkuInfoCollection

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (SkuInfoCollection)

    operation results.



7066
7067
7068
7069
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7066

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

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

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7099

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



7083
7084
7085
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7083

def list_worker_pool_skus_next_with_http_info(next_page_link, custom_headers:nil)
  list_worker_pool_skus_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_worker_pool_skus_with_http_info(resource_group_name, name, worker_pool_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4018
4019
4020
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 4018

def list_worker_pool_skus_with_http_info(resource_group_name, name, worker_pool_name, custom_headers:nil)
  list_worker_pool_skus_async(resource_group_name, name, worker_pool_name, custom_headers:custom_headers).value!
end

#list_worker_pools(resource_group_name, name, custom_headers: nil) ⇒ Array<WorkerPoolResource>

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Array<WorkerPoolResource>)

    operation results.



3092
3093
3094
3095
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3092

def list_worker_pools(resource_group_name, name, custom_headers:nil)
  first_page = list_worker_pools_as_lazy(resource_group_name, name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_worker_pools_as_lazy(resource_group_name, name, custom_headers: nil) ⇒ WorkerPoolCollection

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (WorkerPoolCollection)

    which provide lazy access to pages of the



7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 7954

def list_worker_pools_as_lazy(resource_group_name, name, custom_headers:nil)
  response = list_worker_pools_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_worker_pools_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3127

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_worker_pools_next(next_page_link, custom_headers: nil) ⇒ WorkerPoolCollection

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (WorkerPoolCollection)

    operation results.



6568
6569
6570
6571
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6568

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

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

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6601

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



6585
6586
6587
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6585

def list_worker_pools_next_with_http_info(next_page_link, custom_headers:nil)
  list_worker_pools_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3110
3111
3112
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3110

def list_worker_pools_with_http_info(resource_group_name, name, custom_headers:nil)
  list_worker_pools_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#reboot(resource_group_name, name, custom_headers: nil) ⇒ Object

Reboot all machines in an App Service Environment.

Reboot all machines in an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that



2521
2522
2523
2524
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2521

def reboot(resource_group_name, name, custom_headers:nil)
  response = reboot_async(resource_group_name, name, custom_headers:custom_headers).value!
  nil
end

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

Reboot all machines in an App Service Environment.

Reboot all machines in an App Service Environment.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2556

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Reboot all machines in an App Service Environment.

Reboot all machines in an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2539
2540
2541
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2539

def reboot_with_http_info(resource_group_name, name, custom_headers:nil)
  reboot_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#resume(resource_group_name, name, custom_headers: nil) ⇒ Array<Site>

Resume an App Service Environment.

Resume an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Array<Site>)

    operation results.



2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2617

def resume(resource_group_name, name, custom_headers:nil)
  response = resume_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      resume_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2655

def resume_async(resource_group_name, name, custom_headers:nil)
  # Send request
  promise = begin_resume_async(resource_group_name, name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#resume_next(next_page_link, custom_headers: nil) ⇒ WebAppCollection

Resume an App Service Environment.

Resume an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (WebAppCollection)

    operation results.



6192
6193
6194
6195
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6192

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

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

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

response.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6206

def resume_next_async(next_page_link, custom_headers:nil)
  # Send request
  promise = begin_resume_next_async(next_page_link, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#suspend(resource_group_name, name, custom_headers: nil) ⇒ Array<Site>

Suspend an App Service Environment.

Suspend an App Service Environment.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Array<Site>)

    operation results.



2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2904

def suspend(resource_group_name, name, custom_headers:nil)
  response = suspend_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      suspend_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 2942

def suspend_async(resource_group_name, name, custom_headers:nil)
  # Send request
  promise = begin_suspend_async(resource_group_name, name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#suspend_next(next_page_link, custom_headers: nil) ⇒ WebAppCollection

Suspend an App Service Environment.

Suspend an App Service Environment.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (WebAppCollection)

    operation results.



6428
6429
6430
6431
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6428

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

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

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

response.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 6442

def suspend_next_async(next_page_link, custom_headers:nil)
  # Send request
  promise = begin_suspend_next_async(next_page_link, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#update(resource_group_name, name, hosting_environment_envelope, custom_headers: nil) ⇒ AppServiceEnvironmentResource

Create or update an App Service Environment.

Create or update an App Service Environment.

resource belongs. Configuration details of the App Service Environment. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (AppServiceEnvironmentResource)

    operation results.



437
438
439
440
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 437

def update(resource_group_name, name, hosting_environment_envelope, custom_headers:nil)
  response = update_async(resource_group_name, name, hosting_environment_envelope, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, name, hosting_environment_envelope, custom_headers: nil) ⇒ Concurrent::Promise

Create or update an App Service Environment.

Create or update an App Service Environment.

resource belongs. Configuration details of the App Service Environment. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • hosting_environment_envelope (AppServiceEnvironmentPatchResource)
  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
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
550
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 476

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


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

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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServiceEnvironmentPatchResource.mapper()
  request_content = @client.serialize(request_mapper,  hosting_environment_envelope)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{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,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, 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 || status_code == 202 || status_code == 400 || status_code == 404 || status_code == 409
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServiceEnvironmentResource.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
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServiceEnvironmentResource.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

#update_multi_role_pool(resource_group_name, name, multi_role_pool_envelope, custom_headers: nil) ⇒ WorkerPoolResource

Create or update a multi-role pool.

Create or update a multi-role pool.

resource belongs. multi-role pool. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • multi_role_pool_envelope (WorkerPoolResource)

    Properties of the

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

    A hash of custom headers that

Returns:

  • (WorkerPoolResource)

    operation results.



1582
1583
1584
1585
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1582

def update_multi_role_pool(resource_group_name, name, multi_role_pool_envelope, custom_headers:nil)
  response = update_multi_role_pool_async(resource_group_name, name, multi_role_pool_envelope, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_multi_role_pool_async(resource_group_name, name, multi_role_pool_envelope, custom_headers: nil) ⇒ Concurrent::Promise

Create or update a multi-role pool.

Create or update a multi-role pool.

resource belongs. multi-role pool. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • multi_role_pool_envelope (WorkerPoolResource)

    Properties of the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1621

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


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

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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.mapper()
  request_content = @client.serialize(request_mapper,  multi_role_pool_envelope)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, 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 || status_code == 202 || status_code == 400 || status_code == 404 || status_code == 409
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.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
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.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

#update_multi_role_pool_with_http_info(resource_group_name, name, multi_role_pool_envelope, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update a multi-role pool.

Create or update a multi-role pool.

resource belongs. multi-role pool. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • multi_role_pool_envelope (WorkerPoolResource)

    Properties of the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1602
1603
1604
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 1602

def update_multi_role_pool_with_http_info(resource_group_name, name, multi_role_pool_envelope, custom_headers:nil)
  update_multi_role_pool_async(resource_group_name, name, multi_role_pool_envelope, custom_headers:custom_headers).value!
end

#update_with_http_info(resource_group_name, name, hosting_environment_envelope, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update an App Service Environment.

Create or update an App Service Environment.

resource belongs. Configuration details of the App Service Environment. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



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

def update_with_http_info(resource_group_name, name, hosting_environment_envelope, custom_headers:nil)
  update_async(resource_group_name, name, hosting_environment_envelope, custom_headers:custom_headers).value!
end

#update_worker_pool(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers: nil) ⇒ WorkerPoolResource

Create or update a worker pool.

Create or update a worker pool.

resource belongs. pool. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • worker_pool_envelope (WorkerPoolResource)

    Properties of the worker

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

    A hash of custom headers that

Returns:

  • (WorkerPoolResource)

    operation results.



3363
3364
3365
3366
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3363

def update_worker_pool(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:nil)
  response = update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers: nil) ⇒ Concurrent::Promise

Create or update a worker pool.

Create or update a worker pool.

resource belongs. pool. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • worker_pool_envelope (WorkerPoolResource)

    Properties of the worker

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3404

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


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

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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.mapper()
  request_content = @client.serialize(request_mapper,  worker_pool_envelope)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerPoolName' => worker_pool_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, 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 || status_code == 202 || status_code == 400 || status_code == 404 || status_code == 409
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.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
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WorkerPoolResource.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

#update_worker_pool_with_http_info(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update a worker pool.

Create or update a worker pool.

resource belongs. pool. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service Environment.

  • worker_pool_name (String)

    Name of the worker pool.

  • worker_pool_envelope (WorkerPoolResource)

    Properties of the worker

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3384
3385
3386
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb', line 3384

def update_worker_pool_with_http_info(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:nil)
  update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:custom_headers).value!
end