admin#
The following methods allow for interaction with the ZCON Admin API endpoints.
Methods are accessible via zcon.admin
- class ZCONAdminAPI#
- add_admin(user_name, login_name, role, email, password, **kwargs)#
Create a new admin user.
- Parameters:
- Keyword Arguments:
disabled (bool) – Indicates whether the admin is disabled.
new_location_create_allowed (bool) – Indicates whether the admin can create new locations.
admin_scope_type (str) – The admin scope type.
admin_scope_group_member_entity_ids (list) – Applicable if the admin scope type is LOCATION_GROUP.
is_default_admin (bool) – Indicates whether the admin is the default admin.
is_deprecated_default_admin (bool) – Indicates whether this admin is deletable.
is_auditor (bool) – Indicates whether the admin is an auditor.
is_security_report_comm_enabled (bool) – Indicates whether the admin can receive security reports.
is_service_update_comm_enabled (bool) – Indicates whether the admin can receive service updates.
is_password_login_allowed (bool) – Indicates whether the admin can log in with a password.
is_product_update_comm_enabled (bool) – Indicates whether the admin can receive product updates.
is_exec_mobile_app_enabled (bool) – Indicates whether Executive Insights App access is enabled for the admin.
send_mobile_app_invite (bool) – Indicates whether to send an invitation email to download Executive Insights App to admin.
send_zdx_onboard_invite (bool) – Indicates whether to send an invitation email for ZDX onboarding to admin.
comments (str) – Comments for the admin user.
name (str) – Admin user’s “friendly” name, e.g., “FirstName LastName” (this field typically matches userName.)
- Returns:
A Box object representing the newly created admin user.
- Return type:
Box
Examples
Create a new admin user with only the required parameters:
zcon.admin.add_admin( name="Jane Smith", login_name="jsmith", role="admin", email="jsmith@example.com", password="password123", )
Create a new admin with some additional parameters:
zcon.admin.add_admin( name="Jane Smith", login_name="jsmith", role="admin", email="jsmith@example.com", password="password123", is_default_admin=False, disabled=False, comments="New admin user"
- add_role(name, policy_access='NONE', report_access='NONE', username_access='NONE', dashboard_access='NONE', **kwargs)#
Create a new admin role.
- Parameters:
- Keyword Arguments:
feature_permissions_tuples (
List[Tuple[str, str]]
) –A list of tuple pairs specifying the feature permissions. Each tuple contains the feature name (case-insensitive) and its access level.
Accepted feature names (case-insensitive) are:
APIKEY_MANAGEMENT
EDGE_CONNECTOR_CLOUD_PROVISIONING
EDGE_CONNECTOR_LOCATION_MANAGEMENT
EDGE_CONNECTOR_DASHBOARD
EDGE_CONNECTOR_FORWARDING
EDGE_CONNECTOR_TEMPLATE
REMOTE_ASSISTANCE_MANAGEMENT
EDGE_CONNECTOR_ADMIN_MANAGEMENT
EDGE_CONNECTOR_NSS_CONFIGURATION
alerting_access (str) – The alerting access level.
analysis_access (str) – The analysis access level.
admin_acct_access (str) – The admin account access level.
device_info_access (str) – The device info access level.
Note
For access levels, the accepted values are:
NONE
READ_ONLY
READ_WRITE
- Returns:
The newly created role.
- Return type:
Examples
Minimum required arguments:
zcon.admin.add_role(name="NewRole")
Including keyword arguments:
zcon.admin.add_role( name="AdvancedRole", policy_access="READ_ONLY", feature_permissions_tuples=[ ("apikey_management", "read_only"), ("EDGE_CONNECTOR_CLOUD_PROVISIONING", "NONE") ], alerting_access="READ_WRITE" )
- change_password(username, old_password, new_password)#
Change the password for the specified admin user.
- Parameters:
- Returns:
The status code of the operation.
- Return type:
Examples
Change a password:
zcon.admin.change_password("jdoe", "oldpassword123", "newpassword123")
- delete_admin(admin_id)#
Delete the specified admin user.
- Parameters:
admin_id (str) – The ID of the admin user to delete.
- Returns:
The status code of the operation.
- Return type:
Examples
Delete an admin user:
zcon.admin.delete_admin("123456789")
- delete_role(role_id)#
Delete the specified admin role.
- Parameters:
role_id (str) – The ID of the role to delete.
- Returns:
The status code of the operation.
- Return type:
Examples
Delete a role:
zcon.admin.delete_role("123456789")
- get_admin(admin_id)#
Get details for a specific admin user.
- Parameters:
admin_id (str) – The ID of the admin user to retrieve.
- Returns:
The admin user details.
- Return type:
Box
Examples
Print the details of an admin user:
print(zcon.admin.get_admin("123456789")
- get_role(role_id)#
Get details for a specific admin role.
- Parameters:
role_id (str) – The ID of the role to retrieve.
- Returns:
The role details.
- Return type:
Box
Examples
Print the details of a role:
print(zcon.admin.get_role("123456789")
- list_admins(**kwargs)#
List all existing admin users.
- Keyword Arguments:
include_auditor_users (bool) – Include / exclude auditor users in the response.
include_admin_users (bool) – Include / exclude admin users in the response.
include_api_roles (bool) – Include / exclude API roles in the response.
search (str) – The search string to filter by.
page (int) – The page offset to return.
page_size (int) – The number of records to return per page.
version (int) – Specifies the admins from a backup version
- Returns:
The list of admin users.
- Return type:
BoxList
Examples
List all admins:
for admin in zcon.admin.list_admins(): print(admin)
List all admins with advanced features:
for admin in zcon.admin.list_admins( include_auditor_users=True, include_admin_users=True, include_api_roles=True, ): print(admin)
- list_api_keys(**kwargs)#
List all existing API keys.
- Keyword Arguments:
include_partner_keys (bool) – Include / exclude partner keys in the response.
- Returns:
The list of API keys.
- Return type:
BoxList
Examples
List all API keys:
for api_key in zcon.admin.list_api_keys(): print(api_key)
- list_roles(**kwargs)#
List all existing admin roles.
- Keyword Arguments:
- Returns:
The list of roles.
- Return type:
BoxList
Examples
Print all roles:
for role in zcon.admin.list_roles(): print(role)
Print all roles with additional parameters:
for role in zcon.admin.list_roles( include_auditor_role=True, include_partner_role=True, include_api_roles=True, ): print(role)
- regenerate_api_key(api_key_id)#
Regenerate the specified API key.
- Parameters:
api_key_id (str) – The ID of the API key to regenerate.
- Returns:
The regenerated API key.
- Return type:
Box
Examples
Regenerate an API key:
print(zcon.admin.regenerate_api_key("123456789"))
- update_admin(admin_id, **kwargs)#
Update an existing admin user.
- Parameters:
admin_id (str) – The ID of the admin user to update.
- Keyword Arguments:
role (str) – The role of the admin user.
email (str) – The email address of the admin user.
password (str) – The password for the admin user.
disabled (bool) – Indicates whether the admin is disabled.
new_location_create_allowed (bool) – Indicates whether the admin can create new locations.
admin_scope_type (str) – The admin scope type.
admin_scope_group_member_entity_ids (list) – Applicable if the admin scope type is LOCATION_GROUP.
is_default_admin (bool) – Indicates whether the admin is the default admin.
is_deprecated_default_admin (bool) – Indicates whether this admin is deletable.
is_auditor (bool) – Indicates whether the admin is an auditor.
is_security_report_comm_enabled (bool) – Indicates whether the admin can receive security reports.
is_service_update_comm_enabled (bool) – Indicates whether the admin can receive service updates.
is_password_login_allowed (bool) – Indicates whether the admin can log in with a password.
is_product_update_comm_enabled (bool) – Indicates whether the admin can receive product updates.
is_exec_mobile_app_enabled (bool) – Indicates whether Executive Insights App access is enabled for the admin.
send_mobile_app_invite (bool) – Indicates whether to send an invitation email to download Executive Insights App to admin.
send_zdx_onboard_invite (bool) – Indicates whether to send an invitation email for ZDX onboarding to admin.
comments (str) – Comments for the admin user.
name (str) – Admin user’s “friendly” name, e.g., “FirstName LastName” (this field typically matches userName.)
- Returns:
A Box object representing the updated admin user.
- Return type:
Box
Examples
Update an admin user:
zcon.admin.update_admin( admin_id="123456789", admin_scope_type="LOCATION_GROUP", comments="Updated admin user", )
- update_role(role_id, **kwargs)#
Update an existing admin role.
- Parameters:
role_id (str) – The ID of the role to update.
- Keyword Arguments:
name (str) – The name of the role.
policy_access (str) – The policy access level.
report_access (str) – The report access level.
username_access (str) – The username access level.
dashboard_access (str) – The dashboard access level.
feature_permissions (
List[Tuple[str, str]]
) –A list of tuple pairs specifying the feature permissions. Each tuple contains the feature name (case-insensitive) and its access level.
Accepted feature names (case-insensitive) are:
APIKEY_MANAGEMENT
EDGE_CONNECTOR_CLOUD_PROVISIONING
EDGE_CONNECTOR_LOCATION_MANAGEMENT
EDGE_CONNECTOR_DASHBOARD
EDGE_CONNECTOR_FORWARDING
EDGE_CONNECTOR_TEMPLATE
REMOTE_ASSISTANCE_MANAGEMENT
EDGE_CONNECTOR_ADMIN_MANAGEMENT
EDGE_CONNECTOR_NSS_CONFIGURATION
alerting_access (str) – The alerting access level.
analysis_access (str) – The analysis access level.
admin_acct_access (str) – The admin account access level.
device_info_access (str) – The device info access level.
Note
For access levels, the accepted values are:
NONE
READ_ONLY
READ_WRITE
- Returns:
The updated role.
- Return type:
Box
Examples
Update a role:
zcon.admin.update_role( role_id="123456789", policy_access="READ_ONLY", feature_permissions=[ ("apikey_management", "read_only"), ("EDGE_CONNECTOR_CLOUD_PROVISIONING", "NONE") ], alerting_access="READ_WRITE" )