From 79327785ebda5f2feedcc4995de01c5803d38743 Mon Sep 17 00:00:00 2001 From: SwaggerToSDK Automation Date: Thu, 21 Sep 2017 17:42:36 +0000 Subject: [PATCH] Generated from 48c72713b749b30657d8db0dc8b63faaa548071c --- .../azure_mgmt_analysis_services/servers.rb | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/management/azure_mgmt_analysis_services/lib/generated/azure_mgmt_analysis_services/servers.rb b/management/azure_mgmt_analysis_services/lib/generated/azure_mgmt_analysis_services/servers.rb index cb52de6946..810144a1c9 100644 --- a/management/azure_mgmt_analysis_services/lib/generated/azure_mgmt_analysis_services/servers.rb +++ b/management/azure_mgmt_analysis_services/lib/generated/azure_mgmt_analysis_services/servers.rb @@ -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.