lib/azure/armrest/model/storage_account.rb
# Return a list of blobs for the given +container+ using the given +key+
# or the access_key property of the StorageAccount object.
#
# The following options are supported:
#
# * prefix
# * delimiter
# * maxresults
# * include
# * timeout
#
# By default Azure uses a value of 5000 for :maxresults.
#
# If the :include option is specified, it should contain an array of
# one or more of the following values: snapshots, metadata, copy or
# uncommittedblobs.
#
# If the :all option is set to true, then this method will collect all
# records. Otherwise, it is capped at 5000 records by Azure, or whatever
# you set :maxresults to. If you set both the :all option and the :maxresults
# option, then all records will be collected in :maxresults batches.
#
# Example:
#
#   sas  = Azure::Armrest::StorageAccountService.new(conf)
#   key  = sas.list_account_keys['key1']
#   acct = sas.get('your_storage_account', 'your_resource_group')
#
#   p acct.blobs('vhds', key)
#   p acct.blobs('vhds', key, :timeout => 30)
#   p acct.blobs('vhds', key, :include => ['snapshots', 'metadata'])
#
Return a list of blobs for the given +container+ using the given +key+
or the access_key property of the StorageAccount object.

The following options are supported.

prefix
delimiter
maxresults
include
timeout

By default Azure uses a value of 5000 for :maxresults.

If the :include option is specified, it should contain an array of
one or more of the following values: snapshots, metadata, copy or
uncommittedblobs.

If the :all option is set to true, then this method will collect all
records. Otherwise, it is capped at 5000 records by Azure, or whatever
you set :maxresults to. If you set both the :all option and the :maxresults
option, then all records will be collected in :maxresults batches.






Return a list of blobs for the given + container + using the given + key + or the access_key property of the StorageAccount object . The following options are supported . prefix delimiter maxresults include timeout By default Azure uses a value of 5000 for : maxresults . If the : include option is specified it should contain an array of one or more of the following values : snapshots metadata copy or uncommittedblobs . If the : all option is set to true then this method will collect all records . Otherwise it is capped at 5000 records by Azure or whatever you set : maxresults to . If you set both the : all option and the : maxresults option then all records will be collected in : maxresults batches .
def blobs(container, key = access_key, options = {})
        raise ArgumentError, "No access key specified" unless key
        query = "restype=container&comp=list"
        skip_defs = options[:skip_accessors_definition]
        options.each do |okey, ovalue|
          unless okey == :skip_accessors_definition
            query += "&#{okey}=#{[ovalue].flatten.join(',')}"
          end
        end
        response = blob_response(key, query, container)
        hash = Hash.from_xml(response.body)['EnumerationResults']['Blobs']
        results = []
        if hash && hash['Blob']
          Array.wrap(hash['Blob']).each do |h|
            h[:container] = container
            object = h.key?('Snapshot') ? BlobSnapshot.new(h, skip_defs) : Blob.new(h, skip_defs)
            results << object
          end
        end
        if options[:all] && hash['NextMarker']
          options[:marker] = hash['NextMarker']
          results.concat(blobs(container, key, options))
        end
        results
      end
def blobs ( container , key = access_key , options = { } ) raise ArgumentError , "No access key specified" unless key query = "restype=container&comp=list" skip_defs = options [ :skip_accessors_definition ] options . each do | okey , ovalue | unless okey == :skip_accessors_definition query += "&#{okey}=#{[ovalue].flatten.join(',')}" end end response = blob_response ( key , query , container ) hash = Hash . from_xml ( response . body ) [ 'EnumerationResults' ] [ 'Blobs' ] results = [ ] if hash && hash [ 'Blob' ] Array . wrap ( hash [ 'Blob' ] ) . each do | h | h [ :container ] = container object = h . key? ( 'Snapshot' ) ? BlobSnapshot . new ( h , skip_defs ) : Blob . new ( h , skip_defs ) results << object end end if options [ :all ] && hash [ 'NextMarker' ] options [ :marker ] = hash [ 'NextMarker' ] results . concat ( blobs ( container , key , options ) ) end results end
Return a list of blobs for the given +container+ using the given +key+
or the access_key property of the StorageAccount object.
Return a list of blobs for the given + container + using the given + key + or the access_key property of the StorageAccount object .
container
<not_specific>
key
<not_specific>
access_key
<not_specific>
options
<not_specific>