#NEWLINE# @ click . command ( ) #NEWLINE# @ environment . pass_env #NEWLINE# def cli( env ) : #NEWLINE# #INDENT# 'List iSCSI targets.' #NEWLINE# iscsi_mgr = SoftLayer . ISCSIManager ( iscsi_mgr . client ) #NEWLINE# iscsi_list = iscsi_mgr . list_iscsi ( ) #NEWLINE# iscsi_list = [ utils . NestedDict ( n ) for n in iscsi_list ] #NEWLINE# table = formatting . Table ( [ 'id' , 'datacenter' , 'size' , 'username' , 'password' , 'server' ] ) #NEWLINE# for iscsi in iscsi_list : #NEWLINE# #INDENT# table . add_row ( [ iscsi [ 'id' ] , ( utils . lookup ( iscsi , 'serviceResource' , 'datacenter' , 'name' ) or formatting . blank ( ) ) , formatting . FormattedItem ( iscsi . get ( 'capacityGb' , formatting . blank ( ) ) , ( '%dGB' % iscsi . get ( 'capacityGb' , 0 ) ) ) , iscsi . get ( 'username' , formatting . blank ( ) ) , iscsi . get ( 'password' , formatting . blank ( ) ) , iscsi . get ( 'serviceResourceBackendIpAddress' , formatting . blank ( ) ) ] ) #NEWLINE# #UNINDENT# env . fout ( table )