class Azure::Web::Mgmt::V2016_09_01::AppServiceEnvironments

WebSite Management Client

Attributes

client[R]

@return [WebSiteManagementClient] reference to the WebSiteManagementClient

Private Class Methods

new(client) click to toggle source

Creates and initializes a new instance of the AppServiceEnvironments class. @param client service class for accessing basic functionality.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 17
def initialize(client)
  @client = client
end

Private Instance Methods

begin_create_or_update(resource_group_name, name, hosting_environment_envelope, custom_headers:nil) click to toggle source

Create or update an App Service Environment.

Create or update an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param hosting_environment_envelope [AppServiceEnvironmentResource] Configuration details of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServiceEnvironmentResource] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4148
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) click to toggle source

Create or update an App Service Environment.

Create or update an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param hosting_environment_envelope [AppServiceEnvironmentResource] Configuration details of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4187
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::V2016_09_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::V2016_09_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::V2016_09_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) click to toggle source

Create or update a multi-role pool.

Create or update a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param multi_role_pool_envelope [WorkerPoolResource] Properties of the multi-role pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WorkerPoolResource] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4382
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) click to toggle source

Create or update a multi-role pool.

Create or update a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param multi_role_pool_envelope [WorkerPoolResource] Properties of the multi-role pool. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4421
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::V2016_09_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::V2016_09_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::V2016_09_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) click to toggle source

Create or update a multi-role pool.

Create or update a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param multi_role_pool_envelope [WorkerPoolResource] Properties of the multi-role pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4402
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) click to toggle source

Create or update an App Service Environment.

Create or update an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param hosting_environment_envelope [AppServiceEnvironmentResource] Configuration details of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4168
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) click to toggle source

Create or update a worker pool.

Create or update a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param worker_pool_envelope [WorkerPoolResource] Properties of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WorkerPoolResource] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4745
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) click to toggle source

Create or update a worker pool.

Create or update a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param worker_pool_envelope [WorkerPoolResource] Properties of the worker pool. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4786
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::V2016_09_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::V2016_09_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::V2016_09_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) click to toggle source

Create or update a worker pool.

Create or update a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param worker_pool_envelope [WorkerPoolResource] Properties of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4766
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) click to toggle source

Delete an App Service Environment.

Delete an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param force_delete [Boolean] Specify true to force the deletion even if the App Service Environment contains resources. The default is false. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4278
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) click to toggle source

Delete an App Service Environment.

Delete an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param force_delete [Boolean] Specify true to force the deletion even if the App Service Environment contains resources. The default is false. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4319
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) click to toggle source

Delete an App Service Environment.

Delete an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param force_delete [Boolean] Specify true to force the deletion even if the App Service Environment contains resources. The default is false. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4299
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) click to toggle source

Resume an App Service Environment.

Resume an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<Site>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4510
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) click to toggle source

Resume an App Service Environment.

Resume an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WebAppCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7805
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) click to toggle source

Resume an App Service Environment.

Resume an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4545
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 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::V2016_09_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::V2016_09_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) click to toggle source

Resume an App Service Environment.

Resume an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WebAppCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7015
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) click to toggle source

Resume an App Service Environment.

Resume an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7048
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 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::V2016_09_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::V2016_09_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) click to toggle source

Resume an App Service Environment.

Resume an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7032
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) click to toggle source

Resume an App Service Environment.

Resume an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4528
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) click to toggle source

Suspend an App Service Environment.

Suspend an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<Site>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4626
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) click to toggle source

Suspend an App Service Environment.

Suspend an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WebAppCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7830
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) click to toggle source

Suspend an App Service Environment.

Suspend an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4661
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 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::V2016_09_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::V2016_09_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) click to toggle source

Suspend an App Service Environment.

Suspend an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WebAppCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7121
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) click to toggle source

Suspend an App Service Environment.

Suspend an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7154
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 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::V2016_09_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::V2016_09_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) click to toggle source

Suspend an App Service Environment.

Suspend an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7138
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) click to toggle source

Suspend an App Service Environment.

Suspend an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4644
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
create_or_update(resource_group_name, name, hosting_environment_envelope, custom_headers:nil) click to toggle source

Create or update an App Service Environment.

Create or update an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param hosting_environment_envelope [AppServiceEnvironmentResource] Configuration details of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServiceEnvironmentResource] operation results.

