@AccessCheck
    def stopShaping(self, dev):
        self.logger.info(
            "Request stopShaping for ip {0}".format(dev.controlledIP)
        )
        try:
            socket.inet_aton(dev.controlledIP)
        except Exception as e:
            return TrafficControlRc(
                code=ReturnCode.INVALID_IP,
                message="Invalid IP {0}: {1}".format(dev.controlledIP, e))

        id = self._ip_to_id_map.get(dev.controlledIP, None)
        shaping = self._current_shapings.get(dev.controlledIP, {}).get('tc')
        if id is not None:
            self._unshape_interface(
                id,
                self.wan,
                dev.controlledIP,
                shaping.settings.up,
            )
            self._unshape_interface(
                id,
                self.lan,
                dev.controlledIP,
                shaping.settings.down,
            )
            self._del_mapping(id, dev.controlledIP)
            self.db_task.queue.put((dev.controlledIP, 'remove_shaping'))
            self.idmanager.free(id)
        else:
            return TrafficControlRc(
                code=ReturnCode.UNKNOWN_SESSION,
                message="No session for IP {} found".format(dev.controlledIP))
        return TrafficControlRc(code=ReturnCode.OK)
Stop shaping a connection for a given traffic controlled device.
dataset/ETHPy150Open facebook/augmented-traffic-control/atc/atcd/atcd/AtcdThriftHandlerTask.py/AtcdThriftHandlerTask.stopShaping