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

�
�Udac@`s&ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
y*ddlmZdd
l
mZeZWnek
r�ZeZnXddlmZddlmZmZmZmZmZmZmZd�Zd�Zd�Z d�Z!e"dkr"e!�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bysK
---
module: netscaler_cs_action
short_description: Manage content switching actions
description:
    - Manage content switching actions
    - This module is intended to run either on the ansible  control node or a bastion (jumpserver) with access to the actual netscaler instance

version_added: "2.4.0"

author: George Nikolopoulos (@giorgos-nikolopoulos)

options:

    name:
        description:
            - >-
                Name for the content switching action. Must begin with an ASCII alphanumeric or underscore C(_)
                character, and must contain only ASCII alphanumeric, underscore C(_), hash C(#), period C(.), space C( ), colon
                C(:), at sign C(@), equal sign C(=), and hyphen C(-) characters. Can be changed after the content
                switching action is created.

    targetlbvserver:
        description:
            - "Name of the load balancing virtual server to which the content is switched."

    targetvserver:
        description:
            - "Name of the VPN virtual server to which the content is switched."

    targetvserverexpr:
        description:
            - "Information about this content switching action."

    comment:
        description:
            - "Comments associated with this cs action."

extends_documentation_fragment: netscaler
requirements:
    - nitro python sdk
sl
# lb_vserver_1 must have been already created with the netscaler_lb_vserver module

- name: Configure netscaler content switching action
  delegate_to: localhost
  netscaler_cs_action:
      nsip: 172.18.0.2
      nitro_user: nsroot
      nitro_pass: nsroot
      validate_certs: no

      state: present

      name: action-1
      targetlbvserver: lb_vserver_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(tcsaction(tnitro_exception(t
AnsibleModule(tConfigProxytget_nitro_clienttnetscaler_common_argumentstlogtloglinestensure_feature_is_enabledtget_immutables_intersectioncC`s/tj|d|jd�dkr'tStSdS(Nsname:%stnamei(Rtcount_filteredtparamstTruetFalse(tclienttmodule((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_cs_action.pyt
action_existsts#cC`s*tt|||��dkr"tStSdS(Ni(tlent	diff_listRR(RRtcsaction_proxy((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_cs_action.pytaction_identical{scC`s|tj|d|jd�}|j|d�}trxd|krxtj|dj�}||jdkrx|d=qxn|S(Nsname:%sRittargetvserverexpr(Rtget_filteredRtdiff_objectRtjsontloadsR(RRRtaction_listRt
json_value((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_cs_action.pyR�s
c
C`s�tdtdd�dtdd�dtdd�dtdd��}t�}|jt�|j|�td|dt�}td	td
tdt�}ts�|jdd
�nt	|�}y|j
�Wn�tk
r}dt|j
�|jf}|jd|�n�tk
r�}tt|��dkrP|jddt|��q�tt|��dkr�|jddt|��q�|jddt|��nXddddg}ddddg}ddg}	i}
tdt�d|d|jd|d|d|	d|
�}yXt|d�|jd d!kr�td"�t||�s�|js~|j�|jd#r~|j�q~nt|d	<n�t|||�s6t|t|||�j��}|gkr�|jdd$|fd%t|||�|�n|js)|j�|jd#r)|j�q)nt|d	<n
t|d	<td&�|jsit||�sx|jdd'|�nt|||�s�|jdd(d%t|||�|�q�qin�|jd d)kritd*�t||�r!|js|j�|jd#r|j�qnt|d	<n
t|d	<|jsitd+�t||�rf|jdd,|�qfqinWnBtk
r�}d-t|j
�|jf}|jd||�nX|j�|j |�dS(.NRttypetstrttargetlbvserverRtcommentt
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 %sthitstreferencecountt	undefhitstbuiltintactualRtattribute_values_dicttreadwrite_attrstreadonly_attrstimmutable_attrst
transformstCStstatetpresents"Applying actions for state presenttsave_configs%Cannot update immutable attributes %stdiffsSanity checks for state presents'Content switching action does not exists0Content switching action differs from configuredtabsents!Applying actions for state absentsSanity checks for state absents%Content switching action still existss(nitro exception errorcode=%s, message=%s(!tdicttupdateR
R
RRRtPYTHON_SDK_IMPORTEDt	fail_jsonRtloginR	R&t	errorcodetmessaget	ExceptionR%RRRRRRt
check_modetaddR;RRRtkeystdeletetlogoutt	exit_json(
tmodule_specific_argumentsR)Rt
module_resultRteR-R4R5R6R7Rtimmutables_changed((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_cs_action.pytmain�s�	

								

	


!	

	




		
	



	
 
t__main__(#t
__future__RRRR%t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR!t<nssrc.com.citrix.netscaler.nitro.resource.config.cs.csactionRt:nssrc.com.citrix.netscaler.nitro.exception.nitro_exceptionR	RR@tImportErrorRNRtansible.module_utils.basicR
t0ansible.module_utils.network.netscaler.netscalerRRR
RRRRRRRRPt__name__(((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_cs_action.pyt<module>s,


,

4
			
	�

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