Skip to content
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

fix: Missing docstring for tags #114

Merged
merged 1 commit into from Sep 8, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions anta/inventory/__init__.py
Expand Up @@ -51,12 +51,15 @@ class AntaInventory():
hosts:
- hosts: 1.1.1.1
- host: 2.2.2.2
tags: ['dc1', 'spine', 'pod01']
networks:
- network: 10.0.0.0/8
- network: 192.168.0.0/16
tags: ['dc1', 'spine', 'pod01']
ranges:
- start: 10.0.0.1
end: 10.0.0.11
tags: ['dc1', 'spine', 'pod01']

Inventory result:

Expand All @@ -83,6 +86,7 @@ class AntaInventory():
"url='https://ansible:ansible@192.168.0.2/command-api'",
"established=False"
"is_online=False",
"tags": ['dc1', 'spine', 'pod01'],
"hw_model=unset",
]

Expand Down
4 changes: 4 additions & 0 deletions anta/inventory/models.py
Expand Up @@ -21,6 +21,7 @@ class AntaInventoryHost(BaseModel):

Attributes:
host (IPvAnyAddress): IPv4 or IPv6 address of the device
tags (List[str]): List of attached tags read from inventory file.
"""

host: IPvAnyAddress
Expand All @@ -33,6 +34,7 @@ class AntaInventoryNetwork(BaseModel):

Attributes:
network (IPvAnyNetwork): Subnet to use for testing.
tags (List[str]): List of attached tags read from inventory file.
"""

network: IPvAnyNetwork
Expand All @@ -46,6 +48,7 @@ class AntaInventoryRange(BaseModel):
Attributes:
start (IPvAnyAddress): IPv4 or IPv6 address for the begining of the range.
stop (IPvAnyAddress): IPv4 or IPv6 address for the end of the range.
tags (List[str]): List of attached tags read from inventory file.
"""

start: IPvAnyAddress
Expand Down Expand Up @@ -85,6 +88,7 @@ class InventoryDevice(BaseModel):
is_online (bool): Flag to mark if host is alive (True) or not (False). Default: False.
hw_model (str): HW name gathered during device discovery.
url (str): eAPI URL to use to build session.
tags (List[str]): List of attached tags read from inventory file.
"""

host: IPvAnyAddress
Expand Down
6 changes: 3 additions & 3 deletions anta/result_manager/__init__.py
Expand Up @@ -93,9 +93,9 @@ def get_results(self, output_format: str = "native") -> Any:
Expose list of all test results in different format

Support multiple format:
- native: ListResults format
- list: a list of TestResult
- json: a native JSON format
- native: ListResults format
- list: a list of TestResult
- json: a native JSON format

Args:
output_format (str, optional): format selector. Can be either native/list/json. Defaults to 'native'.
Expand Down