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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddljj
ZddlmZdd
lmZddlmZej�Zdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys3
module: na_ontap_qos_adaptive_policy_group
short_description: NetApp ONTAP Adaptive Quality of Service policy group.
extends_documentation_fragment:
  - netapp.na_ontap
version_added: '2.9'
author: NetApp Ansible Team (@joshedmonds) <[email protected]>

description:
  - Create, destroy, modify, or rename an Adaptive QoS policy group on NetApp ONTAP. Module is based on the standard QoS policy group module.

options:
  state:
    choices: ['present', 'absent']
    description:
      - Whether the specified policy group should exist or not.
    default: 'present'
    type: str

  name:
    description:
    - The name of the policy group to manage.
    type: str
    required: true

  vserver:
    description:
    - Name of the vserver to use.
    type: str
    required: true

  from_name:
    description:
    - Name of the existing policy group to be renamed to name.
    type: str

  absolute_min_iops:
    description:
    - Absolute minimum IOPS defined by this policy.
    type: str

  expected_iops:
    description:
    - Minimum expected IOPS defined by this policy.
    type: str

  peak_iops:
    description:
    - Maximum possible IOPS per allocated or used TB|GB.
    type: str

  peak_iops_allocation:
    choices: ['allocated_space', 'used_space']
    description:
      - Whether peak_iops is specified by allocated or used space.
    default: 'used_space'
    type: str

  force:
    type: bool
    default: False
    description:
    - Setting to 'true' forces the deletion of the workloads associated with the policy group along with the policy group.
s�
    - name: create adaptive qos policy group
      na_ontap_qos_adaptive_policy_group:
        state: present
        name: aq_policy_1
        vserver: policy_vserver
        absolute_min_iops: 70IOPS
        expected_iops: 100IOPS/TB
        peak_iops: 250IOPS/TB
        peak_iops_allocation: allocated_space
        hostname: 10.193.78.30
        username: admin
        password: netapp1!

    - name: modify adaptive qos policy group expected iops
      na_ontap_qos_adaptive_policy_group:
        state: present
        name: aq_policy_1
        vserver: policy_vserver
        absolute_min_iops: 70IOPS
        expected_iops: 125IOPS/TB
        peak_iops: 250IOPS/TB
        peak_iops_allocation: allocated_space
        hostname: 10.193.78.30
        username: admin
        password: netapp1!

    - name: modify adaptive qos policy group peak iops allocation
      na_ontap_qos_adaptive_policy_group:
        state: present
        name: aq_policy_1
        vserver: policy_vserver
        absolute_min_iops: 70IOPS
        expected_iops: 125IOPS/TB
        peak_iops: 250IOPS/TB
        peak_iops_allocation: used_space
        hostname: 10.193.78.30
        username: admin
        password: netapp1!

    - name: delete qos policy group
      na_ontap_qos_adaptive_policy_group:
        state: absent
        name: aq_policy_1
        vserver: policy_vserver
        hostname: 10.193.78.30
        username: admin
        password: netapp1!

