Skip to content

Commit

Permalink
Merge branch 'release/1.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchos committed Nov 13, 2023
2 parents 39c9551 + 6b89d18 commit 316589e
Show file tree
Hide file tree
Showing 40 changed files with 3,065 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
rev: 23.3.0
hooks:
- id: black
language_version: python3.11
language_version: python3.12

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "3.12"

# Build documentation in the "docsrc/" directory with Sphinx
sphinx:
Expand Down
51 changes: 45 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ by Steve McGrath.
## Products
- Zscaler Private Access (ZPA)
- Zscaler Internet Access (ZIA)
- Zscaler Digital Experience (ZDX)
- Zscaler Mobile Admin Portal for Zscaler Client Connector (ZCC)
- Cloud Security Posture Management (CSPM) - (work in progress)
- Zscaler Connector Portal (ZCON)


## Installation
Expand All @@ -51,17 +52,34 @@ for each product that you are interfacing with. Once you have the requirements a
you're ready to go.


### Quick ZIA Example

### Quick ZIA Example - Explicitly Activate Changes
**Note:** Changes will not be activated until you explicitly call the `activate()` method or the admin session is closed.
It's a best-practice to log out your API session so that logging is sane and you don't have unnecessary sessions open.
```python
from pyzscaler import ZIA
from pprint import pprint

zia = ZIA(api_key='API_KEY', cloud='CLOUD', username='USERNAME', password='PASSWORD')
for user in zia.users.list_users():
pprint(user)
print(user)

zia.config.activate() # Explicitly activate changes (if applicable).
zia.session.delete() # Log out of the ZIA API and automatically commit any other changes
```

### Quick ZIA Example - Using the Python Context Manager

**Note**: Using the Python Context Manager will automatically log the admin user out and commit/activate any changes
made when execution is complete.

```python
from pyzscaler import ZIA
with ZIA(api_key='API_KEY', cloud='CLOUD', username='USERNAME', password='PASSWORD') as zia:
for user in zia.users.list_users():
print(user)

```


### Quick ZPA Example

```python
Expand All @@ -83,6 +101,27 @@ zcc = ZCC(client_id='CLIENT_ID', client_secret='CLIENT_SECRET', company_id='COMP
for device in zcc.devices.list_devices():
pprint(device)
```
### Quick ZDX Example

```python
from pyzscaler import ZDX

zdx = ZDX(client_id='CLIENT_ID', client_secret='CLIENT_SECRET', cloud='CLOUD')
for device in zdx.devices.list_devices():
print(device)
```
### Quick ZCON Example
The Zscaler Connector Portal uses the same authentication methods as ZIA and this will allow us to use the Python Context
Manager just like we did with ZIA. Of course, you can still use the explicit method if you prefer.

```python
from pyzscaler import ZCON

with ZCON(api_key='API_KEY', cloud='CLOUD', username='USERNAME', password='PASSWORD') as zcon:
for group in zcon.groups.list_groups():
print(group)
```



