Dev, Tests, Examples and Doc for Network Function #887
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Network Functions Modules Documentation
Overview
This PR introduces two new Ansible modules for managing Network Functions in Nutanix Prism Central. Network Functions enable service insertion capabilities, allowing traffic to be redirected through or mirrored to Network Function Virtual Machines (NFVM).
These modules use PC v4 APIs based SDKs.
Module 1: ntnx_network_functions_v2
Purpose
This module provides full CRUD (Create, Read, Update, Delete) operations for Network Functions in Nutanix Prism Central.
Version
What It Does
1. Create Network Functions
2. Update Network Functions
3. Delete Network Functions
Key Features
Options/Parameters
Conditional Requirements
presentnameORext_idmust be providedabsentext_idis requiredParameters
state (str)
present(create/update) orabsent(delete)ext_id (str)
state=absent(delete operation)state=presentfor update operationname (str)
description (str)
nic_pairs (list of dict)
high_availability_mode (str)
ACTIVE_PASSIVEfailure_handling (str)
FAIL_CLOSE,FAIL_OPEN,NO_ACTIONtraffic_forwarding_mode (str)
INLINE,VTAPdata_plane_health_check_config (dict)
metadata (dict)
Common Parameters (from fragments)
Return Values
response (dict)
changed (bool)
ext_id (str)
task_ext_id (str)
error (str)
failed (bool)
msg (str)
Use Cases
Module 2: ntnx_network_functions_info_v2
Purpose
This module provides read-only operations to fetch information about Network Functions in Nutanix Prism Central.
Version
What It Does
1. Get Single Network Function
2. List All Network Functions
Key Features
Options/Parameters
Parameters (All Optional)
ext_id (str)
filterfilter (str)
$filteris evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the responseext_idextId,nameextId eq '887fddf0-b125-4da3-8110-b82bdbd21da2'name eq 'samplenf'limit (int)
page (int)
orderby (str)
ascor descending order usingdescascordescare not specified, the resources will be sorted in ascending order by defaultnamename descCommon Parameters (from fragments)
Return Values
response (dict or list)
changed (bool)
total_available_results (int)
ext_id (str)
error (str)
msg (str)
Use Cases
Infrastructure Components
API Client Function
Helper Functions
Constants
"Networking:config:network-function"for task entity typeFiles Changed
plugins/modules/ntnx_network_functions_v2.pyplugins/modules/ntnx_network_functions_info_v2.pyplugins/module_utils/v4/network/api_client.pyget_network_function_api_instance()plugins/module_utils/v4/network/helpers.pyget_network_function()helperplugins/module_utils/v4/constants.pyNETWORK_FUNCTIONconstantmeta/runtime.ymlexamples/networks_v2/network_functions_v2.ymltests/integration/targets/ntnx_network_functions_v2/Testing
Comprehensive integration tests are included covering:
Examples
See
examples/networks_v2/network_functions_v2.ymlfor complete usage examples demonstrating:Notes
ntnx_networking_py_client)INGRESSandEGRESSnetwork function types