HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/bigip.cpython-310.pyc
o

�N�gw��@s�dZddlZdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z										dGdd�Z
									dGdd�Zdd�Zdd�Z
																							dHdd�Z																						dIdd�Z																						dIdd�Zdd �Zd!d"�Zd#d$�Z												dJd%d&�Zd'd(�Zd)d*�Z																																						dKd+d,�Z																																						dKd-d.�Z																																						dKd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Z d?d@�Z!dAdB�Z"dCdD�Z#dEdF�Z$dS)Lz�
A state module designed to enforce load-balancing configurations for F5 Big-IP entities.
    :maturity:      develop
    :platform:      f5_bigip_11.6
�NcCsdtvrdSdS)zE
    Only load if the bigip exec module is available in __salt__
    zbigip.list_transactionZbigip)Fz bigip module could not be loaded)�__salt__�rr�E/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/bigip.py�__virtual__srcCs�|ddur|d|d<|S|ddkrd|d<|S|ddkr*|dd|d<|S|dd	kr@d
|d<d|d<|d|d
<|S|dd|d<|S)z1
    format the results of listing functions
    �codeN�content�commenti�z'401 Forbidden: Authentication required!��message��T�resultzgListing Current Configuration Only.  Not action or changes occurred during the execution of this state.�changesr)�response�retrrr�_load_results"��
���rcCsf|��D],\}}||krd||<qt|t�rt||�qt|t�r0|D]}t|t�r/t||�q#q|S)z�
    look for a certain key within a dictionary and nullify ti's contents, check within nested
    dictionaries and lists as well.  Certain attributes such as "generation" will change even
    when there were no changes made to the entity.
    N)�items�
isinstance�dict�
_strip_key�list)Z
dictionary�keyword�key�value�itemrrrr1s




�rcCs�d|d<t|t�rTt|t�rTd|d��vr|dd=d|d��vr(|dd=|d|dkr:dj|d�|d<|Sdj|d�|d<|d|d	d
<|d|d	d<|S||krbdj|d�|d<|Sdj|d�|d<||d	d
<||d	d<|S)zN
    take an existing entity and a modified entity and check for changes.
    Tr�
generationrzK{entity_type} is currently enforced to the desired state.  No changes made.)�entity_typerzy{entity_type} was enforced to the desired state.  Note: Only parameters specified were enforced. See changes for details.r
�old�new)rr�keys�format)rr�existing�modifiedrrr�_check_for_changesEsD

�����������r"cCs�|dkr
|dd7<n7|dks|dkr|dd7<n&|dkr+|dd7<n|d	kr8|dd
7<n|dkrD|dd7<|dd
7<|dtjjj|dd�7<i|d<d|d<|S)z^
    For testing just output what the state will attempt to do without actually doing it.
    rrzCThe list action will just list an entity and will make no changes.
�create�addzQThe create action will attempt to create an entity if it does not already exist.
�deletezJThe delete action will attempt to delete an existing entity if it exists.
�managez}The manage action will create a new entity if it does not exist.  If it does exist, it will be enforcedto the desired state.
�modifyzOThe modify action will attempt to modify an existing entity only if it exists.
z<An iControl REST Request will be made using the parameters:
�)�indentr
Nr)�salt�utils�json�dumps)r�action�paramsrrr�_test_outputws6������r0cC�J|iddd�}tdrt|d||||d�d�Std||||�}t||�S)	a
    A function to connect to a bigip device and list a specific node.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the node to list.
    F���namer
rr�testr��hostname�username�passwordr4�r/�bigip.list_node��__opts__r0rr�r7r8r9r4rrrrr�	list_node����
r?c	Cs�|iddd�}tdrt|d|||||d�d�Std||||�}|d	d
kr1d|d<d
|d<|S|d	dkrYtd|||||�}d|d<i|dd<|d|dd<d|d<|St||�}|S)a0
    Create a new node if it does not already exist.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the node to create
    address
        The address of the node
    Fr2r3r5r#)r7r8r9r4�addressr:r;rrTrz6A node by this name currently exists.  No change made.rr	�bigip.create_noder
rrrzNode was successfully created.r<)r7r8r9r4rArr rrrr�create_node�s8��
�
�
�rCcCs�|iddd�}tdr!t|d||||||||||	|
|||
d�d�Std||||�}|d	d
kri|dd|kr@d|d
<d|d<td|||||||||	|
|||
d�
}|d	d
krbtd|||�}|St||�}|S|d	dkr�td|||||�}|d	d
kr�td|||||||||	|
|||
d�
}|d	d
kr�d|d
<d|d<i|dd<|d|dd<|Std||||�}|d	d
kr�dj|ddd�|d<|Sdj|dd|ddd�|d<|St||�}|St||�}|S) a$
    Manages a node of a given bigip device.  If the node does not exist it will be created, otherwise,
    only the properties which are different than the existing will be updated.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the node to manage.
    address
        The address of the node
    connection_limit
        [integer]
    description
        [string]
    dynam
        c_ratio:        [integer]
    logging
        [enabled | disabled]
    monitor
        [[name] | none | default]
    rate_limit
        [integer]
    ratio
        [integer]
    session
        [user-enabled | user-disabled]
    node_state (state)
        [user-down | user-up ]
    Fr2r3r5r&)r7r8r9r4rA�connection_limit�description�
