Skip to main content

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:

ResourceDescription
EndPointApplicationGroupEnd Point Application Group resource
AdvancedUrlFilteringCloudAppOptionsAdvanced Url Filtering Cloud App Options resource
FirewallFilteringRuleFirewall Filtering Rule resource
PacPac resource
TenancyRestrictionProfileTenancy Restriction Profile resource
EmailDlpRuleEmail Dlp Rule resource
ICAPServerI C A P Server resource
ZpaGatewayZpa Gateway resource
VpnCredentialVpn Credential resource
AdvancedDataProtectionSchemaAdvanced Data Protection Schema resource
FtpSettingsFtp Settings resource
RemoteAssistanceRemote Assistance resource
NetworkServiceNetwork Service resource
TimeIntervalTime Interval resource
WebDlpRuleWeb Dlp Rule resource
...92 more resources

Collections​

List resources using the hasMany pattern:

CollectionResource Type
policies_associated_with_groupsAssociatedRulesDetails
end_point_application_groupsEndPointApplicationGroup
firewall_filtering_rulesFirewallFilteringRule
pacsPac
tenancy_restriction_profilesTenancyRestrictionProfile
email_dlp_rules_liteEmailDlpRule
email_dlp_rulesEmailDlpRule
icap_server_summariesICAPServer
ICAP_serversICAPServer
zpa_gatewaysZpaGateway
vpn_credentialsVpnCredential
dlp_exact_data_match_schemas_liteAdvancedDataProtectionSchemaLite
advanced_data_protection_schemasAdvancedDataProtectionSchema
network_services_liteEntityReference
network_servicesNetworkService

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}")