ConfigToJson

class ConfigToJson(config, omit_empty=False, verbosity=3)

Bases: object

Parameters:
  • config – Reference to the parent BaseConfigParser object
  • verbosity (int) – Logging output level
get_interface_list(flags_filter=None)
get_ordered_interfaces()

Return interfaces as OrderedDict

Returns:Interface section as OrderedDict
Return type:(OrderedDict)
static jprint(data)
parse_common()
parse_interfaces()
Returns:
to_json(indent=2)

Return JSON formatted structure describing configuration

Parameters:indent (int) – Set JSON indent, defaults to 2
Returns:JSON string
Return type:str
to_yaml()

Return YAML formatted structure describing configuration

Returns:YAML string
Return type:str