Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Zscaler SDK Python
Logo

Contents

  • ZCC
    • admin_user
    • company
    • devices
    • entitlements
    • fail_open_policy
    • forwarding_profile
    • secrets
    • trusted_networks
    • web_app_service
    • web_policy
    • web_privacy
  • ZTW
    • account_details
    • account_groups
    • activation
    • admin_roles
    • admin_users
    • api_keys
    • discovery_service
    • ec_groups
    • forwarding_gateways
    • forwarding_rules
    • ip_destination_groups
    • ip_groups
    • ip_source_groups
    • location_management
    • location_template
    • nw_service
    • nw_service_groups
    • provisioning_url
    • public_cloud_info
  • ZDX
    • admin
    • alerts
    • apps
    • devices
    • inventory
    • snapshot
    • troubleshooting
    • users
  • ZIA
    • activate
    • admin_roles
    • admin_users
    • advanced_settings
    • alert_subscriptions
    • apptotal
    • atp_policy
    • audit_logs
    • authentication_settings
    • bandwidth_classes
    • bandwidth_control_rules
    • casb_dlp_rules
    • casb_malware_rules
    • cloud_app_instances
    • cloud_browser_isolation
    • cloud_firewall
    • cloud_firewall_dns
    • cloud_firewall_ips
    • cloud_firewall_rules
    • cloud_nss
    • cloud_to_cloud_ir
    • cloudappcontrol
    • dedicated_ip_gateways
    • device_management
    • dlp_dictionary
    • dlp_engine
    • dlp_resources
    • dlp_templates
    • dlp_web_rules
    • dns_gatways
    • end_user_notification
    • file_type_control_rule
    • forwarding_control
    • ftp_control_policy
    • gre_tunnel
    • intermediate_certificates
    • ipv6_config
    • locations
    • malware_protection_policy
    • mobile_threat_settings
    • nat_control_policy
    • nss_servers
    • organization_information
    • pac_files
    • policy_export
    • proxies
    • remote_assistance
    • rule_labels
    • saas_security_api
    • sandbox
    • sandbox_rules
    • security_policy_settings
    • shadow_it_report
    • ssl_inspection_rules
    • system_audit
    • tenancy_restriction_profile
    • time_intervals
    • traffic_capture
    • traffic_extranet
    • traffic_static_ip
    • traffic_vpn_credentials
    • url_categories
    • url_filtering
    • user_management
    • vzen_clusters
    • vzen_nodes
    • workload_groups
    • zpa_gateway
  • ZPA
    • admin_sso_controller
    • administrator_controller
    • api_keys
    • app_connector_groups
    • app_connector_schedule
    • app_connectors
    • app_protection
    • app_segment_by_type
    • application_segment
    • app_segments_ba
    • app_segments_ba_v2
    • app_segments_inspection
    • app_segments_pra
    • branch_connector_group
    • branch_connectors
    • c2c_ip_ranges
    • cbi_banner
    • cbi_certificate
    • cbi_profile
    • cbi_region
    • cbi_zpa_profile
    • certificates
    • client_settings
    • cloud_connector_controller
    • cloud_connector_groups
    • config_override_controller
    • customer_controller
    • customer_domain
    • customer_dr_tool
    • customer_version_profile
    • emergency_access
    • enrollment_certificates
    • extranet_resource
    • idp
    • location_controller
    • lss
    • machine_groups
    • managed_browser_profile
    • microtenants
    • npn_client_controller
    • oauth2_user_code
    • policies
    • posture_profiles
    • pra_approval
    • pra_console
    • pra_credential
    • pra_credential_pool
    • pra_portal
    • private_cloud_controller
    • private_cloud_group
    • provisioning
    • role_controller
    • saml_attributes
    • scim_attributes
    • scim_groups
    • segment_groups
    • server_groups
    • servers
    • service_edge_group
    • service_edge_schedule
    • service_edges
    • stepup_auth_level
    • trusted_networks
    • user_portal_aup
    • user_portal_controller
    • user_portal_link
    • workload_tag_group
    • zia_customer_config
  • ZWA
    • audit_logs
    • dlp_incidents
  • Zidentity
    • api_client
    • groups
    • resource_servers
    • user_entitlement
    • users
  • Z-Insights
    • web_traffic
    • cyber_security
    • firewall
    • saas_security
    • shadow_it
    • iot
  • ZEASM
    • findings
    • lookalikedomains
    • organizations
  • Guides
    • Examples
    • Release Notes
    • Support Guide
    • Troubleshooting Guide
