Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/f5/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyo

�
�Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZyTddlm
Z
dd
lmZddlmZddlmZddlmZWnaek
rddlm
Z
dd
lmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd ��YZ d!efd"��YZ!d#�Z"e#d$kr�e"�nd%S(&i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
---
module: bigip_partition
short_description: Manage BIG-IP partitions
description:
  - Manage BIG-IP partitions.
version_added: 2.5
options:
  name:
    description:
      - Name of the partition
    type: str
    required: True
  description:
    description:
      - The description to attach to the Partition.
    type: str
  route_domain:
    description:
      - The default Route Domain to assign to the Partition. If no route domain
        is specified, then the default route domain for the system (typically
        zero) will be used only when creating a new partition.
    type: int
  state:
    description:
      - Whether the partition should exist or not.
    type: str
    choices:
      - present
      - absent
    default: present
notes:
  - Requires BIG-IP software version >= 12
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s$
- name: Create partition "foo" using the default route domain
  bigip_partition:
    name: foo
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Create partition "bar" using a custom route domain
  bigip_partition:
    name: bar
    route_domain: 3
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Change route domain of partition "foo"
  bigip_partition:
    name: foo
    route_domain: 8
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Set a description for partition "foo"
  bigip_partition:
    name: foo
    description: Tenant CompanyA
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Delete the "foo" partition
  bigip_partition:
    name: foo
    state: absent
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s
route_domain:
  description: Name of the route domain associated with the partition.
  returned: changed and success
  type: int
  sample: 0
description:
  description: The description of the partition.
  returned: changed and success
  type: str
  sample: Example partition
