Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# Zscaler Python SDK Changelog

## 1.9.15 (February 16, 2026)

### Notes

- Python Versions: **v3.9, v3.10, v3.11, v3.12**

### Enhancements:

* [PR #459](https://github.com/zscaler/zscaler-sdk-python/pull/459) - Added support to the following ZIA Endpoints:
- Added `GET /customFileTypes` Retrieves the list of custom file types. Custom file types can be configured as rule conditions in different ZIA policies.
- Added `POST /customFileTypes` Adds a new custom file type.
- Added `PUT /customFileTypes` Updates information for a custom file type based on the specified ID
- Added `DELETE /customFileTypes/{id}` Deletes a custom file type based on the specified ID
- Added `GET /customFileTypes/count` Retrieves the count of custom file types available
- Added `GET /fileTypeCategories` Retrieves the list of all file types, including predefined and custom file types

* [PR #459](https://github.com/zscaler/zscaler-sdk-python/pull/459) - Added new attributes `url_type`, `regex_patterns`, and `regex_patterns_retaining_parent_category` to `zia_url_categories` resource to specify whether the category uses exact URLs or regex patterns. Supported values are `EXACT` and `REGEX`. See [Zscaler Release Notes](https://help.zscaler.com/zia/release-upgrade-summary-2026) for details. To enable this feature, contact Zscaler Support.

* [PR #459](https://github.com/zscaler/zscaler-sdk-python/pull/459) - Added new attributes to ZIA:
* `ipscontrolpolicies`: `eunEnabled`, and `eunTemplateId`
* `firewalldnscontrolpolicies`: `isWebEunEnabled` and `defaultDnsRuleNameUsed`
* `dlp_web_rules`: `eunTemplateId`

* [PR #459](https://github.com/zscaler/zscaler-sdk-python/pull/459) - Added new `tags` field to ZPA `applicationsegment`

* [PR #459](https://github.com/zscaler/zscaler-sdk-python/pull/459) - Added new attributes to all ZPA Application Segments:
* `policyStyle` to enable `FQDN-to-IP Policy Evaluation`

### Bug Fixes

* [PR #459](https://github.com/zscaler/zscaler-sdk-python/pull/459) - Fixed URL formatting parameter for ZIA resource `casb_dlp_rules`
* [PR #459](https://github.com/zscaler/zscaler-sdk-python/pull/459) - Fixed URL formatting parameter for ZIA function `update_dc_exclusion`. API requires the ID as JSON attribute and not as a parameter.

## 1.9.14 (February 10, 2026)

### Notes
Expand Down
4 changes: 2 additions & 2 deletions docsrc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
html_title = ""

# The short X.Y version
version = "1.9.13"
version = "1.9.15"
# The full version, including alpha/beta/rc tags
release = "1.9.13"
release = "1.9.15"

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

Expand Down
38 changes: 38 additions & 0 deletions docsrc/zs/guides/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,44 @@ Release Notes
Zscaler Python SDK Changelog
----------------------------


1.9.15 (February 16, 2026)
---------------------------

Notes
-----

- Python Versions: **v3.9, v3.10, v3.11, v3.12**

Enhancements:
-------------

(`#459 <https://github.com/zscaler/zscaler-sdk-python/pull/459>`_) - Added support to the following ZIA Endpoints:
- Added `GET /customFileTypes` Retrieves the list of custom file types. Custom file types can be configured as rule conditions in different ZIA policies.
- Added `POST /customFileTypes` Adds a new custom file type.
- Added `PUT /customFileTypes` Updates information for a custom file type based on the specified ID
- Added `DELETE /customFileTypes/{id}` Deletes a custom file type based on the specified ID
- Added `GET /customFileTypes/count` Retrieves the count of custom file types available
- Added `GET /fileTypeCategories` Retrieves the list of all file types, including predefined and custom file types

(`#459 <https://github.com/zscaler/zscaler-sdk-python/pull/459>`_) - Added new attributes `url_type`, `regex_patterns`, and `regex_patterns_retaining_parent_category` to `zia_url_categories` resource to specify whether the category uses exact URLs or regex patterns. Supported values are `EXACT` and `REGEX`. See [Zscaler Release Notes](https://help.zscaler.com/zia/release-upgrade-summary-2026) for details. To enable this feature, contact Zscaler Support.

(`#459 <https://github.com/zscaler/zscaler-sdk-python/pull/459>`_) - Added new attributes to ZIA:
* `ipscontrolpolicies`: `eunEnabled`, and `eunTemplateId`
* `firewalldnscontrolpolicies`: `isWebEunEnabled` and `defaultDnsRuleNameUsed`
* `dlp_web_rules`: `eunTemplateId`

(`#459 <https://github.com/zscaler/zscaler-sdk-python/pull/459>`_) - Added new `tags` field to ZPA `applicationsegment`

(`#459 <https://github.com/zscaler/zscaler-sdk-python/pull/459>`_) - Added new attributes to all ZPA Application Segments:
* `policyStyle` to enable `FQDN-to-IP Policy Evaluation`

Bug Fixes:
----------

(`#459 <https://github.com/zscaler/zscaler-sdk-python/pull/459>`_) - Fixed URL formatting parameter for ZIA resource `casb_dlp_rules`
(`#459 <https://github.com/zscaler/zscaler-sdk-python/pull/459>`_) - Fixed URL formatting parameter for ZIA function `update_dc_exclusion`. API requires the ID as JSON attribute and not as a parameter.

1.9.14 (February 10, 2026)
---------------------------

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

The following methods allow for interaction with the ZIA
Custom File Types API endpoints.

Methods are accessible via ``zia.custom_file_types``

.. _zia-custom_file_types:

.. automodule:: zscaler.zia.custom_file_types
:members:
:undoc-members:
:show-inheritance:
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 = "zscaler-sdk-python"
version = "1.9.14"
version = "1.9.15"
description = "Official Python SDK for the Zscaler Products"
authors = ["Zscaler, Inc. <devrel@zscaler.com>"]
license = "MIT"
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/zia/test_casb_dlp_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_casb_dlp_rules(self, fs):
# Step 2: List CASB DLP rules by type - ITSM
try:
typed_rules, _, error = client.zia.casb_dlp_rules.list_rules(
query_params={'rule_type': rule_type}
rule_type=rule_type
)
assert error is None, f"Error listing CASB DLP rules by type: {error}"
except Exception as exc:
Expand All @@ -57,15 +57,15 @@ def test_casb_dlp_rules(self, fs):
# Step 3: List CASB DLP rules by type - FILE
try:
file_rules, _, error = client.zia.casb_dlp_rules.list_rules(
query_params={'rule_type': 'OFLCASB_DLP_FILE'}
rule_type='OFLCASB_DLP_FILE'
)
except Exception:
pass

# Step 4: List CASB DLP rules by type - EMAIL
try:
email_rules, _, error = client.zia.casb_dlp_rules.list_rules(
query_params={'rule_type': 'OFLCASB_DLP_EMAIL'}
rule_type='OFLCASB_DLP_EMAIL'
)
except Exception:
pass
Expand Down Expand Up @@ -130,7 +130,7 @@ def test_casb_dlp_rules(self, fs):
finally:
if rule_id:
try:
client.zia.casb_dlp_rules.delete_rule(rule_type=rule_type, rule_id=rule_id)
client.zia.casb_dlp_rules.delete_rule(rule_id=rule_id, rule_type=rule_type)
except Exception:
pass

Expand Down
2 changes: 1 addition & 1 deletion zscaler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
__contributors__ = [
"William Guilherme",
]
__version__ = "1.9.14"
__version__ = "1.9.15"


from zscaler.oneapi_client import Client as ZscalerClient # noqa
94 changes: 61 additions & 33 deletions zscaler/zia/casb_dlp_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,23 @@ def __init__(self, request_executor: "RequestExecutor") -> None:

def list_rules(
self,
rule_type: str,
query_params: Optional[dict] = None,
) -> APIResult[List[CasbdDlpRules]]:
"""
Returns a list of all Casb DLP Rules for the specified rule type.

Args:
query_params {dict}: Map of query parameters for the request.
rule_type (str): The type of rules to retrieve (e.g., "OFLCASB_DLP_ITSM").
Required by the API.

``[query_params.search]`` {str}: Search string for filtering results.
Supported Values: `ANY`, `NONE`, `OFLCASB_DLP_FILE`, `OFLCASB_DLP_EMAIL`, `OFLCASB_DLP_CRM`,
`OFLCASB_DLP_ITSM`, `OFLCASB_DLP_COLLAB`, `OFLCASB_DLP_REPO`, `OFLCASB_DLP_STORAGE`,
`OFLCASB_DLP_GENAI`

``[query_params.rule_type]`` {str}: The type of rules to retrieve (e.g., "OFLCASB_DLP_ITSM").
query_params (dict, optional): Additional query parameters for the request.

Supported Values: `ANY`, `NONE`, `OFLCASB_DLP_FILE`, `OFLCASB_DLP_EMAIL`, `OFLCASB_DLP_CRM`,
`OFLCASB_DLP_ITSM`, `OFLCASB_DLP_COLLAB`, `OFLCASB_DLP_REPO`, `OFLCASB_DLP_STORAGE`,
`OFLCASB_DLP_GENAI`
``[query_params.search]`` {str}: Search string for filtering results.

Returns:
tuple: The list of Casb DLP Rules.
Expand All @@ -55,13 +57,21 @@ def list_rules(
List all rules for a specific type::

>>> rules_list, _, error = client.zia.casb_dlp_rules.list_rules(
... query_params={'rule_type': 'OFLCASB_DLP_ITSM'})
... rule_type='OFLCASB_DLP_ITSM'
... )
>>> if error:
... print(f"Error listing casb dlp rules rules: {error}")
... print(f"Error listing casb dlp rules: {error}")
... return
... print(f"Total rules found: {len(rules_list)}")
... for rule in rules_list:
... print(rule.as_dict())

List rules with optional search filter::

>>> rules_list, _, error = client.zia.casb_dlp_rules.list_rules(
... rule_type='OFLCASB_DLP_ITSM',
... query_params={'search': 'MyRule'}
... )
"""
http_method = "get".upper()
api_url = format_url(
Expand All @@ -71,12 +81,15 @@ def list_rules(
"""
)

query_params = query_params or {}
params = {"ruleType": rule_type}
if query_params:
extra = {k: v for k, v in query_params.items() if k != "rule_type"}
params.update(extra)

body = {}
headers = {}

request, error = self._request_executor.create_request(http_method, api_url, body, headers, params=query_params)
request, error = self._request_executor.create_request(http_method, api_url, body, headers, params=params)

if error:
return (None, None, error)
Expand All @@ -98,15 +111,16 @@ def list_rules(
def get_rule(
self,
rule_id: int,
rule_type: str,
rule_type: Optional[str] = None,
) -> APIResult[dict]:
"""
Returns information for the specified Casb DLP Rule under the specified rule type.
Returns information for the specified Casb DLP Rule.

Args:
rule_id (int): The unique identifier for the Casb DLP Rule.

rule_type (str): The type of the rule (e.g., "OFLCASB_DLP_ITSM").
rule_type (str, optional): The type of the rule (e.g., "OFLCASB_DLP_ITSM").
Optional for GET by ID; when provided, passed as query parameter.

Supported Values: `ANY`, `NONE`, `OFLCASB_DLP_FILE`, `OFLCASB_DLP_EMAIL`, `OFLCASB_DLP_CRM`,
`OFLCASB_DLP_ITSM`, `OFLCASB_DLP_COLLAB`, `OFLCASB_DLP_REPO`, `OFLCASB_DLP_STORAGE`,
Expand All @@ -116,11 +130,17 @@ def get_rule(
:obj:`Tuple`: The resource record for the Casb DLP Rule.

Examples:
Get a specific rule by ID and type::
Get a specific rule by ID::

>>> fetched_rule, _, error = client.zia.casb_dlp_rules.get_rule(
... rule_type='OFLCASB_DLP_ITSM',
... rule_id='1070199'
... rule_id=1070199
... )

Get a rule by ID with optional rule type::

>>> fetched_rule, _, error = client.zia.casb_dlp_rules.get_rule(
... rule_id=1070199,
... rule_type='OFLCASB_DLP_ITSM'
... )
>>> if error:
... print(f"Error fetching rule by ID: {error}")
Expand All @@ -135,7 +155,7 @@ def get_rule(
"""
)

params = {"ruleType": rule_type}
params = {"ruleType": rule_type} if rule_type else {}

body = {}
headers = {}
Expand Down Expand Up @@ -169,9 +189,9 @@ def list_all_rules(
tuple: The list of all Casb DLP Rules.

Examples:
List all rules for a specific type::
List all rules::

>>> rules_list, _, error = client.zia.casb_dlp_rules.list_all_rules(
>>> rules_list, _, error = client.zia.casb_dlp_rules.list_all_rules()
>>> if error:
... print(f"Error listing all casb dlp rules rules: {error}")
... return
Expand Down Expand Up @@ -574,10 +594,9 @@ def update_rule(self, rule_id: str, **kwargs) -> APIResult[dict]:
... },
... )
>>> if error:
... print(f"Error adding rule: {error}")
... print(f"Error updating rule: {error}")
... return
... print(f"Rule added successfully: {added_rule.as_dict()}")
... )
... print(f"Rule updated successfully: {updated_rule.as_dict()}")
"""
http_method = "put".upper()
api_url = format_url(
Expand Down Expand Up @@ -614,14 +633,15 @@ def update_rule(self, rule_id: str, **kwargs) -> APIResult[dict]:
return (None, response, error)
return (result, response, None)

def delete_rule(self, rule_type: str, rule_id: int) -> APIResult[dict]:
def delete_rule(self, rule_id: int, rule_type: Optional[str] = None) -> APIResult[dict]:
"""
Deletes the specified casb dlp rules.

Args:
rule_id (int): The unique identifier for the casb dlp rules.

rule_type (str): The type of the rule (e.g., "OFLCASB_DLP_ITSM").
rule_type (str, optional): The type of the rule (e.g., "OFLCASB_DLP_ITSM").
Optional for DELETE; when provided, passed as query parameter.

Supported Values: `ANY`, `NONE`, `OFLCASB_DLP_FILE`, `OFLCASB_DLP_EMAIL`, `OFLCASB_DLP_CRM`,
`OFLCASB_DLP_ITSM`, `OFLCASB_DLP_COLLAB`, `OFLCASB_DLP_REPO`, `OFLCASB_DLP_STORAGE`,
Expand All @@ -631,14 +651,22 @@ def delete_rule(self, rule_type: str, rule_id: int) -> APIResult[dict]:
:obj:`int`: The status code for the operation.

Examples:
>>> _, _, error = client.zia.casb_dlp_rules.delete_rule(
... rule_type='OFLCASB_DLP_ITSM',
... rule_id='1072324'
... )
>>> if error:
... print(f"Error deleting rule: {error}")
... return
... print(f"Rule with ID 1072324 deleted successfully.")
Delete a rule by ID::

>>> _, _, error = client.zia.casb_dlp_rules.delete_rule(
... rule_id=1072324
... )

Delete a rule by ID with optional rule type::

>>> _, _, error = client.zia.casb_dlp_rules.delete_rule(
... rule_id=1072324,
... rule_type='OFLCASB_DLP_ITSM'
... )
>>> if error:
... print(f"Error deleting rule: {error}")
... return
... print(f"Rule with ID 1072324 deleted successfully.")
"""
http_method = "delete".upper()
api_url = format_url(
Expand All @@ -647,7 +675,7 @@ def delete_rule(self, rule_type: str, rule_id: int) -> APIResult[dict]:
/casbDlpRules/{rule_id}
"""
)
params = {"ruleType": rule_type}
params = {"ruleType": rule_type} if rule_type else {}

request, error = self._request_executor.create_request(http_method, api_url, params=params)
if error:
Expand Down
2 changes: 1 addition & 1 deletion zscaler/zia/cloud_firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def list_ip_destination_groups(
Gets a list of all IP destination groups by excluding specific type.

>>> group_list, response, error = zia.cloud_firewall.list_ip_destination_groups(
query_params={"exclude_type": 'DSTN_DOMAIN'}):
query_params={"name": 'Group01'}):
... if error:
... print(f"Error listing ip destination groups: {error}")
... return
Expand Down
Loading
Loading