Sha256: fdb9daffb8ad1303f0d6193e6eb3f8422d44d279592c5384dcf2fcddbe08f611

Contents?: true

Size: 1.82 KB

Versions: 16

Compression:

Stored size: 1.82 KB

Contents

#-------------------------------------------------------------------------
# Copyright 2013 Microsoft Open Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#--------------------------------------------------------------------------
# Represents an HTTP request that can perform synchronous queries to
# an HTTP server, returning a HttpResponse
module Azure
  module BaseManagement
    # This class is used for communicating with the Management certificate authentication API endpoint
    class SqlManagementHttpRequest < ManagementHttpRequest
      attr_accessor :uri
      # Public: Creates the ManagementHttpRequest
      #
      # method  - Symbol. The HTTP method to use (:get, :post, :put, :del, etc...)
      # path    - URI. The URI of the HTTP endpoint to query
      # body    - IO or String. The request body (optional)
      def initialize(method, path, body = nil)
        if sql_endpoint?
          super(method, path, body)
          @headers['x-ms-version'] = '1.0'
          @uri = URI.parse(Azure.config.sql_database_management_endpoint + Azure.config.subscription_id + path)
        else
          path = "/services/sqlservers#{path}"
          super(method, path, body)
        end
      end

      private

      def sql_endpoint?
        Azure.config.sql_database_authentication_mode == :sql_server
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 5 rubygems

Version Path
juliusl-azure-sdk-for-ruby-0.7.0 lib/azure/base_management/sql_management_http_request.rb
azure-0.7.0.pre lib/azure/base_management/sql_management_http_request.rb
stuartpreston-azure-sdk-for-ruby-0.7.1 lib/azure/base_management/sql_management_http_request.rb
stuartpreston-azure-sdk-for-ruby-0.7.0 lib/azure/base_management/sql_management_http_request.rb
stuartpreston-azure-sdk-for-ruby-0.6.9 lib/azure/base_management/sql_management_http_request.rb
stuartpreston-azure-sdk-for-ruby-0.6.7 lib/azure/base_management/sql_management_http_request.rb
stuartpreston-azure-sdk-for-ruby-0.6.6 lib/azure/base_management/sql_management_http_request.rb
stuartpreston-azure-sdk-for-ruby-0.6.5 lib/azure/base_management/sql_management_http_request.rb
azurex-0.6.7 lib/azure/base_management/sql_management_http_request.rb
azurex-0.6.6 lib/azure/base_management/sql_management_http_request.rb
azurex-0.6.5 lib/azure/base_management/sql_management_http_request.rb
azure-multistorage-0.6.4 lib/azure/base_management/sql_management_http_request.rb
azure-0.6.4 lib/azure/base_management/sql_management_http_request.rb
azure-0.6.3 lib/azure/base_management/sql_management_http_request.rb
azure-0.6.2 lib/azure/base_management/sql_management_http_request.rb
azure-0.6.1 lib/azure/base_management/sql_management_http_request.rb