t
N(tNetAppModule(t
AnsibleModule(t	to_nativet!NetAppOntapAdaptiveQosPolicyGroupcB`seeZdZd�Zd
d�Zd�Zd
d�Zd�Zd�Z	d�Z
d�Zd	�ZRS(s;
    Create, delete, modify and rename a policy group.
    cC`s}tj�|_|jjtdtdtdddddgdd�d	tdtdd�d
tdtdd�dtdtdd�dtdtdd�d
tdtdd�dtdtdd�dtdddgdd�dtdtdddt��	�td|jdt�|_t	�|_
|j
j|jj�|_
ttkra|jjdd�ntjd|j�|_dS(s>
        Initialize the Ontap qos policy group class.
        tstatetrequiredttypetstrtchoicestpresenttabsenttdefaulttnamet	from_nametvservertabsolute_min_iopst
expected_iopst	peak_iopstpeak_iops_allocationtallocated_spacet
used_spacetforcetboolt
argument_spectsupports_check_modetmsgs(the python NetApp-Lib module is requiredtmoduleN(tnetapp_utilstna_ontap_host_argument_specR tupdatetdicttFalsetTrueR
R#R	t	na_helpertset_parameterstparamst
parameterstHAS_NETAPP_LIBt	fail_jsontsetup_na_ontap_zapitserver(tself((se/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_qos_adaptive_policy_group.pyt__init__�s*'	
	cC`s]|dkr|jd}ntjjd�}tjjd�}|jd|�|jd|jd�tjjd�}|j|�|j|�|jj|t	�}d}|j
d�rYt|jd��dkrY|j
d	�j
d�}i|jd�d6|jd�d6|jd
�d6|jd�d
6|jd�d6|jd�d6}n|S(s�
        Return details of a policy group.
        :param policy_group_name: policy group name
        :return: policy group details.
        :rtype: dict.
        Rs"qos-adaptive-policy-group-get-itersqos-adaptive-policy-group-infospolicy-groupRtquerysnum-recordsisattributes-listsabsolute-min-iopsRs
expected-iopsRs	peak-iopsRspeak-iops-allocationRN(
tNoneR-R$tzapit	NaElementt
add_new_childtadd_child_elemR1tinvoke_successfullyR)tget_child_by_nametinttget_child_content(R2tpolicy_group_nametpolicy_group_get_itertpolicy_group_infoR4tresulttpolicy_group_detailtpolicy_info((se/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_qos_adaptive_policy_group.pytget_policy_group�s*

*cC`s]tjjd�}|jd|jd�|jd|jd�|jjd�rl|jd|jd�n|jjd�r�|jd|jd�n|jjd	�r�|jd
|jd	�n|jjd�r�|jd|jd�ny|jj|t�WnOtjj	k
rX}|j
jd
d|jdt|�fdt
j��nXdS(s-
        create a policy group name.
        s qos-adaptive-policy-group-createspolicy-groupRRRsabsolute-min-iopsRs
expected-iopsRs	peak-iopsRspeak-iops-allocationR"s/Error creating adaptive qos policy group %s: %st	exceptionN(R$R6R7R8R-tgetR1R:R)t
NaApiErrorR#R/Rt	tracebackt
format_exc(R2tpolicy_groupterror((se/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_qos_adaptive_policy_group.pytcreate_policy_group�s"cC`s�|dkr|jd}ntjjd�}|jd|�|jjd�rp|jdt|jd��ny|jj	|t
�WnHtjjk
r�}|jj
dd|t|�fdtj��nXdS(	sb
        delete an existing policy group.
        :param policy_group: policy group name.
        Rs qos-adaptive-policy-group-deletespolicy-groupRR"s/Error deleting adaptive qos policy group %s: %sREN(R5R-R$R6R7R8RFRR1R:R)RGR#R/RRHRI(R2RJtpolicy_group_objRK((se/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_qos_adaptive_policy_group.pytdelete_policy_group�s cC`sFtjjd�}|jd|jd�|jjd�rU|jd|jd�n|jjd�r�|jd|jd�n|jjd�r�|jd	|jd�n|jjd
�r�|jd|jd
�ny|jj|t�WnOtjj	k
rA}|j
jdd
|jdt|�fdt
j��nXdS(s&
        Modify policy group.
        s qos-adaptive-policy-group-modifyspolicy-groupRRsabsolute-min-iopsRs
expected-iopsRs	peak-iopsRspeak-iops-allocationR"s0Error modifying adaptive qos policy group %s: %sREN(R$R6R7R8R-RFR1R:R)RGR#R/RRHRI(R2RMRK((se/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_qos_adaptive_policy_group.pytmodify_policy_group�s cC`s�tjjd�}|jd|jd�|jd|jd�y|jj|t�WnOtjjk
r�}|j	j
dd|jdt|�fdtj
��nXd	S(
s+
        Rename policy group name.
        s qos-adaptive-policy-group-renamesnew-nameRspolicy-group-nameRR"s/Error renaming adaptive qos policy group %s: %sREN(R$R6R7R8R-R1R:R)RGR#R/RRHRI(R2t
rename_objRK((se/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_qos_adaptive_policy_group.pytrename_policy_groupscC`s4x-|j�D]}|dkr
|j�q
q
WdS(sc
        helper method to modify policy group.
        :param modify: modified attributes.
        RRRRN(sabsolute_min_iopss
expected_iopss	peak_iopsspeak_iops_allocation(tkeysRO(R2tmodifyt	attribute((se/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_qos_adaptive_policy_group.pyt
modify_helperscC`s%|jd�|j�}d\}}|jjd�r_|jj|j|jd�|�}n|jj||j�}|jj||j�}|jj	r|j
jr�q|r�|j�n|dkr�|j
�q|dkr�|j�q|r|j|�qn|j
jd|jj	�dS(s.
        Run module based on playbook
        tna_ontap_qos_policy_groupRtcreatetdeletetchangedN(NN(tautosupport_logRDR5R-RFR*tis_rename_actiont
get_cd_actiontget_modified_attributesRYR#t
check_modeRQRLRNRUt	exit_json(R2tcurrenttrenamet	cd_actionRS((se/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_qos_adaptive_policy_group.pytapply&s&
(


cC`s6tjd|jd|jd�}tj||�dS(sA
        Create a log event against the provided vserver
        R#RN(R$R0R#R-t
ems_log_event(R2t
event_nameR1((se/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_qos_adaptive_policy_group.pyRZ@s"N(
t__name__t
__module__t__doc__R3R5RDRLRNRORQRURcRZ(((se/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_qos_adaptive_policy_group.pyR�s	 						cC`st�}|j�dS(s&Apply vserver operations from playbookN(RRc(tqos_policy_group((se/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_qos_adaptive_policy_group.pytmainHs	t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRHtansible.module_utils.netapptmodule_utilstnetappR$t"ansible.module_utils.netapp_moduleR	tansible.module_utils.basicR
tansible.module_utils._textRthas_netapp_libR.tobjectRRjRf(((se/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_qos_adaptive_policy_group.pyt<module>s"


A3�	

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