Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/storage/netapp/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_port.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddljjZddlmZej�Zdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys
module: na_ontap_net_port
short_description: NetApp ONTAP network ports.
extends_documentation_fragment:
    - netapp.na_ontap
version_added: '2.6'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Modify a ONTAP network port.
options:
  state:
    description:
    - Whether the specified net port should exist or not.
    choices: ['present']
    default: present
  node:
    description:
    - Specifies the name of node.
    required: true
  ports:
    aliases:
    - port
    description:
    - Specifies the name of port(s).
    required: true
  mtu:
    description:
    - Specifies the maximum transmission unit (MTU) reported by the port.
  autonegotiate_admin:
    description:
    - Enables or disables Ethernet auto-negotiation of speed,
      duplex and flow control.
  duplex_admin:
    description:
    - Specifies the user preferred duplex setting of the port.
    - Valid values auto, half, full
  speed_admin:
    description:
    - Specifies the user preferred speed setting of the port.
  flowcontrol_admin:
    description:
    - Specifies the user preferred flow control setting of the port.
  ipspace:
    description:
    - Specifies the port's associated IPspace name.
    - The 'Cluster' ipspace is reserved for cluster ports.
s$
    - name: Modify Net Port
      na_ontap_net_port:
        state: present
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
        hostname: "{{ netapp_hostname }}"
        node: "{{ node_name }}"
        ports: e0d,e0c
        autonegotiate_admin: true
s

N(t
AnsibleModule(t	to_native(tNetAppModuletNetAppOntapNetPortcB`sDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s
        Modify a Net port
    cC`s�tj�|_|jjtdtdtddgdd�dtdtdd�d	tdtdd
ddg�d
tdtdddd�dtdtdddd�dtdtdddd�dtdtdddd�dtdtdddd�dtdtdddd��	�td|jdt�|_	t
�|_|jj|j	j
�|_|j�ttkr�|j	jdd�ntjd|j	�|_dS(s9
            Initialize the Ontap Net Port Class
        tstatetrequiredtchoicestpresenttdefaulttnodettypetstrtportstlisttaliasestporttmtutautonegotiate_admintduplex_admintspeed_admintflowcontrol_admintipspacet
argument_spectsupports_check_modetmsgs(the python NetApp-Lib module is requiredtmoduleN(tnetapp_utilstna_ontap_host_argument_specRtupdatetdicttFalsetTruetNoneRR!R
t	na_helpertset_parameterstparamst
parameterstset_playbook_zapi_key_maptHAS_NETAPP_LIBt	fail_jsontsetup_na_ontap_zapitserver(tself((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_port.pyt__init__\s*	
cC`s:idd6dd6dd6dd6dd	6d
d
6|j_dS(NRs is-administrative-auto-negotiateRsadministrative-duplexRsadministrative-speedRsadministrative-flowcontrolRR(R)tzapi_string_keys(R2((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_port.pyR-|sc
C`s5tjjd�}iii|jdd6|d6d6d6}|j|�ya|jj|t�}|jd�r�t	|j
d��dkr�|dd}t�}ndSWnOtjj
k
r�}|jjd	d
|jdt|�fdtj��nXx3|jjj�D]\}}	|j
|	�||<qW|S(
s�
        Return details about the net port
        :param: port: Name of the port
        :return: Dictionary with current state of the port. None if not found.
        :rtype: dict
        snet-port-get-iterRRs
net-port-infotquerysnum-recordsisattributes-listR s"Error getting net ports for %s: %st	exceptionN(R"tzapit	NaElementR,ttranslate_structR1tinvoke_successfullyR'tget_child_by_nametinttget_child_contentR%R(t
NaApiErrorR!R/R	t	tracebackt
format_excR)R4titems(
R2Rtnet_port_gett
attributestresultt	port_infotport_detailsterrortitem_keytzapi_key((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_port.pytget_net_port�s&
*)cC`s�tjjd�}i|jdd6|d6}xF|D]>}||jjkr4|jjj|�}||||<q4q4W|j|�y|jj	|dt
�WnOtjjk
r�}|jj
dd|jdt|�fdtj��nXdS(	s�
        Modify a port

        :param port: Name of the port
        :param modify: dict with attributes to be modified
        :return: None
        snet-port-modifyRRtenable_tunnelingR s$Error modifying net ports for %s: %sR6N(R"R7R8R,R)R4tgetR9R1R:R'R>R!R/R	R?R@(R2Rtmodifytport_modifytport_attributestkeyRIRG((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_port.pytmodify_net_port�s


)cC`sAtj|j�}tjd|jd|�}tjd|�dS(sM
        AutoSupport log for na_ontap_net_port
        :return: None
        R!tvservertna_ontap_net_portN(R"tget_cserverR1R0R!t
ems_log_event(R2tresultstcserver((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_port.pytautosupport_log�scC`s�|j�xs|jdD]d}|j|�}|jj||j�}|jjr|jjr`q||r||j||�q|qqW|jj	d|jj�dS(s/
        Run Module based on play book
        RtchangedN(
RXR,RJR)tget_modified_attributesRYR!t
check_modeRQt	exit_json(R2RtcurrentRM((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_port.pytapply�s
(	t__name__t
__module__t__doc__R3R-RJRQRXR^(((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_port.pyRWs	 	
	!			cC`st�}|j�dS(s?
    Create the NetApp Ontap Net Port Object and modify it
    N(RR^(tobj((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_port.pytmain�s	t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR?tansible.module_utils.basicRtansible.module_utils._textR	tansible.module_utils.netapptmodule_utilstnetappR"t"ansible.module_utils.netapp_moduleR
thas_netapp_libR.tobjectRRcR_(((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_port.pyt<module>s"


0�	

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