dynamic_ratio�logging�monitor�
rate_limit�ratio�session�state:r:r;rrrrArz<A node with this name exists but the address does not match.r�bigip.modify_node�
r7r8r9r4rDrErFrGrHrIrJrK�state�Noder	rBTz}Node was created and enforced to the desired state.  Note: Only parameters specified were enforced.  See changes for details.r
rr�bigip.delete_nodez�Node was successfully created but an error occurred during modification. The creation of the node has been rolled back. Message is as follows:
{message}r
)r
z�Node was successfully created but an error occurred during modification. The creation of the node was not able to be rolled back. Message is as follows:
 {message}
{message_two})r
Zmessage_two�r=r0rr"rr)r7r8r9r4rArDrErFrGrHrIrJrK�
node_staterr r!r�deletedrrr�manage_node�s�2����I
�G���$��
���

��
�
�rUc
Cs�|iddd�}
tdr t|
d||||||||||	|
||d�
d�Std||||�}|d	d
krXtd||||||||||	|
||d�
}|d	d
krQtd
|
||�}
|
St||
�}
|
S|d	dkrdd|
d<|
St||
�}
|
S)a�
    Modify an existing node. Only a node which already exists will be modified and
    only the parameters specified will be enforced.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the node to modify
    connection_limit
        [integer]
    description
        [string]
    dynamic_ratio
        [integer]
    logging
        [enabled | disabled]
    monitor
        [[name] | none | default]
    rate_limit
        [integer]
    ratio
        [integer]
    session
        [user-enabled | user-disabled]
    node_state (state)
        [user-down | user-up ]
    Fr2r3r5r')
r7r8r9r4rDrErFrGrHrIrJrKrLr:r;rrrMrNrPr	z$A node with this name was not found.r�r=r0rr"r)r7r8r9r4rDrErFrGrHrIrJrKrSrr r!rrr�modify_node�s^/���
�	�
�rWcCs�|iddd�}tdrt|d||||d�d�Std||||�}|d	d
krTtd||||�}|d	d
krMd|d
<d|d<|d|dd<i|dd<|St||�}|S|d	dkrpd|d
<d|d<i|dd<i|dd<|St||�}|S)z�
    Delete an existing node.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the node which will be deleted.
    Fr2r3r5r%r6r:r;rrrQTrzNode was successfully deleted.rrr
rrr	z2This node already does not exist. No changes made.r<�r7r8r9r4rr rTrrr�delete_node�<��
��
�rYcCr1)	a
    A function to connect to a bigip device and list a specific pool.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the pool to list.
    Fr2r3r5rr6r:�bigip.list_poolr<r>rrr�	list_poolUr@r\cCs�|iddd�}tdrQt|did|�d|�d|�d	|�d
|�d|�d|�d
|�d|�d|	�d|
�d|�d|�d|
�d|�d|�d|�|||||||||d�	�d�Std||||�}|ddkrjd|d<d|d<|S|dd kr�td!d4id|�d|�d|�d	|�d
|�d|�d|�d
|�d|�d|	�d"|
�d#|�d|�d|
�d|�d|�d|�d$|�d%|�d&|�d'|�d(|�d)|�d*|�d+|�d,|�d-|��}|ddkr�d|d<i|d.d/<|d0|d.d1<d2|d<|St||�}|St||�}|S)5a,
    Create a new node if it does not already exist.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the pool to create
    members
        List of members to be added to the pool
    allow_nat
        [yes | no]
    allow_snat
        [yes | no]
    description
        [string]
    gateway_failsafe_device
        [string]
    ignore_persisted_weight
        [enabled | disabled]
    ip_tos_to_client
        [pass-through | [integer]]
    ip_tos_to_server
        [pass-through | [integer]]
    link_qos_to_client
        [pass-through | [integer]]
    link_qos_to_server
        [pass-through | [integer]]
    load_balancing_mode
        [dynamic-ratio-member | dynamic-ratio-node |
        fastest-app-response | fastest-node |
        least-connections-members |
        least-connections-node |
        least-sessions |
        observed-member | observed-node |
        predictive-member | predictive-node |
        ratio-least-connections-member |
        ratio-least-connections-node |
        ratio-member | ratio-node | ratio-session |
        round-robin | weighted-least-connections-member |
        weighted-least-connections-node]
    min_active_members
        [integer]
    min_up_members
        [integer]
    min_up_members_action
        [failover | reboot | restart-all]
    min_up_members_checking
        [enabled | disabled]
    monitor
        [name]
    profiles
        [none | profile_name]
    queue_depth_limit
        [integer]
    queue_on_connection_limit
        [enabled | disabled]
    queue_time_limit
        [integer]
    reselect_tries
        [integer]
    service_down_action
        [drop | none | reselect | reset]
    slow_ramp_time
        [integer]
    Fr2r3r5r#r7r8r9r4�members�	allow_nat�
