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/_sf_snapshot_schedule_manager.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddljjZej�Zdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiont
deprecatedtstatust	communitytsupported_byss

module: sf_snapshot_schedule_manager
deprecated:
  removed_in: "2.11"
  why: This Module has been replaced
  alternative: please use M(na_elementsw_snapshot_schedule)
short_description: Manage SolidFire snapshot schedules
extends_documentation_fragment:
    - netapp.solidfire
version_added: '2.3'
author: Sumit Kumar (@timuster) <[email protected]>
description:
- Create, destroy, or update accounts on SolidFire

options:

    state:
        description:
        - Whether the specified schedule should exist or not.
        required: true
        choices: ['present', 'absent']

    paused:
        description:
        - Pause / Resume a schedule.
        required: false

    recurring:
        description:
        - Should the schedule recur?
        required: false

    time_interval_days:
        description: Time interval in days.
        required: false
        default: 1

    time_interval_hours:
        description: Time interval in hours.
        required: false
        default: 0

    time_interval_minutes:
        description: Time interval in minutes.
        required: false
        default: 0

    name:
        description:
        - Name for the snapshot schedule.
        required: true

    snapshot_name:
        description:
        - Name for the created snapshots.
        required: false

    volumes:
        description:
        - Volume IDs that you want to set the snapshot schedule for.
        - At least 1 volume ID is required for creating a new schedule.
        - required when C(state=present)
        required: false

    retention:
        description:
        - Retention period for the snapshot.
        - Format is 'HH:mm:ss'.
        required: false

    schedule_id:
        description:
        - The schedule ID for the schedule that you want to update or delete.
        required: false

    starting_date:
        description:
        - Starting date for the schedule.
        - Required when C(state=present).
        - Please use two '-' in the above format, or you may see an error- TypeError, is not JSON serializable description.
        - "Format: C(2016--12--01T00:00:00Z)"
        required: false
s�
   - name: Create Snapshot schedule
     sf_snapshot_schedule_manager:
       hostname: "{{ solidfire_hostname }}"
       username: "{{ solidfire_username }}"
       password: "{{ solidfire_password }}"
       state: present
       name: Schedule_A
       time_interval_days: 1
       starting_date: 2016--12--01T00:00:00Z
       volumes: 7

   - name: Update Snapshot schedule
     sf_snapshot_schedule_manager:
       hostname: "{{ solidfire_hostname }}"
       username: "{{ solidfire_username }}"
       password: "{{ solidfire_password }}"
       state: present
       schedule_id: 6
       recurring: True
       snapshot_name: AnsibleSnapshots

   - name: Delete Snapshot schedule
     sf_snapshot_schedule_manager:
       hostname: "{{ solidfire_hostname }}"
       username: "{{ solidfire_username }}"
       password: "{{ solidfire_password }}"
       state: absent
       schedule_id: 6
sn

schedule_id:
    description: Schedule ID of the newly created schedule
    returned: success
    type: str
