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

from typing import List

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


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

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

[docs] def set(self, name: str, access: enums.RwAccess, 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.RwAccess.RO, level = enums.UserLevel.AUTH, auth_pwd = 'abc', priv_pwd = 'abc')`` \n No help available """ param = ArgSingleList().compose_cmd_string(ArgSingle('name', name, DataType.String), ArgSingle('access', access, DataType.Enum, enums.RwAccess), 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())
# noinspection PyTypeChecker
[docs] class AllStruct(StructBase): """ Structure for reading output parameters. Fields: \n - Count: int: No parameter help available - Name: List[str]: No parameter help available """ __meta_args_list = [ ArgStruct.scalar_int('Count'), ArgStruct('Name', DataType.StringList, None, False, True, 1)] def __init__(self): StructBase.__init__(self, self) self.Count: int=None self.Name: List[str]=None
[docs] def get_all(self) -> AllStruct: """ ``SYSTem:COMMunicate:SNMP:USM:USER:ALL`` \n Snippet: ``value: AllStruct = driver.system.communicate.snmp.usm.user.get_all()`` \n No help available :return: structure: for return value, see the help for AllStruct structure arguments. """ return self._core.io.query_struct('SYSTem:COMMunicate:SNMP:USM:USER:ALL?', self.__class__.AllStruct())
[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 No help available """ param = Conversions.value_to_quoted_str(name) self._core.io.write(f'SYSTem:COMMunicate:SNMP:USM:USER:DELete {param}')
[docs] def delete_all(self) -> None: """ ``SYSTem:COMMunicate:SNMP:USM:USER:DELete:ALL`` \n Snippet: ``driver.system.communicate.snmp.usm.user.delete_all()`` \n No help available """ self._core.io.write(f'SYSTem:COMMunicate:SNMP:USM:USER:DELete:ALL')
[docs] def delete_all_and_wait(self, opc_timeout_ms: int = -1) -> None: """ ``SYSTem:COMMunicate:SNMP:USM:USER:DELete:ALL`` \n Snippet: ``driver.system.communicate.snmp.usm.user.delete_all_and_wait()`` \n No help available Same as delete_all, but waits for the operation to complete before continuing further. Use the RsRtx.utilities.opc_timeout_set() to set the timeout value. :param opc_timeout_ms: Maximum time to wait in milliseconds, valid only for this call. """ self._core.io.write_with_opc(f'SYSTem:COMMunicate:SNMP:USM:USER:DELete:ALL', opc_timeout_ms)