class Azure::Web::Mgmt::V2020_09_01::AppServicePlans

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 AppServicePlans class. @param client service class for accessing basic functionality.

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

Private Instance Methods

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

Creates or updates an App Service Plan.

Description for Creates or updates an App Service Plan.

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

@return [AppServicePlan] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3058
def begin_create_or_update(resource_group_name, name, app_service_plan, custom_headers:nil)
  response = begin_create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
begin_create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:nil) click to toggle source

Creates or updates an App Service Plan.

Description for Creates or updates an App Service Plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param app_service_plan [AppServicePlan] Details of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3095
def begin_create_or_update_async(resource_group_name, name, app_service_plan, 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, 'app_service_plan is nil' if app_service_plan.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::V2020_09_01::Models::AppServicePlan.mapper()
  request_content = @client.serialize(request_mapper,  app_service_plan)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::AppServicePlan.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::V2020_09_01::Models::AppServicePlan.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_with_http_info(resource_group_name, name, app_service_plan, custom_headers:nil) click to toggle source

Creates or updates an App Service Plan.

Description for Creates or updates an App Service Plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param app_service_plan [AppServicePlan] Details of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3077
def begin_create_or_update_with_http_info(resource_group_name, name, app_service_plan, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
end
create_or_update(resource_group_name, name, app_service_plan, custom_headers:nil) click to toggle source

Creates or updates an App Service Plan.

Description for Creates or updates an App Service Plan.

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

@return [AppServicePlan] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 350
def create_or_update(resource_group_name, name, app_service_plan, custom_headers:nil)
  response = create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_or_update_async(resource_group_name, name, app_service_plan, 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 plan. @param app_service_plan [AppServicePlan] Details of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 366
def create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::AppServicePlan.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_vnet_route(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil) click to toggle source

Create or update a Virtual Network route in an App Service plan.

Description for Create or update a Virtual Network route in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param route_name [String] Name of the Virtual Network route. @param route [VnetRoute] Definition of the Virtual Network route. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [VnetRoute] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2600
def create_or_update_vnet_route(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
  response = create_or_update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_or_update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil) click to toggle source

Create or update a Virtual Network route in an App Service plan.

Description for Create or update a Virtual Network route in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param route_name [String] Name of the Virtual Network route. @param route [VnetRoute] Definition of the Virtual Network route. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2643
def create_or_update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, 'route_name is nil' if route_name.nil?
  fail ArgumentError, 'route is nil' if route.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::V2020_09_01::Models::VnetRoute.mapper()
  request_content = @client.serialize(request_mapper,  route)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'

  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,'vnetName' => vnet_name,'routeName' => route_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 == 400 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::VnetRoute.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
create_or_update_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil) click to toggle source

Create or update a Virtual Network route in an App Service plan.

Description for Create or update a Virtual Network route in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param route_name [String] Name of the Virtual Network route. @param route [VnetRoute] Definition of the Virtual Network route. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2622
def create_or_update_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
  create_or_update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:custom_headers).value!
end
delete(resource_group_name, name, custom_headers:nil) click to toggle source

Delete an App Service plan.

Description for Delete an App Service plan.

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

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 396
def delete(resource_group_name, name, custom_headers:nil)
  response = delete_async(resource_group_name, name, custom_headers:custom_headers).value!
  nil
end
delete_async(resource_group_name, name, custom_headers:nil) click to toggle source

Delete an App Service plan.

Description for Delete an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 431
def delete_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/serverfarms/{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(: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 == 200 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end
delete_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers:nil) click to toggle source

Delete a Hybrid Connection in use in an App Service plan.

Description for Delete a Hybrid Connection in use in an App Service plan.

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

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 859
def delete_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  response = delete_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
  nil
end
delete_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:nil) click to toggle source

Delete a Hybrid Connection in use in an App Service plan.

Description for Delete a Hybrid Connection in use in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param namespace_name [String] Name of the Service Bus namespace. @param relay_name [String] Name of the Service Bus relay. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 898
def delete_hybrid_connection_async(resource_group_name, name, namespace_name, relay_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, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'relay_name is nil' if relay_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/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'

  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,'namespaceName' => namespace_name,'relayName' => relay_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(: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 == 200 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end
delete_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil) click to toggle source

Delete a Hybrid Connection in use in an App Service plan.

Description for Delete a Hybrid Connection in use in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param namespace_name [String] Name of the Service Bus namespace. @param relay_name [String] Name of the Service Bus relay. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 879
def delete_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  delete_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
end
delete_vnet_route(resource_group_name, name, vnet_name, route_name, custom_headers:nil) click to toggle source

Delete a Virtual Network route in an App Service plan.

Description for Delete a Virtual Network route in an App Service plan.

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

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2725
def delete_vnet_route(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
  response = delete_vnet_route_async(resource_group_name, name, vnet_name, route_name, custom_headers:custom_headers).value!
  nil
end
delete_vnet_route_async(resource_group_name, name, vnet_name, route_name, custom_headers:nil) click to toggle source

Delete a Virtual Network route in an App Service plan.

Description for Delete a Virtual Network route in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param route_name [String] Name of the Virtual Network route. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2764
def delete_vnet_route_async(resource_group_name, name, vnet_name, route_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, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, 'route_name is nil' if route_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/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'

  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,'vnetName' => vnet_name,'routeName' => route_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(: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 == 200 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end
delete_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, custom_headers:nil) click to toggle source

Delete a Virtual Network route in an App Service plan.

Description for Delete a Virtual Network route in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param route_name [String] Name of the Virtual Network route. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2745
def delete_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
  delete_vnet_route_async(resource_group_name, name, vnet_name, route_name, custom_headers:custom_headers).value!
end
delete_with_http_info(resource_group_name, name, custom_headers:nil) click to toggle source

Delete an App Service plan.

Description for Delete an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 414
def delete_with_http_info(resource_group_name, name, custom_headers:nil)
  delete_async(resource_group_name, name, custom_headers:custom_headers).value!
end
get(resource_group_name, name, custom_headers:nil) click to toggle source

Get an App Service plan.

Description for Get an App Service plan.

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

@return [AppServicePlan] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 243
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 an App Service plan.

Description for Get an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 278
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/serverfarms/{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 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::AppServicePlan.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_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers:nil) click to toggle source

Retrieve a Hybrid Connection in use in an App Service plan.

Description for Retrieve a Hybrid Connection in use in an App Service plan.

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

@return [HybridConnection] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 746
def get_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  response = get_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:nil) click to toggle source

Retrieve a Hybrid Connection in use in an App Service plan.

Description for Retrieve a Hybrid Connection in use in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param namespace_name [String] Name of the Service Bus namespace. @param relay_name [String] Name of the Service Bus relay. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 785
def get_hybrid_connection_async(resource_group_name, name, namespace_name, relay_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, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'relay_name is nil' if relay_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/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'

  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,'namespaceName' => namespace_name,'relayName' => relay_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

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

Get the maximum number of Hybrid Connections allowed in an App Service plan.

Description for Get the maximum number of Hybrid Connections allowed in an App Service plan.

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

@return [HybridConnectionLimits] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1193
def get_hybrid_connection_plan_limit(resource_group_name, name, custom_headers:nil)
  response = get_hybrid_connection_plan_limit_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_hybrid_connection_plan_limit_async(resource_group_name, name, custom_headers:nil) click to toggle source

Get the maximum number of Hybrid Connections allowed in an App Service plan.

Description for Get the maximum number of Hybrid Connections allowed in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1230
def get_hybrid_connection_plan_limit_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/serverfarms/{name}/hybridConnectionPlanLimits/limit'

  request_url = @base_url || @client.base_url

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

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

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

Get the maximum number of Hybrid Connections allowed in an App Service plan.

Description for Get the maximum number of Hybrid Connections allowed in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1212
def get_hybrid_connection_plan_limit_with_http_info(resource_group_name, name, custom_headers:nil)
  get_hybrid_connection_plan_limit_async(resource_group_name, name, custom_headers:custom_headers).value!
end
get_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil) click to toggle source

Retrieve a Hybrid Connection in use in an App Service plan.

Description for Retrieve a Hybrid Connection in use in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param namespace_name [String] Name of the Service Bus namespace. @param relay_name [String] Name of the Service Bus relay. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 766
def get_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  get_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
end
get_route_for_vnet(resource_group_name, name, vnet_name, route_name, custom_headers:nil) click to toggle source

Get a Virtual Network route in an App Service plan.

Description for Get a Virtual Network route in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param route_name [String] Name of the Virtual Network route. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2468
def get_route_for_vnet(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
  response = get_route_for_vnet_async(resource_group_name, name, vnet_name, route_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_route_for_vnet_async(resource_group_name, name, vnet_name, route_name, custom_headers:nil) click to toggle source

Get a Virtual Network route in an App Service plan.

Description for Get a Virtual Network route in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param route_name [String] Name of the Virtual Network route. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2507
def get_route_for_vnet_async(resource_group_name, name, vnet_name, route_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, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, 'route_name is nil' if route_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/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'

  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,'vnetName' => vnet_name,'routeName' => route_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 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

Get a Virtual Network route in an App Service plan.

Description for Get a Virtual Network route in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param route_name [String] Name of the Virtual Network route. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2488
def get_route_for_vnet_with_http_info(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
  get_route_for_vnet_async(resource_group_name, name, vnet_name, route_name, custom_headers:custom_headers).value!
end
get_server_farm_skus(resource_group_name, name, custom_headers:nil) click to toggle source

Gets all selectable SKUs for a given App Service Plan

Description for Gets all selectable SKUs for a given App Service Plan

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

@return [Object] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1645
def get_server_farm_skus(resource_group_name, name, custom_headers:nil)
  response = get_server_farm_skus_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_server_farm_skus_async(resource_group_name, name, custom_headers:nil) click to toggle source

Gets all selectable SKUs for a given App Service Plan

Description for Gets all selectable SKUs for a given App Service Plan

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of App Service Plan @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1680
def get_server_farm_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/serverfarms/{name}/skus'

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end
get_server_farm_skus_with_http_info(resource_group_name, name, custom_headers:nil) click to toggle source

Gets all selectable SKUs for a given App Service Plan

Description for Gets all selectable SKUs for a given App Service Plan

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of App Service Plan @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1663
def get_server_farm_skus_with_http_info(resource_group_name, name, custom_headers:nil)
  get_server_farm_skus_async(resource_group_name, name, custom_headers:custom_headers).value!
end
get_vnet_from_server_farm(resource_group_name, name, vnet_name, custom_headers:nil) click to toggle source

Get a Virtual Network associated with an App Service plan.

Description for Get a Virtual Network associated with an App Service plan.

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

@return [VnetInfo] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1980
def get_vnet_from_server_farm(resource_group_name, name, vnet_name, custom_headers:nil)
  response = get_vnet_from_server_farm_async(resource_group_name, name, vnet_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_vnet_from_server_farm_async(resource_group_name, name, vnet_name, custom_headers:nil) click to toggle source

Get a Virtual Network associated with an App Service plan.

Description for Get a Virtual Network associated with an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2017
def get_vnet_from_server_farm_async(resource_group_name, name, vnet_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, 'vnet_name is nil' if vnet_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/serverfarms/{name}/virtualNetworkConnections/{vnetName}'

  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,'vnetName' => vnet_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 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::VnetInfo.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_vnet_from_server_farm_with_http_info(resource_group_name, name, vnet_name, custom_headers:nil) click to toggle source

Get a Virtual Network associated with an App Service plan.

Description for Get a Virtual Network associated with an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1999
def get_vnet_from_server_farm_with_http_info(resource_group_name, name, vnet_name, custom_headers:nil)
  get_vnet_from_server_farm_async(resource_group_name, name, vnet_name, custom_headers:custom_headers).value!
end
get_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, custom_headers:nil) click to toggle source

Get a Virtual Network gateway.

Description for Get a Virtual Network gateway.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param gateway_name [String] Name of the gateway. Only the 'primary' gateway is supported. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [VnetGateway] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2092
def get_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, custom_headers:nil)
  response = get_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, custom_headers:nil) click to toggle source

Get a Virtual Network gateway.

Description for Get a Virtual Network gateway.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param gateway_name [String] Name of the gateway. Only the 'primary' gateway is supported. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2133
def get_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_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, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_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/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'

  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,'vnetName' => vnet_name,'gatewayName' => gateway_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::VnetGateway.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_vnet_gateway_with_http_info(resource_group_name, name, vnet_name, gateway_name, custom_headers:nil) click to toggle source

Get a Virtual Network gateway.

Description for Get a Virtual Network gateway.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param gateway_name [String] Name of the gateway. Only the 'primary' gateway is supported. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2113
def get_vnet_gateway_with_http_info(resource_group_name, name, vnet_name, gateway_name, custom_headers:nil)
  get_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, custom_headers:custom_headers).value!
end
get_with_http_info(resource_group_name, name, custom_headers:nil) click to toggle source

Get an App Service plan.

Description for Get an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 261
def get_with_http_info(resource_group_name, name, custom_headers:nil)
  get_async(resource_group_name, name, custom_headers:custom_headers).value!
end
list(detailed:nil, custom_headers:nil) click to toggle source

Get all App Service plans for a subscription.

Description for Get all App Service plans for a subscription.

@param detailed [Boolean] Specify true to return all App Service plan properties. The default is false, which returns a subset of the properties. Retrieval of all properties may increase the API latency. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 38
def list(detailed:nil, custom_headers:nil)
  first_page = list_as_lazy(detailed:detailed, custom_headers:custom_headers)
  first_page.get_all_items
end
list_as_lazy(detailed:nil, custom_headers:nil) click to toggle source

Get all App Service plans for a subscription.

Description for Get all App Service plans for a subscription.

@param detailed [Boolean] Specify true to return all App Service plan properties. The default is false, which returns a subset of the properties. Retrieval of all properties may increase the API latency. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3768
def list_as_lazy(detailed:nil, custom_headers:nil)
  response = list_async(detailed:detailed, 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(detailed:nil, custom_headers:nil) click to toggle source

Get all App Service plans for a subscription.

Description for Get all App Service plans for a subscription.

@param detailed [Boolean] Specify true to return all App Service plan properties. The default is false, which returns a subset of the properties. Retrieval of all properties may increase the API latency. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 75
def list_async(detailed:nil, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  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/serverfarms'

  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: {'detailed' => detailed,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_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_by_resource_group(resource_group_name, custom_headers:nil) click to toggle source

Get all App Service plans in a resource group.

Description for Get all App Service plans 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<AppServicePlan>] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 140
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 plans in a resource group.

Description for Get all App Service plans 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 [AppServicePlanCollection] which provide lazy access to pages of the response.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3792
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 plans in a resource group.

Description for Get all App Service plans 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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 173
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/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,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_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_by_resource_group_next(next_page_link, custom_headers:nil) click to toggle source

Get all App Service plans in a resource group.

Description for Get all App Service plans 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 [AppServicePlanCollection] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3279
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 plans in a resource group.

Description for Get all App Service plans 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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3312
def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_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_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Get all App Service plans in a resource group.

Description for Get all App Service plans 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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3296
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 plans in a resource group.

Description for Get all App Service plans 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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 157
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_capabilities(resource_group_name, name, custom_headers:nil) click to toggle source

List all capabilities of an App Service plan.

Description for List all capabilities of an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 622
def list_capabilities(resource_group_name, name, custom_headers:nil)
  response = list_capabilities_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_capabilities_async(resource_group_name, name, custom_headers:nil) click to toggle source

List all capabilities of an App Service plan.

Description for List all capabilities of an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 657
def list_capabilities_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/serverfarms/{name}/capabilities'

  request_url = @base_url || @client.base_url

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

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

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

List all capabilities of an App Service plan.

Description for List all capabilities of an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 640
def list_capabilities_with_http_info(resource_group_name, name, custom_headers:nil)
  list_capabilities_async(resource_group_name, name, custom_headers:custom_headers).value!
end
list_hybrid_connection_keys(resource_group_name, name, namespace_name, relay_name, custom_headers:nil) click to toggle source

Get the send key name and value of a Hybrid Connection.

Description for Get the send key name and value of a Hybrid Connection.

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

@return [HybridConnectionKey] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 963
def list_hybrid_connection_keys(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  response = list_hybrid_connection_keys_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_hybrid_connection_keys_async(resource_group_name, name, namespace_name, relay_name, custom_headers:nil) click to toggle source

Get the send key name and value of a Hybrid Connection.

Description for Get the send key name and value of a Hybrid Connection.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param namespace_name [String] The name of the Service Bus namespace. @param relay_name [String] The name of the Service Bus relay. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1002
def list_hybrid_connection_keys_async(resource_group_name, name, namespace_name, relay_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, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'relay_name is nil' if relay_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/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'

  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,'namespaceName' => namespace_name,'relayName' => relay_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::HybridConnectionKey.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_hybrid_connection_keys_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil) click to toggle source

Get the send key name and value of a Hybrid Connection.

Description for Get the send key name and value of a Hybrid Connection.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param namespace_name [String] The name of the Service Bus namespace. @param relay_name [String] The name of the Service Bus relay. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 983
def list_hybrid_connection_keys_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  list_hybrid_connection_keys_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
end
list_hybrid_connections(resource_group_name, name, custom_headers:nil) click to toggle source

Retrieve all Hybrid Connections in use in an App Service plan.

Description for Retrieve all Hybrid Connections in use in an App Service plan.

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

@return [Array<HybridConnection>] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1302
def list_hybrid_connections(resource_group_name, name, custom_headers:nil)
  first_page = list_hybrid_connections_as_lazy(resource_group_name, name, custom_headers:custom_headers)
  first_page.get_all_items
end
list_hybrid_connections_as_lazy(resource_group_name, name, custom_headers:nil) click to toggle source

Retrieve all Hybrid Connections in use in an App Service plan.

Description for Retrieve all Hybrid Connections in use in an App Service plan.

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

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

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3846
def list_hybrid_connections_as_lazy(resource_group_name, name, custom_headers:nil)
  response = list_hybrid_connections_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_hybrid_connections_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_hybrid_connections_async(resource_group_name, name, custom_headers:nil) click to toggle source

Retrieve all Hybrid Connections in use in an App Service plan.

Description for Retrieve all Hybrid Connections in use in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1339
def list_hybrid_connections_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/serverfarms/{name}/hybridConnectionRelays'

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::HybridConnectionCollection.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_hybrid_connections_next(next_page_link, custom_headers:nil) click to toggle source

Retrieve all Hybrid Connections in use in an App Service plan.

Description for Retrieve all Hybrid Connections in use in an App Service plan.

@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 [HybridConnectionCollection] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3475
def list_hybrid_connections_next(next_page_link, custom_headers:nil)
  response = list_hybrid_connections_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_hybrid_connections_next_async(next_page_link, custom_headers:nil) click to toggle source

Retrieve all Hybrid Connections in use in an App Service plan.

Description for Retrieve all Hybrid Connections in use in an App Service plan.

@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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3510
def list_hybrid_connections_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::HybridConnectionCollection.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_hybrid_connections_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Retrieve all Hybrid Connections in use in an App Service plan.

Description for Retrieve all Hybrid Connections in use in an App Service plan.

@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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3493
def list_hybrid_connections_next_with_http_info(next_page_link, custom_headers:nil)
  list_hybrid_connections_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_hybrid_connections_with_http_info(resource_group_name, name, custom_headers:nil) click to toggle source

Retrieve all Hybrid Connections in use in an App Service plan.

Description for Retrieve all Hybrid Connections in use in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1321
def list_hybrid_connections_with_http_info(resource_group_name, name, custom_headers:nil)
  list_hybrid_connections_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 plans for a subscription.

Description for Get all App Service plans 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 [AppServicePlanCollection] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3183
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 plans for a subscription.

Description for Get all App Service plans 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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3216
def list_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_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_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Get all App Service plans for a subscription.

Description for Get all App Service plans 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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3200
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_routes_for_vnet(resource_group_name, name, vnet_name, custom_headers:nil) click to toggle source

Get all routes that are associated with a Virtual Network in an App Service plan.

Description for Get all routes that are associated with a Virtual Network in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2337
def list_routes_for_vnet(resource_group_name, name, vnet_name, custom_headers:nil)
  response = list_routes_for_vnet_async(resource_group_name, name, vnet_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_routes_for_vnet_async(resource_group_name, name, vnet_name, custom_headers:nil) click to toggle source

Get all routes that are associated with a Virtual Network in an App Service plan.

Description for Get all routes that are associated with a Virtual Network in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2378
def list_routes_for_vnet_async(resource_group_name, name, vnet_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, 'vnet_name is nil' if vnet_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/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes'

  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,'vnetName' => vnet_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

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

Get all routes that are associated with a Virtual Network in an App Service plan.

Description for Get all routes that are associated with a Virtual Network in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2358
def list_routes_for_vnet_with_http_info(resource_group_name, name, vnet_name, custom_headers:nil)
  list_routes_for_vnet_async(resource_group_name, name, vnet_name, custom_headers:custom_headers).value!
end
list_usages(resource_group_name, name, filter:nil, custom_headers:nil) click to toggle source

Gets server farm usage information

Description for Gets server farm usage information

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of App Service Plan @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'). @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1744
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

Gets server farm usage information

Description for Gets server farm usage information

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of App Service Plan @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'). @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3906
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

Gets server farm usage information

Description for Gets server farm usage information

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of App Service Plan @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'). @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1785
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/serverfarms/{name}/usages'

  request_url = @base_url || @client.base_url

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

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

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

Gets server farm usage information

Description for Gets server farm usage information

@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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3669
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

Gets server farm usage information

Description for Gets server farm usage information

@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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3702
def list_usages_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

Gets server farm usage information

Description for Gets server farm usage information

@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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3686
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

Gets server farm usage information

Description for Gets server farm usage information

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of App Service Plan @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'). @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1765
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_vnets(resource_group_name, name, custom_headers:nil) click to toggle source

Get all Virtual Networks associated with an App Service plan.

Description for Get all Virtual Networks associated with an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1857
def list_vnets(resource_group_name, name, custom_headers:nil)
  response = list_vnets_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_vnets_async(resource_group_name, name, custom_headers:nil) click to toggle source

Get all Virtual Networks associated with an App Service plan.

Description for Get all Virtual Networks associated with an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1892
def list_vnets_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/serverfarms/{name}/virtualNetworkConnections'

  request_url = @base_url || @client.base_url

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

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

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

Get all Virtual Networks associated with an App Service plan.

Description for Get all Virtual Networks associated with an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1875
def list_vnets_with_http_info(resource_group_name, name, custom_headers:nil)
  list_vnets_async(resource_group_name, name, custom_headers:custom_headers).value!
end
list_web_apps(resource_group_name, name, skip_token:nil, filter:nil, top:nil, custom_headers:nil) click to toggle source

Get all apps associated with an App Service plan.

Description for Get all apps associated with an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param skip_token [String] Skip to a web app in the list of webapps associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list @param filter [String] Supported filter: $filter=state eq running. Returns only web apps that are currently running @param top [String] List page size. If specified, results are paged. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1524
def list_web_apps(resource_group_name, name, skip_token:nil, filter:nil, top:nil, custom_headers:nil)
  first_page = list_web_apps_as_lazy(resource_group_name, name, skip_token:skip_token, filter:filter, top:top, custom_headers:custom_headers)
  first_page.get_all_items
end
list_web_apps_as_lazy(resource_group_name, name, skip_token:nil, filter:nil, top:nil, custom_headers:nil) click to toggle source

Get all apps associated with an App Service plan.

Description for Get all apps associated with an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param skip_token [String] Skip to a web app in the list of webapps associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list @param filter [String] Supported filter: $filter=state eq running. Returns only web apps that are currently running @param top [String] List page size. If specified, results are paged. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3878
def list_web_apps_as_lazy(resource_group_name, name, skip_token:nil, filter:nil, top:nil, custom_headers:nil)
  response = list_web_apps_async(resource_group_name, name, skip_token:skip_token, filter:filter, top:top, 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, skip_token:nil, filter:nil, top:nil, custom_headers:nil) click to toggle source

Get all apps associated with an App Service plan.

Description for Get all apps associated with an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param skip_token [String] Skip to a web app in the list of webapps associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list @param filter [String] Supported filter: $filter=state eq running. Returns only web apps that are currently running @param top [String] List page size. If specified, results are paged. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1573
def list_web_apps_async(resource_group_name, name, skip_token:nil, filter:nil, top: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/serverfarms/{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: {'$skipToken' => skip_token,'$top' => top,'api-version' => @client.api_version},
      skip_encoding_query_params: {'$filter' => filter},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_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_by_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers:nil) click to toggle source

Get all apps that use a Hybrid Connection in an App Service Plan.

Description for Get all apps that use a Hybrid Connection in an App Service Plan.

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

@return [Array<String>] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1078
def list_web_apps_by_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  first_page = list_web_apps_by_hybrid_connection_as_lazy(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers)
  first_page.get_all_items
end
list_web_apps_by_hybrid_connection_as_lazy(resource_group_name, name, namespace_name, relay_name, custom_headers:nil) click to toggle source

Get all apps that use a Hybrid Connection in an App Service Plan.

Description for Get all apps that use a Hybrid Connection in an App Service Plan.

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

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

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3820
def list_web_apps_by_hybrid_connection_as_lazy(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  response = list_web_apps_by_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_web_apps_by_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:nil) click to toggle source

Get all apps that use a Hybrid Connection in an App Service Plan.

Description for Get all apps that use a Hybrid Connection in an App Service Plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param namespace_name [String] Name of the Hybrid Connection namespace. @param relay_name [String] Name of the Hybrid Connection relay. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1119
def list_web_apps_by_hybrid_connection_async(resource_group_name, name, namespace_name, relay_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, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'relay_name is nil' if relay_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/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/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,'namespaceName' => namespace_name,'relayName' => relay_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::ResourceCollection.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_by_hybrid_connection_next(next_page_link, custom_headers:nil) click to toggle source

Get all apps that use a Hybrid Connection in an App Service Plan.

Description for Get all apps that use a Hybrid Connection in an App Service Plan.

@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 [ResourceCollection] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3376
def list_web_apps_by_hybrid_connection_next(next_page_link, custom_headers:nil)
  response = list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers:nil) click to toggle source

Get all apps that use a Hybrid Connection in an App Service Plan.

Description for Get all apps that use a Hybrid Connection in an App Service Plan.

@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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3411
def list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::ResourceCollection.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_by_hybrid_connection_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Get all apps that use a Hybrid Connection in an App Service Plan.

Description for Get all apps that use a Hybrid Connection in an App Service Plan.

@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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3394
def list_web_apps_by_hybrid_connection_next_with_http_info(next_page_link, custom_headers:nil)
  list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_web_apps_by_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil) click to toggle source

Get all apps that use a Hybrid Connection in an App Service Plan.

Description for Get all apps that use a Hybrid Connection in an App Service Plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param namespace_name [String] Name of the Hybrid Connection namespace. @param relay_name [String] Name of the Hybrid Connection relay. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1099
def list_web_apps_by_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  list_web_apps_by_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
end
list_web_apps_next(next_page_link, custom_headers:nil) click to toggle source

Get all apps associated with an App Service plan.

Description for Get all apps associated with an App Service plan.

@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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3573
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 associated with an App Service plan.

Description for Get all apps associated with an App Service plan.

@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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3606
def list_web_apps_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

Description for Get all apps associated with an App Service plan.

@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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 3590
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, skip_token:nil, filter:nil, top:nil, custom_headers:nil) click to toggle source

Get all apps associated with an App Service plan.

Description for Get all apps associated with an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param skip_token [String] Skip to a web app in the list of webapps associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list @param filter [String] Supported filter: $filter=state eq running. Returns only web apps that are currently running @param top [String] List page size. If specified, results are paged. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1549
def list_web_apps_with_http_info(resource_group_name, name, skip_token:nil, filter:nil, top:nil, custom_headers:nil)
  list_web_apps_async(resource_group_name, name, skip_token:skip_token, filter:filter, top:top, custom_headers:custom_headers).value!
end
list_with_http_info(detailed:nil, custom_headers:nil) click to toggle source

Get all App Service plans for a subscription.

Description for Get all App Service plans for a subscription.

@param detailed [Boolean] Specify true to return all App Service plan properties. The default is false, which returns a subset of the properties. Retrieval of all properties may increase the API latency. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 57
def list_with_http_info(detailed:nil, custom_headers:nil)
  list_async(detailed:detailed, custom_headers:custom_headers).value!
end
reboot_worker(resource_group_name, name, worker_name, custom_headers:nil) click to toggle source

Reboot a worker machine in an App Service plan.

Description for Reboot a worker machine in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param worker_name [String] Name of worker machine, which typically starts with RD. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2956
def reboot_worker(resource_group_name, name, worker_name, custom_headers:nil)
  response = reboot_worker_async(resource_group_name, name, worker_name, custom_headers:custom_headers).value!
  nil
end
reboot_worker_async(resource_group_name, name, worker_name, custom_headers:nil) click to toggle source

Reboot a worker machine in an App Service plan.

Description for Reboot a worker machine in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param worker_name [String] Name of worker machine, which typically starts with RD. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2995
def reboot_worker_async(resource_group_name, name, worker_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_name is nil' if worker_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/serverfarms/{name}/workers/{workerName}/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,'workerName' => worker_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

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

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

    result
  end

  promise.execute
end
reboot_worker_with_http_info(resource_group_name, name, worker_name, custom_headers:nil) click to toggle source

Reboot a worker machine in an App Service plan.

Description for Reboot a worker machine in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param worker_name [String] Name of worker machine, which typically starts with RD. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2976
def reboot_worker_with_http_info(resource_group_name, name, worker_name, custom_headers:nil)
  reboot_worker_async(resource_group_name, name, worker_name, custom_headers:custom_headers).value!
end
restart_web_apps(resource_group_name, name, soft_restart:nil, custom_headers:nil) click to toggle source

Restart all apps in an App Service plan.

Description for Restart all apps in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param soft_restart [Boolean] Specify true to perform a soft restart, applies the configuration settings and restarts the apps if necessary. The default is false, which always restarts and reprovisions the apps @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1413
def restart_web_apps(resource_group_name, name, soft_restart:nil, custom_headers:nil)
  response = restart_web_apps_async(resource_group_name, name, soft_restart:soft_restart, custom_headers:custom_headers).value!
  nil
end
restart_web_apps_async(resource_group_name, name, soft_restart:nil, custom_headers:nil) click to toggle source

Restart all apps in an App Service plan.

Description for Restart all apps in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param soft_restart [Boolean] Specify true to perform a soft restart, applies the configuration settings and restarts the apps if necessary. The default is false, which always restarts and reprovisions the apps @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1456
def restart_web_apps_async(resource_group_name, name, soft_restart: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/serverfarms/{name}/restartSites'

  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: {'softRestart' => soft_restart,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

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

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

    result
  end

  promise.execute
end
restart_web_apps_with_http_info(resource_group_name, name, soft_restart:nil, custom_headers:nil) click to toggle source

Restart all apps in an App Service plan.

Description for Restart all apps in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param soft_restart [Boolean] Specify true to perform a soft restart, applies the configuration settings and restarts the apps if necessary. The default is false, which always restarts and reprovisions the apps @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 1435
def restart_web_apps_with_http_info(resource_group_name, name, soft_restart:nil, custom_headers:nil)
  restart_web_apps_async(resource_group_name, name, soft_restart:soft_restart, custom_headers:custom_headers).value!
end
update(resource_group_name, name, app_service_plan, custom_headers:nil) click to toggle source

Creates or updates an App Service Plan.

Description for Creates or updates an App Service Plan.

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

@return [AppServicePlan] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 494
def update(resource_group_name, name, app_service_plan, custom_headers:nil)
  response = update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_async(resource_group_name, name, app_service_plan, custom_headers:nil) click to toggle source

Creates or updates an App Service Plan.

Description for Creates or updates an App Service Plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param app_service_plan [AppServicePlanPatchResource] Details of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 533
def update_async(resource_group_name, name, app_service_plan, 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, 'app_service_plan is nil' if app_service_plan.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::V2020_09_01::Models::AppServicePlanPatchResource.mapper()
  request_content = @client.serialize(request_mapper,  app_service_plan)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::AppServicePlan.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::V2020_09_01::Models::AppServicePlan.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_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:nil) click to toggle source

Update a Virtual Network gateway.

Description for Update a Virtual Network gateway.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param gateway_name [String] Name of the gateway. Only the 'primary' gateway is supported. @param connection_envelope [VnetGateway] Definition of the gateway. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [VnetGateway] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2210
def update_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:nil)
  response = update_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:nil) click to toggle source

Update a Virtual Network gateway.

Description for Update a Virtual Network gateway.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param gateway_name [String] Name of the gateway. Only the 'primary' gateway is supported. @param connection_envelope [VnetGateway] Definition of the gateway. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2253
def update_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, connection_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, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
  fail ArgumentError, 'connection_envelope is nil' if connection_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::V2020_09_01::Models::VnetGateway.mapper()
  request_content = @client.serialize(request_mapper,  connection_envelope)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'

  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,'vnetName' => vnet_name,'gatewayName' => gateway_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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::VnetGateway.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_vnet_gateway_with_http_info(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:nil) click to toggle source

Update a Virtual Network gateway.

Description for Update a Virtual Network gateway.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param gateway_name [String] Name of the gateway. Only the 'primary' gateway is supported. @param connection_envelope [VnetGateway] Definition of the gateway. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2232
def update_vnet_gateway_with_http_info(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:nil)
  update_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:custom_headers).value!
end
update_vnet_route(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil) click to toggle source

Create or update a Virtual Network route in an App Service plan.

Description for Create or update a Virtual Network route in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param route_name [String] Name of the Virtual Network route. @param route [VnetRoute] Definition of the Virtual Network route. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [VnetRoute] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2831
def update_vnet_route(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
  response = update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil) click to toggle source

Create or update a Virtual Network route in an App Service plan.

Description for Create or update a Virtual Network route in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param route_name [String] Name of the Virtual Network route. @param route [VnetRoute] Definition of the Virtual Network route. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2874
def update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, 'route_name is nil' if route_name.nil?
  fail ArgumentError, 'route is nil' if route.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::V2020_09_01::Models::VnetRoute.mapper()
  request_content = @client.serialize(request_mapper,  route)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'

  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,'vnetName' => vnet_name,'routeName' => route_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 == 400 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::VnetRoute.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_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil) click to toggle source

Create or update a Virtual Network route in an App Service plan.

Description for Create or update a Virtual Network route in an App Service plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param vnet_name [String] Name of the Virtual Network. @param route_name [String] Name of the Virtual Network route. @param route [VnetRoute] Definition of the Virtual Network route. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 2853
def update_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
  update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:custom_headers).value!
end
update_with_http_info(resource_group_name, name, app_service_plan, custom_headers:nil) click to toggle source

Creates or updates an App Service Plan.

Description for Creates or updates an App Service Plan.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service plan. @param app_service_plan [AppServicePlanPatchResource] Details of the App Service plan. @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/2020-09-01/generated/azure_mgmt_web/app_service_plans.rb, line 514
def update_with_http_info(resource_group_name, name, app_service_plan, custom_headers:nil)
  update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
end