Source code for RsFsw.Implementations.System.Communicate.Snmp.Usm.User

from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ......Internal.Types import DataType
from ......Internal.ArgSingleList import ArgSingleList
from ......Internal.ArgSingle import ArgSingle
from ...... import enums


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class UserCls:
	"""
	| Commands in total: 2
	| Subgroups: 0
	| Direct child commands: 2
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("user", core, parent)

[docs] def set(self, name: str, access: enums.AccessType, level: enums.UserLevel, auth_pwd: str=None, priv_pwd: str=None) -> None: """ ``SYSTem:COMMunicate:SNMP:USM:USER`` \n Snippet: ``driver.system.communicate.snmp.usm.user.set(name = 'abc', access = enums.AccessType.RO, level = enums.UserLevel.AUTH, auth_pwd = 'abc', priv_pwd = 'abc')`` \n Defines an SNMP user profile. Prerequisites for this command: \n - Select SNMPv3 (method ``RsFsw.system.communicate.snmp.version.set()`` ) . :param name: String containing name of the user. :param access: RO | RW Defines the access right a user can have. :param level: NOAuth | AUTH | PRIVacy Defines the security level. :param auth_pwd: String containing the authentication password. :param priv_pwd: String containing the privacy password. """ param = ArgSingleList().compose_cmd_string(ArgSingle('name', name, DataType.String), ArgSingle('access', access, DataType.Enum, enums.AccessType), ArgSingle('level', level, DataType.Enum, enums.UserLevel), ArgSingle('auth_pwd', auth_pwd, DataType.String, None, is_optional=True), ArgSingle('priv_pwd', priv_pwd, DataType.String, None, is_optional=True)) self._core.io.write(f'SYSTem:COMMunicate:SNMP:USM:USER {param}'.rstrip())
[docs] def delete(self, name: str) -> None: """ ``SYSTem:COMMunicate:SNMP:USM:USER:DELete`` \n Snippet: ``driver.system.communicate.snmp.usm.user.delete(name = 'abc')`` \n Deletes a specific SNMP user profile. :param name: String containing name of SNMP user profile to be deleted. """ param = Conversions.value_to_quoted_str(name) self._core.io.write(f'SYSTem:COMMunicate:SNMP:USM:USER:DELete {param}')