Ejemplo n.º 1
0
def configApTftpBackup():
    if request.method == 'GET':
        if session.get("username") is not None:
            status = request.args.get('status')
            completionTime = request.args.get('completionTime')
            return render_template("config-ap-group-tftp-backup.html",
                                   status=status,
                                   completionTime=completionTime)
        else:
            return msgAuthFailed, 401
    elif request.method == 'POST':
        if session.get("username") is not None:
            apGroupId = session.get("apGroupId")
            apGroupName = session.get("apGroupName")
            if apGroupId is None:
                apGroupId = request.form["ap_group_id"]
            tftpIp = request.form["tftp_ip"]
            apList = apGroupIterator(apGroupId=apGroupId, tftpIp=tftpIp)
            startTime = time.time()
            task = processor(operation=scout_sys.scoutTftpBackup,
                             apInfo=apList)
            endTime = time.time() - startTime
            status = "INFO: Config Backup for AP Group {} Successfully Initiated!".format(
                apGroupName)
            completionTime = printCompletionTime(endTime)
            return redirect(
                url_for('cardinal_ap_group_ops_bp.configApTftpBackup',
                        status=status,
                        completionTime=completionTime))
        else:
            return msgAuthFailed, 401
Ejemplo n.º 2
0
def disableApHttp():
    apGroupId = session.get('apGroupId')
    apGroupName = session.get('apGroupName')
    apList = apGroupIterator(apGroupId=apGroupId)
    startTime = time.time()
    task = processor(operation=scout_sys.scoutDisableHttp, apInfo=apList)
    endTime = time.time() - startTime
    status = "INFO: HTTP Server for AP Group {} Successfully Disabled!".format(
        apGroupName)
    completionTime = printCompletionTime(endTime)
    return redirect(
        url_for('cardinal_ap_group_ops_bp.configApHttp',
                status=status,
                completionTime=completionTime))
Ejemplo n.º 3
0
def deploySsid5GhzRadiusGroup():
    if request.method == 'GET':
        if session.get("username") is not None:
            conn = cardinalSql()
            status = request.args.get('status')
            deploySsidCursor = conn.cursor()
            deploySsidCursor.execute(
                "SELECT ap_ssid_id,ap_ssid_name FROM ssids_5ghz_radius")
            ssids = deploySsidCursor.fetchall()
            deploySsidCursor.close()
            conn.close()
            return render_template("deploy-ssid-5ghz-radius-group.html",
                                   status=status,
                                   ssids=ssids)
        else:
            return msgAuthFailed, 401
    elif request.method == 'POST':
        if session.get("username") is not None:
            ssidId = request.form["ssid_id"]
            apGroupId = session.get('apGroupId')
            apGroupName = session.get('apGroupName')
            ssidInfo = getSsidInfo(ssidId=ssidId, ssidType="ssid_5ghz_radius")
            encryptedSharedSecret = bytes(ssidInfo[0][6], 'utf-8')
            sharedSecret = cipherSuite.decrypt(encryptedSharedSecret).decode(
                'utf-8')
            apList = apGroupIterator(apGroupId=apGroupId,
                                     ssid=ssidInfo[0][0],
                                     vlan=ssidInfo[0][1],
                                     bridgeGroup=ssidInfo[0][2],
                                     radioSub=ssidInfo[0][3],
                                     gigaSub=ssidInfo[0][4],
                                     radiusIp=ssidInfo[0][5],
                                     sharedSecret=sharedSecret,
                                     authPort=ssidInfo[0][7],
                                     acctPort=ssidInfo[0][8],
                                     radiusTimeout=ssidInfo[0][9],
                                     radiusGroup=ssidInfo[0][10],
                                     methodList=ssidInfo[0][11])
            startTime = time.time()
            task = processor(operation=scout_ssid.scoutCreateSsid5Radius,
                             apInfo=apList)
            endTime = time.time() - startTime
            status = "Deployment of 5GHz SSID {0} for AP Group {1} Has Been Successfully Initiated!".format(
                ssidInfo[0][0], apGroupName)
            completionTime = printCompletionTime(endTime)
            return redirect(
                url_for('cardinal_ssid_ops_bp.deploySsid5GhzRadiusGroup',
                        status=status))
        else:
            return msgAuthFailed, 401
Ejemplo n.º 4
0
def enableApHttp():
    if session.get("username") is not None:
        apGroupId = session.get('apGroupId')
        apGroupName = session.get('apGroupName')
        if apGroupId is None:
            apGroupId = request.form["ap_group_id"]
        apList = apGroupIterator(apGroupId=apGroupId)
        startTime = time.time()
        task = processor(operation=scout_sys.scoutEnableHttp, apInfo=apList)
        endTime = time.time() - startTime
        status = "INFO: HTTP Server for AP Group {} Successfully Enabled!".format(
            apGroupName)
        completionTime = printCompletionTime(endTime)
        return redirect(
            url_for('cardinal_ap_group_ops_bp.configApHttp',
                    status=status,
                    completionTime=completionTime))
    else:
        return msgAuthFailed, 401
Ejemplo n.º 5
0
def removeSsid5GhzRadiusGroup():
    if request.method == 'GET':
        if session.get("username") is not None:
            conn = cardinalSql()
            status = request.args.get('status')
            deploySsidCursor = conn.cursor()
            deploySsidCursor.execute(
                "SELECT ap_ssid_id,ap_ssid_name FROM ssids_5ghz_radius")
            ssids = deploySsidCursor.fetchall()
            deploySsidCursor.close()
            conn.close()
            return render_template("remove-ssid-5ghz-radius-group.html",
                                   status=status,
                                   ssids=ssids)
        else:
            return msgAuthFailed, 401
    elif request.method == 'POST':
        if session.get("username") is not None:
            ssidId = request.form["ssid_id"]
            apGroupId = session.get('apGroupId')
            apGroupName = session.get('apGroupName')
            ssidInfo = getSsidInfo(ssidId=ssidId, ssidType="ssid_5ghz_radius")
            apList = apGroupIterator(apGroupId=apGroupId,
                                     ssid=ssidInfo[0][0],
                                     vlan=ssidInfo[0][1],
                                     radioSub=ssidInfo[0][3],
                                     gigaSub=ssidInfo[0][4])
            startTime = time.time()
            task = processor(operation=scout_ssid.scoutDeleteSsid5,
                             apInfo=apList)
            endTime = time.time() - startTime
            status = "Deployment of 5GHz RADIUS SSID {0} for AP Group {1} Has Been Successfully Initiated!".format(
                ssidInfo[0][0], apGroupName)
            completionTime = printCompletionTime(endTime)
            return redirect(
                url_for('cardinal_ssid_ops_bp.removeSsid5GhzRadiusGroup',
                        status=status))
        else:
            return msgAuthFailed, 401