allow_snatrE�gateway_failsafe_device�ignore_persisted_weight�ip_tos_client:�
ip_tos_server�link_qos_to_client�link_qos_to_server�load_balancing_mode�min_active_members�min_up_members)	�min_up_members_checkingrH�profiles�queue_depth_limit�queue_on_connection_limit�queue_time_limit�reselect_tries�service_down_action�slow_ramp_timer:r[rrTrz6A pool by this name currently exists.  No change made.rr	�bigip.create_pool�ip_tos_to_client�ip_tos_to_server�min_up_members_actionrirHrjrkrlrmrnrorpr
rrrzPool was successfully created.Nrr<)r7r8r9r4r]r^r_rEr`rarrrsrdrerfrgrhrtrirHrjrkrlrmrnrorprr rrrr�create_poolus�c��������	�
���
�������".���������	�
���
���������������
�
�ruc
Cs�|iddd�}tdrPt|did|�d|�d|�d	|�d
|�d|�d|�d
|�d|�d|	�d|
�d|�d|�d|
�d|�d|�d|�||||||||d��d�Std||||�}|ddkr�tdd6id|�d|�d|�d	|�d
|�d|�d|�d
|�d|�d|	�d|
�d|�d|�d|
�d|�d|�d|�d|�d |�d!|�d"|�d#|�d$|�d%|�d&|�d'|��}|ddkr�|d(d)=|d(d)=|d(d*=|d(d*=td+|||�}|St||�}|S|dd,k�r`td-d6id|�d|�d|�d	|�d
|�d|�d|�d
|�d|�d|	�d|
�d|�d|�d|
�d|�d|�d|�d|�d |�d!|�d"|�d#|�d$|�d%|�d&|�d'|��}|ddk�rYd.|d/<d0|d1<i|d2d3<|d(|d2d4<|St||�}|St||�}|S)7aF
    Create a new pool if it does not already exist. Pool members are managed separately. Only the
    parameters specified are enforced.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the pool to create
    allow_nat
        [yes | no]
    allow_snat
        [yes | no]
    description
        [string]
    gateway_failsafe_device
        [string]
    ignore_persisted_weight
        [enabled | disabled]
    ip_tos_to_client
        [pass-through | [integer]]
    ip_tos_to_server
        [pass-through | [integer]]
    link_qos_to_client
        [pass-through | [integer]]
    link_qos_to_server
        [pass-through | [integer]]
    load_balancing_mode
        [dynamic-ratio-member | dynamic-ratio-node |
        fastest-app-response | fastest-node |
        least-connections-members |
        least-connections-node |
        least-sessions |
        observed-member | observed-node |
        predictive-member | predictive-node |
        ratio-least-connections-member |
        ratio-least-connections-node |
        ratio-member | ratio-node | ratio-session |
        round-robin | weighted-least-connections-member |
        weighted-least-connections-node]
    min_active_members
        [integer]
    min_up_members
        [integer]
    min_up_members_action
        [failover | reboot | restart-all]
    min_up_members_checking
        [enabled | disabled]
    monitor
        [name]
    profiles
        [none | profile_name]
    queue_depth_limit
        [integer]
    queue_on_connection_limit
        [enabled | disabled]
    queue_time_limit
        [integer]
    reselect_tries
        [integer]
    service_down_action
        [drop | none | reselect | reset]
    slow_ramp_time
        [integer]

    Fr2r3r5r&r7r8r9r4r^r_rEr`rarbrcrdrerfrgrhri�rHrjrkrlrmrnrorpr:r[rr�bigip.modify_poolrrrsrtrHrjrkrlrmrnrorpr�membersReference�selfLink�Poolr	rqTrz}Pool was created and enforced to the desired state.  Note: Only parameters specified were enforced.  See changes for details.rr
rrNrrV)r7r8r9r4r^r_rEr`rarrrsrdrerfrgrhrtrirHrjrkrlrmrnrorprr r!rrrr�manage_pool4sfb��������	�
���
�������!��������	�
���
��������������



6
�4���������	�
���
���������������

�
�r{c
Cs�|iddd�}tdrPt|did|�d|�d|�d	|�d
|�d|�d|�d
|�d|�d|	�d|
�d|�d|�d|
�d|�d|�d|�||||||||d��d�Std||||�}|ddkr�tdd0id|�d|�d|�d	|�d
|�d|�d|�d
|�d|�d|	�d|
�d|�d|�d|
�d|�d|�d|�d|�d |�d!|�d"|�d#|�d$|�d%|�d&|�d'|��}|ddkr�|d(d)=|d(d)=|d(d*=|d(d*=td+|||�}|St||�}|S|dd,kr�d-|d.<|St||�}|S)1a/
    Modify an existing pool. Pool members are managed separately. Only the
    parameters specified are enforced.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the pool to create
    allow_nat
        [yes | no]
    allow_snat
        [yes | no]
    description
        [string]
    gateway_failsafe_device
        [string]
    ignore_persisted_weight
        [enabled | disabled]
    ip_tos_to_client
        [pass-through | [integer]]
    ip_tos_to_server
        [pass-through | [integer]]
    link_qos_to_client
        [pass-through | [integer]]
    link_qos_to_server
        [pass-through | [integer]]
    load_balancing_mode
        [dynamic-ratio-member | dynamic-ratio-node |
        fastest-app-response | fastest-node |
        least-connections-members |
        least-connections-node |
        least-sessions |
        observed-member | observed-node |
        predictive-member | predictive-node |
        ratio-least-connections-member |
        ratio-least-connections-node |
        ratio-member | ratio-node | ratio-session |
        round-robin | weighted-least-connections-member |
        weighted-least-connections-node]
    min_active_members
        [integer]
    min_up_members
        [integer]
    min_up_members_action
        [failover | reboot | restart-all]
    min_up_members_checking
        [enabled | disabled]
    monitor
        [name]
    profiles
        [none | profile_name]
    queue_depth_limit
        [integer]
    queue_on_connection_limit
        [enabled | disabled]
    queue_time_limit
        [integer]
    reselect_tries
        [integer]
    service_down_action
        [drop | none | reselect | reset]
    slow_ramp_time
        [integer]

    Fr2r3r5r'r7r8r9r4r^r_rEr`rarbrcrdrerfrgrhrirvr:r[rrrwrrrsrtrHrjrkrlrmrnrorprrxryrzr	�$A pool with this name was not found.rNrrV)r7r8r9r4r^r_rEr`rarrrsrdrerfrgrhrtrirHrjrkrlrmrnrorprr r!rrr�modify_pools�b��������	�
