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/netapp_e_asup.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlm
Z
dd
lmZddlmZmZddlmZidd6dd6Zdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bysA
---
module: netapp_e_asup
short_description: NetApp E-Series manage auto-support settings
description:
    - Allow the auto-support settings to be configured for an individual E-Series storage-system
version_added: '2.7'
author: Michael Price (@lmprice)
extends_documentation_fragment:
    - netapp.eseries
options:
    state:
        description:
            - Enable/disable the E-Series auto-support configuration.
            - When this option is enabled, configuration, logs, and other support-related information will be relayed
              to NetApp to help better support your system. No personally identifiable information, passwords, etc, will
              be collected.
        default: enabled
        choices:
            - enabled
            - disabled
        aliases:
            - asup
            - auto_support
            - autosupport
    active:
        description:
            - Enable active/proactive monitoring for ASUP. When a problem is detected by our monitoring systems, it's
              possible that the bundle did not contain all of the required information at the time of the event.
              Enabling this option allows NetApp support personnel to manually request transmission or re-transmission
              of support data in order ot resolve the problem.
            - Only applicable if I(state=enabled).
        default: yes
        type: bool
    start:
        description:
            - A start hour may be specified in a range from 0 to 23 hours.
            - ASUP bundles will be sent daily between the provided start and end time (UTC).
            - I(start) must be less than I(end).
        aliases:
            - start_time
        default: 0
    end:
        description:
            - An end hour may be specified in a range from 1 to 24 hours.
            - ASUP bundles will be sent daily between the provided start and end time (UTC).
            - I(start) must be less than I(end).
        aliases:
            - end_time
        default: 24
    days:
        description:
            - A list of days of the week that ASUP bundles will be sent. A larger, weekly bundle will be sent on one
              of the provided days.
        choices:
            - monday
            - tuesday
            - wednesday
            - thursday
            - friday
            - saturday
            - sunday
        required: no
        aliases:
            - days_of_week
            - schedule_days
    verbose:
        description:
            - Provide the full ASUP configuration in the return.
        default: no
        required: no
        type: bool
    log_path:
        description:
            - A local path to a file to be used for debug logging
        required: no
notes:
    - Check mode is supported.
    - Enabling ASUP will allow our support teams to monitor the logs of the storage-system in order to proactively
      respond to issues with the system. It is recommended that all ASUP-related options be enabled, but they may be
      disabled if desired.
    - This API is currently only supported with the Embedded Web Services API v2.0 and higher.
s�
    - name: Enable ASUP and allow pro-active retrieval of bundles
      netapp_e_asup:
        state: enabled
        active: yes
        api_url: "10.1.1.1:8443"
        api_username: "admin"
        api_password: "myPass"

    - name: Set the ASUP schedule to only send bundles from 12 AM CST to 3 AM CST.
      netapp_e_asup:
        start: 17
        end: 20
        api_url: "10.1.1.1:8443"
        api_username: "admin"
        api_password: "myPass"
s�
msg:
    description: Success message
    returned: on success
    type: str
    sample: The settings have been updated.
asup:
    description:
        - True if ASUP is enabled.
    returned: on success
    sample: True
    type: bool
active:
    description:
        - True if the active option has been enabled.
    returned: on success
    sample: True
    type: bool
cfg:
    description:
        - Provide the full ASUP configuration.
    returned: on success when I(verbose=true).
    type: complex
    contains:
        asupEnabled:
            description:
                    - True if ASUP has been enabled.
            type: bool
        onDemandEnabled:
            description:
                    - True if ASUP active monitoring has been enabled.
            type: bool
        daysOfWeek:
            description:
                - The days of the week that ASUP bundles will be sent.
            type: list