# File lib/2016-09-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) click to toggle source

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param hosting_environment_envelope [AppServiceEnvironmentResource] Configuration details of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2016-09-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::V2016_09_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) click to toggle source

Create or update a multi-role pool.

Create or update a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param multi_role_pool_envelope [WorkerPoolResource] Properties of the multi-role pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WorkerPoolResource] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1460
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) click to toggle source

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param multi_role_pool_envelope [WorkerPoolResource] Properties of the multi-role pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1477
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::V2016_09_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) click to toggle source

Create or update a worker pool.

Create or update a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param worker_pool_envelope [WorkerPoolResource] Properties of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WorkerPoolResource] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3239
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) click to toggle source

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param worker_pool_envelope [WorkerPoolResource] Properties of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3257
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::V2016_09_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) click to toggle source

Delete an App Service Environment.

Delete an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param force_delete [Boolean] Specify true to force the deletion even if the App Service Environment contains resources. The default is false. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2016-09-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) click to toggle source

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param force_delete [Boolean] Specify true to force the deletion even if the App Service Environment contains resources. The default is false. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2016-09-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) click to toggle source

Get the properties of an App Service Environment.

Get the properties of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServiceEnvironmentResource] operation results.

# File lib/2016-09-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) click to toggle source

Get the properties of an App Service Environment.

Get the properties of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-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 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::V2016_09_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) click to toggle source

Get a diagnostics item for an App Service Environment.

Get a diagnostics item for an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param diagnostics_name [String] Name of the diagnostics item. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [HostingEnvironmentDiagnostics] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 906
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) click to toggle source

Get a diagnostics item for an App Service Environment.

Get a diagnostics item for an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param diagnostics_name [String] Name of the diagnostics item. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 943
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 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::V2016_09_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) click to toggle source

Get a diagnostics item for an App Service Environment.

Get a diagnostics item for an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param diagnostics_name [String] Name of the diagnostics item. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 925
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) click to toggle source

Get properties of a multi-role pool.

Get properties of a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WorkerPoolResource] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1352
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) click to toggle source

Get properties of a multi-role pool.

Get properties of a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1387
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 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::V2016_09_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) click to toggle source

Get properties of a multi-role pool.

Get properties of a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1370
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) click to toggle source

Get the properties of an App Service Environment.

Get the properties of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-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) click to toggle source

Get properties of a worker pool.

Get properties of a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WorkerPoolResource] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3127
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) click to toggle source

Get properties of a worker pool.

Get properties of a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3164
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 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::V2016_09_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) click to toggle source

Get properties of a worker pool.

Get properties of a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3146
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) click to toggle source

Get all App Service Environments for a subscription.

Get all App Service Environments for a subscription.

@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<AppServiceEnvironmentResource>] operation results.

# File lib/2016-09-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) click to toggle source

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<AppServicePlan>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2614
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) click to toggle source

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServicePlanCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7524
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) click to toggle source

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2649
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 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::V2016_09_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) click to toggle source

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServicePlanCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5993
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) click to toggle source

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6026
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 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::V2016_09_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) click to toggle source

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6010
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) click to toggle source

Get all App Service plans in an App Service Environment.

Get all App Service plans in an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2632
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) click to toggle source

Get all App Service Environments for a subscription.

Get all App Service Environments for a subscription.

@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServiceEnvironmentCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7226
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) click to toggle source

Get all App Service Environments for a subscription.

Get all App Service Environments for a subscription.

@param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-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 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::V2016_09_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) click to toggle source

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<AppServiceEnvironmentResource>] operation results.

# File lib/2016-09-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) click to toggle source

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServiceEnvironmentCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7250
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) click to toggle source

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-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 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::V2016_09_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) click to toggle source

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServiceEnvironmentCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4971
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) click to toggle source

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5004
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 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::V2016_09_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) click to toggle source

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4988
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) click to toggle source

Get all App Service Environments in a resource group.

Get all App Service Environments in a resource group.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-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) click to toggle source

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

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

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<StampCapacity>] operation results.

# File lib/2016-09-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) click to toggle source

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

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

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [StampCapacityCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7277
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) click to toggle source

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

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

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-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 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::V2016_09_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) click to toggle source

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

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

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [StampCapacityCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5069
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) click to toggle source

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

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

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5106
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 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::V2016_09_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) click to toggle source

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

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

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5088
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) click to toggle source

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

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

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-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) click to toggle source

