Add copy command
Change-Id: I0a88f7fa9a096022dd95e8af8854f980ca34f043
diff --git a/src/netconf-client.cpp b/src/netconf-client.cpp
index 63045f0..d824324 100644
--- a/src/netconf-client.cpp
+++ b/src/netconf-client.cpp
@@ -381,6 +381,15 @@
}
}
+void Session::copyConfig(const NC_DATASTORE source, const NC_DATASTORE destination)
+{
+ auto rpc = impl::guarded(nc_rpc_copy(destination, nullptr, source, nullptr, NC_WD_UNKNOWN, NC_PARAMTYPE_CONST));
+ if (!rpc) {
+ throw std::runtime_error("Cannot create copy-config RPC");
+ }
+ impl::do_rpc_ok(this, std::move(rpc));
+}
+
ReportedError::ReportedError(const std::string& what)
: std::runtime_error(what)
{