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_snmp.pyo

�
�Udac@`s�dZddlmZmZmZeZidd6dgd6dd6Zd	Zd
Z	dZ
ddlmZdd
l
mZddljjZej�Zdefd��YZd�Zedkr�e�ndS(s3
create SNMP module to add/delete/modify SNMP user
i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
  - "Create/Delete SNMP community"
extends_documentation_fragment:
  - netapp.na_ontap
module: na_ontap_snmp
options:
  access_control:
    description:
      - "Access control for the community. The only supported value is 'ro' (read-only)"
    required: true
  community_name:
    description:
      - "The name of the SNMP community to manage."
    required: true
  state:
    choices: ['present', 'absent']
    description:
      - "Whether the specified SNMP community should exist or not."
    default: 'present'
short_description: NetApp ONTAP SNMP community
version_added: "2.6"
s
    - name: Create SNMP community
      na_ontap_snmp:
        state: present
        community_name: communityName
        access_control: 'ro'
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
    - name: Delete SNMP community
      na_ontap_snmp:
        state: absent
        community_name: communityName
        access_control: 'ro'
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
t
(t
AnsibleModule(t	to_nativeNtNetAppONTAPSnmpcB`s;eZdZd�Zd�Zd�Zd�Zd�ZRS(s3Class with SNMP methods, doesn't support check modecC`s�tj�|_|jjtdtdtdddddgdd�d	tdtdd�d
tdtdd���td|jdt�|_|jj	}|d|_
|d	|_|d
|_t
tkr�|jjd
d�ntjd|j�|_dS(Ntstatetrequiredttypetstrtchoicestpresenttabsenttdefaulttcommunity_nametaccess_controlt
argument_spectsupports_check_modetmsgs(the python NetApp-Lib module is requiredtmodule(tnetapp_utilstna_ontap_host_argument_specRtupdatetdicttFalsetTrueR	RtparamsRRRtHAS_NETAPP_LIBt	fail_jsontsetup_na_ontap_zapitserver(tselft
parameters((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_snmp.pyt__init__Is'	


cC`setjjj|i|jd6|jd6�}y|jj|dt�Wntjj	k
r`t
SXtS(s�
        Invoke zapi - add/delete take the same NaElement structure
        @return: SUCCESS / FAILURE with an error_message
        t	communitysaccess-controltenable_tunneling(Rtzapit	NaElementtcreate_node_with_childrenRRR$tinvoke_successfullyRt
NaApiErrorR(R%R*tsnmp_community((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_snmp.pytinvoke_snmp_communitybscC`s
|jd�S(s'
        Adds a SNMP community
        ssnmp-community-add(R0(R%((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_snmp.pytadd_snmp_communitypscC`s
|jd�S(s)
        Delete a SNMP community
        ssnmp-community-delete(R0(R%((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_snmp.pytdelete_snmp_communityvscC`s�t}tj|j�}tjd|jd|�}tjd|�|jdkrj|j�r�t	}q�n'|jdkr�|j
�r�t	}q�n|jjd|�dS(s�
        Apply action to SNMP community
        This module is not idempotent:
        Add doesn't fail the playbook if user is trying
        to add an already existing snmp community
        Rtvservert
na_ontap_snmpRRtchangedN(RRtget_cserverR$R#Rt
ems_log_eventRR1RR2t	exit_json(R%R5tresultstcserver((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_snmp.pytapply|s(t__name__t
__module__t__doc__R'R0R1R2R;(((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_snmp.pyRFs				cC`st�}|j�dS(sExecute actionN(RR;(t
community_obj((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_snmp.pytmain�s	t__main__(R>t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicR	tansible.module_utils._textR
tansible.module_utils.netapptmodule_utilstnetappRthas_netapp_libR!tobjectRR@R<(((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_snmp.pyt<module>s 


K	

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