Policy Package#

This class is used to manage Policy Package

class PolicyPackage#
add(name, access=None, desktop_security=None, installation_targets=None, qos=None, qos_policy_type=None, tags=None, threat_prevention=None, vpn_traditional_mode=None, **kw)#

Create new object.

Parameters
  • name (str) – Object name. Must be unique in the domain.

  • access (bool, optional) – True - enables, False - disables access & NAT policies, empty - nothing is changed. Defaults to None

  • desktop_security (bool, optional) – True - enables, False - disables Desktop security policy, empty - nothing is changed. Defaults to None

  • installation_targets (Union[str, List[str]], optional) – Which Gateways identified by the name or UID to install the policy on. Defaults to None

  • qos (bool, optional) – True - enables, False - disables QoS policy, empty - nothing is changed. Defaults to None

  • qos_policy_type (str, optional) – QoS policy type. Defaults to None

  • tags (Union[str, List[str]], optional) – Collection of tag identifiers. Defaults to None

  • threat_prevention (bool, optional) – True - enables, False - disables Threat policy, empty - nothing is changed. Defaults to None

  • vpn_traditional_mode (bool, optional) – True - enables, False - disables VPN traditional mode, empty - nothing is changed. Defaults to None

  • **kw (dict, optional) – Arbitrary keyword arguments for secondary parameters.

Keyword Arguments
  • **color (Color, optional) – Color of the object. Should be one of existing colors.

  • **comments (str, optional) – Comments string.

  • **details-level (str, optional) – The level of detail for some of the fields in the response can vary from showing only the UID value of the object to a fully detailed representation of the object.

  • **ignore-warnings (bool, optional) – Apply changes ignoring warnings. Defaults to False

  • **ignore-errors (bool, optional) – Apply changes ignoring errors. You won’t be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. Defaults to False

Returns

The response from the server

Return type

Box

Examples

>>> firewallManagement.policy.package.add(
... name="New_Standard_Package_1",
... comments="My Comments",
... color=Color.GREEN,
... threat_prevention=False,
... access=True,
... desktop_security=False,
... installation_targets="all",
... qos=False,
... qos_policy_type="recommanded",
... tags=["t1"],
... vpn_traditional_mode=False)
delete(uid=None, name=None, **kw)#

Delete existing object using object name or uid.

Parameters
  • uid (str, optional) – Object unique identifier.

  • name (str, optional) – Object name.

Keyword Arguments

**details-level (str, optional) – The level of detail for some of the fields in the response can vary from showing only the UID value of the object to a fully detailed representation of the object.

Returns

The response from the server

Return type

Box

Examples

>>> firewallManagement.policy.package.delete(
... uid="38b4ed6e-711c-49fa-b9f4-638290d621be")
set(uid=None, name=None, new_name=None, access=None, access_layers=None, desktop_security=None, https_layer=None, installation_targets=None, qos=None, qos_policy_type=None, tags=None, threat_prevention=None, vpn_traditional_mode=None, **kw)#

Edit existing object using object name or uid.

Parameters
  • uid (str, optional) – Object unique identifier. Defaults to None

  • name (str, optional) – Object name. Defaults to None

  • new_name (str, optional) – New name of the object. Defaults to None

  • access (bool, optional) – True - enables, False - disables access & NAT policies, empty - nothing is changed. Defaults to None

  • access_layers (dict, optional) – Access policy layers. Defaults to None

  • desktop_security (bool, optional) – True - enables, False - disables Desktop security policy, empty - nothing is changed. Defaults to None

  • https_layer (str, optional) – HTTPS inspection policy layer. Defaults to None

  • installation_targets (Union[str, List[str]], optional) – Which Gateways identified by the name or UID to install the policy on. Defaults to None

  • qos (bool, optional) – True - enables, False - disables QoS policy, empty - nothing is changed. Defaults to None

  • qos_policy_type (str, optional) – QoS policy type. Defaults to None

  • tags (Union[str, List[str]], optional) – Collection of tag identifiers. Defaults to None

  • threat_prevention (bool, optional) – True - enables, False - disables Threat policy, empty - nothing is changed. Defaults to None

  • vpn_traditional_mode (bool, optional) – True - enables, False - disables VPN traditional mode, empty - nothing is changed. Defaults to None

  • **kw (dict, optional) – Arbitrary keyword arguments for secondary parameters.

Keyword Arguments
  • **color (Color, optional) – Color of the object. Should be one of existing colors.

  • **comments (str, optional) – Comments string.

  • **details-level (str, optional) – The level of detail for some of the fields in the response can vary from showing only the UID value of the object to a fully detailed representation of the object.

  • **ignore-warnings (bool, optional) – Apply changes ignoring warnings. Defaults to False

  • **ignore-errors (bool, optional) – Apply changes ignoring errors. You won’t be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. Defaults to False

Raises

MandatoryFieldMissing – The value is not given as a keyword parameter and it’s mandatory

Returns

The response from the server

Return type

Box

Examples

>>> firewallManagement.policy.package.set(
... uid="38b4ed6e-711c-49fa-b9f4-638290d621be",
... new_name="New Standard Package 1",
... comments="My Comments",
... color=Color.GREEN,
... threat_prevention=False,
... access=True,
... access_layers={"name": "New Standard Package 1 Network"},
... desktop_security=False,
... installation_targets="all",
... qos=False,
... qos_policy_type="recommanded",
... tags=["t1"],
... vpn_traditional_mode=False)
show(uid=None, name=None, **kw)#

Retrieve existing object using object name or uid.

Parameters
  • uid (str, optional) – Object unique identifier.

  • name (str, optional) – Object name.

Keyword Arguments

**details-level (str, optional) – The level of detail for some of the fields in the response can vary from showing only the UID value of the object to a fully detailed representation of the object.

Returns

The response from the server

Return type

Box

Examples

>>> firewallManagement.policy.package.show(
... uid="38b4ed6e-711c-49fa-b9f4-638290d621be")
show_packages(filter_results=None, limit=50, offset=0, order=None, **kw)#

Retrieve all objects.

Parameters
  • filter_results (str) – Search expression to filter objects by. The provided text should be exactly the same as it would be given in SmartConsole Object Explorer. The logical operators in the expression (‘AND’, ‘OR’) should be provided in capital letters. he search involves both a IP search and a textual search in name, comment, tags etc.

  • limit (int) – The maximal number of returned results. Defaults to 50 (between 1 and 500)

  • offset (int) – Number of the results to initially skip. Defaults to 0

Keyword Arguments
  • **details-level (str, optional) – The level of detail for some of the fields in the response can vary from showing only the UID value of the object to a fully detailed representation of the object.

  • **domains-to-process (List[str], optional) – Indicates which domains to process the commands on. It cannot be used with the details-level full, must be run from the System Domain only and with ignore-warnings true. Valid values are: CURRENT_DOMAIN, ALL_DOMAINS_ON_THIS_SERVER.

Returns

The response from the server

Return type

Box

Examples

>>> firewallManagement.policy.package.show_packages(
... filter_results="", order={"ASC": "name"})