N(t
AnsibleModule(t	to_nativetSolidFireSnapShotSchedulecB`s>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cC`svtj�|_|jjtdtdtdddg�dtdtdd�d	tdtdd
dd�d
tdtdd
dd�dtdtdd
dd�dtdtdd�dtdtdd�dtdd�dtdtdd�dtdtdd�dtdtdd�dtdd
���td|jdddddgfgdt�|_|jj	}|d|_
|d|_|d	|_|d
|_
|d|_|d|_|d|_|d|_|jdk	r�|jjdd�|_n|d|_|d|_|d|_|d|_d|_ttkrZ|jjdd�ntjd |j�|_dS(!Ntstatetrequiredtchoicestpresenttabsenttnamettypetstrttime_interval_daystinttdefaultittime_interval_hoursittime_interval_minutestpausedtboolt	recurringt
starting_datet
snapshot_nametvolumestlistt	retentiontschedule_idt
argument_spectrequired_iftsupports_check_modes--t-tmsgs)Unable to import the SolidFire Python SDKtmodule(tnetapp_utilstontap_sf_host_argument_specR!tupdatetdicttTruetFalseRR&tparamsRRRRRRRRtNonetreplaceRRRR tcreate_schedule_resultt
HAS_SF_SDKt	fail_jsontcreate_sf_connectiontsfe(tselftp((s`/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_snapshot_schedule_manager.pyt__init__�sJ	











	cC`st|jj�}x^|jD]S}|j|jkr|jdk	rY|j|jkri|Sql|j|_|SqqWdS(N(R4tlist_schedulest	schedulesRR R.(R5t
schedule_listtschedule((s`/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_snapshot_schedule_manager.pytget_schedule�scC`s�y�tj�}tjd|jd|jd|j�|_|j|_tjd|j	d|j
d|j�|_|j
|_
|j|_|j|_|jjd|�|_WnEtk
r�}|jjdd	|jt|�fd
tj��nXdS(Ntdaysthourstminutest
volume_idsRRR;R%sError creating schedule %s: %st	exception(R'tScheduletTimeIntervalFrequencyRRRt	frequencyRtScheduleInfoRRRt
schedule_infoRRRR4tcreate_scheduleR0t	ExceptionR&R2R	t	tracebackt
format_exc(R5tschedte((s`/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_snapshot_schedule_manager.pyRG�s"				%cC`s�yA|jjd|j�}|j}t|_|jjd|�WnEtk
r�}|jj	dd|j
t|�fdtj
��nXdS(NR R;R%sError deleting schedule %s: %sRA(R4R<R R;R+t
to_be_deletedtmodify_scheduleRHR&R2RR	RIRJ(R5tget_schedule_resultRKRL((s`/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_snapshot_schedule_manager.pytdelete_schedule�s		%cC`s�ys|jjd|j�}|j}tjd|jd|jd|j�}|j	j
|j
ks�|j	j|jks�|j	j|jkr�||_	n|j
|_
|jdk	r�|j|j_n|jdk	r�|j|j_n|jdk	r|j|j_n|jdk	r#|j|_n|jdk	rA|j|_n|jdk	r_|j|_n|jjd|�WnEtk
r�}|jjdd|j
t|�fdtj��nXdS(	NR R=R>R?R;R%sError updating schedule %s: %sRA(R4R<R R;R'RCRRRRDR=R>R?RRR.RFR@RRRRRRNRHR&R2R	RIRJ(R5RORKttemp_frequencyRL((s`/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_snapshot_schedule_manager.pytupdate_schedules6		%cC`st}t}t}|j�}|rFt}|jdkrBt}q^|jdkr^|jdk	r�|jj|jkr�t}t}qC|j|jkr�t}t}qC|jdk	r�|jj|jkr�t}t}qC|j	dk	r|jj
|j	krt}t}qC|jdk	r;|j|jkr;t}t}qC|jdk	rk|j|jkrkt}t}qC|j
dk	r�|j
|j
kr�t}t}qC|jdk	s�|jdk	s�|jdk	rCtjd|jd|jd|j�}|jj|jks.|jj|jks.|jj|jkr@t}t}q@qCq^n|jdkr^t}n|r�|jjrsq�|jdkr�|s�|j�q�|r�|j�q�q�|jdkr�|j�q�n|jdk	r�|jjd|d|jj�n|jjd|�dS(NRRR=R>R?tchangedR (R,R<R+RRR.RFRRRR@RRRRRRR'RCRDR=R>R?R&t
check_modeRGRRRPR0t	exit_jsonR (R5RStschedule_existsRRtschedule_detailRQ((s`/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_snapshot_schedule_manager.pytapply/sn	$		$	$	!	!	!			
"(t__name__t
__module__R7R<RGRPRRRX(((s`/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_snapshot_schedule_manager.pyR
�s	?				'cC`st�}|j�dS(N(R
RX(tv((s`/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_snapshot_schedule_manager.pytmains	t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRItansible.module_utils.basicRtansible.module_utils._textR	tansible.module_utils.netapptmodule_utilstnetappR't
has_sf_sdkR1tobjectR
R\RY(((s`/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_snapshot_schedule_manager.pyt<module>s 


V�	

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