�
�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
m 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 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_pfc_interface
version_added: "2.5"
author: "Samer Deeb (@samerd)"
short_description: Manage priority flow control on ONYX network devices
description:
- This module provides declarative management of priority flow control (PFC)
on interfaces of Mellanox ONYX network devices.
notes:
- Tested on ONYX 3.6.4000
options:
name:
description:
- Name of the interface PFC should be configured on.
aggregate:
description: List of interfaces PFC should be configured on.
purge:
description:
- Purge interfaces not defined in the aggregate parameter.
type: bool
default: false
state:
description:
- State of the PFC configuration.
default: enabled
choices: ['enabled', 'disabled']
sQ
- name: configure PFC
onyx_pfc_interface:
name: Eth1/1
state: enabled
s�
commands:
description: The list of configuration mode commands to send to the device.
returned: always
type: list
sample:
- interface ethernet 1/17 dcb priority-flow-control mode on
( t deepcopyN( t
AnsibleModule( t remove_default_spec( t iteritems( t BaseOnyxModule( t show_cmdt OnyxPfcInterfaceModulec B` s� e Z e j d � Z e Z e d � � Z e d � � Z d � Z
d � Z d � Z d � Z
d � Z d � Z d � Z d
� Z d � Z RS( s3 ^(Eth\d+\/\d+)|(Eth\d+\/\d+\/\d+)|(Po\d+)|(Mpo\d+)$c
C` s1 t d t d d � d t d d d d d g � � S( Nt namet typet strt statet defaultt enabledt choicest disabled( t dict( t cls( ( sS /usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_pfc_interface.pyt _get_element_specJ s c C` s- t | � } t d t � | d <t | � | S( Nt requiredR ( R R t TrueR
( R t element_spect aggregate_spec( ( sS /usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_pfc_interface.pyt _get_aggregate_specR s
c C` s� | j � } | j | � } t d t d d d d d | � d t d t d d � � } | j | � d
d g g } d
d g g } t d | d | d
| d t � | _ d S( s module initialization
t aggregateR t listt elementsR t optionst purgeR t boolR t
argument_spect required_one_oft mutually_exclusivet supports_check_modeN( R R R t Falset updateR R t _module( t selfR R R% R&