vzen_nodes¶
The following methods allow for interaction with the ZIA ZIA virtual Zen Nodes API endpoints.
Methods are accessible via zia.vzen_nodes
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 VZENNodesAPI¶
Bases:
APIClientA Client object for the VZen Nodes resource.
- add_zen_node(**kwargs)¶
Creates a new ZIA Virtual Zen Node.
- Parameters:
name (str) – The name of the Virtual Zen Node.
**kwargs – Optional keyword args.
- Keyword Arguments:
enabled (bool) – Whether the Virtual Zen Node is enabled or disabled.
status (str) – The status of the Virtual Zen Node (e.g., “ENABLED”, “DISABLED”).
in_production (bool) – Whether the Virtual Zen Node is in production mode.
ip_address (str) – The IP address of the Virtual Zen Node.
subnet_mask (str) – The subnet mask for the Virtual Zen Node.
default_gateway (str) – The default gateway IP address for the Virtual Zen Node.
type (str) – The type of Virtual Zen Node (e.g., “SMLB”).
ip_sec_enabled (bool) – Whether IPsec is enabled for the Virtual Zen Node.
on_demand_support_tunnel_enabled (bool) – Whether on-demand support tunnel is enabled.
establish_support_tunnel_enabled (bool) – Whether support tunnel establishment is enabled.
load_balancer_ip_address (str) – The IP address of the load balancer.
deployment_mode (str) – The deployment mode for the Virtual Zen Node (e.g., “CLUSTER”).
vzen_sku_type (str) – The SKU type for the Virtual Zen Node (e.g., “LARGE”).
description (str) – Additional notes or information about the Virtual Zen Node.
- Returns:
A tuple containing the newly added Virtual Zen Node, response, and error.
- Return type:
Examples
Add a new Virtual Zen Node with basic configuration:
>>> added_node, _, error = client.zia.vzen_nodes.add_zen_node( ... name="NewVZEN1234", ... enabled=True, ... status="ENABLED", ... in_production=True, ... ip_address="10.0.0.100", ... subnet_mask="255.255.255.0", ... default_gateway="10.0.0.3", ... type="SMLB", ... load_balancer_ip_address="10.0.0.50", ... deployment_mode="CLUSTER", ... vzen_sku_type="LARGE" ... ) >>> if error: ... print(f"Error adding vzen node: {error}") ... return ... print(f"vzen node added successfully: {added_node.as_dict()}")
Add a new Virtual Zen Node with advanced configuration:
>>> added_node, _, error = client.zia.vzen_nodes.add_zen_node( ... name="NewVZEN5678", ... enabled=True, ... status="ENABLED", ... in_production=True, ... ip_address="10.0.0.100", ... subnet_mask="255.255.255.0", ... default_gateway="10.0.0.3", ... type="SMLB", ... ip_sec_enabled=True, ... on_demand_support_tunnel_enabled=True, ... establish_support_tunnel_enabled=True, ... load_balancer_ip_address="10.0.0.50", ... deployment_mode="CLUSTER", ... vzen_sku_type="LARGE", ... description="Production Virtual Zen Node" ... ) >>> if error: ... print(f"Error adding vzen node: {error}") ... return ... print(f"vzen node added successfully: {added_node.as_dict()}")
- delete_zen_node(node_id)¶
Deletes the specified Zen Node.
- Parameters:
node_id (str) – The unique identifier of the Zen Node.
- Returns:
A tuple containing the response object and error (if any).
- Return type:
Examples
Delete a Zen Node:
>>> _, _, error = client.zia.vzen_nodes.delete_zen_node('73459') >>> if error: ... print(f"Error deleting Zen Node: {error}") ... return ... print(f"Zen Node with ID {'73459'} deleted successfully.")
- get_zen_node(node_id)¶
Fetches a specific Zen Node by ID.
- Parameters:
node_id (int) – The unique identifier for the Zen Node.
- Returns:
A tuple containing (Zen Node instance, Response, error).
- Return type:
Examples
Print a specific Zen Node by ID:
>>> fetched_zen_node, _, error = client.zia.vzen_nodes.get_zen_node( '1254654') >>> if error: ... print(f"Error fetching Zen Node by ID: {error}") ... return ... print(f"Fetched Zen Node by ID: {fetched_zen_node.as_dict()}")
- list_zen_nodes(query_params=None)¶
Retrieves the ZIA Virtual Service Edge for an organization
- Parameters:
{dict} (query_params) –
Map of query parameters for the request.
[query_params.search]{str}: Search string for filtering results.- Returns:
A tuple containing (list of VZenNodes instances, Response, error)
- Return type:
Examples
List Zen Nodes using default settings:
>>> zen_node_list, _, error = client.zia.vzen_nodes.list_zen_nodes( query_params={'search': updated_zen_node.name}) >>> if error: ... print(f"Error listing Zen Nodes: {error}") ... return ... print(f"Total Zen Nodes found: {len(zen_node_list)}") ... for zen_node in zen_node_list: ... print(zen_node.as_dict())
- update_zen_node(node_id, **kwargs)¶
Updates information for the specified ZIA Virtual Zen Node.
- Parameters:
node_id (int) – The unique ID for the Virtual Zen Node.
**kwargs – Optional keyword args.
- Keyword Arguments:
name (str) – The name of the Virtual Zen Node.
enabled (bool) – Whether the Virtual Zen Node is enabled or disabled.
status (str) – The status of the Virtual Zen Node (e.g., “ENABLED”, “DISABLED”).
in_production (bool) – Whether the Virtual Zen Node is in production mode.
ip_address (str) – The IP address of the Virtual Zen Node.
subnet_mask (str) – The subnet mask for the Virtual Zen Node.
default_gateway (str) – The default gateway IP address for the Virtual Zen Node.
type (str) – The type of Virtual Zen Node (e.g., “SMLB”).
ip_sec_enabled (bool) – Whether IPsec is enabled for the Virtual Zen Node.
on_demand_support_tunnel_enabled (bool) – Whether on-demand support tunnel is enabled.
establish_support_tunnel_enabled (bool) – Whether support tunnel establishment is enabled.
load_balancer_ip_address (str) – The IP address of the load balancer.
deployment_mode (str) – The deployment mode for the Virtual Zen Node (e.g., “CLUSTER”).
vzen_sku_type (str) – The SKU type for the Virtual Zen Node (e.g., “LARGE”).
description (str) – Additional notes or information about the Virtual Zen Node.
- Returns:
A tuple containing the updated Virtual Zen Node, response, and error.
- Return type:
Examples
Update an existing Virtual Zen Node with basic configuration:
>>> updated_node, _, error = client.zia.vzen_nodes.update_zen_node( ... node_id=1524566, ... name="UpdateVZEN1234", ... enabled=True, ... status="ENABLED", ... in_production=True, ... ip_address="10.0.0.100", ... subnet_mask="255.255.255.0", ... default_gateway="10.0.0.3", ... type="SMLB", ... load_balancer_ip_address="10.0.0.50", ... deployment_mode="CLUSTER", ... vzen_sku_type="LARGE" ... ) >>> if error: ... print(f"Error updating vzen node: {error}") ... return ... print(f"vzen node updated successfully: {updated_node.as_dict()}")
Update an existing Virtual Zen Node with advanced configuration:
>>> updated_node, _, error = client.zia.vzen_nodes.update_zen_node( ... node_id=1524566, ... name="UpdateVZEN5678", ... enabled=True, ... status="ENABLED", ... in_production=True, ... ip_address="10.0.0.100", ... subnet_mask="255.255.255.0", ... default_gateway="10.0.0.3", ... type="SMLB", ... ip_sec_enabled=True, ... on_demand_support_tunnel_enabled=True, ... establish_support_tunnel_enabled=True, ... load_balancer_ip_address="10.0.0.50", ... deployment_mode="CLUSTER", ... vzen_sku_type="LARGE", ... description="Updated Production Virtual Zen Node" ... ) >>> if error: ... print(f"Error updating vzen node: {error}") ... return ... print(f"vzen node updated successfully: {updated_node.as_dict()}")