Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/onyx/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
dd
lmZdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bysV
---
module: onyx_buffer_pool
version_added: "2.8"
author: "Anas Badaha (@anasb)"
short_description: Configures Buffer Pool
description:
  - This module provides declarative management of Onyx Buffer Pool configuration
    on Mellanox ONYX network devices.
notes:
  - Tested on ONYX 3.6.8130
options:
  name:
    description:
      - pool name.
    required: true
  pool_type:
    description:
      - pool type.
    choices: ['lossless', 'lossy']
    default: lossy
  memory_percent:
    description:
      - memory percent.
  switch_priority:
    description:
      - switch priority, range 1-7.
s�
- name: configure buffer pool
  onyx_buffer_pool:
    name: roce
    pool_type: lossless
    memory_percent: 50.00
    switch_priority: 3

s
commands:
  description: The list of configuration mode commands to send to the device.
  returned: always
  type: list
  sample:
    - traffic pool roce type lossless
    - traffic pool roce memory percent 50.00
    - traffic pool roce map switch-priority 3
(t
AnsibleModule(tshow_cmd(tBaseOnyxModuletOnyxBufferPoolModulecB`sPeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(cC`s�tdtdddt�dtdddgd	d�d
tdd�dtdd
��}t�}|j|�td|dt�|_dS(s initialize module
        tnamettypetstrtrequiredt	pool_typetchoicestlosslesstlossytdefaulttmemory_percenttfloattswitch_prioritytintt
argument_spectsupports_check_modeN(tdicttTruetupdateRt_module(tselftelement_specR((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.pytinit_moduleFs	
cC`s/|jj}t|�|_|j|j�dS(N(RtparamsRt_required_configtvalidate_param_values(Rt
module_params((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.pytget_required_configUscC`sC|r?dt|�ko#dknr?|jjdd�ndS(Niitmsgs-switch_priority value must be between 0 and 7(RRt	fail_json(Rtvalue((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.pytvalidate_switch_priorityZs)cC`s�|dkrdS|j|jjd��}|djd�|jd<t|djd��|jd<t|djd��|jd<dS(	NRitTypeRsSwitch PrioritiesRs
Memory [%]R(tNonetgetR#t_current_configRR(Rttraffic_pool_config((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.pyt_set_traffic_pool_config^s cC`s7dj|jjd��}t|j|dtdt�S(Nsshow traffic pool {0}Rtjson_fmtt
fail_on_error(tformatR#R-R	RRtFalse(Rtcmd((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.pyt_show_traffic_poolfscC`s)t�|_|j�}|j|�dS(N(RR.R6R0(RR/((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.pytload_current_configjscC`sO|jjd�}|jjd�}|jdkrF|j||�n1|jjd�}||krw|j||�n|jjd�}|dk	r�|jjd�}|dks�||kr�|jjdj||��q�n|jjd�}|dk	rK|jjd�}|dks)||krK|jjdj||��qKndS(NRRRs#traffic pool {0} memory percent {1}Rs(traffic pool {0} map switch-priority {1}(R#R-R.R,t_add_add_traffic_pool_cmdst	_commandstappendR3(RRRtcurrent_pool_typeRtcurr_memory_percentRtcurr_switch_priority((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.pytgenerate_commandsos""cC`s |jjdj||��dS(Nstraffic pool {0} type {1}(R9R:R3(RRR((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.pyR8�s(
t__name__t
__module__R!R&R*R0R6R7R>R8(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.pyRDs							cC`stj�dS(s+ main entry point for module execution
    N(Rtmain(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.pyRA�st__main__N(t
__future__RRRR
t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt&ansible.module_utils.network.onyx.onyxR	R
RRAR?(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.pyt<module>s



F	

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]