cfme.control.snmp_form module¶
This file contains useful classes for working with SNMP filling.
-
class
cfme.control.snmp_form.
SNMPForm
[source]¶ Bases:
object
Class encapsulating the most common (and hopefully single) configuration of SNMP form
Usage:
form = SNMPForm() fill(form, dict( hosts=["host1", "host2"], traps=[ ("aaa", "Counter32", 125), # Takes 3-tuples ("bbb", "Null"), # 2-tuples with no value specified SNMPTrap("ccc", "Gauge32", 256), # objects dtto SNMPTrap("ddd", "Null"), # value can be unspecified too {"oid": "eee", "type": "Integer", "value": 42} # omg dict too! Yay. ], version="v2", id="aabcd", ))
-
fields
= <cfme.web_ui.Form fields=[('hosts', <cfme.control.snmp_form.SNMPHostsField object at 0x7f4b4ee6df50>), ('version', Select("//select[@id='snmp_version']", multi=False)), ('id', <cfme.web_ui.Input _names=('trap_id',), _use_id=False>), ('traps', <cfme.control.snmp_form.SNMPTrapsField num_fields=None>)]>¶
-
-
class
cfme.control.snmp_form.
SNMPHostsField
[source]¶ Bases:
object
Class designed for handling the two-type snmp hosts field.
They can be 3 or just single.
-
host_fields
¶ Returns list of locators to all host fields
-
-
class
cfme.control.snmp_form.
SNMPTrap
(oid, type, value=None)[source]¶ Bases:
cfme.utils.pretty.Pretty
Nicer representation of the single SNMP trap
Parameters: - oid – SNMP OID
- type – SNMP type
- value – Value (default: None)
-
as_tuple
¶ Return the contents as a tuple used for filling
-
pretty_attrs
= ['oid', 'type', 'value']¶
-
class
cfme.control.snmp_form.
SNMPTrapField
(seq_id)[source]¶ Bases:
cfme.utils.pretty.Pretty
Class representing SNMP trap field consisting of 3 elements - oid, type and value
Parameters: seq_id – Sequential id of the field. Usually in range 1-10 -
oid
¶
-
oid_loc
¶
-
pretty_attrs
= ['seq_id']¶
-
type
¶
-
type_loc
¶
-
value
¶
-
value_loc
¶
-
-
class
cfme.control.snmp_form.
SNMPTrapsField
(num_fields)[source]¶ Bases:
cfme.utils.pretty.Pretty
Encapsulates all trap fields to simplify form filling
Parameters: num_fields – How many SNMPTrapField to generate -
pretty_attrs
= ['num_fields']¶
-