class Azure::Web::Mgmt::V2020_09_01::WebSiteManagementClient

A service client - single point of access to the REST API.

Attributes

accept_language[RW]

@return [String] The preferred language for the response.

api_version[R]

@return [String] API Version

app_service_certificate_orders[R]

@return [AppServiceCertificateOrders] app_service_certificate_orders

app_service_environments[R]

@return [AppServiceEnvironments] app_service_environments

app_service_plans[R]

@return [AppServicePlans] app_service_plans

base_url[RW]

@return [String] the base URI of the service.

certificate_registration_provider[R]

@return [CertificateRegistrationProvider] certificate_registration_provider

certificates[R]

@return [Certificates] certificates

credentials[R]

@return Credentials needed for the client to connect to Azure.

deleted_web_apps[R]

@return [DeletedWebApps] deleted_web_apps

diagnostics[R]

@return [Diagnostics] diagnostics

domain_registration_provider[R]

@return [DomainRegistrationProvider] domain_registration_provider

domains[R]

@return [Domains] domains

generate_client_request_id[RW]

@return [Boolean] Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.

long_running_operation_retry_timeout[RW]

@return [Integer] The retry timeout in seconds for Long Running Operations. Default value is 30.

provider[R]

@return [Provider] provider

recommendations[R]

@return [Recommendations] recommendations

resource_health_metadata_operations[R]

@return [ResourceHealthMetadataOperations] resource_health_metadata_operations

static_sites[R]

@return [StaticSites] static_sites

subscription_id[RW]

@return [String] Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).

top_level_domains[R]

@return [TopLevelDomains] top_level_domains

web_apps[R]

@return [WebApps] web_apps

Public Class Methods

new(credentials = nil, base_url = nil, options = nil) click to toggle source

Creates initializes a new instance of the WebSiteManagementClient class. @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. @param base_url [String] the base URI of the service. @param options [Array] filters to be applied to the HTTP requests.

Calls superclass method
# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 92
def initialize(credentials = nil, base_url = nil, options = nil)
  super(credentials, options)
  @base_url = base_url || 'https://management.azure.com'

  fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
  @credentials = credentials

  @app_service_certificate_orders = AppServiceCertificateOrders.new(self)
  @certificate_registration_provider = CertificateRegistrationProvider.new(self)
  @domains = Domains.new(self)
  @top_level_domains = TopLevelDomains.new(self)
  @domain_registration_provider = DomainRegistrationProvider.new(self)
  @certificates = Certificates.new(self)
  @deleted_web_apps = DeletedWebApps.new(self)
  @diagnostics = Diagnostics.new(self)
  @provider = Provider.new(self)
  @recommendations = Recommendations.new(self)
  @web_apps = WebApps.new(self)
  @static_sites = StaticSites.new(self)
  @app_service_environments = AppServiceEnvironments.new(self)
  @app_service_plans = AppServicePlans.new(self)
  @resource_health_metadata_operations = ResourceHealthMetadataOperations.new(self)
  @api_version = '2020-09-01'
  @accept_language = 'en-US'
  @long_running_operation_retry_timeout = 30
  @generate_client_request_id = true
  add_telemetry
end

Public Instance Methods

check_name_availability(name, type, is_fqdn:nil, custom_headers:nil) click to toggle source

Check if a resource name is available.

Description for Check if a resource name is available.