(t
AnsibleModule(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tf5_argument_spec(tcmp_str_with_nonet
ParameterscB`s?eZidd6ZddgZdddgZdddgZRS(troute_domaintdefaultRouteDomaintdescriptiontfolder_description(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR�s
		t
ApiParameterscB`seZed��ZRS(cC`s"|jddkrdS|jdS(NRtnone(NR(t_valuestNone(tself((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR�s(RRtpropertyR(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR�stModuleParameterscB`s5eZed��Zed��Zed��ZRS(cC`sdS(N(R(R((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyt	partition�scC`s(|jddkrdSt|jd�S(NR(RRtint(R((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR�scC`s9|jddkrdS|jddkr.dS|jdS(NRRt(snoneR"(RR(R((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR�s
(RRRR RR(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR�stChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(Rtgetattrt_filter_paramst	Exception(Rtresultt
returnable((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyt	to_return�s
(RRR)(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR#�st
UsableChangescB`seZRS((RR(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR*�stReportableChangescB`seZRS((RR(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR+�st
DifferencecB`s5eZdd�Zd�Zd�Zed��ZRS(cC`s||_||_dS(N(twantthave(RR-R.((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyt__init__�s	cC`s?yt||�}|SWn!tk
r:|j|�}|SXdS(N(R$tAttributeErrort_Difference__default(RtparamR'((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pytcompare�s
cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R$R-R.R0(RR2tattr1tattr2((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyt	__default�s
cC`sHt|jj|jj�dkr:t|jj|jj�S|jjSdS(N(R
R-RR.RR(R((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR�s!N(RRRR/R3R1RR(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR,�s			t
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�ZRS(cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(tgetRR8R	R9tclientRR-RR.R*tchanges(Rtargstkwargs((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR/�s
cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopR;R8t	deprecate(RR'twarningstwarning((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyt_announce_deprecations�s


cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR9(RRR$R-RR*R<(Rtchangedtkey((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyt_set_changed_options�scC`s�t|j|j�}tj}t�}xX|D]P}|j|�}|dkrUq.q.t|t�rt|j	|�q.|||<q.W|r�t
d|�|_tSt
S(NR9(R,R-R.RRtdictR3Rt
isinstancetupdateR*R<tTruetFalse(RtdiffRRGtktchange((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyt_update_changed_optionss		
cC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentR9RG(RNRJR-tstateRSRTR+R<R)RLRF(RRGR'RUt
reportableR<((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pytexec_modules	

cC`s$|j�r|j�S|j�SdS(N(texistsRLtcreate(R((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyRS's
cC`s\|j�|jjrtS|j�|jjr=|j�n|j�sXt	d��ntS(NsFailed to create the partition.(
RIR8t
check_modeRMtcreate_on_deviceR<Rtupdate_folder_on_deviceRXR
(R((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyRY-s


cC`s|j�}|rtStS(N(RRRMRN(RR'((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyt
should_update8scC`sV|j�|_|j�stS|jjr/tS|j�|jj	rR|j
�ntS(N(tread_current_from_deviceR.R]RNR8RZRMtupdate_on_deviceR<RR\(R((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyRL>s

cC`s|j�r|j�StS(N(RXtremoveRN(R((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyRTIs
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the partition.(R8RZRMtremove_from_deviceRXR
(R((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR`Ns
cC`s�dj|jjd|jjd|jj�}|jjj|�}y|j�}Wn%tk
r{}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��ntd|�}dj|jjd|jjd|jj�}|jjj|�}y|j�}Wn%tk
rS}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��n|j
i|jd	d�d
6�|S(Ns*https://{0}:{1}/mgmt/tm/auth/partition/{2}tservertserver_porttcodei�tmessageR9s'https://{0}:{1}/mgmt/tm/sys/folder/~{2}RR(tformatR;tproviderR-tnametapiR:tjsont
ValueErrorR
tstrtcontentRRLR(RturitresptresponsetexR'((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR^Vs:



 cC`s�dj|jjd|jjd|jj�}|jjj|�}y|j�}Wntk
rht	SX|j
dks�d|kr�|ddkr�t	StS(Ns*https://{0}:{1}/mgmt/tm/auth/partition/{2}RbRci�Rd(RfR;RgR-RhRiR:RjRkRNRRM(RRnRoRp((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyRX{s


+cC`s�|jj�}|jj|d<dj|jjd|jjd�}|jjj|d|�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d
|kr�t|d
��q�t|j
��ndS(NRhs'https://{0}:{1}/mgmt/tm/auth/partition/RbRcRjRdi�i�i�Re(i�i�i�(R<t
api_paramsR-RhRfR;RgRitpostRjRkR
RlRm(RR9RnRoRpRq((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR[�s
cC`s�|jj�}dj|jjd|jjd|jj�}|jjj|d|�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��ndS(Ns*https://{0}:{1}/mgmt/tm/auth/partition/{2}RbRcRjRdi�Re(R<RrRfR;RgR-RhRitpatchRjRkR
RlRm(RR9RnRoRpRq((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR_�s

cC`s�td|jj�}dj|jjd|jjd|jj�}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd|kr�|ddkr�d|kr�t|d��q�t|j��ndS(	NRs'https://{0}:{1}/mgmt/tm/sys/folder/~{2}RbRcRjRdi�Re(RJR<RRfR;RgR-RhRiRtRjRkR
RlRm(RR9RnRoRpRq((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR\�s

cC`s[dj|jjd|jjd|jj�}|jjj|�}|jdkrWtSdS(Ns*https://{0}:{1}/mgmt/tm/auth/partition/{2}RbRci�(	RfR;RgR-RhRitdeleteRRM(RRnRo((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyRa�s

(RRR/RFRIRRRWRSRYR]RLRTR`R^RXR[R_R\Ra(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR7�s"												%				tArgumentSpeccB`seZd�ZRS(c
C`s�t|_tdtdt�dt�dtdd�dtdd	d
gdd
��}i|_|jjt�|jj|�dS(NRhtrequiredRRttypeR!RUtchoicesRTRStdefault(RMtsupports_check_modeRJt
argument_specRLR(RR|((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyR/�s			(RRR/(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyRv�scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR|R{R8R@(
RvRR|R{R7RWt	exit_jsonR
t	fail_jsonRl(tspecR8tmmtresultsRq((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pytmain�s		t__main__N($t
__future__RRRRxt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt%library.module_utils.network.f5.bigipR	t&library.module_utils.network.f5.commonR
RRt'library.module_utils.network.f5.compareR
tImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont'ansible.module_utils.network.f5.compareRRRR#R*R+tobjectR,R7RvR�R(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_partition.pyt<module>s@


'3

�	

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