Skip to content

Added ndo_fabric_span_session module for the Fabric Monitoring Access Policy template (DCNE-138) #656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions plugins/module_utils/mso.py
Original file line number Diff line number Diff line change
Expand Up @@ -1709,6 +1709,28 @@ def verify_time_format(self, date_time):
except ValueError:
return self.fail_json(msg="ERROR: The time must be in 'YYYY-MM-DD HH:MM:SS' format.")

def get_site_interface_details(self, site_id=None, uuid=None, node=None, port=None):
if node and port:
path = "/sitephysifsummary/site/{0}?node={1}".format(site_id, node)
elif uuid:
path = "/sitephysifsummary/site/{0}?uuid={1}".format(site_id, uuid)

site_data = self.request(path, method="GET")

if uuid:
if site_data.get("spec", {}).get("monitoringTemplateInterfaces"):
return site_data.get("spec", {}).get("monitoringTemplateInterfaces", [])[0]
else:
self.fail_json(msg="The site port interface not found. Site ID: {0} and UUID: {1}".format(site_id, uuid))
elif node and port:
for interface in site_data.get("spec", {}).get("interfaces", []):
# To ensure consistency between the API response data and the input data by converting the node to a string
if interface.get("port") == port and str(interface.get("node")) == str(node):
return interface
self.fail_json(msg="The site port interface not found. Site ID: {0}, Node: {1} and Path: {2}".format(site_id, node, port))

return {}


def service_node_ref_str_to_dict(serviceNodeRefStr):
serviceNodeRefTokens = serviceNodeRefStr.split("/")
Expand Down
Loading