���
�������!��������	�
���
��������������




�	�
�r}cC��|iddd�}tdrt|d||||d�d�Std||||�}|d	d
krTtd||||�}|d	d
krMd|d
<d|d<|d|dd<i|dd<|St||�}|S|d	dkrpd|d
<d|d<i|dd<i|dd<|St||�}|S)z�
    Delete an existing pool.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the pool which will be deleted
    Fr2r3r5r%r6r:r[rrzbigip.delete_poolTrzPool was successfully deleted.rrr
rrr	z2This pool already does not exist. No changes made.r<rXrrr�delete_pool�rZrc
	Cs(|iddd�}tdrt|d|||||d�d�Std||||�}|d	d
kr�|ddd
}td|||||�}|d	d
krztd||||�}	|	d	d
krYt|	|�}d|d<|S|	ddd
}
|D]}|d=qc|
D]}|d=qktd|||
�}|St||�}|S|d	dkr�d|d<|St||�}|S)a�
    Manage the members of an existing pool.  This function replaces all current pool members.
    Only the parameters specified are enforced.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the pool to modify
    members
        list of pool members to manage.

    Fr2r3r5r&�r7r8r9r4r]r:r[rrrrxrzbigip.replace_pool_memberszZmodification of the pool was successful but an error occurred upon retrieving new listing.rrzPool Membershipr	r|)r=r0rrr")
r7r8r9r4r]rr �current_membersr!Znew_listing�new_members�current_member�
new_memberrrr�manage_pool_memberssV��

