class Azure::AnalysisServices::Mgmt::V2017_08_01::Servers

The Azure Analysis Services Web API provides a RESTful set of web services that enables users to create, retrieve, update, and delete Analysis Services servers

Attributes

client[R]

@return [AnalysisServicesManagementClient] reference to the AnalysisServicesManagementClient

Private Class Methods

new(client) click to toggle source

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

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 19
def initialize(client)
  @client = client
end

Private Instance Methods

begin_create(resource_group_name, server_name, server_parameters, custom_headers:nil) click to toggle source

Provisions the specified Analysis Services server based on the configuration specified in the request.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. @param server_parameters [AnalysisServicesServer] Contains the information used to provision the Analysis Services server. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AnalysisServicesServer] operation results.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1252
def begin_create(resource_group_name, server_name, server_parameters, custom_headers:nil)
  response = begin_create_async(resource_group_name, server_name, server_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
begin_create_async(resource_group_name, server_name, server_parameters, custom_headers:nil) click to toggle source

Provisions the specified Analysis Services server based on the configuration specified in the request.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. @param server_parameters [AnalysisServicesServer] Contains the information used to provision the Analysis Services server. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1293
def begin_create_async(resource_group_name, server_name, server_parameters, 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, 'server_name is nil' if server_name.nil?
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
  fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
  fail ArgumentError, 'server_parameters is nil' if server_parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  # Serialize Request
  request_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01::Models::AnalysisServicesServer.mapper()
  request_content = @client.serialize(request_mapper,  server_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 201
      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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01::Models::AnalysisServicesServer.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01::Models::AnalysisServicesServer.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
begin_create_with_http_info(resource_group_name, server_name, server_parameters, custom_headers:nil) click to toggle source

Provisions the specified Analysis Services server based on the configuration specified in the request.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. @param server_parameters [AnalysisServicesServer] Contains the information used to provision the Analysis Services server. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1273
def begin_create_with_http_info(resource_group_name, server_name, server_parameters, custom_headers:nil)
  begin_create_async(resource_group_name, server_name, server_parameters, custom_headers:custom_headers).value!
end
begin_delete(resource_group_name, server_name, custom_headers:nil) click to toggle source

Deletes the specified Analysis Services server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1382
def begin_delete(resource_group_name, server_name, custom_headers:nil)
  response = begin_delete_async(resource_group_name, server_name, custom_headers:custom_headers).value!
  nil
end
begin_delete_async(resource_group_name, server_name, custom_headers:nil) click to toggle source

Deletes the specified Analysis Services server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1417
def begin_delete_async(resource_group_name, server_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
  fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end
begin_delete_with_http_info(resource_group_name, server_name, custom_headers:nil) click to toggle source

Deletes the specified Analysis Services server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1400
def begin_delete_with_http_info(resource_group_name, server_name, custom_headers:nil)
  begin_delete_async(resource_group_name, server_name, custom_headers:custom_headers).value!
end
begin_resume(resource_group_name, server_name, custom_headers:nil) click to toggle source

Resumes operation of the specified Analysis Services server instance.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1705
def begin_resume(resource_group_name, server_name, custom_headers:nil)
  response = begin_resume_async(resource_group_name, server_name, custom_headers:custom_headers).value!
  nil
end
begin_resume_async(resource_group_name, server_name, custom_headers:nil) click to toggle source

Resumes operation of the specified Analysis Services server instance.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1740
def begin_resume_async(resource_group_name, server_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
  fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end
begin_resume_with_http_info(resource_group_name, server_name, custom_headers:nil) click to toggle source

Resumes operation of the specified Analysis Services server instance.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1723
def begin_resume_with_http_info(resource_group_name, server_name, custom_headers:nil)
  begin_resume_async(resource_group_name, server_name, custom_headers:custom_headers).value!
end
begin_suspend(resource_group_name, server_name, custom_headers:nil) click to toggle source

Supends operation of the specified Analysis Services server instance.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1609
def begin_suspend(resource_group_name, server_name, custom_headers:nil)
  response = begin_suspend_async(resource_group_name, server_name, custom_headers:custom_headers).value!
  nil
end
begin_suspend_async(resource_group_name, server_name, custom_headers:nil) click to toggle source

Supends operation of the specified Analysis Services server instance.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1644
def begin_suspend_async(resource_group_name, server_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
  fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end
begin_suspend_with_http_info(resource_group_name, server_name, custom_headers:nil) click to toggle source

Supends operation of the specified Analysis Services server instance.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1627
def begin_suspend_with_http_info(resource_group_name, server_name, custom_headers:nil)
  begin_suspend_async(resource_group_name, server_name, custom_headers:custom_headers).value!
end
begin_update(resource_group_name, server_name, server_update_parameters, custom_headers:nil) click to toggle source

Updates the current state of the specified Analysis Services server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param server_update_parameters [AnalysisServicesServerUpdateParameters] Request object that contains the updated information for the server. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AnalysisServicesServer] operation results.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1481
def begin_update(resource_group_name, server_name, server_update_parameters, custom_headers:nil)
  response = begin_update_async(resource_group_name, server_name, server_update_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
begin_update_async(resource_group_name, server_name, server_update_parameters, custom_headers:nil) click to toggle source

Updates the current state of the specified Analysis Services server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param server_update_parameters [AnalysisServicesServerUpdateParameters] Request object that contains the updated information for the server. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1520
def begin_update_async(resource_group_name, server_name, server_update_parameters, 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, 'server_name is nil' if server_name.nil?
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
  fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
  fail ArgumentError, 'server_update_parameters is nil' if server_update_parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  # Serialize Request
  request_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01::Models::AnalysisServicesServerUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  server_update_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01::Models::AnalysisServicesServer.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01::Models::AnalysisServicesServer.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
begin_update_with_http_info(resource_group_name, server_name, server_update_parameters, custom_headers:nil) click to toggle source

Updates the current state of the specified Analysis Services server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param server_update_parameters [AnalysisServicesServerUpdateParameters] Request object that contains the updated information for the server. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1501
def begin_update_with_http_info(resource_group_name, server_name, server_update_parameters, custom_headers:nil)
  begin_update_async(resource_group_name, server_name, server_update_parameters, custom_headers:custom_headers).value!
end
check_name_availability(location, server_parameters, custom_headers:nil) click to toggle source

Check the name availability in the target location.

@param location [String] The region name which the operation will lookup into. @param server_parameters [CheckServerNameAvailabilityParameters] Contains the information used to provision the Analysis Services server. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [CheckServerNameAvailabilityResult] operation results.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 954
def check_name_availability(location, server_parameters, custom_headers:nil)
  response = check_name_availability_async(location, server_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
check_name_availability_async(location, server_parameters, custom_headers:nil) click to toggle source

Check the name availability in the target location.

@param location [String] The region name which the operation will lookup into. @param server_parameters [CheckServerNameAvailabilityParameters] Contains the information used to provision the Analysis Services server. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 987
def check_name_availability_async(location, server_parameters, custom_headers:nil)
  fail ArgumentError, 'location is nil' if location.nil?
  fail ArgumentError, 'server_parameters is nil' if server_parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  # Serialize Request
  request_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01::Models::CheckServerNameAvailabilityParameters.mapper()
  request_content = @client.serialize(request_mapper,  server_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.AnalysisServices/locations/{location}/checkNameAvailability'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01::Models::CheckServerNameAvailabilityResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
check_name_availability_with_http_info(location, server_parameters, custom_headers:nil) click to toggle source

Check the name availability in the target location.

@param location [String] The region name which the operation will lookup into. @param server_parameters [CheckServerNameAvailabilityParameters] Contains the information used to provision the Analysis Services server. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 971
def check_name_availability_with_http_info(location, server_parameters, custom_headers:nil)
  check_name_availability_async(location, server_parameters, custom_headers:custom_headers).value!
end
create(resource_group_name, server_name, server_parameters, custom_headers:nil) click to toggle source

Provisions the specified Analysis Services server based on the configuration specified in the request.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. @param server_parameters [AnalysisServicesServer] Contains the information used to provision the Analysis Services server. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AnalysisServicesServer] operation results.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 149
def create(resource_group_name, server_name, server_parameters, custom_headers:nil)
  response = create_async(resource_group_name, server_name, server_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_async(resource_group_name, server_name, server_parameters, custom_headers:nil) click to toggle source

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. @param server_parameters [AnalysisServicesServer] Contains the information used to provision the Analysis Services server. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 168
def create_async(resource_group_name, server_name, server_parameters, custom_headers:nil)
  # Send request
  promise = begin_create_async(resource_group_name, server_name, server_parameters, custom_headers:custom_headers)

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

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

  promise
end
delete(resource_group_name, server_name, custom_headers:nil) click to toggle source

Deletes the specified Analysis Services server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 197
def delete(resource_group_name, server_name, custom_headers:nil)
  response = delete_async(resource_group_name, server_name, custom_headers:custom_headers).value!
  nil
end
delete_async(resource_group_name, server_name, custom_headers:nil) click to toggle source

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 214
def delete_async(resource_group_name, server_name, custom_headers:nil)
  # Send request
  promise = begin_delete_async(resource_group_name, server_name, custom_headers:custom_headers)

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

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

  promise
end
dissociate_gateway(resource_group_name, server_name, custom_headers:nil) click to toggle source

Dissociates a Unified Gateway associated with the server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 858
def dissociate_gateway(resource_group_name, server_name, custom_headers:nil)
  response = dissociate_gateway_async(resource_group_name, server_name, custom_headers:custom_headers).value!
  nil
end
dissociate_gateway_async(resource_group_name, server_name, custom_headers:nil) click to toggle source

Dissociates a Unified Gateway associated with the server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 893
def dissociate_gateway_async(resource_group_name, server_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
  fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail 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
  end

  promise.execute
end
dissociate_gateway_with_http_info(resource_group_name, server_name, custom_headers:nil) click to toggle source

Dissociates a Unified Gateway associated with the server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 876
def dissociate_gateway_with_http_info(resource_group_name, server_name, custom_headers:nil)
  dissociate_gateway_async(resource_group_name, server_name, custom_headers:custom_headers).value!
end
get_details(resource_group_name, server_name, custom_headers:nil) click to toggle source

Gets details about the specified Analysis Services server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AnalysisServicesServer] operation results.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 39
def get_details(resource_group_name, server_name, custom_headers:nil)
  response = get_details_async(resource_group_name, server_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_details_async(resource_group_name, server_name, custom_headers:nil) click to toggle source

Gets details about the specified Analysis Services server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 74
def get_details_async(resource_group_name, server_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
  fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end
get_details_with_http_info(resource_group_name, server_name, custom_headers:nil) click to toggle source

Gets details about the specified Analysis Services server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 57
def get_details_with_http_info(resource_group_name, server_name, custom_headers:nil)
  get_details_async(resource_group_name, server_name, custom_headers:custom_headers).value!
end
list(custom_headers:nil) click to toggle source

Lists all the Analysis Services servers for the given subscription.

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

@return [AnalysisServicesServers] operation results.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 475
def list(custom_headers:nil)
  response = list_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_async(custom_headers:nil) click to toggle source

Lists all the Analysis Services servers for the given subscription.

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

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

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 500
def list_async(custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

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

Gets all the Analysis Services servers for the given resource group.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AnalysisServicesServers] operation results.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 381
def list_by_resource_group(resource_group_name, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_by_resource_group_async(resource_group_name, custom_headers:nil) click to toggle source

Gets all the Analysis Services servers for the given resource group.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 412
def list_by_resource_group_async(resource_group_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

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

Gets all the Analysis Services servers for the given resource group.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 397
def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
end
list_gateway_status(resource_group_name, server_name, custom_headers:nil) click to toggle source

Return the gateway status of the specified Analysis Services server instance.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [GatewayListStatusLive] operation results.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 754
def list_gateway_status(resource_group_name, server_name, custom_headers:nil)
  response = list_gateway_status_async(resource_group_name, server_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_gateway_status_async(resource_group_name, server_name, custom_headers:nil) click to toggle source

Return the gateway status of the specified Analysis Services server instance.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 787
def list_gateway_status_async(resource_group_name, server_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
  fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end
list_gateway_status_with_http_info(resource_group_name, server_name, custom_headers:nil) click to toggle source

Return the gateway status of the specified Analysis Services server instance.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 771
def list_gateway_status_with_http_info(resource_group_name, server_name, custom_headers:nil)
  list_gateway_status_async(resource_group_name, server_name, custom_headers:custom_headers).value!
end
list_operation_results(location, operation_id, custom_headers:nil) click to toggle source

List the result of the specified operation.

@param location [String] The region name which the operation will lookup into. @param operation_id [String] The target operation Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1057
def list_operation_results(location, operation_id, custom_headers:nil)
  response = list_operation_results_async(location, operation_id, custom_headers:custom_headers).value!
  nil
end
list_operation_results_async(location, operation_id, custom_headers:nil) click to toggle source

List the result of the specified operation.

@param location [String] The region name which the operation will lookup into. @param operation_id [String] The target operation Id. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1088
def list_operation_results_async(location, operation_id, custom_headers:nil)
  fail ArgumentError, 'location is nil' if location.nil?
  fail ArgumentError, 'operation_id is nil' if operation_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end
list_operation_results_with_http_info(location, operation_id, custom_headers:nil) click to toggle source

List the result of the specified operation.

@param location [String] The region name which the operation will lookup into. @param operation_id [String] The target operation Id. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1073
def list_operation_results_with_http_info(location, operation_id, custom_headers:nil)
  list_operation_results_async(location, operation_id, custom_headers:custom_headers).value!
end
list_operation_statuses(location, operation_id, custom_headers:nil) click to toggle source

List the status of operation.

@param location [String] The region name which the operation will lookup into. @param operation_id [String] The target operation Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1142
def list_operation_statuses(location, operation_id, custom_headers:nil)
  response = list_operation_statuses_async(location, operation_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_operation_statuses_async(location, operation_id, custom_headers:nil) click to toggle source

List the status of operation.

@param location [String] The region name which the operation will lookup into. @param operation_id [String] The target operation Id. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1173
def list_operation_statuses_async(location, operation_id, custom_headers:nil)
  fail ArgumentError, 'location is nil' if location.nil?
  fail ArgumentError, 'operation_id is nil' if operation_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end
list_operation_statuses_with_http_info(location, operation_id, custom_headers:nil) click to toggle source

List the status of operation.

@param location [String] The region name which the operation will lookup into. @param operation_id [String] The target operation Id. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 1158
def list_operation_statuses_with_http_info(location, operation_id, custom_headers:nil)
  list_operation_statuses_async(location, operation_id, custom_headers:custom_headers).value!
end
list_skus_for_existing(resource_group_name, server_name, custom_headers:nil) click to toggle source

Lists eligible SKUs for an Analysis Services resource.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [SkuEnumerationForExistingResourceResult] operation results.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 648
def list_skus_for_existing(resource_group_name, server_name, custom_headers:nil)
  response = list_skus_for_existing_async(resource_group_name, server_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_skus_for_existing_async(resource_group_name, server_name, custom_headers:nil) click to toggle source

Lists eligible SKUs for an Analysis Services resource.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 683
def list_skus_for_existing_async(resource_group_name, server_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
  fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
  fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end
list_skus_for_existing_with_http_info(resource_group_name, server_name, custom_headers:nil) click to toggle source

Lists eligible SKUs for an Analysis Services resource.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 666
def list_skus_for_existing_with_http_info(resource_group_name, server_name, custom_headers:nil)
  list_skus_for_existing_async(resource_group_name, server_name, custom_headers:custom_headers).value!
end
list_skus_for_new(custom_headers:nil) click to toggle source

Lists eligible SKUs for Analysis Services resource provider.

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

@return [SkuEnumerationForNewResourceResult] operation results.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 559
def list_skus_for_new(custom_headers:nil)
  response = list_skus_for_new_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_skus_for_new_async(custom_headers:nil) click to toggle source

Lists eligible SKUs for Analysis Services resource provider.

@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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 584
def list_skus_for_new_async(custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end
list_skus_for_new_with_http_info(custom_headers:nil) click to toggle source

Lists eligible SKUs for Analysis Services resource provider.

@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/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 572
def list_skus_for_new_with_http_info(custom_headers:nil)
  list_skus_for_new_async(custom_headers:custom_headers).value!
end
list_with_http_info(custom_headers:nil) click to toggle source

Lists all the Analysis Services servers for the given subscription.

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

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

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 488
def list_with_http_info(custom_headers:nil)
  list_async(custom_headers:custom_headers).value!
end
resume(resource_group_name, server_name, custom_headers:nil) click to toggle source

Resumes operation of the specified Analysis Services server instance.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 337
def resume(resource_group_name, server_name, custom_headers:nil)
  response = resume_async(resource_group_name, server_name, custom_headers:custom_headers).value!
  nil
end
resume_async(resource_group_name, server_name, custom_headers:nil) click to toggle source

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 354
def resume_async(resource_group_name, server_name, custom_headers:nil)
  # Send request
  promise = begin_resume_async(resource_group_name, server_name, custom_headers:custom_headers)

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

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

  promise
end
suspend(resource_group_name, server_name, custom_headers:nil) click to toggle source

Supends operation of the specified Analysis Services server instance.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 293
def suspend(resource_group_name, server_name, custom_headers:nil)
  response = suspend_async(resource_group_name, server_name, custom_headers:custom_headers).value!
  nil
end
suspend_async(resource_group_name, server_name, custom_headers:nil) click to toggle source

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 310
def suspend_async(resource_group_name, server_name, custom_headers:nil)
  # Send request
  promise = begin_suspend_async(resource_group_name, server_name, custom_headers:custom_headers)

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

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

  promise
end
update(resource_group_name, server_name, server_update_parameters, custom_headers:nil) click to toggle source

Updates the current state of the specified Analysis Services server.

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param server_update_parameters [AnalysisServicesServerUpdateParameters] Request object that contains the updated information for the server. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AnalysisServicesServer] operation results.

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 245
def update(resource_group_name, server_name, server_update_parameters, custom_headers:nil)
  response = update_async(resource_group_name, server_name, server_update_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_async(resource_group_name, server_name, server_update_parameters, custom_headers:nil) click to toggle source

@param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63. @param server_update_parameters [AnalysisServicesServerUpdateParameters] Request object that contains the updated information for the server. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb, line 264
def update_async(resource_group_name, server_name, server_update_parameters, custom_headers:nil)
  # Send request
  promise = begin_update_async(resource_group_name, server_name, server_update_parameters, custom_headers:custom_headers)

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

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

  promise
end