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

�
�Udac@`spddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZmZmZmZmZmZmZmZyAe�ddlmZddlmZddlmZeZWnek
rZe ZnXd�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)e*dkrle)�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: netscaler_gslb_service
short_description: Manage gslb service entities in Netscaler.
description:
    - Manage gslb service entities in Netscaler.

version_added: "2.4"

author: George Nikolopoulos (@giorgos-nikolopoulos)

options:

    servicename:
        description:
            - >-
                Name for the GSLB service. 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 GSLB service is created.
            - >-
            - "Minimum length = 1"

    cnameentry:
        description:
            - "Canonical name of the GSLB service. Used in CNAME-based GSLB."
            - "Minimum length = 1"


    servername:
        description:
            - "Name of the server hosting the GSLB service."
            - "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:
            - "Type of service to create."

    port:
        description:
            - "Port on which the load balancing entity represented by this GSLB service listens."
            - "Minimum value = 1"
            - "Range 1 - 65535"
            - "* in CLI is represented as 65535 in NITRO API"

    publicip:
        description:
            - >-
                The public IP address that a NAT device translates to the GSLB service's private IP address.
                Optional.

    publicport:
        description:
            - >-
                The public port associated with the GSLB service's public IP address. The port is mapped to the
                service's private port number. Applicable to the local GSLB service. Optional.

    maxclient:
        description:
            - >-
                The maximum number of open connections that the service can support at any given time. A GSLB service
                whose connection count reaches the maximum is not considered when a GSLB decision is made, until the
                connection count drops below the maximum.
            - "Minimum value = C(0)"
            - "Maximum value = C(4294967294)"

    healthmonitor:
        description:
            - "Monitor the health of the GSLB service."
        type: bool

    sitename:
        description:
            - "Name of the GSLB site to which the service belongs."
            - "Minimum length = 1"

    cip:
        choices:
            - 'enabled'
            - 'disabled'
        description:
            - >-
                In the request that is forwarded to the GSLB service, insert a header that stores the client's IP
                address. Client IP header insertion is used in connection-proxy based site persistence.

    cipheader:
        description:
            - >-
                Name for the HTTP header that stores the client's IP address. Used with the Client IP option. If
                client IP header insertion is enabled on the service and a name is not specified for the header, the
                NetScaler appliance uses the name specified by the cipHeader parameter in the set ns param command
                or, in the GUI, the Client IP Header parameter in the Configure HTTP Parameters dialog box.
            - "Minimum length = 1"

    sitepersistence:
        choices:
            - 'ConnectionProxy'
            - 'HTTPRedirect'
            - 'NONE'
        description:
            - "Use cookie-based site persistence. Applicable only to C(HTTP) and C(SSL) GSLB services."

    siteprefix:
        description:
            - >-
                The site's prefix string. When the service is bound to a GSLB virtual server, a GSLB site domain is
                generated internally for each bound service-domain pair by concatenating the site prefix of the
                service and the name of the domain. If the special string NONE is specified, the site-prefix string
                is unset. When implementing HTTP redirect site persistence, the NetScaler appliance redirects GSLB
                requests to GSLB services by using their site domains.

    clttimeout:
        description:
            - >-
                Idle time, in seconds, after which a client connection is terminated. Applicable if connection proxy
                based site persistence is used.
            - "Minimum value = 0"
            - "Maximum value = 31536000"

    maxbandwidth:
        description:
            - >-
                Integer specifying the maximum bandwidth allowed for the service. A GSLB service whose bandwidth
                reaches the maximum is not considered when a GSLB decision is made, until its bandwidth consumption
                drops below the maximum.

    downstateflush:
        choices:
            - 'enabled'
            - 'disabled'
        description:
            - >-
                Flush all active transactions associated with the GSLB service when its state transitions from UP to
                DOWN. Do not enable this option for services that must complete their transactions. Applicable if
                connection proxy based site persistence is used.

    maxaaausers:
        description:
            - >-
                Maximum number of SSL VPN users that can be logged on concurrently to the VPN virtual server that is
                represented by this GSLB service. A GSLB service whose user count reaches the maximum is not
                considered when a GSLB decision is made, until the count drops below the maximum.
            - "Minimum value = C(0)"
            - "Maximum value = C(65535)"

    monthreshold:
        description:
            - >-
                Monitoring threshold value for the GSLB service. If the sum of the weights of the monitors that are
                bound to this GSLB service and are in the UP state is not equal to or greater than this threshold
                value, the service is marked as DOWN.
            - "Minimum value = C(0)"
            - "Maximum value = C(65535)"

    hashid:
        description:
            - "Unique hash identifier for the GSLB service, used by hash based load balancing methods."
            - "Minimum value = C(1)"

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

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

    ipaddress:
        description:
            - >-
                IP address for the GSLB service. Should represent a load balancing, content switching, or VPN virtual
                server on the NetScaler appliance, or the IP address of another load balancing device.

    monitor_bindings:
        description:
            - Bind monitors to this gslb service
        suboptions:

            weight:
                description:
                    - Weight to assign to the monitor-service binding.
                    - A larger number specifies a greater weight.
                    - Contributes to the monitoring threshold, which determines the state of the service.
                    - Minimum value = C(1)
                    - Maximum value = C(100)

            monitor_name:
                description:
                    - Monitor name.

extends_documentation_fragment: netscaler
requirements:
    - nitro python sdk
s�
- name: Setup gslb service 2

  delegate_to: localhost
  register: result
  check_mode: "{{ check_mode }}"

  netscaler_gslb_service:
    operation: present

    servicename: gslb-service-2
    cnameentry: example.com
    sitename: gslb-site-1
s
loglines:
    description: list of logged messages by the module
    returned: always
    type: list
    sample: "['message 1', 'message 2']"

msg:
    description: Message detailing the failure reason
    returned: failure
    type: str
    sample: "Action does not exist"

diff:
    description: List of differences between the actual configured object and the configuration specified in the module
    returned: failure
    type: dict
    sample: "{ 'targetlbvserver': 'difference. ours: (str) server1 other: (str) server2' }"
N(t
AnsibleModule(tConfigProxytget_nitro_clienttnetscaler_common_argumentstlogtloglinestensure_feature_is_enabledtmonkey_patch_nitro_apitget_immutables_intersection(tgslbservice(tgslbservice_lbmonitor_binding(tnitro_exceptioncC`s/tj|d|jd�dkr'tStSdS(Nsservicename:%stservicenamei(Rtcount_filteredtparamstTruetFalse(tclienttmodule((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.pytgslb_service_exists$s#cC`sdtj|d|jd�}|j|d�}d|krF|d=nt|�dkr\tStSdS(Nsservicename:%sRitip(Rtget_filteredRtdiff_objecttlenRR(RRtgslb_service_proxytgslb_service_listt	diff_dict((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.pytgslb_service_identical+s
cC`sstd�i}tj|d|jd�dkrotj|d|jd�}x|D]}|||j<qUWn|S(Ntget_actual_monitor_bindingsRi(RRtcountRtgettmonitor_name(RRtactual_monitor_bindingstfetched_bindingstbinding((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.pyR$7s
"
cC`s�td�i}dddg}|jddk	r�xp|jdD]^}tj|�}|jd|d<tdt�d|d|d	|d
g�}|||d<q@Wn|S(Ntget_configured_monitor_bindingstweightRR'tmonitor_bindingstactualRtattribute_values_dicttreadwrite_attrstreadonly_attrs(RRtNonetcopytdeepcopyR	R(RRtconfigured_monitor_proxyst&gslbservice_lbmonitor_binding_rw_attrstconfigured_monitor_bindingstbinding_valuestproxy((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.pyR+Es"
			c	C`s�td�t||�}t||�}t|j��}t|j��}||A}t|�dkrztd|�tSxL|j�D]>\}}|j||�s�td|j	||��tSq�Wt
S(Ntmonitor_bindings_identicalisSymmetric difference %ssmonitor binding difference %s(RR$R+tsettkeysRRtitemsthas_equal_attributesRR(	RRtactual_bindingstconfigured_proxyst
actual_keysettconfigured_keysettsymmetric_differencetkeyR9((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.pyR:]s

cC`s�td�t||�}t||�}xa|j�D]S\}}||j�kr5td|�tdt|��tj||�q5q5Wx�|j�D]�\}}||kr�||}|j|�sQtd|j	�tdt|��tdt
|d��tdt
|d	d��tj||�td
|j	�|j�qQq�q�WxJ|j�D]<\}}||j�krbtd|j	�|j�qbqbWdS(Ntsync_monitor_bindingss&Deleting absent binding for monitor %ss	dir is %ss)Deleting differing binding for monitor %ssdir %ssattribute monitor_name %sR'sattribute monitorname %stmonitornames"Adding anew binding for monitor %ss%Adding monitor binding for monitor %s(
RR$R+R=R<tdirRtdeleteR>R'tgetattrR2tadd(RRR(R5R'tactual_bindingt	proxy_keyt
binding_proxy((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.pyREts.

cC`sJtj|d|jd�}|j|d�}d|krF|d=n|S(Nsservicename:%sRiR(RRRR(RRR R!t	diff_list((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.pyRN�s

cC`st|||�ot||�S(N(R#R:(RRR ((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.pyt
all_identical�sc2C`s�tdtdd�dtdd�dtdd�dtddddd	d
ddd
ddddddddddddg�dtdd�dtdd�dtdd�dtdd�d tdd!�d"tdd�d#tdddd$d%g�d&tdd�d'tdddd(d)d*g�d+tdd�d,tdd�d-tdd�d.tdddd$d%g�d/tdd�d0tdd�d1tdd�d2tdd�d3tdddd$d%g�d4tdd��}td5tdd6��}t�}|jt�|j|�|j|�td7|d8t�}td9td:td;t�}tsb|jd<d=�nt	|�}y|j
�Wn�tk
r�}d>t|j
�|jf}|jd<|�n�tk
rS}tt|��d?kr|jd<d@t|��qTtt|��dAkr6|jd<dBt|��qT|jd<dCt|��nXdddDddddddd d"d#d&d'd+d,d-d.d/d0d1d2d3d4g}dEdFdGdHdIdJdKdLdMdNdOdPdQdRg}	dddDdddd"dSd&dTd,dUdVdWdXg}
idYgd 6dZ�gd#6d[�gd.6d\�gd36}|jd4|jdD<td]t�d^|d_|jd`|da|db|	dc|
�}y�t|dd�|jdSdekr�t||�s|js�|j�t||�|jdfr�|j�q�nt|d9<n�t|||�s�t|t|||�j��}
|
gkrs|jd<dg|
fdht|||�|�nt|||�s�|js�|j�q�nt||�s�|js�t||�q�nt|d9<|jdfr�|j�q�n
t|d9<|js<t||�s(|jd<di|�nt|||�sb|jd<djdht|||�|�nt||�s�|jd<dkdht|||�|�q�q<n�|jdSdlkr<t||�r�|js�|j �|jdfr�|j�q�nt|d9<n
t|d9<|js<t||�r9|jd<dm|�q9q<nWnBtk
r�}dnt|j
�|jf}|jd<||�nX|j!�|j"|�dS(oNRttypetstrt
cnameentryt
servernametservicetypetchoicestHTTPtFTPtTCPtUDPtSSLt
SSL_BRIDGEtSSL_TCPtNNTPtANYtSIP_UDPtSIP_TCPtSIP_SSLtRADIUStRDPtRTSPtMYSQLtMSSQLtORACLEtporttinttpublicipt
publicportt	maxclienttfloatt
healthmonitortbooltsitenametciptenabledtdisabledt	cipheadertsitepersistencetConnectionProxytHTTPRedirecttNONEt
siteprefixt
clttimeouttmaxbandwidthtdownstateflushtmaxaaauserstmonthresholdthashidtcommentt
appflowlogt	ipaddressR-tlistt
argument_spectsupports_check_modetchangedtfailedR
tmsgsCould 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 %sRtgslbtsvrstatetsvreffgslbstatet
gslbthresholdtgslbsvcstatstmonstatetpreferredlocationt
monitor_statetstatechangetimesecttickssincelaststatechanget	thresholdt
clmonownert	clmonviewt__counttstatet
cookietimeoutt
svrtimeouttviewiptmonitor_name_svctnewnametbool_yes_nocS`s
|j�S(N(tupper(tv((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.pyt<lambda>TscS`s
|j�S(N(R�(R�((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.pyR�UscS`s
|j�S(N(R�(R�((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.pyR�VsR.RR/t
transformsR0R1timmutable_attrstGSLBtpresenttsave_configs%Cannot update immutable attributes %stdiffsGSLB service does not exists$GSLB service differs from configureds'Monitor bindings differ from configuredtabsentsGSLB service still existss(nitro exception errorcode=%s, message=%s(#tdicttupdateRRRRR
tPYTHON_SDK_IMPORTEDt	fail_jsonR
tloginRRQt	errorcodetmessaget	ExceptionRPRR	RRRt
check_modeRJRER�RORRNR<R#R:RHtlogoutt	exit_json(tmodule_specific_argumentsthand_inserted_argumentsR�Rt
module_resultRteR�R0R1R�R�R timmutables_changed((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.pytmain�s�	


					


			
	



!	

		


		
		



	 
t__main__(+t
__future__RRRRPt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR3tansible.module_utils.basicRt0ansible.module_utils.network.netscaler.netscalerR	R
RRR
RRRtAnssrc.com.citrix.netscaler.nitro.resource.config.gslb.gslbserviceRtSnssrc.com.citrix.netscaler.nitro.resource.config.gslb.gslbservice_lbmonitor_bindingRt:nssrc.com.citrix.netscaler.nitro.exception.nitro_exceptionRRR�tImportErrorR�RRR#R$R+R:RERNROR�t__name__(((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_service.pyt<module>s<


�:

						!			�

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