Back to top
View this page

user_portal_link¶

The following methods allow for interaction with the ZPA User Portal Link Controller API endpoints.

Methods are accessible via zpa.user_portal_link

Copyright (c) 2023, Zscaler Inc.

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

class UserPortalLinkAPI¶

Bases: APIClient

A client object for the user portal link Link resource.

add_bulk_portal_links(portal_links, user_portal_link_ids=None, **kwargs)¶

Adds multiple user portal links in bulk.

Parameters:
  • portal_links (list[dict]) – A list of dictionaries, each containing details for a portal link. Each dictionary can contain the following keys: - protocol (str): The protocol for the portal link (e.g., “http://”). - description (str): Description of the portal link. - icon_text (str): Text for the icon associated with the portal link. - link (str): The URL or link address for the portal link. - link_path (str): The path component of the portal link URL. - name (str): The name of the portal link. - enabled (bool): Whether the portal link is enabled or not.

  • user_portal_link_ids (list[str], optional) – A list of user portal IDs to associate with the portal links.

  • **kwargs – Additional keyword arguments that may be passed to the function.

Returns:

A tuple containing:
  • list[UserPortalLinks]: A list of newly created portal link instances.

  • Response: The raw API response object.

  • Error: An error message, if applicable.

Return type:

tuple

Examples

>>> added_consoles, _, err = client.zpa.user_portal_link.add_bulk_portal_links(
...     portal_links=[
...         dict(
...             protocol="http://",
...             description="server1.example.com",
...             icon_text="",
...             link="server1.example.com",
...             link_path="",
...             name="server1.example.com",
...             enabled=True,
...         ),
...         dict(
...             protocol="http://",
...             description="server3.example.com",
...             icon_text="",
...             link="server3.example.com",
...             link_path="",
...             name="server3.example.com",
...             enabled=True,
...         )
...     ],
...     user_portal_link_ids=["72058304855142803"]
... )
>>> if err:
...     print(f"Error adding bulk consoles: {err}")
...     return
... print("Bulk PRA Consoles added successfully")
... for console in added_consoles:
...     print(console.as_dict())
add_portal_link(**kwargs)¶

Adds a new user portal link.

Parameters:
  • name (str) – The name of the user portal link.

  • description (str) – The description of the user portal link.

  • enabled (bool) – Enable the user portal link. Defaults to True.

Returns:

UserPortalController: The created user portal link object.

Return type:

Tuple

Example

Basic example: Add a new user portal link

>>> added_portal_link, _, err = client.zpa.user_portal_link.add_portal_link(
...     name=f"Portal01_Dev_{random.randint(1000, 10000)}",
...     description=f"Portal01_Dev_{random.randint(1000, 10000)}",
...     enabled=True,
...     link="server1.example.com",
...     user_notification_enabled=True,
...     icon_text='',
...     protocol='https://',
...     user_portal_link_ids=['72058304855142822']
... )
>>> if err:
...     print(f"Error adding user portal link: {err}")
...     return
... print(f"user portal link added successfully: {added_portal_link.as_dict()}")
delete_portal_link(portal_link_id, microtenant_id=None)¶

Deletes the specified user portal link.

Parameters:

portal_link_id (str) – The unique identifier for the user portal link to be deleted.

Returns:

Status code of the delete operation.

Return type:

int

Example

# Delete a user portal link by ID >>> _, _, err = client.zpa.user_portal_link.delete_portal_link(‘513265’) … if err: … print(f”Error deleting user portal link: {err}”) … return … print(f”user portal link with ID {‘513265’} deleted successfully.”)

get_portal_link(portal_link_id, query_params=None)¶

Gets information on the specified user portal link.

Parameters:
  • portal_link_id (str) – The unique identifier of the user portal link.

  • query_params (dict, optional) – Map of query parameters for the request. [query_params.microtenant_id] {str}: The microtenant ID, if applicable.

Returns:

UserPortalController: The corresponding user portal link object.

Return type:

Tuple

Example

Retrieve details of a specific user portal link

>>> fetched_portal, _, err = client.zpa.user_portal_link.get_portal_link('999999')
... if err:
...     print(f"Error fetching user portal link by ID: {err}")
...     return
... print(f"Fetched user portal link by ID: {fetched_portal.as_dict()}")
get_user_portal_link(portal_link_id, query_params=None)¶

Returns information on a User Portal Links for Specified Portal.

Parameters:

portal_link_id (str) – The unique identifier for the User Portal Link.

Returns:

The corresponding portal link object.

Return type:

UserPortalLink

Examples

>>> fetched_portal_link, _, err = client.zpa.user_portal_link.get_user_portal_link('999999')
... if err:
...     print(f"Error fetching portal link by ID: {err}")
...     return
... print(f"Fetched portal link by ID: {fetched_portal_link.as_dict()}")
list_portal_link(query_params=None)¶

Enumerates user portal link link in an organization with pagination.

Parameters:

{dict} (query_params) – Map of query parameters for the request. [query_params.page] {str}: Specifies the page number. [query_params.page_size] {int}: Page size for pagination. [query_params.search] {str}: Search string for filtering results. [query_params.microtenant_id] {str}: ID of the microtenant, if applicable.

Returns:

A tuple containing (list of UserPortalLink instances, Response, error)

Return type:

Tuple

Example

Fetch all user portal links without filtering

>>> portal_list, _, err = client.zpa.user_portal_link.list_user_portal_link()
... if err:
...     print(f"Error listing user portal link link: {err}")
...     return
... print(f"Total user portal links found: {len(portal_list)}")
... for portal in portal_list:
...     print(portal.as_dict())

Fetch user portal links with query_params filters >>> portal_list, _, err = client.zpa.user_portal_link.list_user_portal_link( … query_params={‘search’: ‘UserPortal01’, ‘page’: ‘1’, ‘page_size’: ‘100’}) … if err: … print(f”Error listing user portal links: {err}”) … return … print(f”Total user portal links found: {len(portal_list)}”) … for portal in portal_list: … print(portal.as_dict())

reformat_params = [('user_portal_ids', 'userPortals')]¶
update_portal_link(portal_link_id, **kwargs)¶

Updates the specified user portal link.

Parameters:

portal_link_id (str) – The unique identifier for the user portal link being updated.

Returns:

UserPortalController: The updated user portal link object.

Return type:

Tuple

Example

Updating a user portal link for a specific microtenant

>>> updated_portal_link, _, err = client.zpa.user_portal_link.update_portal_link(
...     portal_link_id='25456654',
...     name=f"Portal01_Dev_{random.randint(1000, 10000)}",
...     description=f"Portal01_Dev_{random.randint(1000, 10000)}",
...     enabled=True,
...     link="server1.example.com",
...     user_notification_enabled=True,
...     icon_text='',
...     protocol='https://',
...     user_portal_link_ids=['72058304855142822']
... )
>>> if err:
...     print(f"Error adding user portal link: {err}")
...     return
... print(f"user portal link added successfully: {added_portal_link.as_dict()}")
Next
workload_tag_group
Previous
user_portal_controller
Copyright © 2023, Zscaler Inc.
Made with Sphinx and @pradyunsg's Furo
On this page
  • user_portal_link
    • UserPortalLinkAPI
      • UserPortalLinkAPI.add_bulk_portal_links()
      • UserPortalLinkAPI.add_portal_link()
      • UserPortalLinkAPI.delete_portal_link()
      • UserPortalLinkAPI.get_portal_link()
      • UserPortalLinkAPI.get_user_portal_link()
      • UserPortalLinkAPI.list_portal_link()
      • UserPortalLinkAPI.reformat_params
      • UserPortalLinkAPI.update_portal_link()