Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
btorresgil committed Apr 13, 2016
2 parents 452db79 + 890fba3 commit dac0f45
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 9 deletions.
13 changes: 13 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
History
=======

0.3.2
-----

Released: 2016-04-13

Status: Alpha

New objects:

* policies.Rulebase
* policies.PreRulebase
* policies.PostRulebase

0.3.1
-----

Expand Down
6 changes: 6 additions & 0 deletions docs/configtree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,10 @@ Network

.. graphviz:: _diagrams/pandevice.network.dot

.. _tree:

Policy
------

.. graphviz:: _diagrams/pandevice.policy.dot

5 changes: 5 additions & 0 deletions docs/module-policies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Inheritance diagram
.. inheritance-diagram:: pandevice.policies
:parts: 1

Configuration tree diagram
--------------------------

.. graphviz:: _diagrams/pandevice.policies.dot

Class Reference
---------------

Expand Down
2 changes: 1 addition & 1 deletion docs/moduleref.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
'ha',
'network',
'panorama',
'policies',
]

tree_not_exists = [
'base',
'errors',
'objects',
'policies',
'updater',
'userid',
]
Expand Down
2 changes: 1 addition & 1 deletion pandevice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

__author__ = 'Brian Torres-Gil'
__email__ = 'btorres-gil@paloaltonetworks.com'
__version__ = '0.3.1'
__version__ = '0.3.2'


import logging
Expand Down
2 changes: 1 addition & 1 deletion pandevice/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Firewall(PanDevice):
"ha.HighAvailability",
"objects.AddressObject",
"objects.AddressGroup",
"policies.SecurityRule",
"policies.Rulebase",
"network.EthernetInterface",
"network.AggregateInterface",
"network.LoopbackInterface",
Expand Down
6 changes: 4 additions & 2 deletions pandevice/panorama.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ class DeviceGroup(PanObject):
"firewall.Firewall",
"objects.AddressObject",
"objects.AddressGroup",
"policies.SecurityRule",
"policies.PreRulebase",
"policies.PostRulebase",
)

@classmethod
Expand Down Expand Up @@ -97,7 +98,8 @@ class Panorama(base.PanDevice):
"firewall.Firewall",
"objects.AddressObject",
"objects.AddressGroup",
"policies.SecurityRule",
"policies.PreRulebase",
"policies.PostRulebase",
)

def __init__(self,
Expand Down
38 changes: 35 additions & 3 deletions pandevice/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,43 @@
logger.addHandler(logging.NullHandler())


class Rulebase(PanObject):
"""Rulebase for a Firewall
Firewall only. For Panorama, use :class:`pandevice.policies.PreRulebase` or
:class:`pandevice.policies.PostRulebase`.
"""
ROOT = Root.VSYS
XPATH = "/rulebase"
CHILDTYPES = (
"policies.SecurityRule",
)


class PreRulebase(Rulebase):
"""Pre-rulebase for a Panorama
Panorama only. For Firewall, use :class:`pandevice.policies.Rulebase`.
"""
XPATH = "/pre-rulebase"


class PostRulebase(Rulebase):
"""Pre-rulebase for a Panorama
Panorama only. For Firewall, use :class:`pandevice.policies.Rulebase`.
"""
XPATH = "/post-rulebase"


class SecurityRule(PanObject):
"""Security Rule
Firewall only. Use SecurityPreRule or SecurityPostRule with Panorama.
Args:
name (str): Name of the rule
from (list): From zones
Expand Down Expand Up @@ -66,9 +100,7 @@ class SecurityRule(PanObject):
data-filtering (str): Data Filtering Security Profile
"""

ROOT = Root.VSYS
XPATH = "/rulebase/security/rules"
XPATH = "/security/rules"
SUFFIX = ENTRY

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

setup(
name='pandevice',
version='0.3.1',
version='0.3.2',
description='Framework for interacting with Palo Alto Networks devices via API',
long_description='The Palo Alto Networks Device Framework is a way to interact with Palo Alto Networks devices (including Next-generation Firewalls and Panorama) using the device API that is object oriented and conceptually similar to interaction with the device via the GUI or CLI.',
author='Brian Torres-Gil',
Expand Down

0 comments on commit dac0f45

Please sign in to comment.