Get diagnostic information for an App Service Environment.

Get diagnostic information for an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 783
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) click to toggle source

Get diagnostic information for an App Service Environment.

Get diagnostic information for an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 818
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 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 = {
          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) click to toggle source

Get diagnostic information for an App Service Environment.

Get diagnostic information for an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 801
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) click to toggle source

Get global metric definitions of an App Service Environment.

Get global metric definitions of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MetricDefinition] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1015
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) click to toggle source

Get global metric definitions of an App Service Environment.

Get global metric definitions of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1050
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 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::V2016_09_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) click to toggle source

Get global metric definitions of an App Service Environment.

Get global metric definitions of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1033
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) click to toggle source

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ResourceMetric>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1127
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) click to toggle source

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7308
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) click to toggle source

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1174
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 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::V2016_09_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) click to toggle source

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5169
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) click to toggle source

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5202
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 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::V2016_09_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) click to toggle source

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5186
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) click to toggle source

Get global metrics of an App Service Environment.

Get global metrics of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1151
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ResourceMetricDefinition>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1876
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricDefinitionCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7416
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1911
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 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::V2016_09_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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricDefinitionCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5565
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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5598
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 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::V2016_09_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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5582
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1894
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) click to toggle source

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

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

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param start_time [String] Beginning time of the metrics query. @param end_time [String] End time of the metrics query. @param time_grain [String] Time granularity of the metrics query. @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ResourceMetric>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1991
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) click to toggle source

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

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

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param start_time [String] Beginning time of the metrics query. @param end_time [String] End time of the metrics query. @param time_grain [String] Time granularity of the metrics query. @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7450
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) click to toggle source

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

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

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param start_time [String] Beginning time of the metrics query. @param end_time [String] End time of the metrics query. @param time_grain [String] Time granularity of the metrics query. @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2044
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 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::V2016_09_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) click to toggle source

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

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

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5661
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) click to toggle source

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

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

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5694
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 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::V2016_09_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) click to toggle source

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

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

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5678
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) click to toggle source

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

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

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param start_time [String] Beginning time of the metrics query. @param end_time [String] End time of the metrics query. @param time_grain [String] Time granularity of the metrics query. @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2018
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param instance [String] Name of the instance in the multi-role pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ResourceMetricDefinition>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1641
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param instance [String] Name of the instance in the multi-role pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricDefinitionCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7361
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param instance [String] Name of the instance in the multi-role pool. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1682
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 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::V2016_09_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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricDefinitionCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5363
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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5400
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 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::V2016_09_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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5382
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param instance [String] Name of the instance in the multi-role pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1662
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param instance [String] Name of the instance in the multi-role pool. @param details [Boolean] Specify true to include instance details. The default is false. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ResourceMetric>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1759
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param instance [String] Name of the instance in the multi-role pool. @param details [Boolean] Specify true to include instance details. The default is false. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7391
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param instance [String] Name of the instance in the multi-role pool. @param details [Boolean] Specify true to include instance details. The default is false. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1804
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 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::V2016_09_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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5465
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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5502
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 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::V2016_09_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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5484
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param instance [String] Name of the instance in the multi-role pool. @param details [Boolean] Specify true to include instance details. The default is false. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1782
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) click to toggle source

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<SkuInfo>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2116
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) click to toggle source

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [SkuInfoCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7475
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) click to toggle source

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2151
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 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::V2016_09_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) click to toggle source

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [SkuInfoCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5757
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) click to toggle source

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5790
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 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::V2016_09_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) click to toggle source

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5774
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) click to toggle source

Get available SKUs for scaling a multi-role pool.

Get available SKUs for scaling a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2134
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) click to toggle source

Get all multi-role pools.

Get all multi-role pools.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<WorkerPoolResource>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1246
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) click to toggle source

Get all multi-role pools.

Get all multi-role pools.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WorkerPoolCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7333
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) click to toggle source

Get all multi-role pools.

Get all multi-role pools.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1281
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 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::V2016_09_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) click to toggle source

Get all multi-role pools.

Get all multi-role pools.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WorkerPoolCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5265
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) click to toggle source

