+ resultData = result.getOutput().orElse(null);
+ }
+
+ if (resultData != null && resultData.isEmpty()) {
+ return Response.status(Status.NO_CONTENT).build();
+ }
+
+ return Response.status(Status.OK)
+ .entity(NormalizedNodePayload.ofNullable(context, resultData))
+ .build();
+ }
+
+ /**
+ * Invoking Action via mount point.
+ *
+ * @param mountPoint mount point
+ * @param data input data
+ * @param schemaPath schema path of data
+ * @return {@link DOMActionResult}
+ */
+ private static DOMActionResult invokeAction(final ContainerNode data,
+ final Absolute schemaPath, final YangInstanceIdentifier yangIId, final DOMMountPoint mountPoint) {
+ return invokeAction(data, schemaPath, yangIId, mountPoint.getService(DOMActionService.class)
+ .orElseThrow(() -> new RestconfDocumentedException("DomAction service is missing.")));
+ }
+
+ /**
+ * Invoke Action via ActionServiceHandler.
+ *
+ * @param data input data
+ * @param yangIId invocation context
+ * @param schemaPath schema path of data
+ * @param actionService action service to invoke action
+ * @return {@link DOMActionResult}
+ */
+ // FIXME: NETCONF-718: we should be returning a future here
+ private static DOMActionResult invokeAction(final ContainerNode data, final Absolute schemaPath,
+ final YangInstanceIdentifier yangIId, final DOMActionService actionService) {
+ return RestconfInvokeOperationsServiceImpl.checkedGet(Futures.catching(actionService.invokeAction(
+ schemaPath, new DOMDataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, yangIId.getParent()), data),
+ DOMActionException.class,
+ cause -> new SimpleDOMActionResult(List.of(RpcResultBuilder.newError(
+ ErrorType.RPC, ErrorTag.OPERATION_FAILED, cause.getMessage()))),
+ MoreExecutors.directExecutor()));
+ }
+
+ /**
+ * Check the validity of the result.
+ *
+ * @param response response of Action
+ * @return {@link DOMActionResult} result
+ */
+ private static DOMActionResult checkActionResponse(final DOMActionResult response) {
+ if (response == null) {
+ return null;
+ }
+
+ try {
+ if (response.getErrors().isEmpty()) {
+ return response;