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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
dd
lmZde
fd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys� 
---
module: netapp_e_volume
version_added: "2.2"
short_description: NetApp E-Series manage storage volumes (standard and thin)
description:
    - Create or remove volumes (standard and thin) for NetApp E/EF-series storage arrays.
author:
    - Kevin Hulquest (@hulquest)
    - Nathan Swartz (@ndswartz)
extends_documentation_fragment:
    - netapp.eseries
options:
    state:
        description:
            - Whether the specified volume should exist
        required: true
        choices: ['present', 'absent']
    name:
        description:
            - The name of the volume to manage.
        required: true
    storage_pool_name:
        description:
            - Required only when requested I(state=='present').
            - Name of the storage pool wherein the volume should reside.
        required: false
    size_unit:
        description:
            - The unit used to interpret the size parameter
        choices: ['bytes', 'b', 'kb', 'mb', 'gb', 'tb', 'pb', 'eb', 'zb', 'yb']
        default: 'gb'
    size:
        description:
            - Required only when I(state=='present').
            - Size of the volume in I(size_unit).
            - Size of the virtual volume in the case of a thin volume in I(size_unit).
            - Maximum virtual volume size of a thin provisioned volume is 256tb; however other OS-level restrictions may
              exist.
        required: true
    segment_size_kb:
        description:
            - Segment size of the volume
            - All values are in kibibytes.
            - Some common choices include '8', '16', '32', '64', '128', '256', and '512' but options are system
              dependent.
            - Retrieve the definitive system list from M(netapp_e_facts) under segment_sizes.
            - When the storage pool is a raidDiskPool then the segment size must be 128kb.
            - Segment size migrations are not allowed in this module
        default: '128'
    thin_provision:
        description:
            - Whether the volume should be thin provisioned.
            - Thin volumes can only be created when I(raid_level=="raidDiskPool").
            - Generally, use of thin-provisioning is not recommended due to performance impacts.
        type: bool
        default: false
    thin_volume_repo_size:
        description:
            - This value (in size_unit) sets the allocated space for the thin provisioned repository.
            - Initial value must between or equal to 4gb and 256gb in increments of 4gb.
            - During expansion operations the increase must be between or equal to 4gb and 256gb in increments of 4gb.
            - This option has no effect during expansion if I(thin_volume_expansion_policy=="automatic").
            - Generally speaking you should almost always use I(thin_volume_expansion_policy=="automatic).
        required: false
    thin_volume_max_repo_size:
        description:
            - This is the maximum amount the thin volume repository will be allowed to grow.
            - Only has significance when I(thin_volume_expansion_policy=="automatic").
            - When the percentage I(thin_volume_repo_size) of I(thin_volume_max_repo_size) exceeds
              I(thin_volume_growth_alert_threshold) then a warning will be issued and the storage array will execute
              the I(thin_volume_expansion_policy) policy.
            - Expansion operations when I(thin_volume_expansion_policy=="automatic") will increase the maximum
              repository size.
        default: same as size (in size_unit)
    thin_volume_expansion_policy:
        description:
            - This is the thin volume expansion policy.
            - When I(thin_volume_expansion_policy=="automatic") and I(thin_volume_growth_alert_threshold) is exceed the
              I(thin_volume_max_repo_size) will be automatically expanded.
            - When I(thin_volume_expansion_policy=="manual") and I(thin_volume_growth_alert_threshold) is exceeded the
              storage system will wait for manual intervention.
            - The thin volume_expansion policy can not be modified on existing thin volumes in this module.
            - Generally speaking you should almost always use I(thin_volume_expansion_policy=="automatic).
        choices: ["automatic", "manual"]
        default: "automatic"
        version_added: 2.8
    thin_volume_growth_alert_threshold:
        description:
            - This is the thin provision repository utilization threshold (in percent).
            - When the percentage of used storage of the maximum repository size exceeds this value then a alert will
              be issued and the I(thin_volume_expansion_policy) will be executed.
            - Values must be between or equal to 10 and 99.
        default: 95
        version_added: 2.8
    owning_controller:
        description:
            - Specifies which controller will be the primary owner of the volume
            - Not specifying will allow the controller to choose ownership.
        required: false
        choices: ["A", "B"]
        version_added: 2.9
    ssd_cache_enabled:
        description:
            - Whether an existing SSD cache should be enabled on the volume (fails if no SSD cache defined)
            - The default value is to ignore existing SSD cache setting.
        type: bool
        default: false
    data_assurance_enabled:
        description:
            - Determines whether data assurance (DA) should be enabled for the volume
            - Only available when creating a new volume and on a storage pool with drives supporting the DA capability.
        type: bool
        default: false
    read_cache_enable:
        description:
            - Indicates whether read caching should be enabled for the volume.
        type: bool
        default: true
        version_added: 2.8
    read_ahead_enable:
        description:
            - Indicates whether or not automatic cache read-ahead is enabled.
            - This option has no effect on thinly provisioned volumes since the architecture for thin volumes cannot
              benefit from read ahead caching.
        type: bool
        default: true
        version_added: 2.8
    write_cache_enable:
        description:
            - Indicates whether write-back caching should be enabled for the volume.
        type: bool
        default: true
        version_added: 2.8
    cache_without_batteries:
        description:
            - Indicates whether caching should be used without battery backup.
            - Warning, M(cache_without_batteries==true) and the storage system looses power and there is no battery backup, data will be lost!
        type: bool
        default: false
        version_added: 2.9
    workload_name:
        description:
            - Label for the workload defined by the metadata.
            - When I(workload_name) and I(metadata) are specified then the defined workload will be added to the storage
              array.
            - When I(workload_name) exists on the storage array but the metadata is different then the workload
              definition will be updated. (Changes will update all associated volumes!)
            - Existing workloads can be retrieved using M(netapp_e_facts).
        required: false
        version_added: 2.8
    metadata:
        description:
            - Dictionary containing meta data for the use, user, location, etc of the volume (dictionary is arbitrarily
              defined for whatever the user deems useful)
            - When I(workload_name) exists on the storage array but the metadata is different then the workload
              definition will be updated. (Changes will update all associated volumes!)
            - I(workload_name) must be specified when I(metadata) are defined.
        type: dict
        required: false
        version_added: 2.8
    wait_for_initialization:
        description:
            - Forces the module to wait for expansion operations to complete before continuing.
        type: bool
        default: false
        version_added: 2.8
    initialization_timeout:
        description:
            - Duration in seconds before the wait_for_initialization operation will terminate.
            - M(wait_for_initialization==True) to have any effect on module's operations.
        type: int
        required: false
        version_added: 2.9
sh
- name: Create simple volume with workload tags (volume meta data)
  netapp_e_volume:
    ssid: "{{ ssid }}"
    api_url: "{{ netapp_api_url }}"
    api_username: "{{ netapp_api_username }}"
    api_password: "{{ netapp_api_password }}"
    validate_certs: "{{ netapp_api_validate_certs }}"
    state: present
    name: volume
    storage_pool_name: storage_pool
    size: 300
    size_unit: gb
    workload_name: volume_tag
    metadata:
      key1: value1
      key2: value2
- name: Create a thin volume
  netapp_e_volume:
    ssid: "{{ ssid }}"
    api_url: "{{ netapp_api_url }}"
    api_username: "{{ netapp_api_username }}"
    api_password: "{{ netapp_api_password }}"
    validate_certs: "{{ netapp_api_validate_certs }}"
    state: present
    name: volume1
    storage_pool_name: storage_pool
    size: 131072
    size_unit: gb
    thin_provision: true
    thin_volume_repo_size: 32
    thin_volume_max_repo_size: 1024
- name: Expand thin volume's virtual size
  netapp_e_volume:
    ssid: "{{ ssid }}"
    api_url: "{{ netapp_api_url }}"
    api_username: "{{ netapp_api_username }}"
    api_password: "{{ netapp_api_password }}"
    validate_certs: "{{ netapp_api_validate_certs }}"
    state: present
    name: volume1
    storage_pool_name: storage_pool
    size: 262144
    size_unit: gb
    thin_provision: true
    thin_volume_repo_size: 32
    thin_volume_max_repo_size: 1024
- name: Expand thin volume's maximum repository size
  netapp_e_volume:
    ssid: "{{ ssid }}"
    api_url: "{{ netapp_api_url }}"
    api_username: "{{ netapp_api_username }}"
    api_password: "{{ netapp_api_password }}"
    validate_certs: "{{ netapp_api_validate_certs }}"
    state: present
    name: volume1
    storage_pool_name: storage_pool
    size: 262144
    size_unit: gb
    thin_provision: true
    thin_volume_repo_size: 32
    thin_volume_max_repo_size: 2048
- name: Delete volume
  netapp_e_volume:
    ssid: "{{ ssid }}"
    api_url: "{{ netapp_api_url }}"
    api_username: "{{ netapp_api_username }}"
    api_password: "{{ netapp_api_password }}"
    validate_certs: "{{ netapp_api_validate_certs }}"
    state: absent
    name: volume
s�
msg:
    description: State of volume
    type: str
    returned: always
    sample: "Standard volume [workload_vol_1] has been created."
(tsleep(tNetAppESeriesModule(t	to_nativetNetAppESeriesVolumecB`s�eZdZd�Zd�Zd�Zedd�Zdd�Zd�Z	d�Z
ed	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�ZRS(i,c1C`s�tdtdtdddg�dtdtdd�d	tdd�d
tdddd
dddddddddg
dd�dtdd�dtdddd�dtdtdddg�dtdddt�d tdddt�d!tdddt�d"tdd�d#tdd�d$tdddd%d&g�d'tdddd(�d)tdddt�d*tdddt�d+tdddt�d,tdddt�d-tdddt�d.tdd/dt�d0tdddt�d1tdddt��}ddd	dggd!d2d"ggg}tt|�jd3|d4d5d6td7|�|jj}|d|_|d|_	|d	|_
|d
|_|d|_|dr�|j
|d�|_nd|_|dr�|ddkr�d8nd9|_n|d)|_|d*|_|d+|_|d|_|d,|_|d |_|d!|_|d$|_t|d'�|_d|_d|_|d"r�|j
|d"�|_n|d#r�|j
|d#�|_n|d-|_|d.|_|d0|_|d1|_ g}|jrq|js(|jj!d:d;|j"�nx:|jj#�D])}|j$td<|d=|j|��q8W||_n|jrc|js�|j|_n|js�d%|_n|jd>dGkr�|jj!d:dA|jdH�n|jr|jr|j|jkr|jj!d:dC|j"�n|jdDks:|jdEkrc|jj!d:dF|j|j"f�qcnd|_%d|_&d|_'dS(INtstatetrequiredtchoicestpresenttabsenttnamettypetstrtstorage_pool_namet	size_unittdefaulttgbtbytestbtkbtmbttbtpbtebtzbtybtsizetfloattsegment_size_kbtinti�towning_controllertAtBtssd_cache_enabledtbooltdata_assurance_enabledtthin_provisiontthin_volume_repo_sizetthin_volume_max_repo_sizetthin_volume_expansion_policyt	automatictmanualt"thin_volume_growth_alert_thresholdi_tread_cache_enabletread_ahead_enabletwrite_cache_enabletcache_without_batteriest
workload_nametmetadatatdicttwait_for_initializationtinitialization_timeoutttruetansible_optionstweb_services_versions02.00.0000.0000tsupports_check_modetrequired_ift070000000000000000000001t070000000000000000000002tmsgsXWhen metadata is specified then the name for the workload must be specified. Array [%s].tkeytvalueiiisZThin provisioned volumes must be less than or equal to 256tb is size. Attempted size [%sg]isdThe initial size of the thin volume must not be larger than the maximum repository size. Array [%s].i
ics}thin_volume_growth_alert_threshold must be between or equal to 10 and 99.thin_volume_growth_alert_threshold [%s]. Array [%s].Ii@((R8tTruetFalsetsuperRt__init__tmoduletparamsRRRRR#tconvert_to_aligned_bytestsize_btNonetowning_controller_idR2R3R4R(R5R*R+R.R$R1tthin_volume_repo_size_btthin_volume_max_repo_size_bR6R7R9R:t	fail_jsontssidtkeystappendt
volume_detailtpool_detailtworkload_id(tselfR<R?targsR7RC((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pyRHs�0	





	
"







		





		'					cC`sLt||j|j�}t|j|jd�}t||�}||S(sHConvert size to the truncated byte size that aligns on the segment size.R(R$t
SIZE_UNIT_MAPRR#(RXR!t
size_bytestsegment_size_bytest
segment_count((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pyRK�scC`st�}t�}y |jd|j�\}}Wn9tk
rm}|jjdd|jt|�f�nXy |jd|j�\}}Wn9tk
r�}|jjdd|jt|�f�nXg||D]}|d|jkr�|^q�}|r|dSt�S(s+Retrieve volume details from storage array.sstorage-systems/%s/volumesRBsBFailed to obtain list of thick volumes.  Array Id [%s]. Error[%s].sstorage-systems/%s/thin-volumessAFailed to obtain list of thin volumes.  Array Id [%s]. Error[%s].Ri(	tlisttrequestRRt	ExceptionRIRQR
RR8(RXtvolumestthin_volumestrcterrtvolumeRU((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pyt
get_volume�s		  0icC`sc|dkr2|jjdd|j|jf�n|j�s_td�|jd|d�ndS(skWaits until volume becomes available.

        :raises AnsibleFailJson when retries are exhausted.
        iRBsDTimed out waiting for the volume %s to become available. Array [%s].itretriesiN(RIRQRRRRfRtwait_for_volume_availability(RXRg((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pyRh�s
c		C`s�d}d}x�|dkr�td�y�|jd|j�\}}d}x�|dD]�}|ddk	rUx�|j�D]�}||dk	rxd||krx||d|jdks�d	|jkrx||d|jd	krx|d}|d
d}qxqxWqUqUWWn?tk
rK}|jjdd
|j	|jt
|�f�nX|dk	r�|dkr�|jjd|||jf�|jjdd||jf�n|r�|d8}q�n|jjd||f�qW|jjd�dS(s�Waits until volume action is complete is complete.
        :param: int timeout: Wait duration measured in seconds. Waits indefinitely when None.
        tunknowntcompleteis1storage-systems/%s/symbol/getLongLivedOpsProgresstlongLivedOpsProgresst	volActiont	volumeReftidtstorageVolumeReftinittpercentCompleteRBsOFailed to get volume expansion progress. Volume [%s]. Array Id [%s]. Error[%s].isfExpansion action, %s, failed to complete during the allotted time. Time remaining [%s]. Array Id [%s].sHExpansion action failed to complete. Time remaining [%s]. Array Id [%s].s%Expansion action, %s, is %s complete.sExpansion action is complete.N(
RMRR_RRRSRUR`RIRQRR
twarntlog(	RXttimeouttactiontpercent_completeRct
operationst	operationRCRd((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pytwait_for_volume_action�s6
 *
 !#cC`s�t�}y |jd|j�\}}Wn9tk
rd}|jjdd|jt|�f�nXg|D]}|d|jkrl|^ql}|r�|dSt�S(s5Retrieve storage pool details from the storage array.s storage-systems/%s/storage-poolsRBsBFailed to obtain list of storage pools.  Array Id [%s]. Error[%s].Ri(	R^R_RRR`RIRQR
RR8(RXt
storage_poolsRcRdtstorage_poolRV((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pytget_storage_pool�s	 ,cC`sI|js&|jjdd|j�n|js�|jr\|jdr\|jjdd�n|jr�|jddo�|jdddkr�|jjdd	|j�nt|jd
�|j	krE|jrE|jjdd|j�qEnTt|jd
�t|jd�|j	krE|jrE|jjdd|j�nd
S(sTPerform a series of checks as to the sufficiency of the storage pool for the volume.RBs%Requested storage pool (%s) not foundtdiskPools@Thin provisioned volumes can only be created on raid disk pools.t!protectionInformationCapabilitiestprotectionInformationCapabletprotectionTypettype2ProtectionsNData Assurance (DA) requires the storage pool to be DA-compatible. Array [%s].t	freeSpacesPNot enough storage pool free space available for the volume's needs. Array [%s].ttotalSizeInBytesN(
RVRIRQRRUR+R*RRR$RL(RX((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pytcheck_storage_pool_sufficiency�s"			&-
cC`s�t}d}d}d}|jr�y |jd|j�\}}Wn-tk
rp}|jjdd|j�nXg|D]u}|dD]d}	|	ddkr�d|	dkr�t|	d�j	dd	�j
�r�t|	dj	dd	��^q�qx}
d
}|
rt|
�d
}nd|}t
d|jd|d
ddt�}x�|D]r}|d|jkrG|d|_|jszPntd�|jD��}td�|dD��}
||
kr�|jjd�t}n|r�|r�|jjt
ddd|��|jt
dtdtdtd|j��y6|jd|j|dfd|dd�\}}Wn9tk
r�}|jjdd|jt|�f�nX|jjd|j�nPqGqGWt}|jjd�|r�|r�|jr|jjt
ddd|��nt
ddd|�g|_|jt
dtdtdtd|j��y9|jd|jddd|�\}}|d|_Wq�tk
r�}|jjdd|jt|�f�q�Xn|jjd|j�n|S(sCheck the status of the workload tag and update storage array definitions if necessary.

        When the workload attributes are not provided but an existing workload tag name is, then the attributes will be
        used.

        :return bool: Whether changes were required to be made.sstorage-systems/%s/workloadsRBs:Failed to retrieve storage array workload tags. Array [%s]tworkloadAttributesRCt	profileIdtansible_workload_RDtisansible_workload_%dRtworkloadInstanceIndextisValidRncs`s'|]}tt|j���VqdS(N(ttupletsortedtitems(t.0tattr((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pys	<genexpr>scs`s7|]-}|ddkrtt|j���VqdS(RCR�N(R�R�R�(R�R�((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pys	<genexpr>ss Workload tag change is required!tisNewWorkloadInstancetisWorkloadDataInitializedtisWorkloadCardDataToBeResetsstorage-systems/%s/workloads/%stdatatmethodtPOSTs9Failed to create new workload tag. Array [%s]. Error [%s]s"Workload tag [%s] required change.s"Workload tag creation is required!sWorkload tag [%s] was added.N(RFRMR6R_RRR`RIRQRtreplacetisdigitR$tmaxR8RERWR7tsetRsRTtupdateR
(RXt
check_modetchange_requiredt
workload_tagstrequest_bodytansible_profile_idRcterrorttagtpairtcurrent_tag_index_listt	tag_indextmetadata_setttag_settresp((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pytupdate_workload_tags�s�	  G
	

			


	"
cC`s�t}td|jdgdtd|jd|j��}|jdt|jd�krz|jj	dd	|jd�n|j|jddks�|j|jddks�|j|jd
kr�t
}n|jr|j|jdkrt
}|jtd|j��n|j
r�|jtdtd
dd|j�td
ddd�g��idd
6|jd6|jdkr�t
}q�n|jdr�t
}n|jr|jt|jd�kr�t
}|jtd|j��n|j|jdkr�t
}|jtd|j��q�n�|jt|jdd�dkkrht
}|djtd|j��n|j|jddkr�t
}|djtd|j��n|r�|St�S(sRetrieve the volume update request body when change(s) are required.

        :raise AnsibleFailJson when attempting to change segment size on existing volume.
        :return dict: request body when change(s) to a volume's properties are required.
        t
flashCachetmetaTagst
cacheSettingstreadCacheEnabletwriteCacheEnableitsegmentSizeRBs:Existing volume segment size is %s and cannot be modified.tflashCachedtpreferredManagertowningControllerIdRCt
workloadIdRDtvolumeTypeIdReR7tgrowthAlertThresholdtexpansionPolicytreadAheadMultiplieritreadAheadEnabletcwobtcacheWithoutBatteries(RFR8R(R2R4R#R$RURIRQRERNR�R6RWR+R1R.R3R5(RXtchangeR�((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pytget_volume_property_changesKsF 		!$
		&  cC`s2t�}|jt|jd�krK|jjdd|j|jf�n|jdr�|jt|jd�kr�|jtddd|j��|jj	d�n|jd	d
kr
|j
t|jd�kr�|jtddd|j
��|jj	d
�q�q.|jd	dkr.|jt|jd�kr�|jt|jd�}|ddks�|ddks�|dddkr�|jjdd|jd�n|jtddd|j��|jj	d�q�q.nN|jt|jd�kr.|jtddd|j��|jj	d�n|S(sExpand the storage specifications for the existing thick/thin volume.

        :raise AnsibleFailJson when a thick/thin volume expansion request fails.
        :return dict: dictionary containing all the necessary values for volume expansion request
        tcapacityRBsFReducing the size of volumes is not permitted. Volume [%s]. Array [%s]tthinProvisionedtsizeUnitRtnewVirtualSizes,Thin volume virtual size have been expanded.R�R/tprovisionedCapacityQuotatnewRepositorySizesJThin volume maximum repository size have been expanded (automatic policy).R0tcurrentProvisionedCapacityiiiiisyThe thin volume repository increase must be between or equal to 4gb and 256gb in increments of 4gb. Attempted size [%sg].sGThin volume maximum repository size have been expanded (manual policy).t
expansionSizes-Volume storage capacities have been expanded.i@i@i@i@(R8RLR$RURIRQRRRR�RsRPRO(RXR�R�((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pytget_expand_volume_changes�s0	
4cC`s�td|jd|jdddd|j�}|jr�|jtd|jd|jd	|jd
|j	d|j
��y,|jd|jd
|dd�\}}Wn?t
k
r�}|jjdd|j|jt|�f�nX|jjd|j�n�|jtd|jd|j��y,|jd|jd
|dd�\}}Wn?t
k
r�}|jjdd|j|jt|�f�nX|jjd|j�dS(s=Create thick/thin volume according to the specified criteria.RtpoolIdRnR�RtdataAssuranceEnabledtvirtualSizetrepositorySizetmaximumRepositorySizeR�R�sstorage-systems/%s/thin-volumesR�R�R�RBsFFailed to create thin volume.  Volume [%s].  Array Id [%s]. Error[%s].sNew thin volume created [%s].R!tsegSizesstorage-systems/%s/volumessAFailed to create volume.  Volume [%s].  Array Id [%s]. Error[%s].sNew volume created [%s].N(R8RRVR*R+R�RLRORPR.R1R_RRR`RIRQR
RsR#(RXtbodyRcReR�((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pyt
create_volume�s*"				
,!",!cC`s5|j�|j�|_|j�}|r1|jr�y9|jd|j|jdfd|dd�\}}Wq-tk
r�}|jj	dd|j
|jt|�f�q-Xn{y9|jd|j|jdfd|dd�\}}Wn?tk
r,}|jj	dd	|j
|jt|�f�nXtSt
S(
s�Update existing thin-volume or volume properties.

        :raise AnsibleFailJson when either thick/thin volume update request fails.
        :return bool: whether update was applied
        s"storage-systems/%s/thin-volumes/%sRnR�R�R�RBsOFailed to update thin volume properties. Volume [%s]. Array Id [%s]. Error[%s].sstorage-systems/%s/volumes/%ssJFailed to update volume properties. Volume [%s]. Array Id [%s]. Error[%s].(RhRfRUR�R+R_RRR`RIRQRR
RERF(RXR�RcR�R�((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pytupdate_volume_properties�s&
		0$ !cC`s?|j�}|r;|jdr�y9|jd|j|jdfd|dd�\}}Wn?tk
r�}|jjdd|j|jt|�f�nX|jj	d	�q;y9|jd
|j|jdfd|dd�\}}Wn?tk
r'}|jjdd|j|jt|�f�nX|jj	d�nd
S(s�Expand the storage specifications for the existing thick/thin volume.

        :raise AnsibleFailJson when a thick/thin volume expansion request fails.
        R�s)storage-systems/%s/thin-volumes/%s/expandRnR�R�R�RBsDFailed to expand thin volume. Volume [%s]. Array Id [%s]. Error[%s].s.Thin volume specifications have been expanded.s$storage-systems/%s/volumes/%s/expandsAFailed to expand volume.  Volume [%s].  Array Id [%s]. Error[%s].s-Volume storage capacities have been expanded.N(
R�RUR_RRR`RIRQRR
Rs(RXR�RcR�Rd((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pyt
expand_volume�s$
	0!!cC`s(|jr�y3|jd|j|jdfdd�\}}Wn?tk
r}}|jjdd|j|jt|�f�nX|jj	d|j�n�y3|jd|j|jdfdd�\}}Wn?tk
r}|jjdd	|j|jt|�f�nX|jj	d
|j�dS(s"Delete existing thin/thick volume.s"storage-systems/%s/thin-volumes/%sRnR�tDELETERBsDFailed to delete thin volume. Volume [%s]. Array Id [%s]. Error[%s].sThin volume deleted [%s].sstorage-systems/%s/volumes/%ss?Failed to delete volume. Volume [%s]. Array Id [%s]. Error[%s].sVolume deleted [%s].N(
R+R_RRRUR`RIRQRR
Rs(RXRcR�R�((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pyt
delete_volume�s	 ! !cC`s�t}d}|j�|_|j�|_|jdkrT|jdt�rTt}n|jr�|jdkrut}q*|jdkr*|j	�s�|j
�r�t}q�q*n|jdkr*|jr!|jddks|jddks|jdddkr!|j
jd	d
|jd�nt}n|j
jd|�|rX|j
jrX|jdkr3|j�rud}n|js�|j�|j�|j�|r�|d
 dnd}nH|j�r�d}n|j	�r|j�|r�|d
 dnd}n|jrU|j
jd�|jd|j�qUqs|jdkrs|j�d}qsn|jdkrmdnd}|j
jd	|r�d|kr�||jn|d|�dS(s�Determine and apply any changes necessary to satisfy the specified criteria.

        :raise AnsibleExitJson when completes successfullyRR�RiiiiiRBsqThe initial thin volume repository size must be between 4gb and 256gb in increments of 4gb. Attempted size [%sg].sUpdate required: [%s].sWorkload tag change occurred.i����s and volume [%s] was created.sVolume [%s] has been created.s$Volume [%s] properties were updated.s and was expanded.sVolume [%s] was expanded.s)Waiting for volume operation to complete.RtsVolume [%s] has been deleted.sVolume [%s] does not exist.sVolume [%s] exists.s%stchangedNi@i@i@i@(RFRMRfRUR|RVRR�RER�R�R+RORIRQRsR�R�R�R�R�R9RyR:R�t	exit_jsonR(RXR�RB((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pytapplysT!						


	
	
N(t__name__t
__module__t$VOLUME_CREATION_BLOCKING_TIMEOUT_SECRHRKRfRhRMRyR|R�RFR�R�R�R�R�R�R�R�(((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pyRs 	l		%		\	5	'				cC`st�}|j�dS(N(RR�(Re((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pytmainRs	t__main__N(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNttimeRtansible.module_utils.netappR	tansible.module_utils._textR
RR�R�(((sR/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_volume.pyt<module>s 


�H��C	

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