%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/panos.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlmZddl	Z
ddlZ
eje
�ZdZd�Zdd�Zd�Zd	�Zd
�Zd�Zd�Zdd
�Zdd�Zd�Zded�Zded�Zdd�Zddd�Zddd�Z d�Z!d�Z"d�Z#d�Z$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'd(�Z2d'd)�Z3dd*�Z4d'd+�Z5d,�Z6d-�Z7d.�Z8d/�Z9d0�Z:d1�Z;d2�Z<d3�Z=d4�Z>d5�Z?d6�Z@d7�ZAd8�ZBd9�ZCd:�ZDd;�ZEdd<�ZFddd=�ZGddd>�ZHddd?�ZId@�ZJdA�ZKdB�ZLdC�ZMdD�ZNdE�ZOdF�ZPddG�ZQdH�ZRdI�ZSdJ�ZTdKdL�ZUdKddM�ZVddN�ZWdeeedO�ZXdP�ZYddQ�ZZdR�Z[edS�Z\dT�Z]dddU�Z^ddV�Z_dW�Z`dedX�ZadedY�ZbecedZ�Zdeced[�Zeeced\�Zfeced]�Zgeced^�Zheced_�Zieced`�Zjdddddeda�Zkddedb�Zldedc�Zmdedd�Znde�Zoddfdg�Zpdddddddddedh�
Zqddi�ZrdS(ju�
Module to provide Palo Alto compatibility to Salt

:codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>``
:maturity:   new
:depends:    none
:platform:   unix

.. versionadded:: 2018.3.0

Configuration
=============

This module accepts connection configuration details either as
parameters, or as configuration settings in pillar as a Salt proxy.
Options passed into opts will be ignored if options are passed into pillar.

.. seealso::
    :py:mod:`Palo Alto Proxy Module <salt.proxy.panos>`

About
=====

This execution module was designed to handle connections to a Palo Alto based
firewall. This module adds support to send connections directly to the device
through the XML API or through a brokered connection to Panorama.

i(tabsolute_importtprint_functiontunicode_literalsN(tCommandExecutionErrorupanoscC@sLy.tjjj�r-tdddkr-tSWntk
rAnXtdfS(u0
    Will load for the panos proxy minions.
    uproxyu	proxytypeupanosuFThe panos execution module can only be loaded for panos proxy minions.(tsalttutilstplatformtis_proxyt__opts__t__virtualname__tKeyErrortFalse(((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pyt__virtual__.s
cC@s�|std��ntd|�}d|kr�d|dkr�|dd}x/t|�ddddkr�tjd�qRWt|�S|SdS(	u�
    Executes a query that requires a job for completion. This function will wait for the job to complete
    and return the results.
    u!Query parameters cannot be empty.u
panos.calluresultujobustatusuFINiN(Rt	__proxy__tget_jobttimetsleep(tquerytresponsetjid((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pyt_get_job_results<s!
cC@s"idd6dd6}td|�S(u�
    Prevent other users from changing configuration until the lock is released.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.add_config_lock

    uoputypeu9<request><config-lock><add></add></config-lock></request>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytadd_config_lockRscC@s"idd6dd6}td|�S(u�
    Get anti-virus information from PaloAlto Networks server

    CLI Example:

    .. code-block:: bash

        salt '*' panos.check_antivirus

    uoputypeuN<request><anti-virus><upgrade><check></check></upgrade></anti-virus></request>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytcheck_antivirusbscC@s"idd6dd6}td|�S(u�
    Get software information from PaloAlto Networks server.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.check_software

    uoputypeuH<request><system><software><check></check></software></system></request>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytcheck_softwarerscC@s"idd6dd6}td|�S(uy
    Clear all commit tasks.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.clear_commit_tasks

    uoputypeu<<request><clear-commit-tasks></clear-commit-tasks></request>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytclear_commit_tasks�scC@sidd6dd6}t|�S(u�
    Commits the candidate configuration to the running configuration.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.commit

    ucommitutypeu<commit></commit>ucmd(R(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytcommit�scC@sdd}td|�s)tdj|�fS|s9tdfSidd6dj|�d6}td	|�S(
u	
    Deactivates an installed license.
    Required version 7.0.0 or greater.

    key_name(str): The file name of the license key installed.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.deactivate_license key_name=License_File_Name.key

    u7.0.0upanos.is_required_versionuBThe panos device requires version {0} or greater for this command.uYou must specify a key_name.uoputypeus<request><license><deactivate><key><features><member>{0}</member></features></key></deactivate></license></request>ucmdu
panos.call(R
Rtformat(tkey_namet_required_versionR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytdeactivate_license�s

cC@s;|stdfSidd6dj|�d6}td|�S(u�
    Remove license keys on disk.

    key_name(str): The file name of the license key to be deleted.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.delete_license key_name=License_File_Name.key

    uYou must specify a key_name.uoputypeu2<delete><license><key>{0}</key></license></delete>ucmdu
panos.call(RRR
(RR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytdelete_license�s
cC@sidd6dd6}t|�S(u�
    Download the most recent anti-virus package.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.download_antivirus

    uoputypeue<request><anti-virus><upgrade><download><latest></latest></download></upgrade></anti-virus></request>ucmd(R(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytdownload_antivirus�s

cC@s�|std��nt|t�s3td��n|tkr_idd6dj|�d6}nidd6dj|�d6}t|�S(uz
    Download software packages by filename.

    Args:
        filename(str): The filename of the PANOS file to download.

        synch (bool): If true then the file will synch to the peer unit.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.download_software_file PanOS_5000-8.0.0
        salt '*' panos.download_software_file PanOS_5000-8.0.0 True

    u!Filename option must not be none.uSynch option must be boolean..uoputypeu^<request><system><software><download><file>{0}</file></download></software></system></request>ucmdu~<request><system><software><download><sync-to-peer>yes</sync-to-peer><file>{0}</file></download></software></system></request>(Rt
isinstancetbooltTrueRR(tfilenametsynchR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytdownload_software_file�s


cC@s�|std��nt|t�s3td��n|tkr_idd6dj|�d6}nidd6dj|�d6}t|�S(un
    Download software packages by version number.

    Args:
        version(str): The version of the PANOS file to download.

        synch (bool): If true then the file will synch to the peer unit.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.download_software_version 8.0.0
        salt '*' panos.download_software_version 8.0.0 True

    u Version option must not be none.uSynch option must be boolean..uoputypeud<request><system><software><download><version>{0}</version></download></software></system></request>ucmdu�<request><system><software><download><sync-to-peer>yes</sync-to-peer><version>{0}</version></download></software></system></request>(RR R!R"RR(tversionR$R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytdownload_software_version	s


cC@sH|sidd6dd6}nidd6dj|�d6}td|�S(u
    Get new license(s) using from the Palo Alto Network Server.

    auth_code
        The license authorization code.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.fetch_license
        salt '*' panos.fetch_license auth_code=foobar

    uoputypeu5<request><license><fetch></fetch></license></request>ucmduO<request><license><fetch><auth-code>{0}</auth-code></fetch></license></request>u
panos.call(RR
(t	auth_codeR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pyt
fetch_license,s

u1cC@s5idd6dd6dj||�d6}td|�S(u�
    Get the candidate configuration for the specified get_address object. This will not return address objects that are
    marked as pre-defined objects.

    address(str): The name of the address object.

    vsys(str): The string representation of the VSYS ID.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_address myhost
        salt '*' panos.get_address myhost 3

    uconfigutypeugetuactionuk/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys{0}']/address/entry[@name='{1}']uxpathu
panos.call(RR
(taddresstvsysR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_addressDs

cC@s5idd6dd6dj||�d6}td|�S(u�
    Get the candidate configuration for the specified address group. This will not return address groups that are
    marked as pre-defined objects.

    addressgroup(str): The name of the address group.

    vsys(str): The string representation of the VSYS ID.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_address_group foobar
        salt '*' panos.get_address_group foobar 3

    uconfigutypeugetuactionuq/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys{0}']/address-group/entry[@name='{1}']uxpathu
panos.call(RR
(taddressgroupR+R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_address_group]s

cC@s"idd6dd6}td|�S(u|
    Show active administrators.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_admins_active

    uoputypeu<show><admins></admins></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_admins_activevscC@s"idd6dd6}td|�S(uv
    Show all administrators.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_admins_all

    uoputypeu)<show><admins><all></all></admins></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_admins_all�scC@s"idd6dd6}td|�S(u�
    Show information about available anti-virus packages.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_antivirus_info

    uoputypeuL<request><anti-virus><upgrade><info></info></upgrade></anti-virus></request>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_antivirus_info�scC@s"idd6dd6}td|�S(ul
    Show ARP information.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_arp

    uoputypeu-<show><arp><entry name = 'all'/></arp></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_arp�scC@s"idd6dd6}td|�S(u�
    Show timeout information for this administrative session.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_cli_idle_timeout

    uoputypeu5<show><cli><idle-timeout></idle-timeout></cli></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_cli_idle_timeout�scC@s"idd6dd6}td|�S(u�
    Show cli administrative permissions.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_cli_permissions

    uoputypeu3<show><cli><permissions></permissions></cli></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_cli_permissions�scC@s"idd6dd6}td|�S(u�
    Report filesystem disk space usage.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_disk_usage

    uoputypeu7<show><system><disk-space></disk-space></system></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_disk_usage�scC@s)idd6dd6dd6}td|�S(u�
    Get the DNS server configuration from the candidate configuration.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_dns_server_config

    uconfigutypeugetuactionu\/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/dns-setting/serversuxpathu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_dns_server_config�s

cC@s)idd6dd6dd6}td|�S(u�
    Get the domain name configuration from the candidate configuration.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_domain_config

    uconfigutypeugetuactionuO/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/domainuxpathu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_domain_config�s

cC@s"idd6dd6}td|�S(uz
    Show the DoS block-ip table.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_dos_blocks

    uoputypeu;<show><dos-block-table><all></all></dos-block-table></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_dos_blocks
scC@s"idd6dd6}td|�S(u�
    Print FQDNs used in rules and their IPs.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_fqdn_cache

    uoputypeu><request><system><fqdn><show></show></fqdn></system></request>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_fqdn_cachescC@s)idd6dd6dd6}td|�S(u�
    Get the high availability configuration.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_ha_config

    uconfigutypeugetuactionuS/config/devices/entry[@name='localhost.localdomain']/deviceconfig/high-availabilityuxpathu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pyt
get_ha_config*s

cC@s"idd6dd6}td|�S(u�
    Show high-availability link-monitoring state.

    CLI Example:

   .. code-block:: bash

        salt '*' panos.get_ha_link

    uoputypeuW<show><high-availability><link-monitoring></link-monitoring></high-availability></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_ha_link<s

cC@s"idd6dd6}td|�S(u�
    Show high-availability path-monitoring state.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_ha_path

    uoputypeuW<show><high-availability><path-monitoring></path-monitoring></high-availability></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_ha_pathMs

cC@s"idd6dd6}td|�S(u�
    Show high-availability state information.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_ha_state

    uoputypeuC<show><high-availability><state></state></high-availability></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_ha_state^s

cC@s"idd6dd6}td|�S(u�
    Show high-availability transition statistic information.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_ha_transitions

    uoputypeuO<show><high-availability><transitions></transitions></high-availability></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_ha_transitionsps

cC@s)idd6dd6dd6}td|�S(u{
    Get the hostname of the device.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_hostname

    uconfigutypeugetuactionuQ/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/hostnameuxpathu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_hostname�s

uallcC@s+idd6dj|�d6}td|�S(u=
    Get the counter statistics for interfaces.

    Args:
        name (str): The name of the interface to view. By default, all interface statistics are viewed.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_interface_counters
        salt '*' panos.get_interface_counters ethernet1/1

    uoputypeu:<show><counter><interface>{0}</interface></counter></show>ucmdu
panos.call(RR
(tnameR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_interface_counters�s
cC@s+idd6dj|�d6}td|�S(u
    Show interface information.

    Args:
        name (str): The name of the interface to view. By default, all interface statistics are viewed.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_interfaces
        salt '*' panos.get_interfaces ethernet1/1

    uoputypeu'<show><interface>{0}</interface></show>ucmdu
panos.call(RR
(R@R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_interfaces�s
cC@s@|std��nidd6dj|�d6}td|�S(u�
    List all a single job by ID.

    jid
        The ID of the job to retrieve.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_job jid=15

    uID option must not be none.uoputypeu&<show><jobs><id>{0}</id></jobs></show>ucmdu
panos.call(RRR
(RR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pyR�scC@s�|j�dkr)idd6dd6}n^|j�dkrRidd6dd6}n5|j�dkr{idd6d	d6}ntd
��td|�S(u�
    List all jobs on the device.

    state
        The state of the jobs to display. Valid options are all, pending, or processed. Pending jobs are jobs
        that are currently in a running or waiting state. Processed jobs are jobs that have completed
        execution.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_jobs
        salt '*' panos.get_jobs state=pending

    ualluoputypeu%<show><jobs><all></all></jobs></show>ucmdupendingu-<show><jobs><pending></pending></jobs></show>u	processedu1<show><jobs><processed></processed></jobs></show>u7The state parameter must be all, pending, or processed.u
panos.call(tlowerRR
(tstateR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_jobs�scC@s"idd6dd6}td|�S(uh
    Show LACP state.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_lacp

    uoputypeuF<show><lacp><aggregate-ethernet>all</aggregate-ethernet></lacp></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_lacp�scC@s"idd6dd6}td|�S(u�
    Show information about owned license(s).

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_license_info

    uoputypeu3<request><license><info></info></license></request>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_license_infoscC@s"idd6dd6}td|�S(u�
    Show license token files for manual license deactivation.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_license_tokens

    uoputypeu8<show><license-token-files></license-token-files></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_license_tokensscC@s"idd6dd6}td|�S(u
    Show lldp config for interfaces.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_lldp_config

    uoputypeu.<show><lldp><config>all</config></lldp></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_lldp_config!scC@s"idd6dd6}td|�S(u�
    Show lldp counters for interfaces.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_lldp_counters

    uoputypeu2<show><lldp><counters>all</counters></lldp></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_lldp_counters1scC@s"idd6dd6}td|�S(u�
    Show lldp local info for interfaces.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_lldp_local

    uoputypeu,<show><lldp><local>all</local></lldp></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_lldp_localAscC@s"idd6dd6}td|�S(u�
    Show lldp neighbors info for interfaces.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_lldp_neighbors

    uoputypeu4<show><lldp><neighbors>all</neighbors></lldp></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_lldp_neighborsQscC@s�t�}g}d|dkr#|St|dddt�roxK|dddD]}|j|d�qQWn|j|dddd�|S(u�
    Show all local administrator accounts.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_local_admins

    uusersuresultuentryuname(tget_users_configR tlisttappend(t
admin_listRtentry((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_local_adminsas	cC@s"idd6dd6}td|�S(uw
    Report the logdb quotas.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_logdb_quota

    uoputypeu9<show><system><logdb-quota></logdb-quota></system></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_logdb_quota{scC@s"idd6dd6}td|�S(u|
    Get the master key properties.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_master_key

    uoputypeuK<show><system><masterkey-properties></masterkey-properties></system></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_master_key�scC@s)idd6dd6dd6}td|�S(u�
    Get the NTP configuration from the candidate configuration.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_ntp_config

    uconfigutypeugetuactionuT/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/ntp-serversuxpathu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_ntp_config�s

cC@s"idd6dd6}td|�S(u�
    Get list of configured NTP servers.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_ntp_servers

    uoputypeu<show><ntp></ntp></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_ntp_servers�scC@s"idd6dd6}td|�S(u�
    Show device operational mode setting.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_operational_mode

    uoputypeu2<show><operational-mode></operational-mode></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_operational_mode�scC@s"idd6dd6}td|�S(u�
    Show panorama connection status.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_panorama_status

    uoputypeu0<show><panorama-status></panorama-status></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_panorama_status�scC@s)idd6dd6dd6}td|�S(u�
    Get the IP addresses that are permitted to establish management connections to the device.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_permitted_ips

    uconfigutypeugetuactionuU/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/permitted-ipuxpathu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_permitted_ips�s

cC@s)idd6dd6dd6}td|�S(u�
    Get the platform model information and limitations.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_platform

    uconfigutypeugetuactionu=/config/devices/entry[@name='localhost.localdomain']/platformuxpathu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_platform�s

cC@s2idd6dd6dj|�d6}td|�S(u=
    Get the configuration for the specified pre-defined application object. This will only return pre-defined
    application objects.

    application(str): The name of the pre-defined application object.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_predefined_application saltstack

    uconfigutypeugetuactionu1/config/predefined/application/entry[@name='{0}']uxpathu
panos.call(RR
(tapplicationR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_predefined_applications
cC@s5idd6dd6dj||�d6}td|�S(uG
    Get the candidate configuration for the specified security rule.

    rulename(str): The name of the security rule.

    vsys(str): The string representation of the VSYS ID.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_security_rule rule01
        salt '*' panos.get_security_rule rule01 3

    uconfigutypeugetuactionu{/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys{0}']/rulebase/security/rules/entry[@name='{1}']uxpathu
panos.call(RR
(trulenameR+R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_security_rules

cC@s5idd6dd6dj||�d6}td|�S(u�
    Get the candidate configuration for the specified service object. This will not return services that are marked
    as pre-defined objects.

    service(str): The name of the service object.

    vsys(str): The string representation of the VSYS ID.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_service tcp-443
        salt '*' panos.get_service tcp-443 3

    uconfigutypeugetuactionuk/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys{0}']/service/entry[@name='{1}']uxpathu
panos.call(RR
(tserviceR+R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_service.s

cC@s5idd6dd6dj||�d6}td|�S(u�
    Get the candidate configuration for the specified service group. This will not return service groups that are
    marked as pre-defined objects.

    servicegroup(str): The name of the service group.

    vsys(str): The string representation of the VSYS ID.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_service_group foobar
        salt '*' panos.get_service_group foobar 3

    uconfigutypeugetuactionuq/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys{0}']/service-group/entry[@name='{1}']uxpathu
panos.call(RR
(tservicegroupR+R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_service_groupGs

cC@s"idd6dd6}td|�S(u
    Show device session statistics.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_session_info

    uoputypeu-<show><session><info></info></session></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_session_info`s

cC@s)idd6dd6dd6}td|�S(u�
    Get the SNMP configuration from the device.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_snmp_config

    uconfigutypeugetuactionuU/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/snmp-settinguxpathu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_snmp_configqs

cC@s"idd6dd6}td|�S(u�
    Show information about available software packages.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_software_info

    uoputypeuF<request><system><software><info></info></software></system></request>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_software_info�scC@s"idd6dd6}td|�S(u}
    Get the system date/time.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_system_date_time

    uoputypeu<show><clock></clock></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_system_date_time�scC@s"idd6dd6}td|�S(u�
    List important files in the system.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_system_files

    uoputypeu-<show><system><files></files></system></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_system_files�scC@s"idd6dd6}td|�S(uz
    Get the system information.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_system_info

    uoputypeu+<show><system><info></info></system></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_system_info�scC@s"idd6dd6}td|�S(ux
    Show system services.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_system_services

    uoputypeu3<show><system><services></services></system></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_system_services�scC@sH|r&idd6dj|�d6}nidd6dd6}td|�S(u/
    Show the system state variables.

    mask
        Filters by a subtree or a wildcard.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_system_state
        salt '*' panos.get_system_state mask=cfg.ha.config.enabled
        salt '*' panos.get_system_state mask=cfg.ha.*

    uoputypeuA<show><system><state><filter>{0}</filter></state></system></show>ucmdu-<show><system><state></state></system></show>u
panos.call(RR
(tmaskR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_system_state�s

cC@sKd}td|�s)tdj|�fSidd6dd6}td|�S(	u�
    Retrieve a list of all uncommitted changes on the device.
    Requires PANOS version 8.0.0 or greater.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_uncommitted_changes

    u8.0.0upanos.is_required_versionuBThe panos device requires version {0} or greater for this command.uoputypeu><show><config><list><changes></changes></list></config></show>ucmdu
panos.call(R
RR(RR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_uncommitted_changes�s

cC@s)idd6dd6dd6}td|�S(u�
    Get the local administrative user account configuration.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_users_config

    uconfigutypeugetuactionu/config/mgt-config/usersuxpathu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pyRMs

cC@s"idd6dd6}td|�S(us
    Show all VLAN information.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_vlans

    uoputypeu<show><vlan>all</vlan></show>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pyt	get_vlanssucC@s)idd6dd6|d6}td|�S(u�
    Retrieve a specified xpath from the candidate configuration.

    xpath(str): The specified xpath in the candidate configuration.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_xpath /config/shared/service

    uconfigutypeugetuactionuxpathu
panos.call(R
(txpathR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pyt	get_xpath$s

cC@s5idd6dd6dj||�d6}td|�S(u
    Get the candidate configuration for the specified zone.

    zone(str): The name of the zone.

    vsys(str): The string representation of the VSYS ID.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_zone trust
        salt '*' panos.get_zone trust 2

    uconfigutypeugetuactionuh/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys{0}']/zone/entry[@name='{1}']uxpathu
panos.call(RR
(tzoneR+R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytget_zone8s

cC@s2idd6dd6dj|�d6}td|�S(u�
    Get all the zones in the candidate configuration.

    vsys(str): The string representation of the VSYS ID.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.get_zones
        salt '*' panos.get_zones 2

    uconfigutypeugetuactionuU/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys{0}']/zoneuxpathu
panos.call(RR
(R+R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pyt	get_zonesPs


cC@s�|r"|tkr"td��n|tkr7d}nd}|tkrRd}nd}|tkr�idd6dj||�d6}n#idd6dj|||�d6}t|�S(	u
    Install anti-virus packages.

    Args:
        version(str): The version of the PANOS file to install.

        latest(bool): If true, the latest anti-virus file will be installed.
                      The specified version option will be ignored.

        synch(bool): If true, the anti-virus will synch to the peer unit.

        skip_commit(bool): If true, the install will skip committing to the device.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.install_antivirus 8.0.0

    u Version option must not be none.uyesunouoputypeu�<request><anti-virus><upgrade><install><commit>{0}</commit><sync-to-peer>{1}</sync-to-peer><version>latest</version></install></upgrade></anti-virus></request>ucmdu�<request><anti-virus><upgrade><install><commit>{0}</commit><sync-to-peer>{1}</sync-to-peer><version>{2}</version></install></upgrade></anti-virus></request>(RRR"RR(R&tlatestR$tskip_committstcR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytinstall_antivirusfs 		

cC@s"idd6dd6}td|�S(uz
    Install the license key(s).

    CLI Example:

    .. code-block:: bash

        salt '*' panos.install_license

    uoputypeu9<request><license><install></install></license></request>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytinstall_license�scC@s<|std��nidd6dj|�d6}t|�S(u�
    Upgrade to a software package by version.

    Args:
        version(str): The version of the PANOS file to install.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.install_license 8.0.0

    u Version option must not be none.uoputypeub<request><system><software><install><version>{0}</version></install></software></system></request>ucmd(RRR(R&R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytinstall_software�s

cC@s"idd6dd6}td|�S(un
    Reboot a running system.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.reboot

    uoputypeu7<request><restart><system></system></restart></request>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytreboot�scC@s]t|t�std��n|r;idd6dd6}nidd6dd6}td|�S(u�
    Force refreshes all FQDNs used in rules.

    force
        Forces all fqdn refresh

    CLI Example:

    .. code-block:: bash

        salt '*' panos.refresh_fqdn_cache
        salt '*' panos.refresh_fqdn_cache force=True

    uForce option must be boolean.uoputypeuV<request><system><fqdn><refresh><force>yes</force></refresh></fqdn></system></request>ucmduD<request><system><fqdn><refresh></refresh></fqdn></system></request>u
panos.call(R R!RR
(tforceR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytrefresh_fqdn_cache�s

cC@s"idd6dd6}td|�S(u�
    Release config lock previously held.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.remove_config_lock

    uoputypeu?<request><config-lock><remove></remove></config-lock></request>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytremove_config_lock�scC@s�d}td|�s)tdj|�fS|s>td��n|sdidd6dj|�d6}n idd6d	j||�d6}td
|�S(uB
    Resolve address to ip address.
    Required version 7.0.0 or greater.

    address
        Address name you want to resolve.

    vsys
        The vsys name.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.resolve_address foo.bar.com
        salt '*' panos.resolve_address foo.bar.com vsys=2

    u7.0.0upanos.is_required_versionuBThe panos device requires version {0} or greater for this command.u,FQDN to resolve must be provided as address.uoputypeu<<request><resolve><address>{0}</address></resolve></request>ucmduL<request><resolve><vsys>{0}</vsys><address>{1}</address></resolve></request>u
panos.call(R
RRR(R*R+RR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytresolve_address�s

cC@s@|std��nidd6dj|�d6}td|�S(u�
    Save device configuration to a named file.

    filename
        The filename to save the configuration to.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.save_device_config foo.xml

    uFilename must not be empty.uoputypeu*<save><config><to>{0}</to></config></save>ucmdu
panos.call(RRR
(R#R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytsave_device_configscC@s"idd6dd6}td|�S(u�
    Save files needed to restore device to local disk.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.save_device_state

    uoputypeu*<save><device-state></device-state></save>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytsave_device_state4scC@s�|std��ni}idd6dd6dd6dj|�d	6}|jtd
|��|tkr||jt��n|S(u�
    Set the authentication profile of the Palo Alto proxy minion. A commit will be required before this is processed.

    CLI Example:

    Args:
        profile (str): The name of the authentication profile to set.

        deploy (bool): If true then commit the full candidate configuration, if false only set pending change.

    .. code-block:: bash

        salt '*' panos.set_authentication_profile foo
        salt '*' panos.set_authentication_profile foo deploy=True

    u%Profile name option must not be none.uconfigutypeusetuactionu_/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/authentication-profileuxpathu4<authentication-profile>{0}</authentication-profile>uelementu
panos.call(RRtupdateR
R"R(tprofiletdeploytretR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytset_authentication_profileDs
cC@s�|std��ni}idd6dd6dd6dj|�d	6}|jtd
|��|tkr||jt��n|S(u�
    Set the hostname of the Palo Alto proxy minion. A commit will be required before this is processed.

    CLI Example:

    Args:
        hostname (str): The hostname to set

        deploy (bool): If true then commit the full candidate configuration, if false only set pending change.

    .. code-block:: bash

        salt '*' panos.set_hostname newhostname
        salt '*' panos.set_hostname newhostname deploy=True

    u!Hostname option must not be none.uconfigutypeusetuactionuH/config/devices/entry[@name='localhost.localdomain']/deviceconfig/systemuxpathu<hostname>{0}</hostname>uelementu
panos.call(RRR�R
R"R(thostnameR�R�R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytset_hostnameis
cC@s�|tkrd}n!|tkr*d}ntd��i}idd6dd6dd	6d
j|�d6}|jtd|��|tkr�|jt��n|S(
u�
    Enables or disables the ICMP management service on the device.

    CLI Example:

    Args:
        enabled (bool): If true the service will be enabled. If false the service will be disabled.

        deploy (bool): If true then commit the full candidate configuration, if false only set pending change.

    .. code-block:: bash

        salt '*' panos.set_management_icmp
        salt '*' panos.set_management_icmp enabled=False deploy=True

    unouyesu3Invalid option provided for service enabled option.uconfigutypeusetuactionuP/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/serviceuxpathu <disable-icmp>{0}</disable-icmp>uelementu
panos.call(R"RRRR�R
R(tenabledR�tvalueR�R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytset_management_icmp�s		
cC@s�|tkrd}n!|tkr*d}ntd��i}idd6dd6dd	6d
j|�d6}|jtd|��|tkr�|jt��n|S(
u�
    Enables or disables the HTTP management service on the device.

    CLI Example:

    Args:
        enabled (bool): If true the service will be enabled. If false the service will be disabled.

        deploy (bool): If true then commit the full candidate configuration, if false only set pending change.

    .. code-block:: bash

        salt '*' panos.set_management_http
        salt '*' panos.set_management_http enabled=False deploy=True

    unouyesu3Invalid option provided for service enabled option.uconfigutypeusetuactionuP/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/serviceuxpathu <disable-http>{0}</disable-http>uelementu
panos.call(R"RRRR�R
R(R�R�R�R�R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytset_management_http�s		
cC@s�|tkrd}n!|tkr*d}ntd��i}idd6dd6dd	6d
j|�d6}|jtd|��|tkr�|jt��n|S(
u�
    Enables or disables the HTTPS management service on the device.

    CLI Example:

    Args:
        enabled (bool): If true the service will be enabled. If false the service will be disabled.

        deploy (bool): If true then commit the full candidate configuration, if false only set pending change.

    .. code-block:: bash

        salt '*' panos.set_management_https
        salt '*' panos.set_management_https enabled=False deploy=True

    unouyesu3Invalid option provided for service enabled option.uconfigutypeusetuactionuP/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/serviceuxpathu"<disable-https>{0}</disable-https>uelementu
panos.call(R"RRRR�R
R(R�R�R�R�R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytset_management_https�s		
cC@s�|tkrd}n!|tkr*d}ntd��i}idd6dd6dd	6d
j|�d6}|jtd|��|tkr�|jt��n|S(
u�
    Enables or disables the HTTP OCSP management service on the device.

    CLI Example:

    Args:
        enabled (bool): If true the service will be enabled. If false the service will be disabled.

        deploy (bool): If true then commit the full candidate configuration, if false only set pending change.

    .. code-block:: bash

        salt '*' panos.set_management_ocsp
        salt '*' panos.set_management_ocsp enabled=False deploy=True

    unouyesu3Invalid option provided for service enabled option.uconfigutypeusetuactionuP/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/serviceuxpathu*<disable-http-ocsp>{0}</disable-http-ocsp>uelementu
panos.call(R"RRRR�R
R(R�R�R�R�R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytset_management_ocsps		
cC@s�|tkrd}n!|tkr*d}ntd��i}idd6dd6dd	6d
j|�d6}|jtd|��|tkr�|jt��n|S(
u�
    Enables or disables the SNMP management service on the device.

    CLI Example:

    Args:
        enabled (bool): If true the service will be enabled. If false the service will be disabled.

        deploy (bool): If true then commit the full candidate configuration, if false only set pending change.

    .. code-block:: bash

        salt '*' panos.set_management_snmp
        salt '*' panos.set_management_snmp enabled=False deploy=True

    unouyesu3Invalid option provided for service enabled option.uconfigutypeusetuactionuP/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/serviceuxpathu <disable-snmp>{0}</disable-snmp>uelementu
panos.call(R"RRRR�R
R(R�R�R�R�R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytset_management_snmp-s		
cC@s�|tkrd}n!|tkr*d}ntd��i}idd6dd6dd	6d
j|�d6}|jtd|��|tkr�|jt��n|S(
u�
    Enables or disables the SSH management service on the device.

    CLI Example:

    Args:
        enabled (bool): If true the service will be enabled. If false the service will be disabled.

        deploy (bool): If true then commit the full candidate configuration, if false only set pending change.

    .. code-block:: bash

        salt '*' panos.set_management_ssh
        salt '*' panos.set_management_ssh enabled=False deploy=True

    unouyesu3Invalid option provided for service enabled option.uconfigutypeusetuactionuP/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/serviceuxpathu<disable-ssh>{0}</disable-ssh>uelementu
panos.call(R"RRRR�R
R(R�R�R�R�R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytset_management_sshUs		
cC@s�|tkrd}n!|tkr*d}ntd��i}idd6dd6dd	6d
j|�d6}|jtd|��|tkr�|jt��n|S(
u�
    Enables or disables the Telnet management service on the device.

    CLI Example:

    Args:
        enabled (bool): If true the service will be enabled. If false the service will be disabled.

        deploy (bool): If true then commit the full candidate configuration, if false only set pending change.

    .. code-block:: bash

        salt '*' panos.set_management_telnet
        salt '*' panos.set_management_telnet enabled=False deploy=True

    unouyesu3Invalid option provided for service enabled option.uconfigutypeusetuactionuP/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/serviceuxpathu$<disable-telnet>{0}</disable-telnet>uelementu
panos.call(R"RRRR�R
R(R�R�R�R�R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytset_management_telnet}s		
c
C@sUi}|dkr'tjjd��n|dkrHtjjd��n|dkrp|rptjjd	��n|dkr�|r�tjjd
��n|dkr�|dkr�tjjd
��n|dkr�|dks�|dkr;idd6dd6dd6dj|||�d6}|jitd|�d6�n|dksS|dkr2idd6dd6dd6dj|||�d6}|jitd|�d6�q2n�|dkrm|dks�|dkridd6dd6dd6dd6}|jitd|�d6�n|dks'|dkr2idd6dd6dd6dd6}|jitd|�d6�q2n�|dkr2|dks�|dkr�idd6dd6dd6dd6}|jitd|�d6�n|dks�|dkr2idd6dd6dd6dd6}|jitd|�d6�q2n|tkrQ|jt��n|S(u�
    Set the NTP authentication of the Palo Alto proxy minion. A commit will be required before this is processed.

    CLI Example:

    Args:
        target(str): Determines the target of the authentication. Valid options are primary, secondary, or both.

        authentication_type(str): The authentication type to be used. Valid options are symmetric, autokey, and none.

        key_id(int): The NTP authentication key ID.

        authentication_key(str): The authentication key.

        algorithm(str): The algorithm type to be used for a symmetric key. Valid options are md5 and sha1.

        deploy (bool): If true then commit the full candidate configuration, if false only set pending change.

    .. code-block:: bash

        salt '*' ntp.set_authentication target=both authentication_type=autokey
        salt '*' ntp.set_authentication target=primary authentication_type=none
        salt '*' ntp.set_authentication target=both authentication_type=symmetric key_id=15 authentication_key=mykey algorithm=md5
        salt '*' ntp.set_authentication target=both authentication_type=symmetric key_id=15 authentication_key=mykey algorithm=md5 deploy=True

    uprimaryu	secondaryubothu2Target option must be primary, secondary, or both.u	symmetricuautokeyunoneu0Type option must be symmetric, autokey, or both.uIWhen using symmetric authentication, authentication_key must be provided.u=When using symmetric authentication, key_id must be provided.umd5usha1uCWhen using symmetric authentication, algorithm must be md5 or sha1.uconfigutypeusetuactionu{/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/ntp-servers/primary-ntp-server/authentication-typeuxpathu�<symmetric-key><algorithm><{0}><authentication-key>{1}</authentication-key></{0}></algorithm><key-id>{2}</key-id></symmetric-key>uelementu
panos.calluprimary_serveru}/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/ntp-servers/secondary-ntp-server/authentication-typeusecondary_serveru
<autokey/>u<none/>(uprimaryu	secondaryuboth(u	symmetricuautokeyunone(umd5usha1(Rt
exceptionsRRR�R
R"R(ttargettauthentication_typetkey_idtauthentication_keyt	algorithmR�R�R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytset_ntp_authentication�sv 

!

$

!

$

!

$cC@s�i}|rXidd6dd6dd6dj|�d6}|jitd	|�d
6�n|r�idd6dd6dd6dj|�d6}|jitd	|�d6�n|tkr�|jt��n|S(
u�
    Set the NTP servers of the Palo Alto proxy minion. A commit will be required before this is processed.

    CLI Example:

    Args:
        primary_server(str): The primary NTP server IP address or FQDN.

        secondary_server(str): The secondary NTP server IP address or FQDN.

        deploy (bool): If true then commit the full candidate configuration, if false only set pending change.

    .. code-block:: bash

        salt '*' ntp.set_servers 0.pool.ntp.org 1.pool.ntp.org
        salt '*' ntp.set_servers primary_server=0.pool.ntp.org secondary_server=1.pool.ntp.org
        salt '*' ntp.ser_servers 0.pool.ntp.org 1.pool.ntp.org deploy=True

    uconfigutypeusetuactionug/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/ntp-servers/primary-ntp-serveruxpathu,<ntp-server-address>{0}</ntp-server-address>uelementu
panos.calluprimary_serverui/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/ntp-servers/secondary-ntp-serverusecondary_server(RR�R
R"R(tprimary_servertsecondary_serverR�R�R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytset_ntp_serverss 
!
!cC@s�|std��ni}idd6dd6dd6dj|�d	6}|jtd
|��|tkr||jt��n|S(u�
    Add an IPv4 address or network to the permitted IP list.

    CLI Example:

    Args:
        address (str): The IPv4 address or network to allow access to add to the Palo Alto device.

        deploy (bool): If true then commit the full candidate configuration, if false only set pending change.

    .. code-block:: bash

        salt '*' panos.set_permitted_ip 10.0.0.1
        salt '*' panos.set_permitted_ip 10.0.0.0/24
        salt '*' panos.set_permitted_ip 10.0.0.1 deploy=True

    u!Address option must not be empty.uconfigutypeusetuactionuU/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/permitted-ipuxpathu<entry name='{0}'></entry>uelementu
panos.call(RRR�R
R"R(R*R�R�R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytset_permitted_ipAs
cC@s�|std��ni}idd6dd6dd6dj|�d	6}|jtd
|��|tkr||jt��n|S(u�
    Set the timezone of the Palo Alto proxy minion. A commit will be required before this is processed.

    CLI Example:

    Args:
        tz (str): The name of the timezone to set.

        deploy (bool): If true then commit the full candidate configuration, if false only set pending change.

    .. code-block:: bash

        salt '*' panos.set_timezone UTC
        salt '*' panos.set_timezone UTC deploy=True

    u&Timezone name option must not be none.uconfigutypeusetuactionuQ/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/timezoneuxpathu<timezone>{0}</timezone>uelementu
panos.call(RRR�R
R"R(ttzR�R�R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytset_timezonefs
cC@s"idd6dd6}td|�S(ur
    Shutdown a running system.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.shutdown

    uoputypeu9<request><shutdown><system></system></shutdown></request>ucmdu
panos.call(R
(R((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytshutdown�suvr1cC@sjd}|r"|dj|�7}n|r>|dj|�7}n|d7}idd6|d6}td|�S(	u;
    Perform a route lookup within active route table (fib).

    ip (str): The destination IP address to test.

    vr (str): The name of the virtual router to test.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.test_fib_route 4.2.2.2
        salt '*' panos.test_fib_route 4.2.2.2 my-vr

    u<test><routing><fib-lookup>u<ip>{0}</ip>u$<virtual-router>{0}</virtual-router>u</fib-lookup></routing></test>uoputypeucmdu
panos.call(RR
(tiptvrRnR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pyttest_fib_route�s


c
C@s5d}
|r"|
dj|�7}
n|r>|
dj|�7}
n|rZ|
dj|�7}
n|rv|
dj|�7}
n|r�|
dj|�7}
n|r�|
dj|�7}
n|r�|
dj|�7}
n|r�|
d	j|�7}
n|	r�|
d
7}
n|
d7}
idd
6dj|�d6|
d6}td|�S(u4
    Checks which security policy as connection will match on the device.

    sourcezone (str): The source zone matched against the connection.

    destinationzone (str): The destination zone matched against the connection.

    source (str): The source address. This must be a single IP address.

    destination (str): The destination address. This must be a single IP address.

    protocol (int): The protocol number for the connection. This is the numerical representation of the protocol.

    port (int): The port number for the connection.

    application (str): The application that should be matched.

    category (str): The category that should be matched.

    vsys (int): The numerical representation of the VSYS ID.

    allrules (bool): Show all potential match rules until first allow rule.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.test_security_policy sourcezone=trust destinationzone=untrust protocol=6 port=22
        salt '*' panos.test_security_policy sourcezone=trust destinationzone=untrust protocol=6 port=22 vsys=2

    u<test><security-policy-match>u<from>{0}</from>u<to>{0}</to>u<source>{0}</source>u<destination>{0}</destination>u<protocol>{0}</protocol>u(<destination-port>{0}</destination-port>u<application>{0}</application>u<category>{0}</category>u<show-all>yes</show-all>u</security-policy-match></test>uoputypeuvsys{0}uvsysucmdu
panos.call(RR
(t
sourcezonetdestinationzonetsourcetdestinationtprotocoltportR[tcategoryR+tallrulesRnR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pyttest_security_policy�s0*



cC@s@|std��nidd6dj|�d6}td|�S(u�
    Unlocks a locked administrator account.

    username
        Username of the administrator.

    CLI Example:

    .. code-block:: bash

        salt '*' panos.unlock_admin username=bob

    u!Username option must not be none.uoputypeuU<set><management-server><unlock><admin>{0}</admin></unlock></management-server></set>ucmdu
panos.call(RRR
(tusernameR((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pytunlock_admin	s

(st__doc__t
__future__RRRtloggingRtsalt.exceptionsRtsalt.proxy.panosRtsalt.utils.platformt	getLoggert__name__tlogR	RtNoneRRRRRRRRRRR%R'R)R,R.R/R0R1R2R3R4R5R6R7R8R9R:R;R<R=R>R?RARBRRERFRGRHRIRJRKRLRRRSRTRURVRWRXRYRZR\R^R`RbRcRdReRfRgRhRiRkRlRMRmRoRqRrRwRxRyRzR|R}R~RR�R�R�R"R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((s6/usr/lib/python2.7/site-packages/salt/modules/panos.pyt<module>s�							##																																											0			%	%$(((((((k,%$	!G

Zerion Mini Shell 1.0