def cli(env, columns, sortby, volume_id):
    """List ACLs."""
    file_manager = SoftLayer.FileStorageManager(env.client)
    access_list = file_manager.get_file_volume_access_list(
        volume_id=volume_id)
    table = formatting.Table(columns.columns)
    table.sortby = sortby

    for key, type_name in [('allowedVirtualGuests', 'VIRTUAL'),
                           ('allowedHardware', 'HARDWARE'),
                           ('allowedSubnets', 'SUBNET'),
                           ('allowedIpAddresses', 'IP')]:
        for obj in access_list.get(key, []):
            obj['type'] = type_name
            table.add_row([value or formatting.blank()
                           for value in columns.row(obj)])

    env.fout(table)
def cli ( env , columns , sortby , volume_id ) : file_manager = SoftLayer . FileStorageManager ( env . client ) access_list = file_manager . get_file_volume_access_list ( volume_id = volume_id ) table = formatting . Table ( columns . columns ) table . sortby = sortby for key , type_name in [ ( 'allowedVirtualGuests' , 'VIRTUAL' ) , ( 'allowedHardware' , 'HARDWARE' ) , ( 'allowedSubnets' , 'SUBNET' ) , ( 'allowedIpAddresses' , 'IP' ) ] : for obj in access_list . get ( key , [ ] ) : obj [ 'type' ] = type_name table . add_row ( [ value or formatting . blank ( ) for value in columns . row ( obj ) ] ) env . fout ( table )
List ACLs.