Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,95 @@ def list_gateway_status_async(resource_group_name, server_name, custom_headers =
promise.execute
end

#
# 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.
#
#
def dissociate_gateway(resource_group_name, server_name, custom_headers = nil)
response = dissociate_gateway_async(resource_group_name, server_name, custom_headers).value!
nil
end

#
# 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.
#
def dissociate_gateway_with_http_info(resource_group_name, server_name, custom_headers = nil)
dissociate_gateway_async(resource_group_name, server_name, custom_headers).value!
end

#
# 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.
#
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, 'server_name is nil' if server_name.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 = {}

# 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

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