Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchos committed Mar 8, 2022
2 parents a5f86eb + 17ac51b commit da288e3
Show file tree
Hide file tree
Showing 8 changed files with 866 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docsrc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
html_title = ""

# The short X.Y version
version = '1.0'
version = '1.1'
# The full version, including alpha/beta/rc tags
release = '1.0.2'
release = '1.1.0'

# -- General configuration ---------------------------------------------------

Expand Down
12 changes: 12 additions & 0 deletions docsrc/zs/zpa/lss.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
lss
---------------

The following methods allow for interaction with the ZPA
Log Streaming Service Controller API endpoints.

Methods are accessible via ``zpa.lss``

.. _zpa-lss:

.. automodule:: pyzscaler.zpa.lss
:members:
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyzscaler"
version = "1.0.2"
version = "1.1.0"
description = "A python SDK for the Zscaler API."
authors = ["Mitch Kelly <me@mkelly.dev>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion pyzscaler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Dax Mickelson",
"Jacob Gårder",
]
__version__ = "1.0.2"
__version__ = "1.1.0"

from pyzscaler.zia import ZIA # noqa
from pyzscaler.zpa import ZPA # noqa
18 changes: 18 additions & 0 deletions pyzscaler/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ def convert_keys(data):
return data


def keys_exists(element, *keys):
"""
Check if *keys (nested) exists in `element` (dict).
"""
if not isinstance(element, dict):
raise AttributeError("keys_exists() expects dict as first argument.")
if len(keys) == 0:
raise AttributeError("keys_exists() expects at least two arguments, one given.")

_element = element
for key in keys:
try:
_element = _element[key]
except KeyError:
return False
return True


# Takes a tuple if id_groups, kwargs and the payload dict; reformat for API call
def add_id_groups(id_groups, kwargs, payload):
for entry in id_groups:
Expand Down
9 changes: 9 additions & 0 deletions pyzscaler/zpa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from pyzscaler.zpa.connector_groups import ConnectorGroupsAPI
from pyzscaler.zpa.connectors import ConnectorsAPI
from pyzscaler.zpa.idp import IDPControllerAPI
from pyzscaler.zpa.lss import LSSConfigControllerAPI
from pyzscaler.zpa.machine_groups import MachineGroupsAPI
from pyzscaler.zpa.policies import PolicySetsAPI
from pyzscaler.zpa.posture_profiles import PostureProfilesAPI
Expand Down Expand Up @@ -110,6 +111,14 @@ def idp(self):
"""
return IDPControllerAPI(self)

@property
def lss(self):
"""
The interface object for the :ref:`ZIA Log Streaming Service Config interface <zpa-lss>`.
"""
return LSSConfigControllerAPI(self)

@property
def machine_groups(self):
"""
Expand Down
Loading

0 comments on commit da288e3

Please sign in to comment.