#!/usr/bin/python

import logging
from clients.ovs import Client

__author__ = 'beb'

if __name__ == '__main__':
    logging.basicConfig(
        format='%(asctime)s_%(process)d:%(lineno)d [%(levelname)s] %(message)s',
        level=logging.DEBUG)

    client = Client()

    host_ip = '192.168.120.15'

    # ------------------
    # Retrieve lists:
    # ------------------
    ports = client.list_ports(host_ip)
    logging.info('Get ports for %s: %s', host_ip, ports)

    interfaces = client.list_interfaces(host_ip)
    logging.info('Get interfaces for %s: %s', host_ip, interfaces)

    # ------------------
    # Test setting QoS:
    # ------------------
    host_ip = '192.168.120.15'
    ovs_port = 'qvo641e9d9d-a5'
    min_rate = 100000