def restore_from_json(self, in_data):
        import json
        import autonetkit.ank_json as ank_json
        data = json.loads(in_data)
        for (overlay_id, graph_data) in data.items():

            self._overlays[overlay_id] = \
                ank_json.ank_json_loads(graph_data)

            ank_json.rebind_interfaces(self)
Example #2
0
    def restore(self, pickle_file):
        """"""
        import json
        import gzip
        import autonetkit.ank_json as ank_json
        log.debug("Restoring %s" % pickle_file)
        with gzip.open(pickle_file, "r") as fh:
            data = json.load(fh)
            for overlay_id, graph_data in data.items():
                self._overlays[
                    overlay_id] = ank_json.ank_json_loads(graph_data)

        ank_json.rebind_interfaces(self)
Example #3
0
    def restore(self, pickle_file):
        """"""

        import json
        import gzip
        import autonetkit.ank_json as ank_json
        log.debug('Restoring %s' % pickle_file)
        with gzip.open(pickle_file, 'r') as filehandle:
            data = json.load(filehandle)
            for (overlay_id, graph_data) in data.items():

                self._overlays[overlay_id] = \
                    ank_json.ank_json_loads(graph_data)

        ank_json.rebind_interfaces(self)