Anons79 Mini Shell

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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd	Z	dd
l
Z
yJddlmZddl
mZdd
lmZddlmZeZWnek
r�ZeZnXddlmZddlmZmZmZmZmZm Z m!Z!m"Z"ddddddddgZ#dddgZ$d�Z%d�Z&d�Z'd�Z(d�Z)d �Z*d!�Z+d"�Z,d#�Z-d$�Z.d%�Z/d&�Z0d'�Z1d(�Z2e3d)kr�e2�nd
S(*i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bysJ0
---
module: netscaler_gslb_vserver
short_description: Configure gslb vserver entities in Netscaler.
description:
    - Configure gslb vserver entities in Netscaler.

version_added: "2.4.0"

author: George Nikolopoulos (@giorgos-nikolopoulos)

options:

    name:
        description:
            - >-
                Name for the GSLB virtual server. Must begin with an ASCII alphanumeric or underscore C(_) character,
                and must contain only ASCII alphanumeric, underscore C(_), hash C(#), period C(.), space, colon C(:), at C(@),
                equals C(=), and hyphen C(-) characters. Can be changed after the virtual server is created.
            - "Minimum length = 1"

    servicetype:
        choices:
            - 'HTTP'
            - 'FTP'
            - 'TCP'
            - 'UDP'
            - 'SSL'
            - 'SSL_BRIDGE'
            - 'SSL_TCP'
            - 'NNTP'
            - 'ANY'
            - 'SIP_UDP'
            - 'SIP_TCP'
            - 'SIP_SSL'
            - 'RADIUS'
            - 'RDP'
            - 'RTSP'
            - 'MYSQL'
            - 'MSSQL'
            - 'ORACLE'
        description:
            - "Protocol used by services bound to the virtual server."
            - >-

    dnsrecordtype:
        choices:
            - 'A'
            - 'AAAA'
            - 'CNAME'
            - 'NAPTR'
        description:
            - "DNS record type to associate with the GSLB virtual server's domain name."
            - "Default value: A"
            - "Possible values = A, AAAA, CNAME, NAPTR"

    lbmethod:
        choices:
            - 'ROUNDROBIN'
            - 'LEASTCONNECTION'
            - 'LEASTRESPONSETIME'
            - 'SOURCEIPHASH'
            - 'LEASTBANDWIDTH'
            - 'LEASTPACKETS'
            - 'STATICPROXIMITY'
            - 'RTT'
            - 'CUSTOMLOAD'
        description:
            - "Load balancing method for the GSLB virtual server."
            - "Default value: LEASTCONNECTION"
            - >-
                Possible values = ROUNDROBIN, LEASTCONNECTION, LEASTRESPONSETIME, SOURCEIPHASH, LEASTBANDWIDTH,
                LEASTPACKETS, STATICPROXIMITY, RTT, CUSTOMLOAD

    backuplbmethod:
        choices:
            - 'ROUNDROBIN'
            - 'LEASTCONNECTION'
            - 'LEASTRESPONSETIME'
            - 'SOURCEIPHASH'
            - 'LEASTBANDWIDTH'
            - 'LEASTPACKETS'
            - 'STATICPROXIMITY'
            - 'RTT'
            - 'CUSTOMLOAD'
        description:
            - >-
                Backup load balancing method. Becomes operational if the primary load balancing method fails or
                cannot be used. Valid only if the primary method is based on either round-trip time (RTT) or static
                proximity.

    netmask:
        description:
            - "IPv4 network mask for use in the SOURCEIPHASH load balancing method."
            - "Minimum length = 1"

    v6netmasklen:
        description:
            - >-
                Number of bits to consider, in an IPv6 source IP address, for creating the hash that is required by
                the C(SOURCEIPHASH) load balancing method.
            - "Default value: C(128)"
            - "Minimum value = C(1)"
            - "Maximum value = C(128)"

    tolerance:
        description:
            - >-
                Site selection tolerance, in milliseconds, for implementing the RTT load balancing method. If a
                site's RTT deviates from the lowest RTT by more than the specified tolerance, the site is not
                considered when the NetScaler appliance makes a GSLB decision. The appliance implements the round
                robin method of global server load balancing between sites whose RTT values are within the specified
                tolerance. If the tolerance is 0 (zero), the appliance always sends clients the IP address of the
                site with the lowest RTT.
            - "Minimum value = C(0)"
            - "Maximum value = C(100)"

    persistencetype:
        choices:
            - 'SOURCEIP'
            - 'NONE'
        description:
            - "Use source IP address based persistence for the virtual server."
            - >-
                After the load balancing method selects a service for the first packet, the IP address received in
                response to the DNS query is used for subsequent requests from the same client.

    persistenceid:
        description:
            - >-
                The persistence ID for the GSLB virtual server. The ID is a positive integer that enables GSLB sites
                to identify the GSLB virtual server, and is required if source IP address based or spill over based
                persistence is enabled on the virtual server.
            - "Minimum value = C(0)"
            - "Maximum value = C(65535)"

    persistmask:
        description:
            - >-
                The optional IPv4 network mask applied to IPv4 addresses to establish source IP address based
                persistence.
            - "Minimum length = 1"

    v6persistmasklen:
        description:
            - >-
                Number of bits to consider in an IPv6 source IP address when creating source IP address based
                persistence sessions.
            - "Default value: C(128)"
            - "Minimum value = C(1)"
            - "Maximum value = C(128)"

    timeout:
        description:
            - "Idle time, in minutes, after which a persistence entry is cleared."
            - "Default value: C(2)"
            - "Minimum value = C(2)"
            - "Maximum value = C(1440)"

    mir:
        choices:
            - 'enabled'
            - 'disabled'
        description:
            - "Include multiple IP addresses in the DNS responses sent to clients."

    disableprimaryondown:
        choices:
            - 'enabled'
            - 'disabled'
        description:
            - >-
                Continue to direct traffic to the backup chain even after the primary GSLB virtual server returns to
                the UP state. Used when spillover is configured for the virtual server.

    dynamicweight:
        choices:
            - 'SERVICECOUNT'
            - 'SERVICEWEIGHT'
            - 'DISABLED'
        description:
            - >-
                Specify if the appliance should consider the service count, service weights, or ignore both when
                using weight-based load balancing methods. The state of the number of services bound to the virtual
                server help the appliance to select the service.

    considereffectivestate:
        choices:
            - 'NONE'
            - 'STATE_ONLY'
        description:
            - >-
                If the primary state of all bound GSLB services is DOWN, consider the effective states of all the
                GSLB services, obtained through the Metrics Exchange Protocol (MEP), when determining the state of
                the GSLB virtual server. To consider the effective state, set the parameter to STATE_ONLY. To
                disregard the effective state, set the parameter to NONE.
            - >-
                The effective state of a GSLB service is the ability of the corresponding virtual server to serve
                traffic. The effective state of the load balancing virtual server, which is transferred to the GSLB
                service, is UP even if only one virtual server in the backup chain of virtual servers is in the UP
                state.

    comment:
        description:
            - "Any comments that you might want to associate with the GSLB virtual server."

    somethod:
        choices:
            - 'CONNECTION'
            - 'DYNAMICCONNECTION'
            - 'BANDWIDTH'
            - 'HEALTH'
            - 'NONE'
        description:
            - "Type of threshold that, when exceeded, triggers spillover. Available settings function as follows:"
            - "* C(CONNECTION) - Spillover occurs when the number of client connections exceeds the threshold."
            - >-
                * C(DYNAMICCONNECTION) - Spillover occurs when the number of client connections at the GSLB virtual
                server exceeds the sum of the maximum client (Max Clients) settings for bound GSLB services. Do not
                specify a spillover threshold for this setting, because the threshold is implied by the Max Clients
                settings of the bound GSLB services.
            - >-
                * C(BANDWIDTH) - Spillover occurs when the bandwidth consumed by the GSLB virtual server's incoming and
                outgoing traffic exceeds the threshold.
            - >-
                * C(HEALTH) - Spillover occurs when the percentage of weights of the GSLB services that are UP drops
                below the threshold. For example, if services gslbSvc1, gslbSvc2, and gslbSvc3 are bound to a virtual
                server, with weights 1, 2, and 3, and the spillover threshold is 50%, spillover occurs if gslbSvc1
                and gslbSvc3 or gslbSvc2 and gslbSvc3 transition to DOWN.
            - "* C(NONE) - Spillover does not occur."

    sopersistence:
        choices:
            - 'enabled'
            - 'disabled'
        description:
            - >-
                If spillover occurs, maintain source IP address based persistence for both primary and backup GSLB
                virtual servers.

    sopersistencetimeout:
        description:
            - "Timeout for spillover persistence, in minutes."
            - "Default value: C(2)"
            - "Minimum value = C(2)"
            - "Maximum value = C(1440)"

    sothreshold:
        description:
            - >-
                Threshold at which spillover occurs. Specify an integer for the CONNECTION spillover method, a
                bandwidth value in kilobits per second for the BANDWIDTH method (do not enter the units), or a
                percentage for the HEALTH method (do not enter the percentage symbol).
            - "Minimum value = C(1)"
            - "Maximum value = C(4294967287)"

    sobackupaction:
        choices:
            - 'DROP'
            - 'ACCEPT'
            - 'REDIRECT'
        description:
            - >-
                Action to be performed if spillover is to take effect, but no backup chain to spillover is usable or
                exists.

    appflowlog:
        choices:
            - 'enabled'
            - 'disabled'
        description:
            - "Enable logging appflow flow information."

    domain_bindings:
        description:
            - >-
                List of bindings for domains for this glsb vserver.
        suboptions:
            cookietimeout:
                description:
                    - Timeout, in minutes, for the GSLB site cookie.

            domainname:
                description:
                    - Domain name for which to change the time to live (TTL) and/or backup service IP address.

            ttl:
                description:
                    - Time to live (TTL) for the domain.

            sitedomainttl:
                description:
                    - >-
                        TTL, in seconds, for all internally created site domains (created when a site prefix is
                        configured on a GSLB service) that are associated with this virtual server.
                    - Minimum value = C(1)

    service_bindings:
        description:
            - List of bindings for gslb services bound to this gslb virtual server.
        suboptions:
            servicename:
                description:
                    - Name of the GSLB service for which to change the weight.
            weight:
                description:
                    - Weight to assign to the GSLB service.

    disabled:
        description:
            - When set to C(yes) the GSLB Vserver state will be set to C(disabled).
            - When set to C(no) the GSLB Vserver state will be set to C(enabled).
            - >-
                Note that due to limitations of the underlying NITRO API a C(disabled) state change alone
                does not cause the module result to report a changed status.
        type: bool
        default: false




extends_documentation_fragment: netscaler
requirements:
    - nitro python sdk
t
N(tgslbvserver(tgslbvserver_gslbservice_binding(tgslbvserver_domain_binding(tnitro_exception(t
AnsibleModule(tConfigProxytget_nitro_clienttnetscaler_common_argumentstlogtloglinestensure_feature_is_enabledtget_immutables_intersectiontcomplete_missing_attributestnamet
domainnametbackupipflagt
cookietimeouttbackupiptttlt
sitedomainttltcookie_domainflagtservicenametweightcC`s�td�i}tj|d|jd�dkr�tj|d|jd�}x1|D]&}t|tdd�|||j<qUWn|S(Ntget_actual_domain_bindingsRit
fill_value(	RRtcounttparamstgetRt#gslbvserver_domain_binding_rw_attrstNoneR(tclienttmoduletactual_domain_bindingstfetched_domain_bindingstbinding((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pyR �s
"
cC`s�td�i}|jddk	r�xp|jdD]^}tj|�}|jd|d<tdt�d|d|dtdg�}|||d	<q1Wn|S(
Nt%get_configured_domain_bindings_proxystdomain_bindingsRtactualR'tattribute_values_dicttreadwrite_attrstreadonly_attrsR(RR#R&tcopytdeepcopyRRR%(R'R(tconfigured_domain_proxystconfigured_domain_bindingtbinding_valuest gslbvserver_domain_binding_proxy((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pyR,�s
		c	C`sMtd�t||�}t||�}xM|j�D]?\}}||j�kr5td|�tj||�q5q5Wx�|j�D]s\}}||kr�||}|j|�s�td|j�tj||�td|j�|j	�q�q�q�WxJ|j�D]<\}}||j�kr	td|j�|j	�q	q	WdS(Ntsync_domain_bindingss%Deleting absent binding for domain %ss(Deleting differing binding for domain %ss!Adding anew binding for domain %ss#Adding domain binding for domain %s(
RR R,titemstkeysRtdeletethas_equal_attributesRtadd(	R'R(R)R4Rtactual_domain_bindingt	proxy_keyt
binding_proxytactual_binding((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pyR8�s&

c
C`s�td�t||�}t||�}t|j��}t|j��}||A}td|�t|�dkrztSxY|j�D]K\}}|j||�}	d|	kr�|	d=nt|	�dks�tSq�Wt	S(Ntdomain_bindings_identicalssymmetric difference %siR(
RR R,tsetR:tlentFalseR9tdiff_objecttTrue(
R'R(R)R4t
actual_keysettconfigured_keysettsymmetric_differencetkeytproxytdiff((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pyRB�s 


cC`s�td�i}tj|d|jd�dkr�tj|d|jd�}x1|D]&}t|tdd�|||j<qUWn|S(Ntget_actual_service_bindingsRiR!(	RR
R"R#R$Rt(gslbvserver_gslbservice_binding_rw_attrsR&R(R'R(tactual_bindingstfetched_bindingsR+((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pyRN�s
"
cC`s�td�i}|jddk	r�xp|jdD]^}tj|�}|jd|d<tdt�d|d|dtdg�}|||d	<q1Wn|S(
Nt&get_configured_service_bindings_proxystservice_bindingsRR.R'R/R0R1R(RR#R&R2R3RR
RO(R'R(tconfigured_proxystconfigured_bindingR6t!gslbvserver_service_binding_proxy((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pytget_configured_service_bindings�s
		c
C`sut||�}t||�}tt|j��t|j���}xF|D]>}td|�||}|jd|_tj	||�qMWtt|j��t|j��@�}x\|D]T}||}||}|j
|�s�td|�tj	||�|j�q�q�Wtt|j��t|j���}	x0|	D](}||}td|�|j�qEWdS(Ns(Deleting missing binding from service %sRs'Recreating differing service binding %ss!Adding missing service binding %s(RNRWtlistRCR:RR#RR
R;R<R=(
R'R(R.t
configuredtextraneous_service_bindingsRR+tcommon_service_bindingsRLtmissing_service_bindings((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pytsync_service_bindingss*(

(


(

c	C`s�t||�}t||�}t|j��}t|j��}||A}t|�dkrbtSxF|j�D]8\}}||j�kro|j||�s�tSqoqoWtS(Ni(	RNRWRCR:RDRER9R<RG(	R'R(RPRTRHRIRJRKRL((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pytservice_bindings_identicals
cC`s/tj|d|jd�dkr'tStSdS(Nsname:%sRi(R	tcount_filteredR#RGRE(R'R(((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pytgslb_vserver_exists3s#cC`sNtj|d|jd�}|j|d�}t|�dkrFtStSdS(Nsname:%sRi(R	tget_filteredR#RFRDRERG(R'R(tgslb_vserver_proxytgslb_vserver_listt	diff_dict((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pytgslb_vserver_identical:s
cC`s.t|||�o-t||�o-t||�S(N(ReRBR^(R'R(Rb((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pyt
all_identicalCscC`s.tj|d|jd�}|j|d�S(Nsname:%sRi(R	RaR#RF(R'R(RbRc((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pyt	diff_listKscC`sR|jdr/td�tj||j�}ntd�tj||j�}|S(NtdisabledsDisabling glsb_vserversEnabling gslbvserver(R#RR	tdisableR.tenable(R'R(Rbtresult((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pytdo_state_changePs


c7C`s]	tdtdd�dtddddddd	d
ddd
ddddddddddg�dtdddddddg�dtdddddd d!d"d#d$d%d&g	�d'tdddddd d!d"d#d$d%d&g	�d(tdd�d)tdd*�d+tdd*�d,tdddd-d.g�d/tdd*�d0tdd�d1tdd*�d2tdd*�d3tdddd4d5g�d6tdddd4d5g�d7tdddd8d9d:g�d;tdddd.d<g�d=tdd�d>tdddd?d@dAdBd.g�dCtdddd4d5g�dDtdd*�dEtdd*�dFtddddGdHdIg�dJtdddd4d5g�dKtdd�dLtdd��}tdMtddN�dOtddN�d5tddPdQt��}t�}|jt�|j|�|j|�tdR|dSt�}tdTtdUtdVt�}tsO|jdWdX�nt	|�}y|j
�Wn�tk
r�}dYt|j
�|jf}|jdW|�n�tk
r@}tt|��dZkr�|jdWd[t|��qAtt|��d\kr#|jdWd]t|��qA|jdWd^t|��nXddddd'd(d)d+d,d/d0d1d2d3d6d7d;d=d>dCdDdEdFdJdLg}d_d`dadbdcdddedfdgdhdidjdkdlddmdndog}	ddg}
idp�gd36dq�gd66dr�gdC6ds�gdJ6}tdtt�du|dv|jdw|dx|	dy|
dz|�}y�t|d{�|jd|d}kr_td~�t||�s�td�|js�|j�t||�t||�|jd�r�|j�q�nt|dT<n@t|||�s td��t|||�s�td��t|t|||�j ��}
|
gkr~|jdWd�|
fd�t|||�|�n|js�|j�q�nt!||�s�|js�t||�q�nt"||�s�|js�t||�q�nt|dT<|js*|jd�r|j�qq*n
t|dT<|js�t#|||�}|j
d�kr�d�|j
|jf}|jdW||�q�n|js�t||�s�|jdWd�|�nt|||�s�|jdWd�d�t|||�|�nt!||�s"|jdWd�d�t|||�|�nt"||�s\|jdWd�d�t|||�|�q\q�n�|jd|d�kr�t||�r�|js�|j$�|jd�r�|j�q�nt|dT<n
t|dT<|js�t||�r�|jdWd�|�q�q�nWnBtk
rA	}d�t|j
�|jf}|jdW||�nX|j%�|j&|�dS(�NRttypetstrtservicetypetchoicestHTTPtFTPtTCPtUDPtSSLt
SSL_BRIDGEtSSL_TCPtNNTPtANYtSIP_UDPtSIP_TCPtSIP_SSLtRADIUStRDPtRTSPtMYSQLtMSSQLtORACLEt
dnsrecordtypetAtAAAAtCNAMEtNAPTRtlbmethodt
ROUNDROBINtLEASTCONNECTIONtLEASTRESPONSETIMEtSOURCEIPHASHtLEASTBANDWIDTHtLEASTPACKETStSTATICPROXIMITYtRTTt
CUSTOMLOADtbackuplbmethodtnetmasktv6netmasklentfloatt	tolerancetpersistencetypetSOURCEIPtNONEt
persistenceidtpersistmasktv6persistmasklenttimeouttmirtenabledRhtdisableprimaryondownt
dynamicweighttSERVICECOUNTt
SERVICEWEIGHTtDISABLEDtconsidereffectivestatet
STATE_ONLYtcommenttsomethodt
CONNECTIONtDYNAMICCONNECTIONt	BANDWIDTHtHEALTHt
sopersistencetsopersistencetimeouttsothresholdtsobackupactiontDROPtACCEPTtREDIRECTt
appflowlogRt
cookie_domainR-RXRStbooltdefaultt
argument_spectsupports_check_modetchangedtfailedRtmsgsCould not load nitro python sdks6nitro exception during login. errorcode=%s, message=%ss-<class 'requests.exceptions.ConnectionError'>sConnection error %ss&<class 'requests.exceptions.SSLError'>sSSL Error %ss Unexpected error during login %stcurstateRt
lbrrreasontiscnametsitepersistencet
totalservicestactiveserviceststatechangetimesectstatechangetimemsecttickssincelaststatechangethealtht
policynametprioritytgotopriorityexpressiont
vsvrbindsvciptvsvrbindsvcportt__countcS`s
|j�S(N(tupper(tv((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pyt<lambda>PscS`s
|j�S(N(R�(R�((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pyR�QscS`s
|j�S(N(R�(R�((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pyR�RscS`s
|j�S(N(R�(R�((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pyR�SsR.R'R/R0R1timmutable_attrst
transformstGSLBtstatetpresentsApplying state presentsCreating objecttsave_configsEntering update actionssUpdating gslb vservers%Cannot update immutable attributes %sRMis<Error when setting disabled state. errorcode: %s message: %ssGSLB Vserver does not exists$GSLB Vserver differs from configureds&Domain bindings differ from configureds'Service bindings differ from configuredtabsentsGSLB Vserver still existss(nitro exception errorcode=%s, message=%s('tdictREtupdateRR
RGRtPYTHON_SDK_IMPORTEDt	fail_jsonRtloginRRnt	errorcodetmessaget	ExceptionRmRR	R#RRR`t
check_modeR=R8R]R�RfReRRgR:RBR^RlR;tlogoutt	exit_json(tmodule_specific_argumentsthand_inserted_argumentsR�R(t
module_resultR'teR�R0R1R�R�Rbtimmutables_changedtres((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pytmainZs	


					


			


	






!	

			
	

		((.	



	 
t__main__(4t
__future__RRRRmt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR2tAnssrc.com.citrix.netscaler.nitro.resource.config.gslb.gslbvserverR	tUnssrc.com.citrix.netscaler.nitro.resource.config.gslb.gslbvserver_gslbservice_bindingR
tPnssrc.com.citrix.netscaler.nitro.resource.config.gslb.gslbvserver_domain_bindingRt:nssrc.com.citrix.netscaler.nitro.exception.nitro_exceptionRRGR�tImportErrorR�REtansible.module_utils.basicR
t0ansible.module_utils.network.netscaler.netscalerRRRRRRRRR%ROR R,R8RBRNRWR]R^R`ReRfRgRlR�t__name__(((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_vserver.pyt<module>s^


�H

:
																
	�`

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