-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
686 additions
and
34 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
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
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,35 @@ | ||
# 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 pydantic import BaseModel, ConfigDict | ||
|
||
from anta.custom_types import SnmpEncryptionAlgorithm, SnmpHashingAlgorithm, SnmpVersion | ||
|
||
|
||
class SnmpUser(BaseModel): | ||
"""Model for a SNMP User.""" | ||
|
||
model_config = ConfigDict(extra="forbid") | ||
username: str | ||
"""SNMP user name.""" | ||
group_name: str | ||
"""SNMP group for the user.""" | ||
version: SnmpVersion | ||
"""SNMP protocol version.""" | ||
auth_type: SnmpHashingAlgorithm | None = None | ||
"""User authentication algorithm. Can be provided in the `VerifySnmpUser` test.""" | ||
priv_type: SnmpEncryptionAlgorithm | None = None | ||
"""User privacy algorithm. Can be provided in the `VerifySnmpUser` test.""" | ||
|
||
def __str__(self) -> str: | ||
"""Return a human-readable string representation of the SnmpUser for reporting. | ||
Examples | ||
-------- | ||
- User: Test Group: Test_Group Version: v2c | ||
""" | ||
return f"User: {self.username} Group: {self.group_name} Version: {self.version}" |
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
Oops, something went wrong.