## Documentation
Expand All @@ -96,7 +135,7 @@ pyZscaler makes some quality of life improvements to simplify and clarify argume
A start has been made on [user documentation](https://pyzscaler.packet.tech) with examples and explanations on how to implement with pyZcaler.

## Is It Tested?
Yes! pyZscaler has a complete test suite that fully covers all methods within the ZIA and ZPA modules.
Yes! pyZscaler has a complete test suite that fully covers all methods within all modules.

## Contributing

Expand Down
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.5'
version = '1.6'
# The full version, including alpha/beta/rc tags
release = '1.5.0'
release = '1.6.0'

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

Expand Down
27 changes: 18 additions & 9 deletions docsrc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
zs/zpa/index
zs/zcc/index
zs/zdx/index
zs/zcon/index

pyZscaler SDK - Library Reference
=====================================================================
Expand Down Expand Up @@ -43,6 +44,7 @@ Products
- :doc:`Zscaler Internet Access (ZIA) <zs/zia/index>`
- :doc:`Zscaler Mobile Admin Portal <zs/zcc/index>`
- :doc:`Zscaler Digital Experience (ZDX) <zs/zdx/index>`
- :doc:`Zscaler Connector Portal (ZCON) <zs/zcon/index>`

Installation
==============
Expand All @@ -68,23 +70,21 @@ Quick ZIA Example
.. code-block:: python
from pyzscaler import ZIA
from pprint import pprint
zia = ZIA(api_key='API_KEY', cloud='CLOUD', username='USERNAME', password='PASSWORD')
for user in zia.users.list_users():
pprint(user)
print(user)
Quick ZPA Example
^^^^^^^^^^^^^^^^^^

.. code-block:: python
from pyzscaler import ZPA
from pprint import pprint
zpa = ZPA(client_id='CLIENT_ID', client_secret='CLIENT_SECRET', customer_id='CUSTOMER_ID')
for app_segment in zpa.app_segments.list_segments():
pprint(app_segment)
print(app_segment)
Quick ZCC Example
Expand All @@ -93,23 +93,32 @@ Quick ZCC Example
.. code-block:: python
from pyzscaler import ZCC
from pprint import pprint
zcc = ZCC(client_id='CLIENT_ID', client_secret='CLIENT_SECRET', company_id='COMPANY_ID)
for device in zcc.devices.list_devices():
pprint(device)
print(device)
Quick ZDX Example
^^^^^^^^^^^^^^^^^^^
.. code-block:: python
from pyzscaler import ZDX
from pprint import pprint
zcc = ZDX(client_id='CLIENT_ID', client_secret='CLIENT_SECRET')
zdx = ZDX(client_id='CLIENT_ID', client_secret='CLIENT_SECRET')
for device in zdx.devices.list_devices():
pprint(device)
print(device)
Quick ZCON Example
^^^^^^^^^^^^^^^^^^^
.. code-block:: python
from pyzscaler import ZCON
zcon = ZCON(api_key='API_KEY', cloud='CLOUD', username='USERNAME', password='PASSWORD')
for group in zcon.connectors.list_groups():
print(group)
.. automodule:: pyzscaler
Expand Down
12 changes: 12 additions & 0 deletions docsrc/zs/zcon/admin.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
admin
--------------

The following methods allow for interaction with the ZCON
Admin API endpoints.

Methods are accessible via ``zcon.admin``

.. _zcon-admin:

.. automodule:: pyzscaler.zcon.admin
:members:
12 changes: 12 additions & 0 deletions docsrc/zs/zcon/config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
config
--------------

The following methods allow for interaction with the ZCON
Config API endpoints.

Methods are accessible via ``zcon.config``

.. _zcon-config:

.. automodule:: pyzscaler.zcon.config
:members:
12 changes: 12 additions & 0 deletions docsrc/zs/zcon/connectors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
connectors
--------------

The following methods allow for interaction with the ZCON
Connectors API endpoints.

Methods are accessible via ``zcon.connectors``

.. _zcon-connectors:

.. automodule:: pyzscaler.zcon.connectors
:members:
13 changes: 13 additions & 0 deletions docsrc/zs/zcon/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ZCON
==========
This package covers the ZCON interface.

.. toctree::
:maxdepth: 1
:glob:
:hidden:

*

.. automodule:: pyzscaler.zcon
:members:
12 changes: 12 additions & 0 deletions docsrc/zs/zcon/locations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
locations
--------------

The following methods allow for interaction with the ZCON
Locations API endpoints.

Methods are accessible via ``zcon.locations``

.. _zcon-locations:

.. automodule:: pyzscaler.zcon.locations
:members:
12 changes: 12 additions & 0 deletions docsrc/zs/zcon/session.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
session
--------------

The following methods allow for interaction with the ZCON
Session API endpoints.

Methods are accessible via ``zcon.session``

.. _zcon-session:

.. automodule:: pyzscaler.zcon.session
:members:
11 changes: 11 additions & 0 deletions docsrc/zs/zia/apptotal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apptotal
============

The following methods allow for interaction with the ZIA AppTotal API endpoints.

Methods are accessible via ``zia.apptotal``

.. _zia-apptotal:

.. automodule:: pyzscaler.zia.apptotal
:members:
12 changes: 12 additions & 0 deletions docsrc/zs/zia/cloud_apps.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cloud_apps
-------------

The following methods allow for interaction with the ZIA
Cloud Applications API endpoints.

Methods are accessible via ``zia.cloud_apps``

.. _zia-cloud_apps:

.. automodule:: pyzscaler.zia.cloud_apps
:members:
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyzscaler"
version = "1.5.0"
version = "1.6.0"
description = "A python SDK for the Zscaler API."
authors = ["Mitch Kelly <[email protected]>"]
license = "MIT"
Expand All @@ -20,6 +20,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Security",
"Topic :: Software Development :: Libraries :: Python Modules", ]
include = [
Expand Down
3 changes: 2 additions & 1 deletion pyzscaler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"Dax Mickelson",
"Jacob Gårder",
]
__version__ = "1.5.0"
__version__ = "1.6.0"

from pyzscaler.zcc import ZCC # noqa
from pyzscaler.zcon import ZCON # noqa
from pyzscaler.zdx import ZDX # noqa
from pyzscaler.zia import ZIA # noqa
from pyzscaler.zpa import ZPA # noqa
Loading

0 comments on commit 316589e

Please sign in to comment.