Get all multi-role pools.

Get all multi-role pools.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5298
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 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::V2016_09_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) click to toggle source

Get all multi-role pools.

Get all multi-role pools.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5282
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) click to toggle source

Get all multi-role pools.

Get all multi-role pools.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1264
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<Usage>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2222
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [UsageCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7499
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2257
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 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::V2016_09_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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [UsageCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5853
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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5886
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 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::V2016_09_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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5870
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2240
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) click to toggle source

Get all App Service Environments for a subscription.

Get all App Service Environments for a subscription.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServiceEnvironmentCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4875
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) click to toggle source

Get all App Service Environments for a subscription.

Get all App Service Environments for a subscription.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4908
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 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::V2016_09_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) click to toggle source

Get all App Service Environments for a subscription.

Get all App Service Environments for a subscription.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4892
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) click to toggle source

List all currently running operations on the App Service Environment.

List all currently running operations on the App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2328
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) click to toggle source

List all currently running operations on the App Service Environment.

List all currently running operations on the App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2363
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 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 = {
          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) click to toggle source

List all currently running operations on the App Service Environment.

List all currently running operations on the App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2346
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) click to toggle source

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<CsmUsageQuota>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2905
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) click to toggle source

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [CsmUsageQuotaCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7580
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) click to toggle source

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2948
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 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::V2016_09_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) click to toggle source

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [CsmUsageQuotaCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6229
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) click to toggle source

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6262
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 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::V2016_09_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) click to toggle source

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6246
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) click to toggle source

Get global usage metrics of an App Service Environment.

Get global usage metrics of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2927
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) click to toggle source

Get IP addresses assigned to an App Service Environment.

Get IP addresses assigned to an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AddressResponse] operation results.

# File lib/2016-09-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) click to toggle source

Get IP addresses assigned to an App Service Environment.

Get IP addresses assigned to an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-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 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::V2016_09_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) click to toggle source

Get IP addresses assigned to an App Service Environment.

Get IP addresses assigned to an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-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) click to toggle source

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param properties_to_include [String] Comma separated list of app properties to include. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<Site>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2722
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) click to toggle source

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param properties_to_include [String] Comma separated list of app properties to include. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WebAppCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7551
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) click to toggle source

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param properties_to_include [String] Comma separated list of app properties to include. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2761
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 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::V2016_09_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) click to toggle source

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WebAppCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6089
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) click to toggle source

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6122
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 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::V2016_09_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) click to toggle source

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6106
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) click to toggle source

Get all apps in an App Service Environment.

Get all apps in an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param properties_to_include [String] Comma separated list of app properties to include. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2742
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) click to toggle source

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ResourceMetricDefinition>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3682
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) click to toggle source

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricDefinitionCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7695
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) click to toggle source

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3719
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 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::V2016_09_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) click to toggle source

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricDefinitionCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6625
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) click to toggle source

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6658
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 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::V2016_09_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) click to toggle source

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6642
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) click to toggle source

Get metric definitions for a worker pool of an App Service Environment.

Get metric definitions for a worker pool of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3701
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) click to toggle source

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of worker pool @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ResourceMetric>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3800
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) click to toggle source

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of worker pool @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7729
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) click to toggle source

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of worker pool @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3853
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 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::V2016_09_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) click to toggle source

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6723
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) click to toggle source

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6760
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 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::V2016_09_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) click to toggle source

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6742
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) click to toggle source

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

Get metrics for a worker pool of a AppServiceEnvironment (App Service Environment).

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of worker pool @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3827
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) click to toggle source

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<Usage>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4037
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) click to toggle source

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [UsageCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7780
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) click to toggle source

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4074
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 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::V2016_09_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) click to toggle source

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [UsageCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6919
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) click to toggle source

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6952
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 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::V2016_09_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) click to toggle source

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6936
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) click to toggle source

Get usage metrics for a worker pool of an App Service Environment.

Get usage metrics for a worker pool of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 4056
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) click to toggle source

Get all App Service Environments for a subscription.

Get all App Service Environments for a subscription.

