Sha256: 29f39c342cce0371ea458bc5e20556e0ff024da3e5d061d2b1f29c16356c4c50

Contents?: true

Size: 1.5 KB

Versions: 3

Compression:

Stored size: 1.5 KB

Contents

module Fog
  module Storage
    class AzureRM
      # This class provides the actual implementation for service calls.
      class Real
        def list_containers(options = {})
          msg = 'Listing containers.'
          Fog::Logger.debug msg
          begin
            containers = @blob_client.list_containers(options)
          rescue Azure::Core::Http::HTTPError => ex
            raise_azure_exception(ex, msg)
          end
          Fog::Logger.debug 'Listing containers successfully.'
          containers
        end
      end

      # This class provides the mock implementation for unit tests.
      class Mock
        def list_containers(*)
          [
            {
              'name' => 'testcontainer1',
              'properties' =>
                {
                  'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
                  'etag' => '0x8D3A3B5F017F52D',
                  'lease_status' => 'unlocked',
                  'lease_state' => 'available'
                },
              'metadata' => {}
            },
            {
              'name' => 'testcontainer2',
              'properties' =>
                {
                  'last_modified' => 'Tue, 04 Aug 2015 06:01:08 GMT',
                  'etag' => '0x8D29C92176C8352',
                  'lease_status' => 'unlocked',
                  'lease_state' => 'available'
                },
              'metadata' => {}
            }
          ]
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.0 lib/fog/azurerm/requests/storage/list_containers.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/requests/storage/list_containers.rb
fog-azure-rm-0.0.8 lib/fog/azurerm/requests/storage/list_containers.rb