- xml = ns_instance_config.to_xml_v2(self._model)
- netconf_xml = self.wrap_netconf_config_xml(xml)
-
- self._log.debug("Sending configure ns-instance-config xml to %s: %s",
- netconf_xml, NsrRpcDtsHandler.NETCONF_IP_ADDRESS)
-
- response = yield from self._manager.edit_config(
- target="running",
- config=netconf_xml,
- )
- self._log.debug("Received edit config response: %s", str(response))
+ payload_dict = ns_instance_config.to_json(self._model)
+ #xml = ns_instance_config.to_xml_v2(self._model)
+ #netconf_xml = self.wrap_netconf_config_xml(xml)
+
+ #self._log.debug("Sending configure ns-instance-config xml to %s: %s",
+ # netconf_xml, NsrRpcDtsHandler.NETCONF_IP_ADDRESS)
+ self._log.debug("Sending configure ns-instance-config json to %s: %s",
+ self._nsr_config_url,ns_instance_config)
+
+ #response = yield from self._manager.edit_config(
+ # target="running",
+ # config=netconf_xml,
+ # )
+ response = yield from self._loop.run_in_executor(
+ None,
+ self._apply_ns_instance_config,
+ payload_dict
+ )
+ response.raise_for_status()
+ self._log.debug("Received edit config response: %s", response.json())