#NEWLINE# @ app . route ( '/VolumeDriver.List' , methods = [ 'POST' ] ) #NEWLINE# @ _endpoint ( 'List' ) #NEWLINE# def volumedriver_list( self ) : #NEWLINE# #INDENT# '\n        Return information about the current state of all volumes.\n\n        :return: Result indicating success.\n        ' #NEWLINE# listing = DeferredContext ( self . _flocker_client . list_datasets_configuration ( ) ) #NEWLINE# def got_configured( configured ) : #NEWLINE# #INDENT# results = [ ] #NEWLINE# for dataset in configured : #NEWLINE# #INDENT# if ( NAME_FIELD not in dataset . metadata ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# dataset_name = dataset . metadata [ NAME_FIELD ] #NEWLINE# d = self . _get_path_from_dataset_id ( dataset . dataset_id ) #NEWLINE# d . addCallback ( ( lambda path , name = dataset_name : ( path , name ) ) ) #NEWLINE# results . append ( d ) #NEWLINE# #UNINDENT# return gatherResults ( results ) #NEWLINE# #UNINDENT# listing . addCallback ( got_configured ) #NEWLINE# def got_paths( results ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# 'Err' : '' , #NEWLINE# 'Volumes' : sorted ( [ { #NEWLINE# #INDENT# 'Name' : name , #NEWLINE# 'Mountpoint' : ( '' if ( path is None ) else path . path ) , #NEWLINE# #UNINDENT# } for ( path , name ) in results ] ) , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# listing . addCallback ( got_paths ) #NEWLINE# return listing . result