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_data_group.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlZddl
mZdd
lmZddlmZyddlmZWn!ek
r�ddlmZnXy�ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!ddl m"Z"ddl#m$Z$ddlm%Z%Wn�ek
rUddl&mZddl'mZddl'mZddl'mZddl(mZddl'mZddl)mZddl*m!Z!ddl*m"Z"ddl+m$Z$ddl(m%Z%nXdZ,dZ-d�Z.d�Z/d�Z0d e1fd!��YZ2d"e1fd#��YZ3d$efd%��YZ4d&e4fd'��YZ5d(e4fd)��YZ6d*e4fd+��YZ7d,e7fd-��YZ8d.e7fd/��YZ9d0e1fd1��YZ:d2e1fd3��YZ;d4e;fd5��YZ<d6e;fd7��YZ=d8e1fd9��YZ>d:e1fd;��YZ?d<�Z@eAd=kr�e@�ndS(>i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys
---
module: bigip_data_group
short_description: Manage data groups on a BIG-IP
description:
  - Allows for managing data groups on a BIG-IP. Data groups provide a way to store collections
    of values on a BIG-IP for later use in things such as LTM rules, iRules, and ASM policies.
version_added: 2.6
options:
  name:
    description:
      - Specifies the name of the data group.
    type: str
    required: True
  description:
    description:
      - The description of the data group.
    type: str
    version_added: 2.8
  type:
    description:
      - The type of records in this data group.
      - This parameter is especially important because it causes BIG-IP to store your data
        in different ways so-as to optimize access to it. For example, it would be wrong
        to specify a list of records containing IP addresses, but label them as a C(string)
        type.
      - This value cannot be changed once the data group is created.
    type: str
    choices:
      - address
      - addr
      - ip
      - string
      - str
      - integer
      - int
    default: string
  internal:
    description:
      - The type of this data group.
      - You should only consider setting this value in cases where you know exactly what
        you're doing, B(or), you are working with a pre-existing internal data group.
      - Be aware that if you deliberately force this parameter to C(yes), and you have a
        either a large number of records or a large total records size, this large amount
        of data will be reflected in your BIG-IP configuration. This can lead to B(long)
        system configuration load times due to needing to parse and verify the large
        configuration.
      - There is a limit of either 4 megabytes or 65,000 records (whichever is more restrictive)
        for uploads when this parameter is C(yes).
      - This value cannot be changed once the data group is created.
    type: bool
    default: no
  external_file_name:
    description:
      - When creating a new data group, this specifies the file name that you want to give an
        external data group file on the BIG-IP.
      - This parameter is ignored when C(internal) is C(yes).
      - This parameter can be used to select an existing data group file to use with an
        existing external data group.
      - If this value is not provided, it will be given the value specified in C(name) and,
        therefore, match the name of the data group.
      - This value may only contain letters, numbers, underscores, dashes, or a period.
    type: str
  records:
    description:
      - Specifies the records that you want to add to a data group.
      - If you have a large number of records, it is recommended that you use C(records_content)
        instead of typing all those records here.
      - The technical limit of either 1. the number of records, or 2. the total size of all
        records, varies with the size of the total resources on your system; in particular,
        RAM.
      - When C(internal) is C(no), at least one record must be specified in either C(records)
        or C(records_content).
      - "When C(type) is: C(ip), C(address), C(addr) if the addresses use non default route domain,
        they must be explicit about it that is they must contain a route domain notation C(%) eg. 10.10.1.1%11.
        This is true regardless if the data group resides in a partition or not."
    type: list
    suboptions:
      key:
        description:
          - The key describing the record in the data group.
          - Your key will be used for validation of the C(type) parameter to this module.
        type: str
        required: True
      value:
        description:
          - The value of the key describing the record in the data group.
        type: raw
  records_src:
    description:
      - Path to a file with records in it.
      - The file should be well-formed. This means that it includes records, one per line,
        that resemble the following format "key separator value". For example, C(foo := bar).
      - BIG-IP is strict about this format, but this module is a bit more lax. It will allow
        you to include arbitrary amounts (including none) of empty space on either side of
        the separator. For an illustration of this, see the Examples section.
      - Record keys are limited in length to no more than 65520 characters.
      - Values of record keys are limited in length to no more than 65520 characters.
      - The total number of records you can have in your BIG-IP is limited by the memory
        of the BIG-IP.
      - The format of this content is slightly different depending on whether you specify
        a C(type) of C(address), C(integer), or C(string). See the examples section for
        examples of the different types of payload formats that are expected in your data
        group file.
      - When C(internal) is C(no), at least one record must be specified in either C(records)
        or C(records_content).
    type: path
  separator:
    description:
      - When specifying C(records_content), this is the string of characters that will
        be used to break apart entries in the C(records_content) into key/value pairs.
      - By default, this parameter's value is C(:=).
      - This value cannot be changed once it is set.
      - This parameter is only relevant when C(internal) is C(no). It will be ignored
        otherwise.
    type: str
    default: ":="
  delete_data_group_file:
    description:
      - When C(yes), will ensure that the remote data group file is deleted.
      - This parameter is only relevant when C(state) is C(absent) and C(internal) is C(no).
    type: bool
    default: no
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
  state:
    description:
      - When C(state) is C(present), ensures the data group exists.
      - When C(state) is C(absent), ensures that the data group is removed.
      - The use of state in this module refers to the entire data group, not its members.
    type: str
    choices:
      - present
      - absent
    default: present
notes:
  - This module does NOT support atomic updates of data group members in a type C(internal) data group.
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
  - Greg Crosby (@crosbygw)
s�

- name: Create a data group of addresses
  bigip_data_group:
    name: foo
    internal: yes
    records:
      - key: 0.0.0.0/32
        value: External_NAT
      - key: 10.10.10.10
        value: No_NAT
    type: address
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Create a data group of strings
  bigip_data_group:
    name: foo
    internal: yes
    records:
      - key: caddy
        value: ""
      - key: cafeteria
        value: ""
      - key: cactus
        value: ""
    type: str
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Create a data group of IP addresses from a file
  bigip_data_group:
    name: foo
    records_src: /path/to/dg-file
    type: address
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Update an existing internal data group of strings
  bigip_data_group:
    name: foo
    internal: yes
    records:
      - key: caddy
        value: ""
      - key: cafeteria
        value: ""
      - key: cactus
        value: ""
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Show the data format expected for records_content - address 1
  copy:
    dest: /path/to/addresses.txt
    content: |
      network 10.0.0.0 prefixlen 8 := "Network1",
      network 172.16.0.0 prefixlen 12 := "Network2",
      network 192.168.0.0 prefixlen 16 := "Network3",
      network 2402:9400:1000:0:: prefixlen 64 := "Network4",
      host 192.168.20.1 := "Host1",
      host 172.16.1.1 := "Host2",
      host 172.16.1.1/32 := "Host3",
      host 2001:0db8:85a3:0000:0000:8a2e:0370:7334 := "Host4",
      host 2001:0db8:85a3:0000:0000:8a2e:0370:7334/128 := "Host5"

- name: Show the data format expected for records_content - address 2
  copy:
    dest: /path/to/addresses.txt
    content: |
      10.0.0.0/8 := "Network1",
      172.16.0.0/12 := "Network2",
      192.168.0.0/16 := "Network3",
      2402:9400:1000:0::/64 := "Network4",
      192.168.20.1 := "Host1",
      172.16.1.1 := "Host2",
      172.16.1.1/32 := "Host3",
      2001:0db8:85a3:0000:0000:8a2e:0370:7334 := "Host4",
      2001:0db8:85a3:0000:0000:8a2e:0370:7334/128 := "Host5"

- name: Show the data format expected for records_content - string
  copy:
    dest: /path/to/strings.txt
    content: |
      a := alpha,
      b := bravo,
      c := charlie,
      x := x-ray,
      y := yankee,
      z := zulu,

- name: Show the data format expected for records_content - integer
  copy:
    dest: /path/to/integers.txt
    content: |
      1 := bar,
      2 := baz,
      3,
      4,
s
# only common fields returned
N(tto_text(t
AnsibleModule(tenv_fallback(tStringIO(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(ttransform_name(tcompare_complex_list(tf5_argument_spec(tis_valid_ip_interface(t
ip_network(tip_interface(tupload_file(tcmp_str_with_nonei�i	=cC`s@|jdtj�|j�}|jd�|dkr<tStS(Ni(tseektostSEEK_ENDttelltTruetFalse(tcontenttlength((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pytzero_length@s
cC`sF|}|jdtj�|j�}|jd�|tkrBtStS(Ni(RRRRtSIZE_LIMIT_BYTESRR(Rtrecordstsize((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyt
size_exceededIs
cC`sIt}x/t|�D]!\}}|tkrt}qqW|jd�|S(Ni(Rt	enumeratet
LINE_LIMITRR(Rtresulttitline((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pytlines_exceededSs

tRecordsEncodercB`s�eZd
d
d�Zd�Zd�Zed�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�ZRS(cC`s^||_||_tjd�|_tjd�|_tjd�|_tjd�|_dS(Ns=^network\s+(?P<addr>[^ ]+)\s+prefixlen\s+(?P<prefix>\d+)\s+.*s^host\s+(?P<addr>[^ ]+)\s+.*s1(?P<addr>[^%]+)%(?P<rd>[0-9]+)/(?P<prefix>[0-9]+)s(?P<addr>[^%]+)%(?P<rd>[0-9]+)(t_record_typet
_separatortretcompilet_network_patternt
_host_patternt_rd_net_patternt_rd_host_pattern(tselftrecord_typet	separator((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyt__init__]s		cC`s-t|t�r|j|�S|j|�SdS(N(t
isinstancetdicttencode_dictt
encode_string(R3trecord((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pytencodees
cC`sI|jdkr|j|�S|jdkr8|j|�S|j|�SdS(Ntiptinteger(R+tencode_address_from_dicttencode_integer_from_dicttencode_string_from_dict(R3R;((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR9ks


cC`s�|rKt|jd��r<tdj|jd���}q�td��nNt|jd��r�tdj|jd�|jd���}ntd��|r%d|kr%|jjdkr�|jt|j	�d	|jd
�|d�S|j
t|jj�d	|jd
�|jj|d�S|r�|jjdkr�|jt|j	�d	|jd
�t|j	�d	|jd
��S|j
t|jj�d	|jd
�|jjt|jj�d	|jd
��SdS(
Ntaddru{0}sXWhen specifying an 'address' type, the value to the left of the separator must be an IP.u{0}/{1}tprefixtvaluei i�t%trd(i i�(i i�(RtgroupRtformatR
tnetworkt	prefixlentencode_hosttstrR=tencode_networktnetwork_address(R3R;tmatchthosttkey((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pytencode_rd_addressss(!-	.4D)cC`s{tj|j|d�}|r/|j||�Stj|j|d�}|rd|j||dt�St|d�r�tdjt	|d���}nt
d��|rd|kr|jjdkr�|j
t	|j�|d�S|jt	|jj�|jj|d�S|rw|jjd	krF|j
t	|j�t	|j��S|jt	|jj�|jjt	|jj��SdS(
NRQRPu{0}sXWhen specifying an 'address' type, the value to the left of the separator must be an IP.RDi i�(i i�(i i�(R-ROR1RRR2RRRRHRLR
RIRJRKR=RMRN(R3R;trd_matchRQ((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR?�s("	#"cC`s�yt|d�Wntk
r1td��nXd|krhd|krhdj|d|j|d�Sd|kr�t|d�SdS(NRQs[When specifying an 'integer' type, the value to the left of the separator must be a number.RDs{0} {1} {2}(tintt
ValueErrorR
RHR,RL(R3R;((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR@�s

cC`s]d|kr6d|kr6dj|d|j|d�Sd|krYdj|d|j�SdS(NRQRDs{0} {1} {2}s
{0} {1} ""(RHR,(R3R;((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRA�scC`s^|j�jd�}|jdkr1|j|�S|jdkrM|j|�S|j|�SdS(Nt,R=R>(tstripR+tencode_address_from_stringtencode_integer_from_stringtencode_string_from_string(R3R;((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR:�s

cC`s�|jj|�r|S|jj|�r,|S|jj|�sP|jj|�rT|S|j|j�}|ddkrzdSt|d�s�td��nt	dj
t|d���}t|�dkr"|j
jd	kr�|jt|j�|d�S|jt|j
j�|j
j|d�St|�dkr�|ddkr�|j
jd
krx|jt|j�t|j��S|jt|j
j�|j
jt|j
j��SdS(NitsXWhen specifying an 'address' type, the value to the left of the separator must be an IP.u{0}ii i�i(i i�(i i�(R/ROR0R1R2tsplitR,RR
RRHRLtlenRIRJRKR=RMRN(R3R;tpartsRQ((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRX�s.$#""cC`s"djt|�|jt|��S(Nshost {0} {1} {2}(RHRLR,(R3RQRD((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRK�scC`s+djt|�t|�|jt|��S(Ns!network {0} prefixlen {1} {2} {3}(RHRLR,(R3RQRJRD((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRM�scC`s�|j|j�}t|�dkr8|ddkr8dSyt|d�Wntk
ritd��nXt|�dkr�dj|d|j|d�St|�dkr�t|d�SdS(NiiR[s[When specifying an 'integer' type, the value to the left of the separator must be a number.is{0} {1} {2}(	R\R,R]tNoneRTRUR
RHRL(R3R;R^((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRY�s"

cC`s|j|j�}t|�dkrBdj|d|j|d�St|�dkr{|ddkr{dj|d|j�SdS(Nis{0} {1} {2}iiR[s
{0} {1} ""(R\R,R]RH(R3R;R^((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRZs
"N(t__name__t
__module__R_R6R<R9RRRR?R@RAR:RXRKRMRYRZ(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR*\s								(			tRecordsDecodercB`s2eZddd�Zd�Zd�Zd�ZRS(cC`s^||_||_tjd�|_tjd�|_tjd�|_tjd�|_dS(Ns=^network\s+(?P<addr>[^ ]+)\s+prefixlen\s+(?P<prefix>\d+)\s+.*s^host\s+(?P<addr>[^ ]+)\s+.*sL^network\s+(?P<addr>[^%]+)%(?P<rd>[0-9]+)\s+prefixlen\s+(?P<prefix>\d+)\s+.*s+^host\s+(?P<addr>[^%]+)%(?P<rd>[0-9]+)\s+.*(R+R,R-R.R/R0t_rd_net_ptrnt
_rd_host_ptrn(R3R4R5((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR6
s		cC`sB|j�jd�}|jdkr1|j|�S|j|�SdS(NRVR=(RWR+tdecode_address_from_stringtdecode_from_string(R3R;((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pytdecodes
cC`sX|jj|�}|r�|j|j�dj�jd�}dj|jd�|jd�|jd��}td|d|�}|S|jj|�}|rd	j|jd�|jd��}t	|�}|j|j�dj�jd�}tdt
|�d|�}|S|jj|�}|r�td
j|jd���}dj|jd�|jd�t
|j
j��}|j|j�dj�jd�}td|d|�}|S|jj|�}|r?|jd�}td
jt
|���}|j|j�dj�jd�}tdt
|�d|�}|Stdj|���dS(Nit"s{0}%{1}/{2}RBRFRCtnametdatau{0}/{1}u{0}s!The value "{0}" is not an address(RcROR\R,RWRHRGR8R/RRLRdRRIRJR0R
(R3R;tmatchesRDRBR&RQRP((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRes:%0$%3%%cC`su|j|j�}t|�dkrTtd|dj�d|djd�j��Std|dj�dd�SdS(NiRiiRjiRhR[(R\R,R]R8RW(R3R;R^((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRfEs0N(R`RaR_R6RgReRf(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRbs		)t
ParameterscB`sieZidd6ZdddgZdddgZdddgZed��Zed��Zd�Z	RS(	texternal_file_nametexternalFileNameR!ttypetdescriptiontchecksumcC`sI|jddkrdS|jdd	kr.dS|jdd
krEdSdS(NRotaddressRBR=R>RTtstring(Rrsaddrsip(sintegersint(sstring(t_values(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRodscC`s�y#|jdjd�|jdSWntk
r6nX|jdrZt|jd�}n
|jd}|dkrwdSt�|jd<|j|�|jdS(Ntrecords_srciR!(RtRtAttributeErrortopenR_Rt_write_records_to_file(R3R!((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRums



cC`s�d}g}td|jd|j�}xl|D]d}|j|�}|r.|jt|d��t|�|kr�|jdj|�g}q�q.q.W|jdj|�|jdj	d�dS(Ni@BR4R5s,
Rui(
R*RoR5R<tappendRR]Rtt
writelinesR(R3R!tbucket_sizetbuckettencoderR;R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRx�s
(
R`Ratapi_maptapi_attributestreturnablest
updatablestpropertyRoRuRx(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRlMs
				t
ApiParameterscB`s5eZed��Zed��Zed��ZRS(cC`s5|jddkrdS|jdjd�d}|S(NRqt:i(RtR_R\(R3R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRq�scC`s|jdS(NR!(Rt(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pytrecords_list�scC`s"|jddkrdS|jdS(NRptnone(NR�(RtR_(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRp�s(R`RaR�RqR�Rp(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��stModuleParameterscB`sSeZed��Zed��Zed��Zed��Zed��ZRS(cC`s9|jddkrdS|jddkr.dS|jdS(NRpR�R[(snoneR[(RtR_(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRp�s
cC`s�|jdr|jdS|jdkr+dStj�}|j}x9tr{|jd�}|sbPn|j|jd��qCW|j	�}||jd<|S(NRqisutf-8(
RtRuR_thashlibtsha1RtreadtupdateR<t	hexdigest(R3R&R!Rj((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRq�s
		
cC`sQ|jddkr|j}n
|jd}tjd|�rMtd��n|S(NRms[^a-zA-Z0-9-_.]sY'external_file_name' may only contain letters, numbers, underscores, dashes, or a period.(RtR_RiR-tsearchR
(R3Ri((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRm�s
cC`sqg}|jdkrdStd|jd|j�}x6|jD]+}|j|�}|r>|j|�q>q>W|S(NR4R5(RuR_RbRoR5RgRy(R3tresultstdecoderR;R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR!�scC`s|jddkrdS|jS(NR!(RtR_R!(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s(R`RaR�RpRqRmR!R�(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s
tChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R�tgetattrt_filter_paramst	Exception(R3R&t
returnable((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyt	to_return�s
(R`RaR�(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��st
UsableChangescB`seZRS((R`Ra(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��stReportableChangescB`seZRS((R`Ra(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��st
DifferencecB`sbeZdd�Zd�Zd�Zed��Zed��Zed��Z	ed��Z
RS(cC`s||_||_dS(N(twantthave(R3R�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR6�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R�Rvt_Difference__default(R3tparamR&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R�R�R�Rv(R3R�tattr1tattr2((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyt	__defaults
cC`sy|jjtkrdS|jjdkr>|jjgkr>dS|jjdkrZ|jjSt|jj|jj�}|S(N(R�tinternalRR_R�R!R(R3R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR!s$
cC`sdS(N(R_(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRoscC`sF|jjrdS|jjdkr&dS|jj|jjkrBtSdS(N(R�R�R_RqR�R(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRq scC`st|jj|jj�S(N(RR�RpR�(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyRp)sN(R`RaR_R6R�R�R�R!RoRqRp(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s				tBaseManagercB`sYeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(tgetR_R�RR�tclientR�R�R�R�R�tchanges(R3targstkwargs((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR6/s
cC`s|j�}|rtStS(N(t_update_changed_optionsRR(R3R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyt
should_update6scC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentR�tchanged(RR8R�tstateR�R�R�R�R�R�t_announce_deprecations(R3R�R&R�t
reportableR�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pytexec_module<s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopR�R�t	deprecate(R3R&twarningstwarning((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�Ms


cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR�(R�R�R�R�R_R�R�(R3R�RQ((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyt_set_changed_optionsUs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�(R�R�R�R�R�R8R�R_R7R�R�R�RR(R3tdiffR�R�tktchange((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�]s		
cC`s$|j�r|j�S|j�SdS(N(texistsR�tcreate(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�os
cC`s|j�r|j�StS(N(R�tremoveR(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�us
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(R�t
check_modeRtremove_from_deviceR�R
(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�zs
(R`RaR6R�R�R�R�R�R�R�R�(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�.s								tInternalManagercB`sGeZd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cC`s[|j�t|jj�s.t|jj�r=td��n|jjrMtS|j	�tS(NsPThe size of the provided data (or file) is too large for an internal data group.(
R�R#R�RuR)R
R�R�Rtcreate_on_device(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s
$
cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR�R�RR�R�Rtupdate_on_device(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s
cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns3https://{0}:{1}/mgmt/tm/ltm/data-group/internal/{2}tservertserver_porti�tcode(RHR�tproviderRR�t	partitionRitapiR�tjsonRURRR(R3turitresptresponse((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s


+cC`s�|jj�}|jj|d<|jj|d<dj|jjd|jjd�}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd|kr�|ddkr�d|kr�t|d��q�t|j��ndS(
NRiR�s0https://{0}:{1}/mgmt/tm/ltm/data-group/internal/R�R�R�R�i�i�i�tmessage(i�i�i�(R�t
api_paramsR�RiR�RHR�R�R�tpostR�RUR
RLR(R3R�R�R�R�tex((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.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(Ns3https://{0}:{1}/mgmt/tm/ltm/data-group/internal/{2}R�R�R�R�i�R�(R�R�RHR�R�RR�R�RiR�tpatchR�RUR
RLR(R3R�R�R�R�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s

cC`sjdj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
SdS(Ns3https://{0}:{1}/mgmt/tm/ltm/data-group/internal/{2}R�R�i�(RHR�R�RR�R�RiR�tdeleteRR(R3R�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.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(Ns3https://{0}:{1}/mgmt/tm/ltm/data-group/internal/{2}R�R�R�i�R�R�(RHR�R�RR�R�RiR�R�R�RUR
RLRR�(R3R�R�R�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s

(	R`RaR�R�R�R�R�R�R�(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s							
tExternalManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zed�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�ZRS(
cC`sLt}|j�r!|j�}n|j�rH|jjrH|j�}n|S(N(RR�R�texternal_file_existsR�tdelete_data_group_filet"remove_data_group_file_from_device(R3R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��scC`sIt|jj�r!td��n|j�|jjr;tS|j�tS(Ns'An external data group cannot be empty.(	RR�RuR
R�R�R�RR�(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s

cC`sj|j�|_|j�stS|jjrLt|jj�rLtd��n|j	j
r\tS|j�tS(Ns'An external data group cannot be empty.(
R�R�R�RR�RuRR�R
R�R�RR�(R3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�s
cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns3https://{0}:{1}/mgmt/tm/ltm/data-group/external/{2}R�R�i�R�(RHR�R�RR�R�RiR�R�R�RURRR(R3R�R�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�
s


+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/sys/file/data-group/{2}R�R�i�R�(RHR�R�RR�R�RmR�R�R�RURRR(R3R�R�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�s


+cC`sddj|jjd|jjd�}yt|j|||�Wntk
r_td��nXdS(Ns1https://{0}:{1}/mgmt/shared/file-transfer/uploadsR�R�sFailed to upload the file.(RHR�R�RR
(R3RRiturl((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pytupload_file_to_device+s

c
C`s�|j|jj|�|r
dj|jjd|jjdt|jj|��}idj|�d6}|jjj	|d|�}y|j
�}Wn%tk
r�}	tt
|	���nXd|kr�|ddkr�d	|kr�t|d	��q
t|j��q�n�d
j|jjd|jjd�}td|d|ddj|��}|jjj|d|�}y|j
�}Wn%tk
r�}	tt
|	���nXd|kr�|ddkr�d	|kr�t|d	��q�t|j��n|dS(Ns/https://{0}:{1}/mgmt/tm/sys/file/data-group/{2}R�R�sfile:{0}t
sourcePathR�R�i�R�s,https://{0}:{1}/mgmt/tm/sys/file/data-group/RiRoi�(i�i�(R�R�RuRHR�R�RR�R�R�R�RUR
RLRR8R�(
R3RiRotremote_pathR�R�R�R�R�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyt_upload_to_file7sB


cC`s�dj|jjd|jjd�}tddd|�}|jjj|d|�}y|j�}Wn%tk
r�}tt	|���nXd|kr�|dd	kr�d
|kr�t|d
��q�t|j
��ndS(Ns%https://{0}:{1}/mgmt/tm/util/unix-rm/R�R�tcommandtruntutilCmdArgsR�R�i�R�(RHR�R�R8R�R�R�RUR
RLR(R3R�R�R�R�R�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pytremove_file_on_deviceds
	c	C`sY|jj}dj|�}|j||jj|dt�}td|jjd|jjd|�}|jj	r�|jj	|d<ndj|j
jd|j
jd	�}|j
jj
|d
|�}y|j�}Wn%tk
r�}tt|���nXd|krH|ddkrHd|kr6t|d��qHt|j��n|j|�dS(Ns/var/config/rest/downloads/{0}R�RiR�RnRps0https://{0}:{1}/mgmt/tm/ltm/data-group/external/R�R�R�R�i�i�R�(i�i�(R�RmRHR�RoRR8RiR�RpR�R�R�R�R�RUR
RLRR�(	R3RiR�t
external_fileR�R�R�R�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�xs,!	
c	C`sri}|jjdk	ra|jj}dj|�}|j||jj|dt�}||d<n|j	j
dk	r�|j	j
|d<n|s�dSdj|jjd|jjdt
|jj|jj��}|jjj|d|�}y|j�}Wn%tk
r }tt|���nXd	|krn|d	d
krnd|kr\t|d��qnt|j��ndS(Ns/var/config/rest/downloads/{0}R�RnRps3https://{0}:{1}/mgmt/tm/ltm/data-group/external/{2}R�R�R�R�i�R�(R�RuR_RmRHR�R�RoRR�RpR�R�RR�RiR�R�R�RUR
RLR(	R3R�RiR�R�R�R�R�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s.!


cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}|jj	rl|j
�n|jdkrtSdS(Ns3https://{0}:{1}/mgmt/tm/ltm/data-group/external/{2}R�R�i�(
RHR�R�RR�R�RiR�R�R�R�RR(R3R�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s


cC`sndj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
StSdS(Ns/https://{0}:{1}/mgmt/tm/sys/file/data-group/{2}R�R�i�(RHR�R�RR�R�RmR�R�RRR(R3R�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s

c
C`sdj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��ntjj|d�}tjj|d�jd�}d	j|jjd|jjdt||��}|jjj|�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��ntd
|�}	|	ji|jdd�d6�|	S(
sReads the current configuration from the device

        For an external data group, we are interested in two things from the
        current configuration

        * ``checksum``
        * ``type``

        The ``checksum`` will allow us to compare the data group value we have
        with the data group value being provided.

        The ``type`` will allow us to do validation on the data group value being
        provided (if any).

        Returns:
             ExternalApiParameters: Attributes of the remote resource.
        s3https://{0}:{1}/mgmt/tm/ltm/data-group/external/{2}R�R�R�i�R�Rnt/s/https://{0}:{1}/mgmt/tm/sys/file/data-group/{2}R�RpN(RHR�R�RR�R�RiR�R�R�RUR
RLRRtpathtbasenametdirnameRWR�R�R_(
R3R�tresp_dgtresponse_dgR�R�texternal_file_partitionR�R�R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s>



 (R`RaR�R�R�R�R�R�RR�R�R�R�R�R�R�(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR��s			
			-		 	!		
t
ModuleManagercB`s#eZd�Zd�Zd�ZRS(cO`s||_|jd�|_dS(NR�(R�R�R�(R3R�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR6s	cC`s;|jjdr"|jd�}n|jd�}|j�S(NR�texternal(R�R�tget_managerR�(R3tmanager((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�scC`s6|dkrt|j�S|dkr2t|j�SdS(NR�R�(R�R�R�(R3Ro((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�s
(R`RaR6R�R�(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�s		tArgumentSpeccB`seZd�ZRS(cC`sPt|_tdtdt�dtdddddd	d
dgdd�d
tdd�dtdddd�dtdddtdtdt�dtdd���dtdd�dt�dtdd�dt�dtdddgdd�d tdd!d"td#gf��}i|_|jjt�|jj|�dd$dgg|_dS(%NRitrequiredRotchoicesRrRBR=RsRLR>RTtdefaultR�tboolR�tnoR!tlistt
suboptionsRQRDtrawRuR�RmR5s:=RpR�R�R�R�tCommontfallbacktF5_PARTITIONtrecords_content(Rtsupports_check_modeR8R
t
argument_specR�Rtmutually_exclusive(R3R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR6's2					(R`RaR6(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyR�&scC`s�t�}td|jd|jd|j�}y,td|�}|j�}|j|�Wn)tk
r�}|j	dt
|��nXdS(NR�R�R�R�R�(R�R	R�R�R�R�R�t	exit_jsonR
t	fail_jsonRL(tspecR�tmmR�R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pytmainJs			t__main__(Bt
__future__RRRRot
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR�RR-tansible.module_utils._textRtansible.module_utils.basicR	R
RtImportErrortiot%library.module_utils.network.f5.bigipRt&library.module_utils.network.f5.commonR
RRt'library.module_utils.network.f5.compareRRt)library.module_utils.network.f5.ipaddressRt%library.module_utils.compat.ipaddressRRt(library.module_utils.network.f5.icontrolRRt%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont'ansible.module_utils.network.f5.comparet)ansible.module_utils.network.f5.ipaddresst%ansible.module_utils.compat.ipaddresst(ansible.module_utils.network.f5.icontrolR%R RR#R)tobjectR*RbRlR�R�R�R�R�R�R�R�R�R�R�RR`(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_data_group.pyt<module>s�


�p

			
		�AI98Ui�($	

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