"""
SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
SPDX-License-Identifier: LicenseRef-ONF-Member-1.01
"""

import requests
import json
from requests.structures import CaseInsensitiveDict


TOKEN = "### A VALID TOKEN ###"

URL = "https://roc.menlo.aetherproject.org/aether-roc-api/aether/v4.0.0/connectivity-service-v4/"
#URL = "https://roc.staging.aether.onlab.us/aether-roc-api/aether/v4.0.0/connectivity-service-v4/"

cameras = "menlo-4g-cameras"
#cameras = "cameras-4g"

MBR_HIGH = 4000000
MBR_LOW = 2000000

roc_headers = CaseInsensitiveDict()
roc_headers["Content-Type"] = "application/json"
roc_headers["Authorization"] = "Bearer " + TOKEN

def get_mbr(device_group):
    url = URL + "vcs/vcs/vcs-{}/slice/mbr".format(device_group)
    response = requests.get(url, headers=roc_headers)
    assert response.status_code == 200, "Failed to get mbr"
    mbr = json.loads(response.text)
    return mbr

def set_mbr(device_group, mbr):
    url = URL + "vcs/vcs/vcs-{}/slice/mbr".format(device_group)
    response = requests.post(url, headers=roc_headers, json=mbr)
    assert response.status_code == 201, "Failed to set mbr"

def set_uplink_mbr_high():
    mbr = {'uplink' : MBR_HIGH}
    set_mbr(cameras, mbr)

def set_uplink_mbr_low():
    mbr = {'uplink' : MBR_LOW}
    set_mbr(cameras, mbr)

if __name__ == '__main__':
    mbr = get_mbr(cameras)
    print("uplink mbr:{}, downlink mbr: {}".format(mbr["uplink"], mbr["downlink"]))
    set_uplink_mbr_low()
    mbr = get_mbr(cameras)
    print("uplink mbr:{}, downlink mbr: {}".format(mbr["uplink"], mbr["downlink"]))
    set_uplink_mbr_high()
    mbr = get_mbr(cameras)
    print("uplink mbr:{}, downlink mbr: {}".format(mbr["uplink"], mbr["downlink"]))
