noc.core.script.beef

Module Contents

noc.core.script.beef.Box
noc.core.script.beef.CLIFSM
noc.core.script.beef.CLI
noc.core.script.beef.MIB
class noc.core.script.beef.Beef

Bases: object

classmethod from_json(cls, data)
static get_or_die(d, k)
decode_v1(self, data)
get_data(self, decode=False)
static compress_gzip(data)
static compress_bz2(data)
static decompress_gzip(data)
static decompress_bz2(data)
save(self, storage, path)

Write beef to external storage. Compression depends on extension. Following extensions are supported: * .json - JSON without compression * .json.gz - JSON with gzip compression * .json.bz2 - JSON with bzip2 compression

Parameters:
  • storage – ExtStorage instance
  • path – Beef path
Returns:

Compressed, Uncompressed sizes

classmethod load(cls, storage, path)

Load beef from storage :param storage: :param path: :return:

iter_fsm_state_reply(self, state)

Iterate fsm states :param state: :return:

iter_cli_reply(self, command)

Iterate fsm states :param state: :return:

static mib_decode_base64(value)

Decode base64 :param value: :return:

static mib_decode_hex(value)

Decode base64 :param value: :return:

static cli_decode_quopri(value)

Decode quoted-printable :param value: :return:

get_mib_oid_values(self)
get_mib_value(self, oid)

Lookup mib and return oid value :param oid: :return: Binary OID data or None

get_mib_oids(self)

Return sorted list of MIB oids :return:

iter_mib_oids(self, oid)

Generator yielding all consequentive oids :param oid: :return: