#NEWLINE# def avail_images( kwargs = None , call = None ) : #NEWLINE# #INDENT# '\n    Return a list of the images that are on the provider.\n\n    CLI Examples:\n\n    .. code-block:: bash\n\n        salt-cloud --list-images my-qingcloud\n        salt-cloud -f avail_images my-qingcloud zone=gd1\n    ' #NEWLINE# if ( call == 'action' ) : #NEWLINE# #INDENT# raise SaltCloudSystemExit ( 'The avail_images function must be called with -f or --function, or with the --list-images option' ) #NEWLINE# #UNINDENT# if ( not isinstance ( kwargs , dict ) ) : #NEWLINE# #INDENT# kwargs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# params = { #NEWLINE# #INDENT# 'action' : 'DescribeImages' , #NEWLINE# 'provider' : 'system' , #NEWLINE# 'zone' : _get_specified_zone ( kwargs , get_configured_provider ( ) ) , #NEWLINE# #UNINDENT# } #NEWLINE# items = query ( params = kwargs ) #NEWLINE# result = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for image in items [ 'image_set' ] : #NEWLINE# #INDENT# result [ image [ 'image_id' ] ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for key in image : #NEWLINE# #INDENT# result [ image [ 'image_id' ] ] [ key ] = image [ key ] #NEWLINE# #UNINDENT# #UNINDENT# return result