Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/storage/purestorage/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_snmp.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZd
�Zd�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_byse
---
module: purefa_snmp
version_added: '2.9'
short_description: Configure FlashArray SNMP Managers
description:
- Manage SNMP managers on a Pure Storage FlashArray.
- Changing of a named SNMP managers version is not supported.
- This module is not idempotent and will always modify an
  existing SNMP manager due to hidden parameters that cannot
  be compared to the play parameters.
author:
- Pure Storage Ansible Team (@sdodsley) <[email protected]>
options:
  name:
    description:
    - Name of SNMP Manager
    required: True
    type: str
  state:
    description:
    - Create or delete SNMP manager
    type: str
    default: present
    choices: [ absent, present ]
  auth_passphrase:
    type: str
    description:
    - SNMPv3 only. Passphrase of 8 - 32 characters.
  auth_protocol:
    type: str
    description:
    - SNMP v3 only. Hash algorithm to use
    choices: [ MD5, SHA ]
  community:
    type: str
    description:
    - SNMP v2c only. Manager community ID. Between 1 and 32 characters long.
  host:
    type: str
    description:
    - IPv4 or IPv6 address or FQDN to send trap messages to.
  user:
    type: str
    description:
    - SNMP v3 only. User ID recognized by the specified SNMP manager.
      Must be between 1 and 32 characters.
  version:
    type: str
    description:
    - Version of SNMP protocol to use for the manager.
    choices: [ v2c, v3 ]
    default: v2c
  notification:
    type: str
    description:
    - Action to perform on event.
    default: trap
    choices: [ inform, trap ]
  privacy_passphrase:
    type: str
    description:
    - SNMPv3 only. Passphrase to encrypt SNMP messages.
      Must be between 8 and 63 non-space ASCII characters.
  privacy_protocol:
    type: str
    description:
    - SNMP v3 only. Encryption protocol to use
    choices: [ AES, DES ]
extends_documentation_fragment:
- purestorage.fa
s�
- name: Delete existing SNMP manager
  purefa_snmp:
    name: manager1
    state: absent
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Create v2c SNMP manager
  purefa_snmp:
    name: manager1
    community: public
    host: 10.21.22.23
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Create v3 SNMP manager
  purefa_snmp:
    name: manager2
    version: v3
    auth_protocol: MD5
    auth_passphrase: password
    host: 10.21.22.23
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Update existing SNMP manager
  purefa_snmp:
    name: manager1
    community: private
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
t
(t
AnsibleModule(t
get_systemtpurefa_argument_speccC`s
t}|js�y|j|jd�}Wn1tk
r\|jddj|jd��nX|d|jdkr�|jdd�q�|jddkry?|j|jdd|jdd|jdd	|jd	�Wq�tk
r|jdd
j|jd��q�Xq�|jdr�|jdr�ys|j|jdd
|jd
d|jdd|jdd|jdd|jdd|jdd	|jd	�Wq�tk
r�|jdd
j|jd��q�Xq�|jdr�|jdr�yf|j|jdd|jdd
|jd
d|jdd|jdd|jdd	|jd	�Wq�tk
r�|jdd
j|jd��q�Xq�|jdrD|jdrDyf|j|jdd|jdd|jdd|jdd|jdd|jdd	|jd	�Wq�tk
r@|jdd
j|jd��q�Xq�|jdr�|jdr�yL|j|jdd|jdd|jdd|jdd	|jd	�Wq�tk
r�|jdd
j|jd��q�Xq�|jdd�n|jd|�dS(sUpdate SNMP Managertnametmsgs9Failed to get current configuration for SNMP manager {0}.tversions3Changing an SNMP managers version is not supported.tv2cRtnotificationthosts"Failed to update SNMP manager {0}.t
auth_protocoltprivacy_protocoltauth_passphrasetprivacy_passphrasetusersKInvalid parameters selected in update. Please raise issue in Ansible GitHubtchangedN(	tTruet
check_modetget_snmp_managertparamst	Exceptiont	fail_jsontformattset_snmp_managert	exit_json(tmoduletarrayRtmgr((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_snmp.pytupdate_manager�sz	
$


'






'





'





'



'cC`srt}|js^y|j|jd�Wq^tk
rZ|jddj|jd��q^Xn|jd|�dS(sDelete SNMP ManagerRR
sDelete SNMP manager {0} failedRN(RRtdelete_snmp_managerRRRRR (R!R"R((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_snmp.pytdelete_manager�s	
'cC`s�t}|js�|jddkr�yL|j|jdd|jdd|jdd|jdd|jd�Wq�tk
r�|jddj|jd��q�Xq�|jd	rv|jd
rvy�|j|jdd|jdd|jdd	|jd	d|jdd
|jd
d|jdd
|jd
d|jd�Wq�tk
rr|jddj|jd��q�Xq�|jd	r.|jd
r.yf|j|jdd|jdd|jdd	|jd	d|jdd
|jd
d|jd�Wq�tk
r*|jddj|jd��q�Xq�|jd	r�|jd
r�yf|j|jdd|jdd|jdd
|jd
d|jdd
|jd
d|jd�Wq�tk
r�|jddj|jd��q�Xq�|jd	r�|jd
r�yL|j|jdd|jdd|jdd
|jd
d|jd�Wq�tk
r�|jddj|jd��q�Xq�|jdd�n|jd|�dS(sCreate SNMP ManagerRRRRRRR
s"Failed to create SNMP manager {0}.RRRRRsKInvalid parameters selected in create. Please raise issue in Ansible GitHubRN(RRRtcreate_snmp_managerRRRR (R!R"R((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_snmp.pytcreate_manager�sr	



'







'





'





'



'c	C`st�}|jtdtdddt�dtdd�dtddddd	d
dg�dtdd�dtddd	d
dgdd�dtdddt�dtddd	ddg�dtdddt�dtddd	ddg�dtddddd	ddg�dtdd���ddgddgg}ddddggddddggg}t|d|d|dt�}|jd}t|�}t}|j�}xBt	dt
|��D]+}||d|jdkr�t}Pq�q�W|jddkr�|jdrJd t
|jd�ko2d!knrJ|jd"d#�n|jdr�d t
|jd�ko{d$knr�|jd"d%�q�n|d
kr�|r�t||�nU|r�|dkr�t
||�n3|r�|dkr�t||�n|jd&t�dS('NRttypetstrtrequiredRtstatetdefaulttpresenttchoicestabsentRRtinformttrapRtno_logRtMD5tSHARRtAEStDESRRtv3Rtrequired_togethertrequired_iftsupports_check_modeiii R
s1auth_password must be between 8 and 32 charactersi?s4privacy_password must be between 8 and 63 charactersR(RtupdatetdictRR	RR
tFalsetlist_snmp_managerstrangetlenRR&R$R(R (	t
argument_specR9R:R!R,R"tmgr_configuredtmgrsR#((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_snmp.pytmainsR	!!!			
66t__main__N(t
__future__RRRR)t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicR	tansible.module_utils.pureR
RR$R&R(REt__name__(((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_snmp.pyt<module>s


I"	I		D	1

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