-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue_821: Refactored testcase with latest changes of input modules a…
…nd updated TC, docstrings
- Loading branch information
1 parent
9397f70
commit 9764580
Showing
5 changed files
with
104 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright (c) 2023-2025 Arista Networks, Inc. | ||
# Use of this source code is governed by the Apache License 2.0 | ||
# that can be found in the LICENSE file. | ||
"""Module containing input models for SNMP tests.""" | ||
|
||
from __future__ import annotations | ||
|
||
from ipaddress import IPv4Address | ||
|
||
from pydantic import BaseModel, ConfigDict | ||
|
||
from anta.custom_types import Hostname | ||
|
||
|
||
class SNMPHost(BaseModel): | ||
"""Model for a SNMP Host.""" | ||
|
||
model_config = ConfigDict(extra="forbid") | ||
hostname: IPv4Address | Hostname | ||
"""IPv4 address of the SNMP notification host.""" | ||
vrf: str = "default" | ||
"""Optional VRF for SNMP Hosts. If not provided, it defaults to `default`.""" | ||
|
||
def __str__(self) -> str: | ||
"""Return a human-readable string representation of the Host for reporting. | ||
Examples | ||
-------- | ||
- Host: 192.168.1.100 VRF: default | ||
""" | ||
return f"Host: {self.hostname} VRF: {self.vrf}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters