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

�
�Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZmZmZmZmZy*dd
lmZddlmZeZWnek
r�ZeZnXd�Zd�Zd�Zd�Ze dkre�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�	
---
module: netscaler_cs_policy
short_description: Manage content switching policy
description:
    - Manage content switching policy.
    - "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"

author: George Nikolopoulos (@giorgos-nikolopoulos)

options:

    policyname:
        description:
            - >-
                Name for the content switching policy. Must begin with an ASCII alphanumeric or underscore C(_)
                character, and must contain only ASCII alphanumeric, underscore, hash C(#), period C(.), space C( ), colon
                C(:), at sign C(@), equal sign C(=), and hyphen C(-) characters. Cannot be changed after a policy is
                created.
            - "The following requirement applies only to the NetScaler CLI:"
            - >-
                If the name includes one or more spaces, enclose the name in double or single quotation marks (for
                example, my policy or my policy).
            - "Minimum length = 1"

    url:
        description:
            - >-
                URL string that is matched with the URL of a request. Can contain a wildcard character. Specify the
                string value in the following format: C([[prefix] [*]] [.suffix]).
            - "Minimum length = 1"
            - "Maximum length = 208"

    rule:
        description:
            - >-
                Expression, or name of a named expression, against which traffic is evaluated. Written in the classic
                or default syntax.
            - "Note:"
            - >-
                Maximum length of a string literal in the expression is 255 characters. A longer string can be split
                into smaller strings of up to 255 characters each, and the smaller strings concatenated with the +
                operator. For example, you can create a 500-character string as follows: '"<string of 255
                characters>" + "<string of 245 characters>"'

    domain:
        description:
            - "The domain name. The string value can range to 63 characters."
            - "Minimum length = 1"

    action:
        description:
            - >-
                Content switching action that names the target load balancing virtual server to which the traffic is
                switched.

extends_documentation_fragment: netscaler
requirements:
    - nitro python sdk
s�
- name: Create url cs policy
  delegate_to: localhost
  netscaler_cs_policy:
    nsip: 172.18.0.2
    nitro_user: nsroot
    nitro_pass: nsroot
    validate_certs: no

    state: present

    policyname: policy_1
    url: /example/
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: "Could not load nitro python sdk"

diff:
    description: List of differences between the actual configured object and the configuration specified in the module
    returned: failure
    type: dict
    sample: { 'url': 'difference. ours: (str) example1 other: (str) /example1' }
(t
AnsibleModule(tConfigProxytget_nitro_clienttnetscaler_common_argumentstlogtloglinestensure_feature_is_enabled(tcspolicy(tnitro_exceptioncC`s9td�tj|d|jd�dkr1tStSdS(NsChecking if policy existss
policyname:%st
policynamei(RRtcount_filteredtparamstTruetFalse(tclienttmodule((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_cs_policy.pyt
policy_exists|s
#cC`s�td�tj|d|jd�dkr1tStj|d|jd�}|j|d�}d|krw|d=nt|�dkr�tStSdS(Ns5Checking if defined policy is identical to configureds
policyname:%sRitip(	RRRRRtget_filteredtdiff_objecttlenR(RRtcspolicy_proxytpolicy_listt	diff_dict((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_cs_policy.pytpolicy_identical�s
#
cC`s.tj|d|jd�}|j|d�S(Ns
policyname:%sRi(RRRR(RRRR((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_cs_policy.pyt	diff_list�sc
C`s�tdtdd�dtdd�dtdd�dtdd�dtdd��}t�}t�}|jt�|j|�|j|�td|d	t�}td
tdtdt�}ts�|jd
d�nt	|�}y|j
�Wn�tk
r1}dt|j
�|jf}|jd
|�n�tk
r�}tt|��dkru|jd
dt|��q�tt|��dkr�|jd
dt|��q�|jd
dt|��nXdddddg}ddddddddg}	i}
tdt�d|d|jd |d!|	d"|
�}y�t|d#�|jd$d%kr~td&�t||�s�|js�|j�|jd'r�|j�q�nt|d
<nYt|||�s�|js�|j�|jd'r�|j�q�nt|d
<n
t|d
<|js/td&�t||�s>|jd
d(|�nt|||�s{|jd
d)d*t|||�|�q{q/n�|jd$d+kr/td,�t||�r�|js�|j�|jd'r�|j�q�nt|d
<n
t|d
<|js/td-�t||�r,|jd
d.|�q,q/nWnBtk
rt}d/t|j
�|jf}|jd
||�nX|j�|j|�dS(0NRttypetstrturltruletdomaintactiont
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 %stvstypethitstbindhitst	labelnamet	labeltypetprioritytactivepolicytcspolicytypetactualRtattribute_values_dicttreadwrite_attrstreadonly_attrst
transformstCStstatetpresentsSanity checks for state presenttsave_configsPolicy does not existsPolicy differs from configuredtdifftabsents!Applying actions for state absentsSanity checks for state absentsPolicy still existss(nitro exception errorcode=%s, message=%s(tdicttupdateRRRRR
tPYTHON_SDK_IMPORTEDt	fail_jsonR
tloginRR#t	errorcodetmessaget	ExceptionR"R	RRRRRt
check_modetaddR=R R!tdeletetlogoutt	exit_json(tmodule_specific_argumentsthand_inserted_argumentsR(Rt
module_resultRteR,R7R8R9R((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_cs_policy.pytmain�s�		


							

	


	



	
.
	



	
 
t__main__N(!t
__future__RRRR"t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt0ansible.module_utils.network.netscaler.netscalerR	R
RRR
Rt<nssrc.com.citrix.netscaler.nitro.resource.config.cs.cspolicyRt:nssrc.com.citrix.netscaler.nitro.exception.nitro_exceptionRRRBtImportErrorRPRRR R!RQt__name__(((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_cs_policy.pyt<module>s*


@.

				�

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