@route(app, '/lumeta/addiplist', methods=['GET', 'PUT', 'POST'])
@util.rest_workflow_permission_required('lumeta_workflow_page')
@util.rest_exception_catcher
def addiplist_addiplist_page():
    g.user.logger.info('SUCCESS')
    rdata_arr = request.get_json()
    stats = {}
    global api
    for rdata in rdata_arr:
        config_name = rdata['config_name']
        add_network = rdata['add_network_block']
        device_list = rdata['deviceList']
        added_ips = 0
        dup_ips = 0
        api = g.user.get_api()
        print(add_network)
        print(device_list)
        config = api.get_configuration(config_name)
        for device in device_list:
            print(device['ip'])
            (added_ip, dup_ip, ip) = add_device(device, config, add_network)
            added_ips += added_ip
            dup_ips += dup_ip
            if (added_ip == 1):
                add_tag(ip)
        stats.update({config_name: {'added_ips': added_ips, 'dup_ips': dup_ips}})
    return jsonify(stats)
@route(app, '/lumeta/addiplist', methods=['GET', 'PUT', 'POST'])
@util.rest_workflow_permission_required('lumeta_workflow_page')
@util.rest_exception_catcher
def addiplist_addiplist_page():
    g.user.logger.info('SUCCESS')
    rdata_arr = request.get_json()
    stats = {}
    global api
    for rdata in rdata_arr:
        config_name = rdata['config_name']
        add_network = rdata['add_network_block']
        device_list = rdata['deviceList']
        added_ips = 0
        dup_ips = 0
        api = g.user.get_api()
        print(add_network)
        print(device_list)
        config = api.get_configuration(config_name)
        for device in device_list:
            print(device['ip'])
            (added_ip, dup_ip, ip) = add_device(device, config, add_network)
            added_ips += added_ip
            dup_ips += dup_ip
            if (added_ip == 1):
                add_tag(ip)
        stats.update({config_name: {'added_ips': added_ips, 'dup_ips': dup_ips}})
    return jsonify(stats)