puresnmp.types module¶
SMI Types / Structure types which are not defined in the x690 protocol (see
also x690).
See RFC 1155 section 3.2.3 for a description of the types and RFC 3416 for the definition of the new types.
Note
The IPv6 type is not defined in the default RFCs and needs to be post-processed.
- class puresnmp.types.Counter(value: int | ~x690.types._SENTINEL_UNINITIALISED = <x690.types._SENTINEL_UNINITIALISED object>)¶
Bases:
IntegerSNMP type for counters.
- SIGNED = False¶
- TYPECLASS: TypeClass = 'application'¶
The x690 type-class (universal, application or context)
- pyvalue: TWrappedPyType | _SENTINEL_UNINITIALISED¶
The decoded (or to-be encoded) Python value
- class puresnmp.types.Counter64(value: int | ~x690.types._SENTINEL_UNINITIALISED = <x690.types._SENTINEL_UNINITIALISED object>)¶
Bases:
IntegerAs defined in RFC 2578
- SIGNED = False¶
- TYPECLASS: TypeClass = 'application'¶
The x690 type-class (universal, application or context)
- pyvalue: TWrappedPyType | _SENTINEL_UNINITIALISED¶
The decoded (or to-be encoded) Python value
- class puresnmp.types.Gauge(value: ~x690.types.TWrappedPyType | ~x690.types._SENTINEL_UNINITIALISED = <x690.types._SENTINEL_UNINITIALISED object>)¶
Bases:
IntegerSNMP type for gauges.
- SIGNED = False¶
- TYPECLASS: TypeClass = 'application'¶
The x690 type-class (universal, application or context)
- pyvalue: TWrappedPyType | _SENTINEL_UNINITIALISED¶
The decoded (or to-be encoded) Python value
- class puresnmp.types.IpAddress(value: ~x690.types.TWrappedPyType | ~x690.types._SENTINEL_UNINITIALISED = <x690.types._SENTINEL_UNINITIALISED object>)¶
Bases:
X690Type[IPv4Address]SNMP Type for IPv4 Addresses
- NATURE = [TypeNature.PRIMITIVE, TypeNature.CONSTRUCTED]¶
The x690 “private/constructed” information
- TYPECLASS: TypeClass = 'application'¶
The x690 type-class (universal, application or context)
- static decode_raw(data: bytes, slc: slice = slice(None, None, None)) IPv4Address¶
Converts raw-bytes to an ip-address instance
>>> IpAddress.decode_raw(b"\xc0\x00\x02\x01") IPv4Address('192.0.2.1')
- encode_raw() bytes¶
Converts ip-address instance into raw bytes
>>> IpAddress(ip_address('192.0.2.1')).encode_raw() b'\xc0\x00\x02\x01'
- pyvalue: TWrappedPyType | _SENTINEL_UNINITIALISED¶
The decoded (or to-be encoded) Python value
- class puresnmp.types.NsapAddress(value: ~x690.types.TWrappedPyType | ~x690.types._SENTINEL_UNINITIALISED = <x690.types._SENTINEL_UNINITIALISED object>)¶
Bases:
IntegerWrapped type for an NSAP Address
- TYPECLASS: TypeClass = 'application'¶
The x690 type-class (universal, application or context)
- pyvalue: TWrappedPyType | _SENTINEL_UNINITIALISED¶
The decoded (or to-be encoded) Python value
- class puresnmp.types.Opaque(value: str | bytes | _SENTINEL_UNINITIALISED = b'')¶
Bases:
OctetStringThe Opaque type is to be considered to carry “any” binary data.
It is up to the application to know how to interpret this data and is passed through transparently by the SNMP protocol.
- TYPECLASS: TypeClass = 'application'¶
The x690 type-class (universal, application or context)
- pyvalue: TWrappedPyType | _SENTINEL_UNINITIALISED¶
The decoded (or to-be encoded) Python value
- class puresnmp.types.TimeTicks(value: ~datetime.timedelta | int | ~x690.types._SENTINEL_UNINITIALISED = <x690.types._SENTINEL_UNINITIALISED object>)¶
Bases:
IntegerSNMP type for time ticks exposed as Python
datetime.timedelta- SIGNED = False¶
- TYPECLASS: TypeClass = 'application'¶
The x690 type-class (universal, application or context)
- pyvalue: TWrappedPyType | _SENTINEL_UNINITIALISED¶
The decoded (or to-be encoded) Python value