Internet Access SDK
This article outlines the Zscaler Python SDK resources you can use to manage Zscaler Internet Access (ZIA) 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 Internet Access service
zia = session.zia
Available Resources
Access individual resources using the has pattern:
| Resource | Description |
|---|---|
EndPointApplicationGroup | End Point Application Group resource |
AdvancedUrlFilteringCloudAppOptions | Advanced Url Filtering Cloud App Options resource |
FirewallFilteringRule | Firewall Filtering Rule resource |
Pac | Pac resource |
TenancyRestrictionProfile | Tenancy Restriction Profile resource |
EmailDlpRule | Email Dlp Rule resource |
ICAPServer | I C A P Server resource |
ZpaGateway | Zpa Gateway resource |
VpnCredential | Vpn Credential resource |
AdvancedDataProtectionSchema | Advanced Data Protection Schema resource |
FtpSettings | Ftp Settings resource |
RemoteAssistance | Remote Assistance resource |
NetworkService | Network Service resource |
TimeInterval | Time Interval resource |
WebDlpRule | Web Dlp Rule resource |
| ... | 92 more resources |
Collections
List resources using the hasMany pattern:
| Collection | Resource Type |
|---|---|
policies_associated_with_groups | AssociatedRulesDetails |
end_point_application_groups | EndPointApplicationGroup |
firewall_filtering_rules | FirewallFilteringRule |
pacs | Pac |
tenancy_restriction_profiles | TenancyRestrictionProfile |
email_dlp_rules_lite | EmailDlpRule |
email_dlp_rules | EmailDlpRule |
icap_server_summaries | ICAPServer |
ICAP_servers | ICAPServer |
zpa_gateways | ZpaGateway |
vpn_credentials | VpnCredential |
dlp_exact_data_match_schemas_lite | AdvancedDataProtectionSchemaLite |
advanced_data_protection_schemas | AdvancedDataProtectionSchema |
network_services_lite | EntityReference |
network_services | NetworkService |
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.zia.EndPointApplicationGroup()
resource.name = "value"
resource.create()
# Read
resource = session.zia.EndPointApplicationGroup(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.zia.policies_associated_with_groups():
print(f"{item.id}: {item.name}")