N(tpformat(t
AnsibleModule(trequestteseries_host_argument_spec(t	to_nativesapplication/jsonsContent-TypetAccepttAsupcB`sPeZdddddddgZd�Zd�Zd	�Zd
�Zd�ZRS(tsundaytmondayttuesdayt	wednesdaytthursdaytfridaytsaturdaycC`s t�}|jtdtdddtddddd	d
gdddg�d
tdddtdt�dtdddtdddgd|j�dtdddtddddg�dtdddtddddg�dtdddtdt�dtdddt���td|dt�|_|jj}|ddk|_	|d
|_
|d|_|d|_|d|_
|d|_|d|_|d|_td |d!d"|d"d#|d$�|_|jj|_|d}tj|jj�|_|r'tjd%tjd&|d'd(d)d*�n|jjd+�sK|jd+7_n|j|j
krs|jjd,d-�n|jdks�|jd.kr�|jjd,d/�n|jd0|_|j
d1ks�|j
dkr�|jjd,d2�nt|j
d0d3�|_
|js|j|_ndS(4Ntstatettypetstrtrequiredtdefaulttenabledtaliasestasuptauto_supporttautosupporttchoicestdisabledtactivetbooltdaystlistt
schedule_daystdays_of_weektstarttintit
start_timetenditend_timetverbosetlog_patht
argument_spectsupports_check_modetssidtapi_urlturl_passwordtapi_passwordtvalidate_certsturl_usernametapi_usernametleveltfilenametfilemodetwtformatsS%(relativeCreated)dms %(levelname)s %(module)s.%(funcName)s:%(lineno)d
 %(message)st/tmsgsTThe value provided for the start time is invalid. It must be less than the end time.isNThe value provided for the start time is invalid. It must be between 0 and 23.i<isLThe value provided for the end time is invalid. It must be between 1 and 24.i�(RtupdatetdicttFalsetTruetDAYS_OPTIONSR	tmoduletparamsRR"R$R(R+R-R1turltcredst
check_modetloggingt	getLoggert	__class__t__name__t_loggertbasicConfigtDEBUGtendswitht	fail_jsontmin(tselfR/targsR.((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_asup.pyt__init__�sV	'$$








	
	cC`s�y^t|jddt|j�\}}|do9|dsY|jjdd|j�n|SWn9tk
r�}|jjdd|jt|�f�nXdS(Nsdevice-asuptheaderstasupCapabletonDemandCapableR>s4ASUP is not supported on this device. Array Id [%s].sAFailed to retrieve ASUP configuration! Array Id [%s]. Error [%s].(	R
RFtHEADERSRGRDRQR1t	ExceptionR(RStrctresultterr((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_asup.pytget_configuration�s%c
C`sA|j�}t}t�}|jrxtdt�}|dsFt}n|doW|d|jkr�t}|jtd|jd|j��n|jj�|ddj�td|jd|j	d|j
d|j	d	|j
�|d<|j|ddkrt}n|j	|ddks5|j	|ddkr>t}q�|j
|ddksl|j
|dd	kr�t}q�n"|dr�tdt�}t}n|jjt
|��|r=|jr=y>t|jd
ddd
tj|�dt|j�\}}Wq=tk
r9}|jjdd|jt|�f�q=Xn|S(NtasupEnabledtonDemandEnabledtremoteDiagsEnabledtschedulet
daysOfWeektdailyMinTimetdailyMaxTimet
weeklyMinTimet
weeklyMaxTimesdevice-asuptmethodtPOSTtdataRVR>sDWe failed to set the storage-system name! Array Id [%s]. Error [%s].(R^RAR@RRBR"R?R$tsortR(R+RMtinfoRRHR
RFtjsontdumpsRYRGRZRDRQR1R(RStconfigR?tbodyR[R\R]((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_asup.pytupdate_configuration�sH		
	
				.	.
	(cC`s�|j�}|j�}|jrW|jjddd|d|dd|dd|�n-|jjddd|d|dd|d�dS(	NR>s$The ASUP settings have been updated.tchangedRR_R"R`tcfg(RqR^R-RDt	exit_json(RSR?Rs((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_asup.pyR?!s	cO`s|j�dS(N(R?(RSRTtkwargs((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_asup.pyt__call__+s(RLt
__module__RCRUR^RqR?Rv(((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_asup.pyR�s	;		/	
cC`st�}|�dS(N(R(tsettings((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_asup.pytmain/s	t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRmRItpprintRtansible.module_utils.basicR	tansible.module_utils.netappR
Rtansible.module_utils._textRRYtobjectRRyRL(((sP/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_asup.pyt<module>s(


T&
�	

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