Digital Experience SDK
This article outlines the Zscaler Python SDK resources you can use to manage Zscaler Digital Experience (ZDX) features programmatically, with code examples.
Quick Start
import zssdk
session = zssdk.Session(
vanity_domain="your-vanity-domain",
client_id="your-client-id",
client_secret="your-client-secret",
)
# Access Digital Experience service
zdx = session.zdx
Available Resources
Access individual resources using the has pattern:
| Resource | Description |
|---|---|
ActiveGeoLocation | Active Geo Location resource |
Department | Department resource |
AlertDetails | Alert Details resource |
YEngineAnalysisResult | Y Engine Analysis Result resource |
ConfigApplicationResp | Config Application Resp resource |
AppDetail | App Detail resource |
Collection | Collection resource |
ConfigDevice | Config Device resource |
UserInfo | User Info resource |
ConfigDepartment | Config Department resource |
DeviceDetail | Device Detail resource |
Group | Group resource |
SoftwareInventory | Software Inventory resource |
LocationGroup | Location Group resource |
Location | Location resource |
| ... | 6 more resources |
Collections
List resources using the hasMany pattern:
| Collection | Resource Type |
|---|---|
active_geo_locations | ActiveGeoLocation |
locations | Location |
departments | Department |
historical_alerts | Alert |
ongoing_alerts | Alert |
supported_os_types | Entity |
supported_providers | ProviderResponse |
application_summaries | ConfigApplication |
predefined_applications | PredefinedApplicationResp |
config_application_resps | ConfigApplicationResp |
app_details | AppDetail |
collections | Collection |
config_devices | ConfigDevice |
user_infos | UserInfo |
config_department_summaries | EntityResponse |
Example: CRUD Operations
import zssdk
session = zssdk.Session(
vanity_domain="your-vanity-domain",
client_id="your-client-id",
client_secret="your-client-secret",
)
# Create
resource = session.zdx.ActiveGeoLocation()
resource.name = "value"
resource.create()
# Read
resource = session.zdx.ActiveGeoLocation(id=resource.id)
resource.load()
print(resource.name)
# Update
resource.name = "Updated value"
resource.update()
# Delete
resource.delete()
Example: List Resources
# List all resources
for item in session.zdx.active_geo_locations():
print(f"{item.id}: {item.name}")