from a10sdk.common.A10BaseClass import A10BaseClass


class Qos(A10BaseClass):
    
    """Class Description::
    QoS configuration.

    Class qos supports CRUD Operations and inherits from `common/A10BaseClass`.
    This class is the `"PARENT"` class for this module.`

    :param policy_list: {"minItems": 1, "items": {"type": "policy"}, "uniqueItems": true, "array": [{"required": ["name"], "properties": {"class-list": {"minItems": 1, "items": {"type": "class"}, "uniqueItems": true, "array": [{"required": ["name"], "properties": {"action-cfg": {"type": "object", "properties": {"conform": {"default": 0, "type": "number", "description": "packets that conform the limitation", "format": "flag"}, "exceed": {"default": 0, "type": "number", "description": "packets that exceed the limitation", "format": "flag"}, "exceed-dscpenum": {"not": "exceed-dscpnum", "enum": ["af11", "af12", "af13", "af21", "af22", "af23", "af31", "af32", "af33", "af41", "af42", "af43", "cs1", "cs2", "cs3", "cs4", "cs5", "cs6", "cs7", "ef"], "type": "string", "description": "'af11': af11; 'af12': af12; 'af13': af13; 'af21': af21; 'af22': af22; 'af23': af23; 'af31': af31; 'af32': af32; 'af33': af33; 'af41': af41; 'af42': af42; 'af43': af43; 'cs1': cs1; 'cs2': cs2; 'cs3': cs3; 'cs4': cs4; 'cs5': cs5; 'cs6': cs6; 'cs7': cs7; 'ef': ef; ", "format": "enum"}, "dscpnum": {"not": "dscpenum", "minimum": 1, "type": "number", "maximum": 63, "format": "number"}, "fifo": {"default": 0, "type": "number", "description": "First-in-first-out queueing", "format": "flag"}, "exceed-set-dscp": {"default": 0, "not": "limit-drop", "type": "number", "description": "Set DSCP then forward the packet", "format": "flag"}, "bandwidth": {"default": 0, "not": "drop", "type": "number", "description": "Bandwidth reservation, and need bandwidth control enabled", "format": "flag"}, "interval": {"description": "Pertubation interval in seconds", "format": "number", "default": 10, "maximum": 60, "minimum": 1, "type": "number"}, "threshold": {"description": "Minimum packet threshold of the RED queue", "format": "number", "default": 4, "maximum": 512, "minimum": 1, "type": "number"}, "min": {"description": "Minimum bandwidth in Kbps", "minimum": 0, "type": "number", "maximum": 1000000000, "format": "number"}, "limit-dscpenum": {"not": "limit-dscpnum", "enum": ["af11", "af12", "af13", "af21", "af22", "af23", "af31", "af32", "af33", "af41", "af42", "af43", "cs1", "cs2", "cs3", "cs4", "cs5", "cs6", "cs7", "ef"], "type": "string", "description": "'af11': af11; 'af12': af12; 'af13': af13; 'af21': af21; 'af22': af22; 'af23': af23; 'af31': af31; 'af32': af32; 'af33': af33; 'af41': af41; 'af42': af42; 'af43': af43; 'cs1': cs1; 'cs2': cs2; 'cs3': cs3; 'cs4': cs4; 'cs5': cs5; 'cs6': cs6; 'cs7': cs7; 'ef': ef; ", "format": "enum"}, "length": {"description": "Maximum number of packets in a FIFO", "format": "number", "default": 16, "maximum": 512, "minimum": 1, "type": "number"}, "mark": {"default": 0, "not": "drop", "type": "number", "description": "packet marking action", "format": "flag"}, "priority": {"description": "Queuing Priority", "minimum": 0, "type": "number", "maximum": 7, "format": "number"}, "tail": {"default": 0, "not": "red", "type": "number", "description": "Drop packets when the queue is full", "format": "flag"}, "policy": {"description": "Child policy name", "format": "string", "minLength": 1, "maxLength": 31, "type": "string", "$ref": "/axapi/v3/qos/policy"}, "red": {"default": 0, "not": "tail", "type": "number", "description": "drop packets using random early drop algorithm", "format": "flag"}, "limit-drop": {"default": 0, "not": "exceed-set-dscp", "type": "number", "description": "Drop the packet that exceed limitation", "format": "flag"}, "max": {"description": "Maximum bandwidth in Kbps", "minimum": 0, "type": "number", "maximum": 1000000000, "format": "number"}, "dscp": {"default": 0, "type": "number", "description": "DSCP marking", "format": "flag"}, "sfq": {"default": 0, "type": "number", "description": "Statistical fair queueing", "format": "flag"}, "drop-method": {"default": 0, "type": "number", "description": "Bandwidth drop method", "format": "flag"}, "limit-dscpnum": {"not": "limit-dscpenum", "minimum": 1, "type": "number", "maximum": 63, "format": "number"}, "dscpenum": {"not": "dscpnum", "enum": ["af11", "af12", "af13", "af21", "af22", "af23", "af31", "af32", "af33", "af41", "af42", "af43", "cs1", "cs2", "cs3", "cs4", "cs5", "cs6", "cs7", "ef"], "type": "string", "description": "'af11': af11; 'af12': af12; 'af13': af13; 'af21': af21; 'af22': af22; 'af23': af23; 'af31': af31; 'af32': af32; 'af33': af33; 'af41': af41; 'af42': af42; 'af43': af43; 'cs1': cs1; 'cs2': cs2; 'cs3': cs3; 'cs4': cs4; 'cs5': cs5; 'cs6': cs6; 'cs7': cs7; 'ef': ef; ", "format": "enum"}, "exceed-dscpnum": {"not": "exceed-dscpenum", "minimum": 1, "type": "number", "maximum": 63, "format": "number"}, "drop": {"default": 0, "not-list": ["limit", "mark", "bandwidth"], "type": "number", "description": "Drop packet action", "format": "flag"}, "bucket": {"description": "Number of hash buckets", "format": "number", "default": 16, "maximum": 64, "minimum": 1, "type": "number"}, "queue": {"default": 0, "type": "number", "description": "configure bandwidth queue type", "format": "flag"}, "limit-rate": {"description": "Rate limit in Kbps", "minimum": 0, "type": "number", "maximum": 1000000000, "format": "number"}, "limit": {"default": 0, "not": "drop", "type": "number", "description": "Rate limit action", "format": "flag"}, "sfq-length": {"description": "Maximum number of packets in a bucket", "format": "number", "default": 16, "maximum": 128, "minimum": 1, "type": "number"}, "set-dscp": {"default": 0, "type": "number", "description": "Set DSCP before forward the packet", "format": "flag"}}}, "sampling-enable": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "counters1": {"enum": ["all", "current-rate", "everage-rate", "peak-rate", "bytes", "packets", "dropped-bytes", "dropped-packets", "active-session", "total-session", "dropped-session", "conform-packets", "exceed-packets", "bandwidth-bytes", "bandwidth-packets", "bandwidth-queue-bytes", "bandwidth-queue-packets", "bandwidth-dropped-bytes", "bandwidth-dropped-packets", "bandwidth-red-dropped-bytes", "bandwidth-red-dropped-packets"], "type": "string", "description": "'all': all; 'current-rate': current-rate; 'everage-rate': everage-rate; 'peak-rate': peak-rate; 'bytes': bytes; 'packets': packets; 'dropped-bytes': dropped-bytes; 'dropped-packets': dropped-packets; 'active-session': active-session; 'total-session': total-session; 'dropped-session': dropped-session; 'conform-packets': conform-packets; 'exceed-packets': exceed-packets; 'bandwidth-bytes': bandwidth-bytes; 'bandwidth-packets': bandwidth-packets; 'bandwidth-queue-bytes': bandwidth-queue-bytes; 'bandwidth-queue-packets': bandwidth-queue-packets; 'bandwidth-dropped-bytes': bandwidth-dropped-bytes; 'bandwidth-dropped-packets': bandwidth-dropped-packets; 'bandwidth-red-dropped-bytes': bandwidth-red-dropped-bytes; 'bandwidth-red-dropped-packets': bandwidth-red-dropped-packets; ", "format": "enum"}}}]}, "name": {"description": "class name", "format": "string", "minLength": 1, "optional": false, "maxLength": 31, "type": "string"}, "precedence": {"description": "Precedence in the policy", "format": "number", "default": 10, "optional": true, "maximum": 10, "minimum": 0, "type": "number"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}}}], "type": "array", "$ref": "/axapi/v3/qos/policy/{name}/class/{name}"}, "name": {"description": "policy name", "format": "string", "minLength": 1, "optional": false, "maxLength": 31, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}}}], "type": "array", "$ref": "/axapi/v3/qos/policy/{name}"}
    :param interface_list: {"minItems": 1, "items": {"type": "interface"}, "uniqueItems": true, "array": [{"required": ["name"], "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}, "shape": {"description": "Shape traffic rate on the interface", "format": "number", "type": "number", "maximum": 1000000000, "minimum": 0, "optional": true}, "qos": {"type": "object", "properties": {"policy": {"description": "Policy name", "format": "string", "minLength": 1, "maxLength": 31, "type": "string", "$ref": "/axapi/v3/qos/policy"}}}, "name": {"description": "QoS interface name", "format": "string", "minLength": 1, "optional": false, "maxLength": 31, "type": "string"}, "port": {"type": "object", "properties": {"ve-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"port-ve-start": {"type": "number", "description": "Virtual Ethernet Interface", "format": "number"}, "optional": true, "port-ve-end": {"type": "number", "format": "number"}}}]}, "ethernet-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "port-ethernet-end": {"type": "number", "format": "interface"}, "port-ethernet-start": {"type": "number", "description": "Ethernet Interface", "format": "interface"}}}]}, "trunk-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"port-trunk-end": {"type": "number", "format": "number"}, "optional": true, "port-trunk-start": {"type": "number", "description": "Trunk Interface", "format": "number"}}}]}}}}}], "type": "array", "$ref": "/axapi/v3/qos/interface/{name}"}
    :param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py`

    

    URL for this object::
    `https://<Hostname|Ip address>//axapi/v3/qos`.

    

    
    """
    def __init__(self, **kwargs):
        self.ERROR_MSG = ""
        self.required=[]
        self.b_key = "qos"
        self.a10_url="/axapi/v3/qos"
        self.DeviceProxy = ""
        self.policy_list = []
        self.bandwidth = {}
        self.interface_list = []

        for keys, value in kwargs.items():
            setattr(self,keys, value)


