Sha256: 729fa76592c9b70aa4e95584aa1e84b9fa8fa776221235eb7f707f45bc2ff46d

Contents?: true

Size: 1.02 KB

Versions: 53

Compression:

Stored size: 1.02 KB

Contents

module Fog
  module Storage
    class AzureRM
      # This class provides the actual implemention for service calls.
      class Real
        # Get a public container url from Azure storage container
        #
        # @param container_name [String] Name of container
        #
        # @return [String] - url for container
        #
        def get_container_url(container_name, options = {})
          query = { 'comp' => 'list', 'restype' => 'container' }
          uri = @blob_client.generate_uri(container_name, query)

          if options[:scheme] == 'http'
            uri.to_s.gsub('https:', 'http:')
          else
            uri.to_s
          end
        end
      end

      # This class provides the mock implementation for unit tests.
      class Mock
        def get_container_url(_container_name, options = {})
          url = 'https://sa.blob.core.windows.net/test_container?comp=list&restype=container'
          url.gsub!('https:', 'http:') if options[:scheme] == 'http'
          url
        end
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 5 rubygems

Version Path
fog-azure-rm-0.6.0 lib/fog/azurerm/requests/storage/get_container_url.rb
gitlab-fog-azure-rm-1.0.0 lib/fog/azurerm/requests/storage/get_container_url.rb
gitlab-fog-azure-rm-0.9.0 lib/fog/azurerm/requests/storage/get_container_url.rb
gitlab-fog-azure-rm-0.8.1 lib/fog/azurerm/requests/storage/get_container_url.rb
gitlab-fog-azure-rm-0.8.0 lib/fog/azurerm/requests/storage/get_container_url.rb
gitlab-fog-azure-rm-0.7.0 lib/fog/azurerm/requests/storage/get_container_url.rb
gitlab-fog-azure-rm-0.6.0 lib/fog/azurerm/requests/storage/get_container_url.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/requests/storage/get_container_url.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/requests/storage/get_container_url.rb
far-gem-0.5.6 lib/fog/azurerm/requests/storage/get_container_url.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/requests/storage/get_container_url.rb
far-gem-0.5.5 lib/fog/azurerm/requests/storage/get_container_url.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/requests/storage/get_container_url.rb
far-gem-0.5.4 lib/fog/azurerm/requests/storage/get_container_url.rb
far-gem-0.5.3 lib/fog/azurerm/requests/storage/get_container_url.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/requests/storage/get_container_url.rb
far-gem-0.5.2 lib/fog/azurerm/requests/storage/get_container_url.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/requests/storage/get_container_url.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/requests/storage/get_container_url.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/requests/storage/get_container_url.rb