fun editConfig(messageContent: String, configTarget: String = NetconfDatastore.CANDIDATE.datastore,
editDefaultOperation: String = ModifyAction.NONE.action): DeviceResponse
+ /**
+ * Invoke custom RPC as provided as input.
+ *
+ * Some use cases might required one to directly invoke a device
+ * specific RPC. The RPC must be correctly formatted.
+ *
+ * Ex: in order to rollback last submitted configuration
+ * for JUNOS devices, such RPC can be use:
+ * <code>
+ * <rpc>
+ * <load-configuration rollback="1"/>
+ * </rpc>
+ * </code>
+ *
+ * @param rpc the rpc content.
+ */
+ fun invokeRpc(rpc: String): DeviceResponse
+
/**
* Validate
*
this.netconfSession = netconfSession
}
+ override fun invokeRpc(rpc: String): DeviceResponse {
+ var output = DeviceResponse()
+ val messageId = messageIdInteger.getAndIncrement().toString()
+ log.info("$deviceInfo: invokeRpc: messageId($messageId)")
+ try {
+ output = asyncRpc(rpc, messageId)
+ } catch (e: Exception) {
+ output.status = RpcStatus.FAILURE
+ output.errorMessage = "$deviceInfo: failed in invokeRpc command $e.message"
+ }
+ return output
+ }
+
override fun getConfig(filter: String, configTarget: String): DeviceResponse {
var output = DeviceResponse()
val messageId = messageIdInteger.getAndIncrement().toString()