def findPotentialFloodedLink():
    global auth, base_url
    url = base_url + 'find-potential-flooded-link'
    data = {"input": {"message": "find-potential-flooded-link"}}

    r = post_request(url, data, auth)

    return r
def subscribeForStatsFromSwitch(switch_ids):
    global auth, base_url
    url = base_url + 'subscribe-for-stats-from-switch'
    data = {"input": {"switch-ids": switch_ids}}

    r = post_request(url, data, auth)

    return r
def checkNewComers(sliding_window_size, new_comer_threshold):
    global auth, base_url
    url = base_url + 'check-new-comers'
    data = {
        "input": {
            "sliding-window-size": sliding_window_size,
            "new-comer-threshold": new_comer_threshold,
        }
    }

    r = post_request(url, data, auth)

    return r
def checkElephantTcpFlow(switch_id, anomalous_threshold):
    global auth, base_url
    url = base_url + 'check-elephant-tcp-flow'
    data = {
        "input": {
            "switch-id": switch_id,
            "anomalous-threshold": anomalous_threshold,
        }
    }

    r = post_request(url, data, auth)

    return r
def checkUdpIcmpFlows(switch_id, anomalous_rate):
    global auth, base_url
    url = base_url + 'check-udp-icmp-flows'
    data = {
        "input": {
            "switch-id": switch_id,
            "anomalous-rate": anomalous_rate,
        }
    }

    r = post_request(url, data, auth)

    return r
def subscribeForLinkFloodingCheck(switch_id, connector_id, drop_threshold):
    global auth, base_url
    url = base_url + 'subscribe-for-link-flooding-check'
    data = {
        "input": {
            "switch-id": switch_id,
            "connector-id": connector_id,
            "drop-threshold": drop_threshold
        }
    }

    r = post_request(url, data, auth)

    return r
def blockFlow(switch_id, flow_id, type):
    global auth, base_url
    url = base_url + 'block-flow'
    data = {
        "input": {
            "switch-id": switch_id,
            "flow-id": flow_id,
            "type": type
        }
    }

    r = post_request(url, data, auth)

    return r
def limitFlow(switch_id, flooded_link, source_ip):
    global auth, base_url
    url = base_url + 'limit-flow'
    data = {
        "input": {
            "switch-id": switch_id,
            "flooded-link": flooded_link,
            "source-ip": source_ip,
        }
    }

    r = post_request(url, data, auth)

    return r