��
��
�	�
�r�c	Cs�|iddd�}tdrt|d|||||d�d�Std||||�}|d	d
kr�|ddd
}d}|D]}	|	d|dkrAd}nq3|r`d|d<dj|dd�|d<i|dd<i|dd<|Std|||||�}
|
d	d
kr�d|d<dj|dd�|d<i|dd<td||||�}|d	d
kr�t|
|�}|S|ddd
}|D]}	|	d|dkr�|	}
nq�|
|dd<|St|
|�}|S|d	dkr�d|d<|St||�}|S)aW
    A function to connect to a bigip device and add a new member to an existing pool.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the pool to modify
    member
        The member to add to the pool
    Fr2r3r5r$r�r:r[rrrrxrr4TrzAMember: {name} already exists within this pool.  No changes made.�r4rr
rrzbigip.add_pool_memberz7Member: {name} has been successfully added to the pool.r	r|�r=r0rrr)r7r8r9r4�memberr�
existing_poolr��existsr�r�Zpool_listingr]Zadded_memberrrr�add_pool_memberqsz��
���+�
����
�
��
�r�c	Cs�|iddd�}tdrt|d|||||d�d�Std||||�}|d	d
kr�|ddd
}d}|D]}|d|krAd}|}nq3|r�tdd(id|�d|�d|�d|�d|�d|�d|�d|�d|�d|	�d|
�d|�d|�d|
�d|�d|�d |��}td||||�}|d	d
kr�|d	d
kr�|ddd
}|D]}|d|kr�|}nq�d|i}d|i}td!|��|||�}|St||�}|Sd"j|dd#�|d$<|S|d	d%kr�d&|d$<|St||�}|S))a%
    A function to connect to a bigip device and modify a member of an existing pool.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the pool to modify
    member
        The member modify
    connection_limit
        [integer]
    description
        [string]
    dynamic_ratio
        [integer]
    inherit_profile
        [enabled | disabled]
    logging
        [enabled | disabled]
    monitor
        [name]
    priority_group
        [integer]
    profiles
        [none | profile_name]
    rate_limit
        [integer]
    ratio
        [integer]
    session
        [user-enabled | user-disabled]
    member_state (state)
        [ user-up | user-down ]

    Fr2r3r5r'r�r:r[rrrrxrr4Tzbigip.modify_pool_memberr7r8r9r�rDrErF�inherit_profilerGrH�priority_grouprjrIrJrKrOz
Pool Member: zBMember: {name} does not exists within this pool.  No changes made.r�rr	r|NrrR)r7r8r9r4r�rDrErFr�rGrHr�rjrIrJrKZmember_staterr�r�r�r��existing_memberr!Znew_poolr�r�Zmodified_memberrrrrr�modify_pool_member�s�;��
���������	�
���
������
�����
�r�c	Cs|iddd�}tdrt|d|||||d�d�Std||||�}|d	d
kr�|ddd
}d}|D]}	|	d|krAd}|	}
nq3|rntd|||||�}|d	d
krld|d<dj|d�|d<|
|dd<i|dd<|Sd|d<d|d<i|dd<i|dd<|St||�}|S)a;
    Delete an existing pool member.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the pool to be modified
    member
        The name of the member to delete from the pool
    Fr2r3r5r%r�r:r[rrrrxrr4Tzbigip.delete_pool_memberrz/Pool Member: {member} was successfully deleted.)r�rr
rrz9This pool member already does not exist. No changes made.r�)r7r8r9r4r�rr r�r�r�r�rTrrr�delete_pool_memberssT��
�
����
�r�cCr1)	z�
    A function to list a specific virtual.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the virtual to list
    Fr2r3r5rr6r:�bigip.list_virtualr<r>rrr�list_virtual�r@r�c+.Cs�|iddd�}+tdr�t|+did|�d|�d|�d	|�d
|�d|�d|�d
|�d|�d|	�d|
�d|�d|�d|
�d|�d|�d|�id|�d|�d|�d|�d|�d|�d|�d|�d|�d |�d!|�d"|�d#|�d$|�d%|�d&| �d'|!��|"|#|$|%|&|'|(|)|*d(�	�d)�Std*||||�},|,d+d,kr�d-|+d.<d/|+d0<|+S|,d+d1k�rTtd2dBid|�d|�d|�d	|�d
|�d|�d|�d|�d
|�d|�d|	�d|
�d|�d|
�d|�d|�d|�d|�d|�d|�d|�d|�d|�d|�d|�d|�d |�d!|�d"|�d#|�d$|�d%|�d&| �d'|!�d3|"�d4|#�d5|$�d6|%�d7|&�d8|'�d9|(�d:|)�d;|*��}-|-d+d,k�rMd-|+d.<i|+d<d=<|-d>|+d<d?<d@|+d0<|+St|,|+�}+|+St|,|+�}+|+S)Ca�
    A function to connect to a bigip device and create a virtual server if it does not already exists.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the virtual to create
    destination
        [ [virtual_address_name:port] | [ipv4:port] | [ipv6.port] ]
    pool
        [ [pool_name] | none]
    address_status
        [yes | no]
    auto_lasthop
        [default | enabled | disabled ]
    bwc_policy
        [none] | string]
    cmp_enabled
        [yes | no]
    dhcp_relay
        [yes | no}
    connection_limit
        [integer]
    description
        [string]
    state
        [disabled | enabled]
    fallback_persistence
        [none | [profile name] ]
    flow_eviction_policy
        [none | [eviction policy name] ]
    gtm_score
        [integer]
    ip_forward
        [yes | no]
    ip_protocol
        [any | protocol]
    internal
        [yes | no]
    twelve_forward(12-forward)
        [yes | no]
    last_hop-pool
        [ [pool_name] | none]
    mask
        { [ipv4] | [ipv6] }
    mirror
        { [disabled | enabled | none] }
    nat64
        [enabled | disabled]
    persist
        [list]
    profiles
        [none | default | list ]
    policies
        [none | default | list ]
    rate_class
        [name]
    rate_limit
        [integer]
    rate_limit-mode
        [destination | object | object-destination |
        object-source | object-source-destination |
        source | source-destination]
    rate_limit-dst
        [integer]
    rate_limit-src
        [integer]
    rules
        [none | list ]
    related_rules
        [none | list ]
    reject
        [yes | no]
    source
        { [ipv4[/prefixlen]] | [ipv6[/prefixlen]] }
    source_address_translation
        [none | snat:pool_name | lsn | automap | dictionary ]
    source_port
        [change | preserve | preserve-strict]
    state
        [enabled | disabled]
    traffic_classes
        [none | default | list ]
    translate_address
        [enabled | disabled]
    translate_port
        [enabled | disabled]
    vlans
        [none | default | dictionary]

        vlan_ids
            [ list]
        enabled
            [ true | false ]
    Fr2r3r5r#r7r8r9r4�destination�pool�address_status�auto_lasthop�
bwc_policy�cmp_enabledrD�
dhcp_relayrE�fallback_persistence�flow_eviction_policy�	gtm_score�
ip_forward�ip_protocol�internal�twelve_forward�
last_hop_pool�mask�mirror�nat64�persistrj�policies�
rate_classrI�rate_limit_mode�rate_limit_dst�rate_limit_src�rules�
related_rules�	�reject�source�source_address_translation�source_port�
virtual_state�traffic_classes�translate_address�translate_port�vlansr:r�rrTrz9A virtual by this name currently exists.  No change made.rr	�bigip.create_virtualr�r�r�r�rOr�r�r�r�r
rrrz!Virtual was successfully created.Nrr<).r7r8r9r4r�r�r�r�r�r�rDr�rEr�r�r�r�r�r�r�r�r�r�r�r�rjr�r�rIr�r�r�r�r�r�r�r�r�r�r�r�r�r�rr �virtualrrr�create_virtual�sz��������	�
���
������������������� �!�"�#��2>���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�-
�
�r�c+0Cs$|iddd�}+tdr�t|+did|�d|�d|�d	|�d
|�d|�d|�d
|�d|�d|	�d|
�d|�d|�d|
�d|�d|�d|�id|�d|�d|�d|�d|�d|�d|�d|�d|�d |�d!|�d"|�d#|�d$|�d%|�d&| �d'|!��|"|#|$|%|&|'|(|)|*d(�	�d)�Std*||||�},|,d+d,k�rVtd-dDid|�d|�d|�d	|�d
|�d|�d|�d|�d
|�d|�d|	�d|
�d|�d|
�d|�d|�d|�d|�d|�d|�d|�d|�d|�d|�d|�d|�d |�d!|�d"|�d#|�d$|�d%|�d&| �d'|!�d.|"�d/|#�d0|$�d1|%�d2|&�d3|'�d4|(�d5|)�d6|*��}-|-d+d,k�rOtd*||||�}.|.d+d,k�rHt|.d7�}.t|,d7�},td8|+|,|.�}+|+St|.|+�}+|+St|-|+�}+|+S|,d+d9k�rtd:dDid|�d|�d|�d	|�d
|�d|�d|�d|�d
|�d|�d|	�d|
�d|�d|
�d|�d|�d|�d|�d|�d|�d|�d|�d|�d|�d|�d|�d |�d!|�d"|�d#|�d$|�d%|�d&| �d'|!�d.|"�d/|#�d0|$�d1|%�d2|&�d3|'�d4|(�d5|)�d6|*��}/|/d+d,k�rd;|+d<<i|+d=d><|/d?|+d=d@<dA|+dB<|+St|/|+�}+|+St|,|+�}+|+S)Ea$	
    Manage a virtual server.  If a virtual does not exists it will be created, otherwise only the
    parameters specified will be enforced.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the virtual to create
    destination
        [ [virtual_address_name:port] | [ipv4:port] | [ipv6.port] ]
    pool
        [ [pool_name] | none]
    address_status
        [yes | no]
    auto_lasthop
        [default | enabled | disabled ]
    bwc_policy
        [none] | string]
    cmp_enabled
        [yes | no]
    dhcp_relay
        [yes | no}
    connection_limit
        [integer]
    description
        [string]
    state
        [disabled | enabled]
    fallback_persistence
        [none | [profile name] ]
    flow_eviction_policy
        [none | [eviction policy name] ]
    gtm_score
        [integer]
    ip_forward
        [yes | no]
    ip_protocol
        [any | protocol]
    internal
        [yes | no]
    twelve_forward(12-forward)
        [yes | no]
    last_hop-pool
        [ [pool_name] | none]
    mask
        { [ipv4] | [ipv6] }
    mirror
        { [disabled | enabled | none] }
    nat64
        [enabled | disabled]
    persist
        [list]
    profiles
        [none | default | list ]
    policies
        [none | default | list ]
    rate_class
        [name]
    rate_limit
        [integer]
    rate_limit-mode
        [destination | object | object-destination |
        object-source | object-source-destination |
        source | source-destination]
    rate_limit-dst
        [integer]
    rate_limit-src
        [integer]
    rules
        [none | list ]
    related_rules
        [none | list ]
    reject
        [yes | no]
    source
        { [ipv4[/prefixlen]] | [ipv6[/prefixlen]] }
    source_address_translation
        [none | snat:pool_name | lsn | automap | dictionary ]
    source_port
        [change | preserve | preserve-strict]
    state
        [enabled | disabled]
    traffic_classes
        [none | default | list ]
    translate_address
        [enabled | disabled]
    translate_port
        [enabled | disabled]
    vlans
        [none | default | dictionary]

        vlan_ids
            [ list]
        enabled
            [ true | false ]
    Fr2r3r5r&r7r8r9r4r�r�r�r�r�r�rDr�rEr�r�r�r�r�r�r�r�r�r�r�r�rjr�r�rIr�r�r�r�r�r�r:r�rr�bigip.modify_virtualr�r�r�r�rOr�r�r�r�r�Virtualr	r�Trr
rrrzCVirtual was successfully created and enforced to the desired state.rNr�r=r0rrr"r)0r7r8r9r4r�r�r�r�r�r�rDr�rEr�r�r�r�r�r�r�r�r�r�r�r�rjr�r�rIr�r�r�r�r�r�r�r�r�r�r�r�r�r�rr r!�	relistingr�rrr�manage_virtual�s>��������	�
���
������������������� �!�"�#��2��������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�/�

G
�E
�B���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�/�

�
�r�c+/Cs�|iddd�}+tdr�t|+did|�d|�d|�d	|�d
|�d|�d|�d
|�d|�d|	�d|
�d|�d|�d|
�d|�d|�d|�id|�d|�d|�d|�d|�d|�d|�d|�d|�d |�d!|�d"|�d#|�d$|�d%|�d&| �d'|!��|"|#|$|%|&|'|(|)|*d(�	�d)�Std*||||�},|,d+d,k�rVtd-d=id|�d|�d|�d	|�d
|�d|�d|�d|�d
|�d|�d|	�d|
�d|�d|
�d|�d|�d|�d|�d|�d|�d|�d|�d|�d|�d|�d|�d |�d!|�d"|�d#|�d$|�d%|�d&| �d'|!�d.|"�d/|#�d0|$�d1|%�d2|&�d3|'�d4|(�d5|)�d6|*��}-|-d+d,k�rOtd*||||�}.|.d+d,k�rHt|.d7�}.t|,d7�},td8|+|,|.�}+|+St|.|+�}+|+St|-|+�}+|+S|,d+d9k�rcd:|+d;<|+St|,|+�}+|+S)>a	
    Modify an virtual server.  modify an existing virtual.  Only parameters specified will be enforced.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the virtual to create
    destination
        [ [virtual_address_name:port] | [ipv4:port] | [ipv6.port] ]
    pool
        [ [pool_name] | none]
    address_status
        [yes | no]
    auto_lasthop
        [default | enabled | disabled ]
    bwc_policy
        [none] | string]
    cmp_enabled
        [yes | no]
    dhcp_relay
        [yes | no}
    connection_limit
        [integer]
    description
        [string]
    state
        [disabled | enabled]
    fallback_persistence
        [none | [profile name] ]
    flow_eviction_policy
        [none | [eviction policy name] ]
    gtm_score
        [integer]
    ip_forward
        [yes | no]
    ip_protocol
        [any | protocol]
    internal
        [yes | no]
    twelve_forward(12-forward)
        [yes | no]
    last_hop-pool
        [ [pool_name] | none]
    mask
        { [ipv4] | [ipv6] }
    mirror
        { [disabled | enabled | none] }
    nat64
        [enabled | disabled]
    persist
        [list]
    profiles
        [none | default | list ]
    policies
        [none | default | list ]
    rate_class
        [name]
    rate_limit
        [integer]
    rate_limit-mode
        [destination | object | object-destination |
        object-source | object-source-destination |
        source | source-destination]
    rate_limit_dst
        [integer]
    rate_limit_src
        [integer]
    rules
        [none | list ]
    related_rules
        [none | list ]
    reject
        [yes | no]
    source
        { [ipv4[/prefixlen]] | [ipv6[/prefixlen]] }
    source_address_translation
        [none | snat:pool_name | lsn | automap | dictionary ]
    source_port
        [change | preserve | preserve-strict]
    state
        [enabled | disabled]
    traffic_classes
        [none | default | list ]
    translate_address
        [enabled | disabled]
    translate_port
        [enabled | disabled]
    vlans
        [none | default | dictionary ]

        vlan_ids
            [ list]
        enabled
            [ true | false ]

    Fr2r3r5r'r7r8r9r4r�r�r�r�r�r�rDr�rEr�r�r�r�r�r�r�r�r�r�r�r�rjr�r�rIr�r�r�r�r�r�r:r�rrr�r�r�r�r�rOr�r�r�r�rr�r	z'A Virtual with this name was not found.rNrr�)/r7r8r9r4r�r�r�r�r�r�rDr�rEr�r�r�r�r�r�r�r�r�r�r�r�rjr�r�rIr�r�r�r�r�r�r�r�r�r�r�r�r�r�rr r!r�rrr�modify_virtual>	s���������	�
���
������������������� �!�"�#��2��������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�/�


�
��
�r�cCr~)z�
    Delete an existing virtual.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    name
        The name of the virtual which will be deleted
    Fr2r3r5r%r6r:r�rrzbigip.delete_virtualTrz!Virtual was successfully deleted.rrr
rrr	z5This virtual already does not exist. No changes made.r<rXrrr�delete_virtualV
s<��
��
�r�c	C�N|iddd�}tdrt|d|||||d�d�Std|||||�}t||�S)	a2
    A function to list an existing monitor.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    monitor_type
        The type of monitor to list
    name
        The name of the monitor to list
    Fr2r3r5r�r7r8r9�monitor_typer4r:�bigip.list_monitorr<)r7r8r9r�r4rrrrr�list_monitor�
� ��
�
r�cKs|iddd�}tdr&|||||d�}|��D]\}}	|	||<qt|d|�Std|||||�}
|
dd	kr@d
|d<d|d
<|S|
ddkrytd|||||fi|��}|dd	krrd
|d<i|dd<|d|dd<d|d
<|St||�}|St|
|�}|S)a�
    A function to connect to a bigip device and create a monitor.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    monitor_type
        The type of monitor to create
    name
        The name of the monitor to create
    kwargs
        [ arg=val ] ...

        Consult F5 BIGIP user guide for specific options for each monitor type.
        Typically, tmsh arg names are used.
    Fr2r3r5r�r#r�rrTrz9A monitor by this name currently exists.  No change made.rr	�bigip.create_monitorr
rrr�!Monitor was successfully created.)r=rr0rr)r7r8r9r�r4�kwargsrr/rrr rrrr�create_monitor�
sD�

��
��
�
�r�c
KsH|iddd�}tdr&|||||d�}|��D]\}}	|	||<qt|d|�Std|||||�}
|
dd	krdtd
|||||fi|��}|dd	kr]|
dd=|dd=td
||
|�}|St||�}|S|
ddkr�td|||||fi|��}|dd	kr�d|d<i|dd<|d|dd<d|d<|St||�}|St|
|�}|S)aG
    Create a new monitor if a monitor of this type and name does not already exists.  If it does exists, only
    the parameters specified will be enforced.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    monitor_type
        The type of monitor to create
    name
        The name of the monitor to create
    kwargs
        [ arg=val ] ...

        Consult F5 BIGIP user guide for specific options for each monitor type.
        Typically, tmsh arg names are used.
    Fr2r3r5r�r&r�rr�bigip.modify_monitorrry�Monitorr	r�Trr
rrr�r�r=rr0rr"r)
r7r8r9r�r4r�rr/rrr r!rrrr�manage_monitor�
�V�

�
��


��
��
�
�r�cK��|iddd�}tdr&|||||d�}|��D]\}}	|	||<qt|d|�Std|||||�}
|
dd	krdtd
|||||fi|��}|dd	kr]|
dd=|dd=td
||
|�}|St||�}|S|
ddkrpd|d<|St|
|�}|S)�
    Modify an existing monitor.  If it does exists, only
    the parameters specified will be enforced.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    monitor_type
        The type of monitor to create
    name
        The name of the monitor to create
    kwargs
        [ arg=val ] ...

        Consult F5 BIGIP user guide for specific options for each monitor type.
        Typically, tmsh arg names are used.
    Fr2r3r5r�r'r�rrr�rryr�r	z'A Monitor with this name was not found.rr�)r7r8r9r�r4r�rr/rrr r!rrr�modify_monitorJ�@�

�
��


�	�
�r�c	C��|iddd�}tdrt|d|||||d�d�Std|||||�}|d	d
krWtd|||||�}|d	d
krPd|d
<d|d<|d|dd<i|dd<|St||�}|S|d	dkrsd|d
<d|d<i|dd<i|dd<|St||�}|S)r�Fr2r3r5r%r�r:r�rrzbigip.delete_monitorTrz!Monitor was successfully deleted.rrr
rrr	z5This Monitor already does not exist. No changes made.r<)r7r8r9r�r4rr rTrrr�delete_monitor�sF��
�
�
��
�r�c	Cr�)	a2
    A function to list an existing profile.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    profile_type
        The type of profile to list
    name
        The name of the profile to list
    Fr2r3r5r�r7r8r9�profile_typer4r:�bigip.list_profiler<)r7r8r9r�r4rrrrr�list_profile�r�r�c		Ks�|iddd�}tdrt|d|||||d�d�Std|||||�}|d	d
kr2d|d<d
|d<|S|d	dkrktd|||||fi|��}|d	d
krdd|d<i|dd<|d|dd<d|d<|St||�}|St||�}|S)aV
    A function to connect to a bigip device and create a profile.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    profile_type
        The type of profile to create
    name
        The name of the profile to create
    kwargs
        [ arg=val ] ...

        Consult F5 BIGIP user guide for specific options for each profile type.
        Typically, tmsh arg names are used.

    Special Characters ``|``, ``,`` and ``:`` must be escaped using ``\`` when
    used within strings.

    Fr2r3r5r#r�r:r�rrTrz9A profile by this name currently exists.  No change made.rr	�bigip.create_profiler
