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

�
�Udac@`sSddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddl
mZytdd
l
mZddlmZddlmZddlmZddlmZddlmZddlmZWn�ek
ridd
lmZddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZ d e!fd!��YZ"d"e!fd#��YZ#d$e!fd%��YZ$d&�Z%e&d'krOe%�nd(S()i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontstableinterfacetstatust	certifiedtsupported_bys7
---
module: bigip_gtm_datacenter
short_description: Manage Datacenter configuration in BIG-IP
description:
  - Manage BIG-IP data center configuration. A data center defines the location
    where the physical network components reside, such as the server and link
    objects that share the same subnet on the network. This module is able to
    manipulate the data center definitions in a BIG-IP.
version_added: 2.2
options:
  contact:
    description:
      - The name of the contact for the data center.
    type: str
  description:
    description:
      - The description of the data center.
    type: str
  location:
    description:
      - The location of the data center.
    type: str
  name:
    description:
      - The name of the data center.
    type: str
    required: True
  state:
    description:
      - The virtual address state. If C(absent), an attempt to delete the
        virtual address will be made. This will only succeed if this
        virtual address is not in use by a virtual server. C(present) creates
        the virtual address and enables it. If C(enabled), enable the virtual
        address if it exists. If C(disabled), create the virtual address if
        needed, and set state to C(disabled).
    type: str
    choices:
      - present
      - absent
      - enabled
      - disabled
    default: present
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
    version_added: 2.5
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s�
- name: Create data center "New York"
  bigip_gtm_datacenter:
    name: New York
    location: 222 West 23rd
    provider:
      user: admin
      password: secret
      server: lb.mydomain.com
  delegate_to: localhost
s�
contact:
  description: The contact that was set on the datacenter.
  returned: changed
  type: str
  sample: [email protected]
description:
  description: The description that was set for the datacenter.
  returned: changed
  type: str
  sample: Datacenter in NYC
enabled:
  description: Whether the datacenter is enabled or not
  returned: changed
  type: bool
  sample: true
disabled:
  description: Whether the datacenter is disabled or not.
  returned: changed
  type: bool
  sample: true
state:
  description: State of the datacenter.
  returned: changed
  type: str
  sample: disabled
location:
  description: The location that is set for the datacenter.
  returned: changed
  type: str
  sample: 222 West 23rd
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_name(tmodule_provisionedt
ParameterscB`sMeZiZddddgZddddddgZdddddgZRS(tlocationtdescriptiontcontacttstatetenabledtdisabled(t__name__t
__module__tapi_mapt
updatablestreturnablestapi_attributes(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR�st
ApiParameterscB`s&eZed��Zed��ZRS(cC`s|jdtkrtSdS(NR(t_valuestTruetNone(tself((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR�scC`s|jdtkrtSdS(NR(RR R!(R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR�s(RRtpropertyRR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR�stModuleParameterscB`s5eZed��Zed��Zed��ZRS(cC`s|jddkrtSdS(NRR(RR R!(R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR�scC`s|jddkrtSdS(NRRtpresent(senabledspresent(RR R!(R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR�scC`sO|jr |jddkr dS|jr@|jddkr@dS|jdSdS(NRR%RR(RRR(R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR�s
(RRR#RRR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR$�stChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(Rtgetattrt_filter_paramst	Exception(R"tresultt
returnable((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyt	to_return�s
(RRR,(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR&�st
UsableChangescB`s&eZed��Zed��ZRS(cC`s|jddkrtSdS(NRR(RR (R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR�scC`s|jddkrtSdS(NRRR%(senabledspresent(RR (R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR�s(RRR#RR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR-�stReportableChangescB`s&eZed��Zed��ZRS(cC`s2|jddkrtS|jddkr.tSdS(NRRRR%(senabledspresent(RR tFalseR!(R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR�s
cC`s2|jddkrtS|jddkr.tSdS(NRRR%R(senabledspresent(RR R/R!(R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR�s
(RRR#RR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR.�st
DifferencecB`s5eZdd�Zd�Zd�Zed��ZRS(cC`s||_||_dS(N(twantthave(R"R1R2((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R'tAttributeErrort_Difference__default(R"tparamR*((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R'R1R2R4(R"R6tattr1tattr2((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyt	__default�s
cC`sr|jj|jjkr7td|jjd|jj�S|jj|jjkrntd|jjd|jj�SdS(NRRR(R1RR2tdictRR(R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR�s
N(RRR!R3R7R5R#R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR0�s			t
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�ZRS(cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(tpopR!R=R
R>tclientR$R1RR2R-tchanges(R"targstkwargs((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR3s
cC`sH|jdg�}x/|D]'}|jjd|dd|d�qWdS(Nt
__warningstmsgtversion(R?R=t	deprecate(R"R*twarningstwarning((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyt_announce_deprecationss


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(NR>(R0R1R2RRR;R7R!t
isinstancetupdateR-RAR R/(R"tdiffRtchangedtktchange((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyt_update_changed_optionss		
cC`s�t|jd�s!td��nt}t�}|jj}|d	krW|j�}n|dkrr|j�}nt	d|j
j��}|j�}|j|�|jtd|��|j
|�|S(
Ntgtms+GTM must be provisioned to use this module.R%RRtabsentR>RN(spresentsenabledsdisabled(RR@RR/R;R1RR%RSR.RAR,RLRJ(R"RNR*Rt
reportableRA((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pytexec_module,s 	

cC`s$|j�r|j�S|j�SdS(N(texistsRLtcreate(R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR%As
cC`s%t}|j�r!|j�}n|S(N(R/RVtremove(R"RN((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyRSGscC`sPt�|_|j�|jjr&tS|j�|j�r@tStd��dS(NsFailed to create the datacenter(	RR2t
should_updateR=t
check_modeR tcreate_on_deviceRVR(R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyRWMs

cC`s|j�}|rtStS(N(RQR R/(R"R*((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyRYXscC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR2RYR/R=RZR tupdate_on_device(R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyRL^s
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the datacenter(R=RZR tremove_from_deviceRVR(R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyRXgs
cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns*https://{0}:{1}/mgmt/tm/gtm/datacenter/{2}tservertserver_porti�tcode(tformatR@tproviderRR1t	partitiontnametapitgettjsont
ValueErrorR/RR (R"turitresptresponse((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyRVos


+cC`s�|jj�}|jj|d<|jj|d<dj|jjd|jjd�}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd|kr�|ddkr�d
|kr�t|d
��q�t|j��ndS(NReRds'https://{0}:{1}/mgmt/tm/gtm/datacenter/R_R`RhRai�i�tmessage(i�i�(RAt
api_paramsR1ReRdRbR@RcRftpostRhRiRtstrtcontent(R"R>RjRkRltex((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR[~s
cC`s�|jj�}dj|jjd|jjdt|jj|jj��}|jj	j
|d|�}y|j�}Wn%tk
r�}t
t|���nXd|kr�|ddkr�d|kr�t
|d��q�t
|j��ndS(Ns*https://{0}:{1}/mgmt/tm/gtm/datacenter/{2}R_R`RhRai�Rm(RARnRbR@RcRR1RdReRftpatchRhRiRRpRq(R"R>RjRkRlRr((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR]�s

cC`sjdj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
SdS(Ns*https://{0}:{1}/mgmt/tm/gtm/datacenter/{2}R_R`i�(RbR@RcRR1RdReRftdeleteRR (R"RjRk((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR^�s

cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��ntd|�S(Ns*https://{0}:{1}/mgmt/tm/gtm/datacenter/{2}R_R`Rai�RmR>(RbR@RcRR1RdReRfRgRhRiRRpRqR(R"RjRkRlRr((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR\�s

(RRR3RJRQRUR%RSRWRYRLRXRVR[R]R^R\(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR<
s															
tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdt�dt�dt�dtdt�dtddd	dd
ddg�d
tdddtdgf��}i|_|jjt�|jj|�dS(NRRRRetrequiredRtdefaultR%tchoicesRSRRRdtCommontfallbacktF5_PARTITION(R tsupports_check_modeR;R	t
argument_specRLR(R"R}((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyR3�s					(RRR3(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyRu�scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR}R|R=RE(
RuRR}R|R<RUt	exit_jsonRt	fail_jsonRp(tspecR=tmmtresultsRr((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pytmain�s		t__main__N('t
__future__RRRttypet
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRR	t%library.module_utils.network.f5.bigipR
t&library.module_utils.network.f5.commonRRR
RRt(library.module_utils.network.f5.icontrolRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont(ansible.module_utils.network.f5.icontrolRRR$R&R-R.tobjectR0R<RuR�R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_datacenter.pyt<module>sJ


7!
#�	

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