class Azure::Web::Mgmt::V2016_03_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

base_url[RW]

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

billing_meters[R]

@return [BillingMeters] billing_meters

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

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

subscription_id[RW]

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 67
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

  @certificates = Certificates.new(self)
  @deleted_web_apps = DeletedWebApps.new(self)
  @diagnostics = Diagnostics.new(self)
  @provider = Provider.new(self)
  @recommendations = Recommendations.new(self)
  @resource_health_metadata_operations = ResourceHealthMetadataOperations.new(self)
  @billing_meters = BillingMeters.new(self)
  @api_version = '2016-03-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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 644
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 685
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::V2016_03_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 665
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
get_publishing_user(custom_headers:nil) click to toggle source

Gets publishing user

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 156
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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 185
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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 171
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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 438
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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 469
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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 454
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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 763
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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 792
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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 778
def get_subscription_deployment_locations_with_http_info(custom_headers:nil)
  get_subscription_deployment_locations_async(custom_headers:custom_headers).value!
end
list_geo_regions(sku:nil, linux_workers_enabled:nil, custom_headers:nil) click to toggle source

Get a list of available geographical regions.

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', 'PremiumV2', 'Dynamic', 'Isolated' @param linux_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux 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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 860
def list_geo_regions(sku:nil, linux_workers_enabled:nil, custom_headers:nil)
  first_page = list_geo_regions_as_lazy(sku:sku, linux_workers_enabled:linux_workers_enabled, custom_headers:custom_headers)
  first_page.get_all_items
end
list_geo_regions_as_lazy(sku:nil, linux_workers_enabled:nil, custom_headers:nil) click to toggle source

Get a list of available geographical regions.

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', 'PremiumV2', 'Dynamic', 'Isolated' @param linux_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux 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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2157
def list_geo_regions_as_lazy(sku:nil, linux_workers_enabled:nil, custom_headers:nil)
  first_page = list_geo_regions_as_lazy_async(sku:sku, linux_workers_enabled:linux_workers_enabled, custom_headers:custom_headers)
  first_page.get_all_items
end
list_geo_regions_as_lazy_async(sku:nil, linux_workers_enabled:nil, custom_headers:nil) click to toggle source

Get a list of available geographical regions.

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', 'PremiumV2', 'Dynamic', 'Isolated' @param linux_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux 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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2196
def list_geo_regions_as_lazy_async(sku:nil, linux_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},
      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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

Get a list of available geographical regions.

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', 'PremiumV2', 'Dynamic', 'Isolated' @param linux_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux 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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2177
def list_geo_regions_as_lazy_with_http_info(sku:nil, linux_workers_enabled:nil, custom_headers:nil)
  list_geo_regions_as_lazy_async(sku:sku, linux_workers_enabled:linux_workers_enabled, custom_headers:custom_headers).value!
end
list_geo_regions_async(sku:nil, linux_workers_enabled:nil, custom_headers:nil) click to toggle source

Get a list of available geographical regions.

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', 'PremiumV2', 'Dynamic', 'Isolated' @param linux_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux 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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 899
def list_geo_regions_async(sku:nil, linux_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,'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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1782
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1815
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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1799
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, custom_headers:nil) click to toggle source

Get a list of available geographical regions.

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', 'PremiumV2', 'Dynamic', 'Isolated' @param linux_workers_enabled [Boolean] Specify true if you want to filter to only regions that support Linux 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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 880
def list_geo_regions_with_http_info(sku:nil, linux_workers_enabled:nil, custom_headers:nil)
  list_geo_regions_async(sku:sku, linux_workers_enabled:linux_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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1065
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2347
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2376
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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2362
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1094
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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1974
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2007
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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1991
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1080
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 963
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2253
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2284
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::V2016_03_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2269
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 994
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::V2016_03_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1878
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1911
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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1895
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 979
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1157
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1186
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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1172
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 347
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2068
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2097
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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2083
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 376
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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1686
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1719
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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1703
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 362
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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 104
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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 129
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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 116
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1361
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1398
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::V2016_03_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end
move_with_http_info(resource_group_name, move_resource_envelope, custom_headers:nil) click to toggle source

Move resources between resource groups.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1380
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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 247
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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 278
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::V2016_03_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 263
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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 534
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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 567
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::V2016_03_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 551
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1467
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1504
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::V2016_03_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1582
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1619
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::V2016_03_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1601
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1486
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1252
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.

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1287
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::V2016_03_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 1270
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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb, line 2426
def add_telemetry
    sdk_information = 'azure_mgmt_web'
    sdk_information = "#{sdk_information}/0.18.1"
    add_user_agent_information(sdk_information)
end