rrr�!Profile was successfully created.r<)	r7r8r9r�r4r�rr rrrr�create_profile�sF��
��
��
�
�r�c
KsH|iddd�}tdr&|||||d�}|��D]\}}	|	||<qt|d|�Std|||||�}
|
dd	krdtd
|||||fi|��}|dd	kr]|
dd=|dd=td
||
|�}|St||�}|S|
ddkr�td|||||fi|��}|dd	kr�d|d<i|dd<|d|dd<d|d<|St|
|�}|St|
|�}|S)aG
    Create a new profile if a monitor of this type and name does not already exists.  If it does exists, only
    the parameters specified will be enforced.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    profile_type
        The type of profile to create
    name
        The name of the profile to create
    kwargs
        [ arg=val ] ...

        Consult F5 BIGIP user guide for specific options for each profile type.
        Typically, tmsh arg names are used.
    Fr2r3r5r�r&r�rr�bigip.modify_profilerry�Profiler	r�Trr
rrr�rr�)
r7r8r9r�r4r�rr/rrr r!rrrr�manage_profileCr�r�cKr�)a
    Modify an existing profile.  If it does exists, only
    the parameters specified will be enforced.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    profile_type
        The type of profile to create
    name
        The name of the profile to create
    kwargs
        [ arg=val ] ...

        Consult F5 BIGIP user guide for specific options for each monitor type.
        Typically, tmsh arg names are used.
    Fr2r3r5r�r'r�rrr�rryr�r	z'A Profile with this name was not found.rr�)r7r8r9r�r4r�rr/rrr r!rrr�modify_profile�r�r�c	Cr�)a
    Modify an existing profile.  If it does exists, only
    the parameters specified will be enforced.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    profile_type
        The type of profile to create
    name
        The name of the profile to create
    kwargs
        [ arg=val ] ...

        Consult F5 BIGIP user guide for specific options for each profile type.
        Typically, tmsh arg names are used.
    Fr2r3r5r%r�r:r�rrzbigip.delete_profileTrz!Profile was successfully deleted.rrr
rrr	z5This Profile already does not exist. No changes made.r<)r7r8r9r�r4rr rTrrr�delete_profile�sF��
�
�
��
�r�)	NNNNNNNNN)NNNNNNNNNNNNNNNNNNNNNNN)NNNNNNNNNNNNNNNNNNNNNN)NNNNNNNNNNNN)&NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)%�__doc__Zsalt.utils.jsonr*rrrr"r0r?rCrUrWrYr\rur{r}rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr�<module>s	2( @
�<
�l:%
�E
�p
�@:Zn
�L&
�
�Z
�8%FQFE%IQF