�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
Z
d d l m Z d d
l
m Z d d l m Z d d l m Z d e f d � � YZ d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys�
---
module: onyx_traffic_class
version_added: "2.9"
author: "Anas Badaha (@anasb)"
short_description: Configures Traffic Class
description:
- This module provides declarative management of Traffic Class configuration
on Mellanox ONYX network devices.
options:
state:
description:
- enable congestion control on interface.
choices: ['enabled', 'disabled']
default: enabled
interfaces:
description:
- list of interfaces name.
required: true
tc:
description:
- traffic class, range 0-7.
required: true
congestion_control:
description:
- configure congestion control on interface.
suboptions:
control:
description:
- congestion control type.
choices: ['red', 'ecn', 'both']
required: true
threshold_mode:
description:
- congestion control threshold mode.
choices: ['absolute', 'relative']
required: true
min_threshold:
description:
- Set minimum-threshold value (in KBs) for marking traffic-class queue.
required: true
max_threshold:
description:
- Set maximum-threshold value (in KBs) for marking traffic-class queue.
required: true
dcb:
description:
- configure dcb control on interface.
suboptions:
mode:
description:
- dcb control mode.
choices: ['strict', 'wrr']
required: true
weight:
description:
- Relevant only for wrr mode.
s
- name: configure traffic class
onyx_traffic_class:
interfaces:
- Eth1/1
- Eth1/2
tc: 3
congestion_control:
control: ecn
threshold_mode: absolute
min_threshold: 500
max_threshold: 1500
dcb:
mode: strict
sE
commands:
description: The list of configuration mode commands to send to the device.
returned: always
type: list
sample:
- interface ethernet 1/15 traffic-class 3 congestion-control ecn minimum-absolute 150 maximum-absolute 1500
- interface ethernet 1/16 traffic-class 3 congestion-control ecn minimum-absolute 150 maximum-absolute 1500
- interface mlag-port-channel 7 traffic-class 3 congestion-control ecn minimum-absolute 150 maximum-absolute 1500
- interface port-channel 1 traffic-class 3 congestion-control ecn minimum-absolute 150 maximum-absolute 1500
- interface ethernet 1/15 traffic-class 3 dcb ets strict
- interface ethernet 1/16 traffic-class 3 dcb ets strict
- interface mlag-port-channel 7 traffic-class 3 dcb ets strict
- interface port-channel 1 traffic-class 3 dcb ets strict
N( t iteritems( t
AnsibleModule( t show_cmd( t BaseOnyxModulet OnyxTrafficClassModulec B` s� e Z e j d � Z e j d � Z e j d � Z d Z d Z d Z i e e 6e e 6e e 6Z
d � Z d � Z d � Z
d d � Z d
� Z d � Z d � Z d
� Z d � Z d � Z d � Z d � Z d � Z RS( s ^Eth(\d+\/\d+|Eth\d+\/\d+\d+)$s ^Po(\d+)$s
^Mpo(\d+)$t ethernets port-channels mlag-port-channelc C` sI t d t d d d d g d t � d t d d d g d t � d
t d t d t � d t d t d t � � } t d
t d d d g d t � d t d t � � } t d t d d d t � d t d t d t � d t d d d | � d t d d d | � d t d d d g d d � � } t � } | j | � t d | d t � | _ d S( s initialize module
t controlt choicest redt ecnt botht requiredt threshold_modet absolutet relativet
min_thresholdt typet
max_thresholdt modet strictt wrrt weightt
interfacest listt tct congestion_controlt dictt optionst dcbt statet enabledt disabledt defaultt
argument_spect supports_check_modeN( R"