From 98593c38f178297c00afed2cc03dce02aa95b6ab Mon Sep 17 00:00:00 2001 From: Ivan Hrasko Date: Mon, 13 Feb 2023 11:08:35 +0100 Subject: [PATCH] Remove misleading identifier check Check for presence of mount prefix in request for operation is misleading. Its fully legal to ask for particular operation on controller or device. Remove this check which allows us to invoke requests for particular operation on controller. For now the request gives us all operations available on controller/device and that will be fixed as part of NETCONF-928. JIRA: NETCONF-929 Change-Id: Ia45ec624640b7b75416071f7675088c2bdab3091 Signed-off-by: Ivan Hrasko --- .../services/impl/RestconfOperationsServiceImpl.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfOperationsServiceImpl.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfOperationsServiceImpl.java index 5fc5155d4b..1f993eafb8 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfOperationsServiceImpl.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfOperationsServiceImpl.java @@ -23,15 +23,11 @@ import org.opendaylight.mdsal.dom.api.DOMMountPoint; import org.opendaylight.mdsal.dom.api.DOMMountPointService; import org.opendaylight.mdsal.dom.api.DOMSchemaService; import org.opendaylight.restconf.common.context.InstanceIdentifierContext; -import org.opendaylight.restconf.common.errors.RestconfDocumentedException; import org.opendaylight.restconf.nb.rfc8040.databind.DatabindProvider; import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload; import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfOperationsService; -import org.opendaylight.restconf.nb.rfc8040.utils.RestconfConstants; import org.opendaylight.restconf.nb.rfc8040.utils.parser.ParserIdentifier; import org.opendaylight.yangtools.yang.common.Empty; -import org.opendaylight.yangtools.yang.common.ErrorTag; -import org.opendaylight.yangtools.yang.common.ErrorType; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.builder.DataContainerNodeBuilder; @@ -78,14 +74,6 @@ public class RestconfOperationsServiceImpl implements RestconfOperationsService @Override public NormalizedNodePayload getOperations(final String identifier, final UriInfo uriInfo) { - if (!identifier.contains(RestconfConstants.MOUNT)) { - final var errMsg = """ - URI has bad format. If operations behind mount point should be showed, URI has to end with %s. - """.formatted(RestconfConstants.MOUNT); - LOG.debug("{} for {}", errMsg, identifier); - throw new RestconfDocumentedException(errMsg, ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE); - } - final InstanceIdentifierContext mountPointIdentifier = ParserIdentifier.toInstanceIdentifier(identifier, databindProvider.currentContext().modelContext(), Optional.of(mountPointService)); final DOMMountPoint mountPoint = mountPointIdentifier.getMountPoint(); -- 2.36.6