@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param instance [String] Name of the instance in the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ResourceMetricDefinition>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3426
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param instance [String] Name of the instance in the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricDefinitionCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7634
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param instance [String] Name of the instance in the worker pool. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3469
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 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::V2016_09_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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricDefinitionCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6423
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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6460
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 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::V2016_09_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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6442
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param instance [String] Name of the instance in the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3448
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param instance [String] Name of the instance in the worker pool. @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ResourceMetric>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3552
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param instance [String] Name of the instance in the worker pool. @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7669
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param instance [String] Name of the instance in the worker pool. @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3607
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 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::V2016_09_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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceMetricCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6525
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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6562
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 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::V2016_09_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) click to toggle source

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.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6544
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) click to toggle source

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.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param instance [String] Name of the instance in the worker pool. @param details [Boolean] Specify true to include instance details. The default is false. @param filter [String] Return only usages/metrics specified in the filter. 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’'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3580
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) click to toggle source

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<SkuInfo>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3927
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) click to toggle source

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [SkuInfoCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7755
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) click to toggle source

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3964
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 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::V2016_09_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) click to toggle source

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [SkuInfoCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6823
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) click to toggle source

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6856
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 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::V2016_09_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) click to toggle source

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6840
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) click to toggle source

Get available SKUs for scaling a worker pool.

Get available SKUs for scaling a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3946
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) click to toggle source

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<WorkerPoolResource>] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3020
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) click to toggle source

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WorkerPoolCollection] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 7605
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) click to toggle source

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3055
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 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::V2016_09_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) click to toggle source

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WorkerPoolCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6325
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) click to toggle source

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6358
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 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::V2016_09_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) click to toggle source

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6342
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) click to toggle source

Get all worker pools of an App Service Environment.

Get all worker pools of an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3038
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) click to toggle source

Reboot all machines in an App Service Environment.

Reboot all machines in an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2449
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) click to toggle source

Reboot all machines in an App Service Environment.

Reboot all machines in an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2484
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) click to toggle source

Reboot all machines in an App Service Environment.

Reboot all machines in an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2467
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) click to toggle source

Resume an App Service Environment.

Resume an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<Site>] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2545
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) click to toggle source

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2583
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::V2016_09_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) click to toggle source

Resume an App Service Environment.

Resume an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WebAppCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5949
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) click to toggle source

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 5963
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::V2016_09_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) click to toggle source

Suspend an App Service Environment.

Suspend an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<Site>] which provide lazy access to pages of the response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2832
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) click to toggle source

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 2870
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::V2016_09_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) click to toggle source

Suspend an App Service Environment.

Suspend an App Service Environment.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WebAppCollection] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6185
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) click to toggle source

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 6199
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::V2016_09_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) click to toggle source

Create or update an App Service Environment.

Create or update an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param hosting_environment_envelope [AppServiceEnvironmentPatchResource] Configuration details of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServiceEnvironmentResource] operation results.

# File lib/2016-09-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) click to toggle source

Create or update an App Service Environment.

Create or update an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param hosting_environment_envelope [AppServiceEnvironmentPatchResource] Configuration details of the App Service Environment. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-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::V2016_09_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::V2016_09_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::V2016_09_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) click to toggle source

Create or update a multi-role pool.

Create or update a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param multi_role_pool_envelope [WorkerPoolResource] Properties of the multi-role pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WorkerPoolResource] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1510
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) click to toggle source

Create or update a multi-role pool.

Create or update a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param multi_role_pool_envelope [WorkerPoolResource] Properties of the multi-role pool. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1549
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::V2016_09_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::V2016_09_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::V2016_09_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) click to toggle source

Create or update a multi-role pool.

Create or update a multi-role pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param multi_role_pool_envelope [WorkerPoolResource] Properties of the multi-role pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 1530
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) click to toggle source

Create or update an App Service Environment.

Create or update an App Service Environment.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param hosting_environment_envelope [AppServiceEnvironmentPatchResource] Configuration details of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-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) click to toggle source

Create or update a worker pool.

Create or update a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param worker_pool_envelope [WorkerPoolResource] Properties of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WorkerPoolResource] operation results.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3291
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) click to toggle source

Create or update a worker pool.

Create or update a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param worker_pool_envelope [WorkerPoolResource] Properties of the worker pool. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3332
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::V2016_09_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::V2016_09_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::V2016_09_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) click to toggle source

Create or update a worker pool.

Create or update a worker pool.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param worker_pool_envelope [WorkerPoolResource] Properties of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb, line 3312
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