Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/netvisor/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_cpu_class.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZdd
lmZd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bysI
---
module: pn_cpu_class
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.8"
short_description: CLI command to create/modify/delete cpu-class
description:
  - This module can be used to create, modify and delete CPU class information.
options:
  pn_cliswitch:
    description:
      - Target switch to run the CLI on.
    required: False
    type: str
  state:
    description:
      - State the action to perform. Use C(present) to create cpu-class and
        C(absent) to delete cpu-class C(update) to modify the cpu-class.
    required: True
    type: str
    choices: ['present', 'absent', 'update']
  pn_scope:
    description:
      - scope for CPU class.
    required: false
    choices: ['local', 'fabric']
  pn_hog_protect:
    description:
      - enable host-based hog protection.
    required: False
    type: str
    choices: ['disable', 'enable', 'enable-and-drop']
  pn_rate_limit:
    description:
      - rate-limit for CPU class.
    required: False
    type: str
  pn_name:
    description:
      - name for the CPU class.
    required: False
    type: str
s�
- name: create cpu class
  pn_cpu_class:
    pn_cliswitch: 'sw01'
    state: 'present'
    pn_name: 'icmp'
    pn_rate_limit: '1000'
    pn_scope: 'local'

- name: delete cpu class
  pn_cpu_class:
    pn_cliswitch: 'sw01'
    state: 'absent'
    pn_name: 'icmp'


- name: modify cpu class
  pn_cpu_class:
    pn_cliswitch: 'sw01'
    state: 'update'
    pn_name: 'icmp'
    pn_rate_limit: '2000'
s�
command:
  description: the CLI command run on the target node.
  returned: always
  type: str
stdout:
  description: set of responses from the cpu-class command.
  returned: always
  type: list
stderr:
  description: set of error responses from the cpu-class command.
  returned: on error
  type: list
changed:
  description: indicates whether the CLI caused changes on the target.
  returned: always
  type: bool
(t
AnsibleModule(tpn_clitrun_cli(trun_commandscC`s�|jd}|}|d7}t||�d}|j�}d|kra|jdtdd�n|}|d7}t||�d}|r�|j�}n||kr�tStS(	s�
    This method checks for idempotency using the cpu-class-show command.
    If a user with given name exists, return True else False.
    :param module: The Ansible module to fetch input parameters
    :param cli: The CLI string
    tpn_names= system-settings-show format cpu-class-enable no-show-headersitontfailedtmsgs,Enable CPU class before creating or deletings+ cpu-class-show format name no-show-headers(tparamsRtsplitt	fail_jsontTruetFalse(tmoduletclitnametclicopytout((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_cpu_class.pyt	check_clijs

	

cC`s�tdddddd�}tdtdtd	td
d�dtd	td
dd
|j��dtd	td
dd
ddg�dtd	td
dd
dddg�dtd	td
d�dtd	td
d��ddddddggdddggdddggf�}|jd}|jd}|jd}|jd}|jd}|jd}||}t||�}	t||	�}
|	d||f7}	|dkr�|
tkr�|jdtdd|�q�n|dkr|
tkr|j	dtdd|�qn|dkrT|
tkr:|j	dtdd|�n|rT|	d|7}	qTn|dkr�|rw|	d|7}	n|r�|	d |7}	q�nt
||	|�d!S("s' This section is for arguments parsing tpresentscpu-class-createtabsentscpu-class-deletetupdatescpu-class-modifyt
argument_spectpn_cliswitchtrequiredttypetstrtstatetchoicestpn_scopetlocaltfabrictpn_hog_protecttdisabletenablesenable-and-dropt
pn_rate_limitRtrequired_ifs %s name %s RRs%cpu class with name %s does not existtskippeds%cpu class with name %s already existss
 scope %s s hog-protect %s s rate-limit %s N(tdictRRRtkeysRR	RRt	exit_jsonR
(t	state_mapRt	cliswitchR#tscopethog_protectt
rate_limitRtcommandRtNAME_EXISTS((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_cpu_class.pytmain�sh	






			t__main__N(t
__future__RRRR!t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt-ansible.module_utils.network.netvisor.pn_nvosR	R
t.ansible.module_utils.network.netvisor.netvisorRRR8t__name__(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_cpu_class.pyt<module>s


-		M

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