@route(app, '/lumeta/getiplist', methods=['GET', 'PUT', 'POST'])
@util.rest_workflow_permission_required('lumeta_workflow_page')
@util.rest_exception_catcher
def getiplist_getiplist_page():
    g.user.logger.info('SUCCESS')
    networks = []
    ip_addresses = []
    if g.user:
        configurations = g.user.get_api().get_configurations()
        for c in configurations:
            print(c)
            configuration_json = {'id': c.get_id(), 'name': c.get_name()}
            try:
                for nw in c.get_children_of_type('IP4Block'):
                    print(nw)
                    for n in g.user.get_api().get_by_object_types(nw.get_property('CIDR'), ['IP4Network', 'IP4Block', 'IP6Network', 'IP6Block']):
                        if ('6' in n.get_type()):
                            networks.append({'network_id': n.get_id(), 'display_text': n.get_properties()['prefix']})
                            ip_addresses.extend(calculate_block_stats(n, c.get_id(), c.get_name()))
                        else:
                            networks.append({'network_id': n.get_id(), 'display_text': n.get_properties()['CIDR']})
                            ip_addresses.extend(calculate_block_stats(n, c.get_id(), c.get_name()))
            except Exception as e:
                app.loggererror(('get_subnets: ' + e.message))
    return jsonify(ip_addresses)
@route(app, '/lumeta/getiplist', methods=['GET', 'PUT', 'POST'])
@util.rest_workflow_permission_required('lumeta_workflow_page')
@util.rest_exception_catcher
def getiplist_getiplist_page():
    g.user.logger.info('SUCCESS')
    networks = []
    ip_addresses = []
    if g.user:
        configurations = g.user.get_api().get_configurations()
        for c in configurations:
            print(c)
            configuration_json = {'id': c.get_id(), 'name': c.get_name()}
            try:
                for nw in c.get_children_of_type('IP4Block'):
                    print(nw)
                    for n in g.user.get_api().get_by_object_types(nw.get_property('CIDR'), ['IP4Network', 'IP4Block', 'IP6Network', 'IP6Block']):
                        if ('6' in n.get_type()):
                            networks.append({'network_id': n.get_id(), 'display_text': n.get_properties()['prefix']})
                            ip_addresses.extend(calculate_block_stats(n, c.get_id(), c.get_name()))
                        else:
                            networks.append({'network_id': n.get_id(), 'display_text': n.get_properties()['CIDR']})
                            ip_addresses.extend(calculate_block_stats(n, c.get_id(), c.get_name()))
            except Exception as e:
                app.loggererror(('get_subnets: ' + e.message))
    return jsonify(ip_addresses)