@param name [String] Resource name to verify. @param type [CheckNameResourceTypes] Resource type used for verification. Possible values include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', 'Microsoft.Web/hostingEnvironments', 'Microsoft.Web/publishingUsers' @param is_fqdn [Boolean] Is fully qualified domain name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ResourceNameAvailability] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 885
def check_name_availability(name, type, is_fqdn:nil, custom_headers:nil)
  response = check_name_availability_async(name, type, is_fqdn:is_fqdn, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
check_name_availability_async(name, type, is_fqdn:nil, custom_headers:nil) click to toggle source

Check if a resource name is available.

Description for Check if a resource name is available.

@param name [String] Resource name to verify. @param type [CheckNameResourceTypes] Resource type used for verification. Possible values include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', 'Microsoft.Web/hostingEnvironments', 'Microsoft.Web/publishingUsers' @param is_fqdn [Boolean] Is fully qualified domain name. @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/web_site_management_client.rb, line 926
def check_name_availability_async(name, type, is_fqdn:nil, custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'type is nil' if type.nil?

  request = ResourceNameAvailabilityRequest.new
  unless name.nil? && type.nil? && is_fqdn.nil?
    request.name = name
    request.type = type
    request.is_fqdn = is_fqdn
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::ResourceNameAvailabilityRequest.mapper()
  request_content = self.serialize(request_mapper,  request)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::ResourceNameAvailability.mapper()
        result.body = self.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
check_name_availability_with_http_info(name, type, is_fqdn:nil, custom_headers:nil) click to toggle source

Check if a resource name is available.

Description for Check if a resource name is available.

@param name [String] Resource name to verify. @param type [CheckNameResourceTypes] Resource type used for verification. Possible values include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', 'Microsoft.Web/hostingEnvironments', 'Microsoft.Web/publishingUsers' @param is_fqdn [Boolean] Is fully qualified domain name. @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/web_site_management_client.rb, line 906
def check_name_availability_with_http_info(name, type, is_fqdn:nil, custom_headers:nil)
  check_name_availability_async(name, type, is_fqdn:is_fqdn, custom_headers:custom_headers).value!
end
generate_github_access_token_for_appservice_cliasync(code, state, custom_headers:nil) click to toggle source

Exchange code for GitHub access token for AppService CLI

Description for Exchange code for GitHub access token for AppService CLI

@param code [String] Code string to exchange for Github Access token @param state [String] State string used for verification. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppserviceGithubToken] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 191
def generate_github_access_token_for_appservice_cliasync(code, state, custom_headers:nil)
  response = generate_github_access_token_for_appservice_cliasync_async(code, state, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
generate_github_access_token_for_appservice_cliasync_async(code, state, custom_headers:nil) click to toggle source

Exchange code for GitHub access token for AppService CLI

Description for Exchange code for GitHub access token for AppService CLI

@param code [String] Code string to exchange for Github Access token @param state [String] State string used for verification. @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/web_site_management_client.rb, line 224
def generate_github_access_token_for_appservice_cliasync_async(code, state, custom_headers:nil)
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'code is nil' if code.nil?
  fail ArgumentError, 'state is nil' if state.nil?

  request = AppserviceGithubTokenRequest.new
  unless code.nil? && state.nil?
    request.code = code
    request.state = state
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::AppserviceGithubTokenRequest.mapper()
  request_content = self.serialize(request_mapper,  request)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.Web/generateGithubAccessTokenForAppserviceCLI'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::AppserviceGithubToken.mapper()
        result.body = self.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
generate_github_access_token_for_appservice_cliasync_with_http_info(code, state, custom_headers:nil) click to toggle source

Exchange code for GitHub access token for AppService CLI

Description for Exchange code for GitHub access token for AppService CLI

@param code [String] Code string to exchange for Github Access token @param state [String] State string used for verification. @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/web_site_management_client.rb, line 208
def generate_github_access_token_for_appservice_cliasync_with_http_info(code, state, custom_headers:nil)
  generate_github_access_token_for_appservice_cliasync_async(code, state, custom_headers:custom_headers).value!
end
get_publishing_user(custom_headers:nil) click to toggle source

Gets publishing user

Description for Gets publishing user

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

@return [User] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 299
def get_publishing_user(custom_headers:nil)
  response = get_publishing_user_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_publishing_user_async(custom_headers:nil) click to toggle source

Gets publishing user

Description for Gets publishing user

@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/web_site_management_client.rb, line 328
def get_publishing_user_async(custom_headers:nil)
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?
  path_template = 'providers/Microsoft.Web/publishingUsers/web'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::User.mapper()
        result.body = self.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_publishing_user_with_http_info(custom_headers:nil) click to toggle source

Gets publishing user

Description for Gets publishing user

@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/web_site_management_client.rb, line 314
def get_publishing_user_with_http_info(custom_headers:nil)
  get_publishing_user_async(custom_headers:custom_headers).value!
end
get_source_control(source_control_type, custom_headers:nil) click to toggle source

Gets source control token

Description for Gets source control token

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

@return [SourceControl] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 581
def get_source_control(source_control_type, custom_headers:nil)
  response = get_source_control_async(source_control_type, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_source_control_async(source_control_type, custom_headers:nil) click to toggle source

Gets source control token

Description for Gets source control token

@param source_control_type [String] Type of source control @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/web_site_management_client.rb, line 612
def get_source_control_async(source_control_type, custom_headers:nil)
  fail ArgumentError, 'source_control_type is nil' if source_control_type.nil?
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?
  path_template = 'providers/Microsoft.Web/sourcecontrols/{sourceControlType}'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'sourceControlType' => source_control_type},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::SourceControl.mapper()
        result.body = self.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_source_control_with_http_info(source_control_type, custom_headers:nil) click to toggle source

Gets source control token

Description for Gets source control token

@param source_control_type [String] Type of source control @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/web_site_management_client.rb, line 597
def get_source_control_with_http_info(source_control_type, custom_headers:nil)
  get_source_control_async(source_control_type, custom_headers:custom_headers).value!
end
get_subscription_deployment_locations(custom_headers:nil) click to toggle source

Gets list of available geo regions plus ministamps

Description for Gets list of available geo regions plus ministamps

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

@return [DeploymentLocations] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1004
def get_subscription_deployment_locations(custom_headers:nil)
  response = get_subscription_deployment_locations_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_subscription_deployment_locations_async(custom_headers:nil) click to toggle source

Gets list of available geo regions plus ministamps

Description for Gets list of available geo regions plus ministamps

@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/web_site_management_client.rb, line 1033
def get_subscription_deployment_locations_async(custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::DeploymentLocations.mapper()
        result.body = self.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_subscription_deployment_locations_with_http_info(custom_headers:nil) click to toggle source

Gets list of available geo regions plus ministamps

Description for Gets list of available geo regions plus ministamps

@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/web_site_management_client.rb, line 1019
def get_subscription_deployment_locations_with_http_info(custom_headers:nil)
  get_subscription_deployment_locations_async(custom_headers:custom_headers).value!
end
list_billing_meters(billing_location:nil, os_type:nil, custom_headers:nil) click to toggle source

Gets a list of meters for a given location.

Description for Gets a list of meters for a given location.

@param billing_location [String] Azure Location of billable resource @param os_type [String] App Service OS type meters used for @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<BillingMeter>] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 783
def list_billing_meters(billing_location:nil, os_type:nil, custom_headers:nil)
  first_page = list_billing_meters_as_lazy(billing_location:billing_location, os_type:os_type, custom_headers:custom_headers)
  first_page.get_all_items
end
list_billing_meters_as_lazy(billing_location:nil, os_type:nil, custom_headers:nil) click to toggle source

Gets a list of meters for a given location.

Description for Gets a list of meters for a given location.

@param billing_location [String] Azure Location of billable resource @param os_type [String] App Service OS type meters used for @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [BillingMeterCollection] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2503
def list_billing_meters_as_lazy(billing_location:nil, os_type:nil, custom_headers:nil)
  first_page = list_billing_meters_as_lazy_async(billing_location:billing_location, os_type:os_type, custom_headers:custom_headers)
  first_page.get_all_items
end
list_billing_meters_as_lazy_async(billing_location:nil, os_type:nil, custom_headers:nil) click to toggle source

Gets a list of meters for a given location.

Description for Gets a list of meters for a given location.

@param billing_location [String] Azure Location of billable resource @param os_type [String] App Service OS type meters used for @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/web_site_management_client.rb, line 2536
def list_billing_meters_as_lazy_async(billing_location:nil, os_type:nil, custom_headers:nil)


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'billingLocation' => billing_location,'osType' => os_type},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::BillingMeterCollection.mapper()
        result.body = self.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_billing_meters_as_lazy_with_http_info(billing_location:nil, os_type:nil, custom_headers:nil) click to toggle source

Gets a list of meters for a given location.

Description for Gets a list of meters for a given location.

@param billing_location [String] Azure Location of billable resource @param os_type [String] App Service OS type meters used for @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/web_site_management_client.rb, line 2520
def list_billing_meters_as_lazy_with_http_info(billing_location:nil, os_type:nil, custom_headers:nil)
  list_billing_meters_as_lazy_async(billing_location:billing_location, os_type:os_type, custom_headers:custom_headers).value!
end
list_billing_meters_async(billing_location:nil, os_type:nil, custom_headers:nil) click to toggle source

Gets a list of meters for a given location.

Description for Gets a list of meters for a given location.

@param billing_location [String] Azure Location of billable resource @param os_type [String] App Service OS type meters used for @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/web_site_management_client.rb, line 816
def list_billing_meters_async(billing_location:nil, os_type:nil, custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id},
      query_params: {'billingLocation' => billing_location,'osType' => os_type,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::BillingMeterCollection.mapper()
        result.body = self.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_billing_meters_next(next_page_link, custom_headers:nil) click to toggle source

Gets a list of meters for a given location.

Description for Gets a list of meters for a given location.

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

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

Gets a list of meters for a given location.

Description for Gets a list of meters for a given location.

@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/web_site_management_client.rb, line 2068
def list_billing_meters_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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::BillingMeterCollection.mapper()
        result.body = self.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_billing_meters_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Gets a list of meters for a given location.

Description for Gets a list of meters for a given location.

@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/web_site_management_client.rb, line 2052
def list_billing_meters_next_with_http_info(next_page_link, custom_headers:nil)
  list_billing_meters_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_billing_meters_with_http_info(billing_location:nil, os_type:nil, custom_headers:nil) click to toggle source

Gets a list of meters for a given location.

Description for Gets a list of meters for a given location.

@param billing_location [String] Azure Location of billable resource @param os_type [String] App Service OS type meters used for @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/web_site_management_client.rb, line 800
def list_billing_meters_with_http_info(billing_location:nil, os_type:nil, custom_headers:nil)
  list_billing_meters_async(billing_location:billing_location, os_type:os_type, custom_headers:custom_headers).value!
end
list_geo_regions(sku:nil, linux_workers_enabled:nil, xenon_workers_enabled:nil, linux_dynamic_workers_enabled:nil, custom_headers:nil) click to toggle source

Get a list of available geographical regions.

Description for Get a list of available geographical regions.

@param sku [SkuName] Name of SKU used to filter the regions. Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' @param linux_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux workers. @param xenon_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Xenon workers. @param linux_dynamic_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux Consumption Workers. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<GeoRegion>] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1105
def list_geo_regions(sku:nil, linux_workers_enabled:nil, xenon_workers_enabled:nil, linux_dynamic_workers_enabled:nil, custom_headers:nil)
  first_page = list_geo_regions_as_lazy(sku:sku, linux_workers_enabled:linux_workers_enabled, xenon_workers_enabled:xenon_workers_enabled, linux_dynamic_workers_enabled:linux_dynamic_workers_enabled, custom_headers:custom_headers)
  first_page.get_all_items
end
list_geo_regions_as_lazy(sku:nil, linux_workers_enabled:nil, xenon_workers_enabled:nil, linux_dynamic_workers_enabled:nil, custom_headers:nil) click to toggle source

Get a list of available geographical regions.

Description for Get a list of available geographical regions.

@param sku [SkuName] Name of SKU used to filter the regions. Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' @param linux_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux workers. @param xenon_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Xenon workers. @param linux_dynamic_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux Consumption Workers. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [GeoRegionCollection] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2601
def list_geo_regions_as_lazy(sku:nil, linux_workers_enabled:nil, xenon_workers_enabled:nil, linux_dynamic_workers_enabled:nil, custom_headers:nil)
  first_page = list_geo_regions_as_lazy_async(sku:sku, linux_workers_enabled:linux_workers_enabled, xenon_workers_enabled:xenon_workers_enabled, linux_dynamic_workers_enabled:linux_dynamic_workers_enabled, custom_headers:custom_headers)
  first_page.get_all_items
end
list_geo_regions_as_lazy_async(sku:nil, linux_workers_enabled:nil, xenon_workers_enabled:nil, linux_dynamic_workers_enabled:nil, custom_headers:nil) click to toggle source

Get a list of available geographical regions.

Description for Get a list of available geographical regions.

@param sku [SkuName] Name of SKU used to filter the regions. Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' @param linux_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux workers. @param xenon_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Xenon workers. @param linux_dynamic_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux Consumption Workers. @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/web_site_management_client.rb, line 2648
def list_geo_regions_as_lazy_async(sku:nil, linux_workers_enabled:nil, xenon_workers_enabled:nil, linux_dynamic_workers_enabled:nil, custom_headers:nil)


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'sku' => sku,'linuxWorkersEnabled' => linux_workers_enabled,'xenonWorkersEnabled' => xenon_workers_enabled,'linuxDynamicWorkersEnabled' => linux_dynamic_workers_enabled},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::GeoRegionCollection.mapper()
        result.body = self.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_geo_regions_as_lazy_with_http_info(sku:nil, linux_workers_enabled:nil, xenon_workers_enabled:nil, linux_dynamic_workers_enabled:nil, custom_headers:nil) click to toggle source

Get a list of available geographical regions.

Description for Get a list of available geographical regions.

@param sku [SkuName] Name of SKU used to filter the regions. Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' @param linux_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux workers. @param xenon_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Xenon workers. @param linux_dynamic_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux Consumption Workers. @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/web_site_management_client.rb, line 2625
def list_geo_regions_as_lazy_with_http_info(sku:nil, linux_workers_enabled:nil, xenon_workers_enabled:nil, linux_dynamic_workers_enabled:nil, custom_headers:nil)
  list_geo_regions_as_lazy_async(sku:sku, linux_workers_enabled:linux_workers_enabled, xenon_workers_enabled:xenon_workers_enabled, linux_dynamic_workers_enabled:linux_dynamic_workers_enabled, custom_headers:custom_headers).value!
end
list_geo_regions_async(sku:nil, linux_workers_enabled:nil, xenon_workers_enabled:nil, linux_dynamic_workers_enabled:nil, custom_headers:nil) click to toggle source

Get a list of available geographical regions.

Description for Get a list of available geographical regions.

@param sku [SkuName] Name of SKU used to filter the regions. Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' @param linux_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux workers. @param xenon_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Xenon workers. @param linux_dynamic_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux Consumption Workers. @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/web_site_management_client.rb, line 1152
def list_geo_regions_async(sku:nil, linux_workers_enabled:nil, xenon_workers_enabled:nil, linux_dynamic_workers_enabled:nil, custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id},
      query_params: {'sku' => sku,'linuxWorkersEnabled' => linux_workers_enabled,'xenonWorkersEnabled' => xenon_workers_enabled,'linuxDynamicWorkersEnabled' => linux_dynamic_workers_enabled,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::GeoRegionCollection.mapper()
        result.body = self.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_geo_regions_next(next_page_link, custom_headers:nil) click to toggle source

Get a list of available geographical regions.

Description for Get a list of available geographical regions.

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

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

Get a list of available geographical regions.

Description for Get a list of available geographical regions.

@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/web_site_management_client.rb, line 2164
def list_geo_regions_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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::GeoRegionCollection.mapper()
        result.body = self.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_geo_regions_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Get a list of available geographical regions.

Description for Get a list of available geographical regions.

@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/web_site_management_client.rb, line 2148
def list_geo_regions_next_with_http_info(next_page_link, custom_headers:nil)
  list_geo_regions_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_geo_regions_with_http_info(sku:nil, linux_workers_enabled:nil, xenon_workers_enabled:nil, linux_dynamic_workers_enabled:nil, custom_headers:nil) click to toggle source

Get a list of available geographical regions.

Description for Get a list of available geographical regions.

@param sku [SkuName] Name of SKU used to filter the regions. Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' @param linux_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux workers. @param xenon_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Xenon workers. @param linux_dynamic_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux Consumption Workers. @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/web_site_management_client.rb, line 1129
def list_geo_regions_with_http_info(sku:nil, linux_workers_enabled:nil, xenon_workers_enabled:nil, linux_dynamic_workers_enabled:nil, custom_headers:nil)
  list_geo_regions_async(sku:sku, linux_workers_enabled:linux_workers_enabled, xenon_workers_enabled:xenon_workers_enabled, linux_dynamic_workers_enabled:linux_dynamic_workers_enabled, custom_headers:custom_headers).value!
end
list_premier_add_on_offers(custom_headers:nil) click to toggle source

List all premier add-on offers.

Description for List all premier add-on offers.

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

@return [Array<PremierAddOnOffer>] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1318
def list_premier_add_on_offers(custom_headers:nil)
  first_page = list_premier_add_on_offers_as_lazy(custom_headers:custom_headers)
  first_page.get_all_items
end
list_premier_add_on_offers_as_lazy(custom_headers:nil) click to toggle source

List all premier add-on offers.

Description for List all premier add-on offers.

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

@return [PremierAddOnOfferCollection] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2799
def list_premier_add_on_offers_as_lazy(custom_headers:nil)
  first_page = list_premier_add_on_offers_as_lazy_async(custom_headers:custom_headers)
  first_page.get_all_items
end
list_premier_add_on_offers_as_lazy_async(custom_headers:nil) click to toggle source

List all premier add-on offers.

Description for List all premier add-on offers.

@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/web_site_management_client.rb, line 2828
def list_premier_add_on_offers_as_lazy_async(custom_headers:nil)


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::PremierAddOnOfferCollection.mapper()
        result.body = self.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_premier_add_on_offers_as_lazy_with_http_info(custom_headers:nil) click to toggle source

List all premier add-on offers.

Description for List all premier add-on offers.

@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/web_site_management_client.rb, line 2814
def list_premier_add_on_offers_as_lazy_with_http_info(custom_headers:nil)
  list_premier_add_on_offers_as_lazy_async(custom_headers:custom_headers).value!
end
list_premier_add_on_offers_async(custom_headers:nil) click to toggle source

List all premier add-on offers.

Description for List all premier add-on offers.

@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/web_site_management_client.rb, line 1347
def list_premier_add_on_offers_async(custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::PremierAddOnOfferCollection.mapper()
        result.body = self.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_premier_add_on_offers_next(next_page_link, custom_headers:nil) click to toggle source

List all premier add-on offers.

Description for List all premier add-on offers.

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

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

List all premier add-on offers.

Description for List all premier add-on offers.

@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/web_site_management_client.rb, line 2356
def list_premier_add_on_offers_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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::PremierAddOnOfferCollection.mapper()
        result.body = self.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_premier_add_on_offers_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

List all premier add-on offers.

Description for List all premier add-on offers.

@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/web_site_management_client.rb, line 2340
def list_premier_add_on_offers_next_with_http_info(next_page_link, custom_headers:nil)
  list_premier_add_on_offers_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_premier_add_on_offers_with_http_info(custom_headers:nil) click to toggle source

List all premier add-on offers.

Description for List all premier add-on offers.

@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/web_site_management_client.rb, line 1333
def list_premier_add_on_offers_with_http_info(custom_headers:nil)
  list_premier_add_on_offers_async(custom_headers:custom_headers).value!
end
list_site_identifiers_assigned_to_host_name(name_identifier, custom_headers:nil) click to toggle source

List all apps that are assigned to a hostname.

Description for List all apps that are assigned to a hostname.

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

@return [Array<Identifier>] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1216
def list_site_identifiers_assigned_to_host_name(name_identifier, custom_headers:nil)
  first_page = list_site_identifiers_assigned_to_host_name_as_lazy(name_identifier, custom_headers:custom_headers)
  first_page.get_all_items
end
list_site_identifiers_assigned_to_host_name_as_lazy(name_identifier, custom_headers:nil) click to toggle source

List all apps that are assigned to a hostname.

Description for List all apps that are assigned to a hostname.

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

@return [IdentifierCollection] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2705
def list_site_identifiers_assigned_to_host_name_as_lazy(name_identifier, custom_headers:nil)
  first_page = list_site_identifiers_assigned_to_host_name_as_lazy_async(name_identifier, custom_headers:custom_headers)
  first_page.get_all_items
end
list_site_identifiers_assigned_to_host_name_as_lazy_async(name_identifier, custom_headers:nil) click to toggle source

List all apps that are assigned to a hostname.

Description for List all apps that are assigned to a hostname.

@param name_identifier [NameIdentifier] Hostname information. @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/web_site_management_client.rb, line 2736
def list_site_identifiers_assigned_to_host_name_as_lazy_async(name_identifier, custom_headers:nil)
  fail ArgumentError, 'name_identifier is nil' if name_identifier.nil?


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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::NameIdentifier.mapper()
  request_content = self.serialize(request_mapper,  name_identifier)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::IdentifierCollection.mapper()
        result.body = self.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_site_identifiers_assigned_to_host_name_as_lazy_with_http_info(name_identifier, custom_headers:nil) click to toggle source

List all apps that are assigned to a hostname.

Description for List all apps that are assigned to a hostname.

@param name_identifier [NameIdentifier] Hostname information. @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/web_site_management_client.rb, line 2721
def list_site_identifiers_assigned_to_host_name_as_lazy_with_http_info(name_identifier, custom_headers:nil)
  list_site_identifiers_assigned_to_host_name_as_lazy_async(name_identifier, custom_headers:custom_headers).value!
end
list_site_identifiers_assigned_to_host_name_async(name_identifier, custom_headers:nil) click to toggle source

List all apps that are assigned to a hostname.

Description for List all apps that are assigned to a hostname.

@param name_identifier [NameIdentifier] Hostname information. @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/web_site_management_client.rb, line 1247
def list_site_identifiers_assigned_to_host_name_async(name_identifier, custom_headers:nil)
  fail ArgumentError, 'name_identifier is nil' if name_identifier.nil?
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::NameIdentifier.mapper()
  request_content = self.serialize(request_mapper,  name_identifier)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::IdentifierCollection.mapper()
        result.body = self.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_site_identifiers_assigned_to_host_name_next(next_page_link, custom_headers:nil) click to toggle source

List all apps that are assigned to a hostname.

Description for List all apps that are assigned to a hostname.

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

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

List all apps that are assigned to a hostname.

Description for List all apps that are assigned to a hostname.

@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/web_site_management_client.rb, line 2260
def list_site_identifiers_assigned_to_host_name_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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::IdentifierCollection.mapper()
        result.body = self.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_site_identifiers_assigned_to_host_name_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

List all apps that are assigned to a hostname.

Description for List all apps that are assigned to a hostname.

@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/web_site_management_client.rb, line 2244
def list_site_identifiers_assigned_to_host_name_next_with_http_info(next_page_link, custom_headers:nil)
  list_site_identifiers_assigned_to_host_name_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_site_identifiers_assigned_to_host_name_with_http_info(name_identifier, custom_headers:nil) click to toggle source

List all apps that are assigned to a hostname.

Description for List all apps that are assigned to a hostname.

@param name_identifier [NameIdentifier] Hostname information. @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/web_site_management_client.rb, line 1232
def list_site_identifiers_assigned_to_host_name_with_http_info(name_identifier, custom_headers:nil)
  list_site_identifiers_assigned_to_host_name_async(name_identifier, custom_headers:custom_headers).value!
end
list_skus(custom_headers:nil) click to toggle source

List all SKUs.

Description for List all SKUs.

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

@return [SkuInfos] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1410
def list_skus(custom_headers:nil)
  response = list_skus_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_skus_async(custom_headers:nil) click to toggle source

List all SKUs.

Description for List all SKUs.

@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/web_site_management_client.rb, line 1439
def list_skus_async(custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/skus'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::SkuInfos.mapper()
        result.body = self.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_skus_with_http_info(custom_headers:nil) click to toggle source

List all SKUs.

Description for List all SKUs.

@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/web_site_management_client.rb, line 1425
def list_skus_with_http_info(custom_headers:nil)
  list_skus_async(custom_headers:custom_headers).value!
end
list_source_controls(custom_headers:nil) click to toggle source

Gets the source controls available for Azure websites.

Description for Gets the source controls available for Azure websites.

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

@return [Array<SourceControl>] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 490
def list_source_controls(custom_headers:nil)
  first_page = list_source_controls_as_lazy(custom_headers:custom_headers)
  first_page.get_all_items
end
list_source_controls_as_lazy(custom_headers:nil) click to toggle source

Gets the source controls available for Azure websites.

Description for Gets the source controls available for Azure websites.

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

@return [SourceControlCollection] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2417
def list_source_controls_as_lazy(custom_headers:nil)
  first_page = list_source_controls_as_lazy_async(custom_headers:custom_headers)
  first_page.get_all_items
end
list_source_controls_as_lazy_async(custom_headers:nil) click to toggle source

Gets the source controls available for Azure websites.

Description for Gets the source controls available for Azure websites.

@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/web_site_management_client.rb, line 2446
def list_source_controls_as_lazy_async(custom_headers:nil)


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
  path_template = 'providers/Microsoft.Web/sourcecontrols'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::SourceControlCollection.mapper()
        result.body = self.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_source_controls_as_lazy_with_http_info(custom_headers:nil) click to toggle source

Gets the source controls available for Azure websites.

Description for Gets the source controls available for Azure websites.

@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/web_site_management_client.rb, line 2432
def list_source_controls_as_lazy_with_http_info(custom_headers:nil)
  list_source_controls_as_lazy_async(custom_headers:custom_headers).value!
end
list_source_controls_async(custom_headers:nil) click to toggle source

Gets the source controls available for Azure websites.

Description for Gets the source controls available for Azure websites.

@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/web_site_management_client.rb, line 519
def list_source_controls_async(custom_headers:nil)
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?
  path_template = 'providers/Microsoft.Web/sourcecontrols'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::SourceControlCollection.mapper()
        result.body = self.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_source_controls_next(next_page_link, custom_headers:nil) click to toggle source

Gets the source controls available for Azure websites.

Description for Gets the source controls available for Azure websites.

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

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

Gets the source controls available for Azure websites.

Description for Gets the source controls available for Azure websites.

@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/web_site_management_client.rb, line 1972
def list_source_controls_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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::SourceControlCollection.mapper()
        result.body = self.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_source_controls_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Gets the source controls available for Azure websites.

Description for Gets the source controls available for Azure websites.

@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/web_site_management_client.rb, line 1956
def list_source_controls_next_with_http_info(next_page_link, custom_headers:nil)
  list_source_controls_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_source_controls_with_http_info(custom_headers:nil) click to toggle source

Gets the source controls available for Azure websites.

Description for Gets the source controls available for Azure websites.

@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/web_site_management_client.rb, line 505
def list_source_controls_with_http_info(custom_headers:nil)
  list_source_controls_async(custom_headers:custom_headers).value!
end
make_request(method, path, options = {}) click to toggle source

Makes a request and returns the body of the response. @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. @param path [String] the path, relative to {base_url}. @param options [Hash{String=>String}] specifying any request options like :body. @return [Hash{String=>String}] containing the body of the response. Example:

request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
path = "/path"
options = {
  body: request_content,
  query_params: {'api-version' => '2016-02-01'}
}
result = @client.make_request(:put, path, options)
# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 137
def make_request(method, path, options = {})
  result = make_request_with_http_info(method, path, options)
  result.body unless result.nil?
end
make_request_async(method, path, options = {}) click to toggle source

Makes a request asynchronously. @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. @param path [String] the path, relative to {base_url}. @param options [Hash{String=>String}] specifying any request options like :body. @return [Concurrent::Promise] Promise object which holds the HTTP response.

Calls superclass method
# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 162
def make_request_async(method, path, options = {})
  fail ArgumentError, 'method is nil' if method.nil?
  fail ArgumentError, 'path is nil' if path.nil?

  request_url = options[:base_url] || @base_url
  if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
    @request_headers['Content-Type'] = options[:headers]['Content-Type']
  end

  request_headers = @request_headers
  request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
  options.merge!({headers: request_headers.merge(options[:headers] || {})})
  options.merge!({credentials: @credentials}) unless @credentials.nil?

  super(request_url, method, path, options)
end
make_request_with_http_info(method, path, options = {}) click to toggle source

Makes a request and returns the operation response. @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. @param path [String] the path, relative to {base_url}. @param options [Hash{String=>String}] specifying any request options like :body. @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 149
def make_request_with_http_info(method, path, options = {})
  result = make_request_async(method, path, options).value!
  result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
  result
end
move(resource_group_name, move_resource_envelope, custom_headers:nil) click to toggle source

Move resources between resource groups.

Description for Move resources between resource groups.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param move_resource_envelope [CsmMoveResourceEnvelope] Object that represents the resource to move. @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/web_site_management_client.rb, line 1614
def move(resource_group_name, move_resource_envelope, custom_headers:nil)
  response = move_async(resource_group_name, move_resource_envelope, custom_headers:custom_headers).value!
  nil
end
move_async(resource_group_name, move_resource_envelope, custom_headers:nil) click to toggle source

Move resources between resource groups.

Description for Move resources between resource groups.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param move_resource_envelope [CsmMoveResourceEnvelope] Object that represents the resource to move. @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/web_site_management_client.rb, line 1651
def move_async(resource_group_name, move_resource_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, 'move_resource_envelope is nil' if move_resource_envelope.nil?
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::CsmMoveResourceEnvelope.mapper()
  request_content = self.serialize(request_mapper,  move_resource_envelope)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => subscription_id},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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
move_with_http_info(resource_group_name, move_resource_envelope, custom_headers:nil) click to toggle source

Move resources between resource groups.

Description for Move resources between resource groups.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param move_resource_envelope [CsmMoveResourceEnvelope] Object that represents the resource to move. @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/web_site_management_client.rb, line 1633
def move_with_http_info(resource_group_name, move_resource_envelope, custom_headers:nil)
  move_async(resource_group_name, move_resource_envelope, custom_headers:custom_headers).value!
end
update_publishing_user(user_details, custom_headers:nil) click to toggle source

Updates publishing user

Description for Updates publishing user

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

@return [User] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 390
def update_publishing_user(user_details, custom_headers:nil)
  response = update_publishing_user_async(user_details, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_publishing_user_async(user_details, custom_headers:nil) click to toggle source

Updates publishing user

Description for Updates publishing user

@param user_details [User] Details of publishing user @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/web_site_management_client.rb, line 421
def update_publishing_user_async(user_details, custom_headers:nil)
  fail ArgumentError, 'user_details is nil' if user_details.nil?
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::User.mapper()
  request_content = self.serialize(request_mapper,  user_details)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.Web/publishingUsers/web'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::User.mapper()
        result.body = self.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_publishing_user_with_http_info(user_details, custom_headers:nil) click to toggle source

Updates publishing user

Description for Updates publishing user

@param user_details [User] Details of publishing user @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/web_site_management_client.rb, line 406
def update_publishing_user_with_http_info(user_details, custom_headers:nil)
  update_publishing_user_async(user_details, custom_headers:custom_headers).value!
end
update_source_control(source_control_type, request_message, custom_headers:nil) click to toggle source

Updates source control token

Description for Updates source control token

@param source_control_type [String] Type of source control @param request_message [SourceControl] Source control token information @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [SourceControl] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 677
def update_source_control(source_control_type, request_message, custom_headers:nil)
  response = update_source_control_async(source_control_type, request_message, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_source_control_async(source_control_type, request_message, custom_headers:nil) click to toggle source

Updates source control token

Description for Updates source control token

@param source_control_type [String] Type of source control @param request_message [SourceControl] Source control token information @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/web_site_management_client.rb, line 710
def update_source_control_async(source_control_type, request_message, custom_headers:nil)
  fail ArgumentError, 'source_control_type is nil' if source_control_type.nil?
  fail ArgumentError, 'request_message is nil' if request_message.nil?
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::SourceControl.mapper()
  request_content = self.serialize(request_mapper,  request_message)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.Web/sourcecontrols/{sourceControlType}'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'sourceControlType' => source_control_type},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::SourceControl.mapper()
        result.body = self.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_source_control_with_http_info(source_control_type, request_message, custom_headers:nil) click to toggle source

Updates source control token

Description for Updates source control token

@param source_control_type [String] Type of source control @param request_message [SourceControl] Source control token information @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/web_site_management_client.rb, line 694
def update_source_control_with_http_info(source_control_type, request_message, custom_headers:nil)
  update_source_control_async(source_control_type, request_message, custom_headers:custom_headers).value!
end
validate(resource_group_name, validate_request, custom_headers:nil) click to toggle source

Validate if a resource can be created.

Description for Validate if a resource can be created.

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

@return [ValidateResponse] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1720
def validate(resource_group_name, validate_request, custom_headers:nil)
  response = validate_async(resource_group_name, validate_request, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
validate_async(resource_group_name, validate_request, custom_headers:nil) click to toggle source

Validate if a resource can be created.

Description for Validate if a resource can be created.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param validate_request [ValidateRequest] Request with the resources to validate. @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/web_site_management_client.rb, line 1757
def validate_async(resource_group_name, validate_request, 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, 'validate_request is nil' if validate_request.nil?
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::ValidateRequest.mapper()
  request_content = self.serialize(request_mapper,  validate_request)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => subscription_id},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::ValidateResponse.mapper()
        result.body = self.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
validate_move(resource_group_name, move_resource_envelope, custom_headers:nil) click to toggle source

Validate whether a resource can be moved.

Description for Validate whether a resource can be moved.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param move_resource_envelope [CsmMoveResourceEnvelope] Object that represents the resource to move. @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/web_site_management_client.rb, line 1835
def validate_move(resource_group_name, move_resource_envelope, custom_headers:nil)
  response = validate_move_async(resource_group_name, move_resource_envelope, custom_headers:custom_headers).value!
  nil
end
validate_move_async(resource_group_name, move_resource_envelope, custom_headers:nil) click to toggle source

Validate whether a resource can be moved.

Description for Validate whether a resource can be moved.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param move_resource_envelope [CsmMoveResourceEnvelope] Object that represents the resource to move. @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/web_site_management_client.rb, line 1872
def validate_move_async(resource_group_name, move_resource_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, 'move_resource_envelope is nil' if move_resource_envelope.nil?
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::CsmMoveResourceEnvelope.mapper()
  request_content = self.serialize(request_mapper,  move_resource_envelope)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => subscription_id},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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
validate_move_with_http_info(resource_group_name, move_resource_envelope, custom_headers:nil) click to toggle source

Validate whether a resource can be moved.

Description for Validate whether a resource can be moved.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param move_resource_envelope [CsmMoveResourceEnvelope] Object that represents the resource to move. @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/web_site_management_client.rb, line 1854
def validate_move_with_http_info(resource_group_name, move_resource_envelope, custom_headers:nil)
  validate_move_async(resource_group_name, move_resource_envelope, custom_headers:custom_headers).value!
end
validate_with_http_info(resource_group_name, validate_request, custom_headers:nil) click to toggle source

Validate if a resource can be created.

Description for Validate if a resource can be created.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param validate_request [ValidateRequest] Request with the resources to validate. @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/web_site_management_client.rb, line 1739
def validate_with_http_info(resource_group_name, validate_request, custom_headers:nil)
  validate_async(resource_group_name, validate_request, custom_headers:custom_headers).value!
end
verify_hosting_environment_vnet(parameters, custom_headers:nil) click to toggle source

Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.

Description for Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.

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

@return [VnetValidationFailureDetails] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1505
def verify_hosting_environment_vnet(parameters, custom_headers:nil)
  response = verify_hosting_environment_vnet_async(parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
verify_hosting_environment_vnet_async(parameters, custom_headers:nil) click to toggle source

Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.

Description for Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.

@param parameters [VnetParameters] VNET information @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/web_site_management_client.rb, line 1540
def verify_hosting_environment_vnet_async(parameters, custom_headers:nil)
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'api_version is nil' if 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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::VnetParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet'

  request_url = @base_url || self.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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::VnetValidationFailureDetails.mapper()
        result.body = self.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
verify_hosting_environment_vnet_with_http_info(parameters, custom_headers:nil) click to toggle source

Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.

Description for Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.

@param parameters [VnetParameters] VNET information @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/web_site_management_client.rb, line 1523
def verify_hosting_environment_vnet_with_http_info(parameters, custom_headers:nil)
  verify_hosting_environment_vnet_async(parameters, custom_headers:custom_headers).value!
end

Private Instance Methods

add_telemetry() click to toggle source

Adds telemetry information.

# File lib/2020-09-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2878
def add_telemetry
    sdk_information = 'azure_mgmt_web'
    sdk_information = "#{sdk_information}/0.18.1"
    add_user_agent_information(sdk_information)
end