mirror of
https://github.com/adulau/dcu-tools.git
synced 2024-12-22 08:46:10 +00:00
date option added to limit the query of containers
date in format YYYY-MM-DD to limit the query (default is all)
This commit is contained in:
parent
ee10433bd5
commit
8c98ae7524
1 changed files with 3 additions and 0 deletions
|
@ -41,6 +41,7 @@ parser.add_option("-k","--account_key", dest="account_key", help="Microsoft Azur
|
|||
parser.add_option("-c","--clear", dest="clear", action='store_true', help="Delete blobs and containers after fetching")
|
||||
parser.add_option("-e","--header", dest="header", action='store_true', help="Remove field header in the output (default is displayed)")
|
||||
parser.add_option("-f","--format", dest="output_format", help="output txt, json (default is txt)")
|
||||
parser.add_option("-t","--date", dest="date", help="date in format YYYY-MM-DD to limit the query (default is all)")
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
|
@ -69,9 +70,11 @@ if header and not options.output_format:
|
|||
print '\t'.join(str(h) for h in headers)
|
||||
|
||||
blob_service = BlobService(account_name, account_key)
|
||||
|
||||
for container in blob_service.list_containers():
|
||||
c = container.name
|
||||
if c == "heartbeat": continue
|
||||
if options.date and not ( c == "processed-"+options.date ): continue
|
||||
if debug: sys.stderr.write("Processing container: "+str(c)+"\n")
|
||||
for b in blob_service.list_blobs(c):
|
||||
if debug: sys.stderr.write("Processing blob: "+str(b.name)+"\n")
|
||||
|
|
Loading…
Reference in a new issue