lib/azure/armrest/model/storage_account.rb
# Return a list of container names for the given storage account +key+.
# If no key is provided, it is assumed that the StorageAccount object
# includes the access_key property.
#
# # The following options are supported:
#
# * prefix
# * delimiter
# * maxresults
# * include
# * timeout
# * all
#
# By default Azure uses a value of 5000 for :maxresults.
#
# If the :include option is specified, it should contain an array of
# one element: metadata. More options may be added by Microsoft
# at a later date.
#
# 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.containers(key)
#   p acct.containers(key, :include => ['metadata'])
#   p acct.containers(key, :maxresults => 1)
#
Return a list of container names for the given storage account +key+.
If no key is provided, it is assumed that the StorageAccount object
includes the access_key property.

The following options are supported.

prefix
delimiter
maxresults
include
timeout
all

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

If the :include option is specified, it should contain an array of
one element: metadata. More options may be added by Microsoft
at a later date.

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 container names for the given storage account + key + . If no key is provided it is assumed that the StorageAccount object includes the access_key property . The following options are supported . prefix delimiter maxresults include timeout all By default Azure uses a value of 5000 for : maxresults . If the : include option is specified it should contain an array of one element : metadata . More options may be added by Microsoft at a later date . 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 containers(key = access_key, options = {})
        raise ArgumentError, "No access key specified" unless key
        query = "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)
        hash = Hash.from_xml(response.body)['EnumerationResults']['Containers']
        results = []
        if hash && hash['Container']
          Array.wrap(hash['Container']).each { |c| results << Container.new(c, skip_defs) }
        end
        if options[:all] && hash['NextMarker']
          options[:marker] = hash['NextMarker']
          results.concat(containers(key, options))
        end
        results
      end
def containers ( key = access_key , options = { } ) raise ArgumentError , "No access key specified" unless key query = "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 ) hash = Hash . from_xml ( response . body ) [ 'EnumerationResults' ] [ 'Containers' ] results = [ ] if hash && hash [ 'Container' ] Array . wrap ( hash [ 'Container' ] ) . each { | c | results << Container . new ( c , skip_defs ) } end if options [ :all ] && hash [ 'NextMarker' ] options [ :marker ] = hash [ 'NextMarker' ] results . concat ( containers ( key , options ) ) end results end
Return a list of container names for the given storage account +key+.
Return a list of container names for the given storage account + key + .
key
<not_specific>
access_key
<not_specific>
options
<not_specific>