Skip to content
Open
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
8 changes: 6 additions & 2 deletions pyaoscx/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def from_uri(cls, session, uri):
return name, interface_obj

@classmethod
def get_facts(cls, session):
def get_facts(cls, session, depth=None):
"""
Perform a GET call to retrieve all Interfaces and their data.

Expand All @@ -415,7 +415,11 @@ def get_facts(cls, session):
logging.info("Retrieving the switch interfaces facts")

# Set depth
interface_depth = session.api.default_facts_depth
interface_depth = depth or session.api.default_facts_depth

if not session.api.valid_depth(interface_depth):
interface_depth = session.api.default_facts_depth
raise Exception("ERROR: Depth should be {0}".format(interface_depth))

# Build URI
uri = "{0}?depth={1}".format(Interface.base_uri, interface_depth)
Expand Down