accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html";
+ revision "2024-02-18" {
+ description "Corrected output to result in a stream name";
+ }
+
revision "2022-11-06" {
description
"Initial revision";
"Subscribe to notifications on specified device.";
input {
- leaf path {
- type instance-identifier;
- description "Device mount point path";
- }
- }
- output {
- leaf stream-path {
- type inet:uri;
- description "Device Notification stream URL";
- }
- }
+ leaf path {
+ type instance-identifier;
+ description "Device mount point path";
+ }
+ }
+ output {
+ leaf stream-name {
+ type string;
+ description "Notification stream name.";
+ }
+ }
}
}
import org.opendaylight.restconf.server.spi.OperationInput;
import org.opendaylight.restconf.server.spi.RestconfStream;
import org.opendaylight.restconf.server.spi.RpcImplementation;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.device.notification.rev221106.SubscribeDeviceNotification;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.device.notification.rev221106.SubscribeDeviceNotificationInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.device.notification.rev221106.SubscribeDeviceNotificationOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.device.notification.rev240218.SubscribeDeviceNotification;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.device.notification.rev240218.SubscribeDeviceNotificationInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.device.notification.rev240218.SubscribeDeviceNotificationOutput;
import org.opendaylight.yangtools.yang.common.ErrorTag;
import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.QName;
public final class SubscribeDeviceNotificationRpc extends RpcImplementation {
private static final NodeIdentifier DEVICE_NOTIFICATION_PATH_NODEID =
NodeIdentifier.create(QName.create(SubscribeDeviceNotificationInput.QNAME, "path").intern());
- // FIXME: NETCONF-1102: this should be 'stream-name'
- private static final NodeIdentifier DEVICE_NOTIFICATION_STREAM_PATH_NODEID =
- NodeIdentifier.create(QName.create(SubscribeDeviceNotificationInput.QNAME, "stream-path").intern());
+ private static final NodeIdentifier DEVICE_NOTIFICATION_STREAM_NAME_NODEID =
+ NodeIdentifier.create(QName.create(SubscribeDeviceNotificationInput.QNAME, "stream-name").intern());
private final DOMMountPointService mountPointService;
private final RestconfStream.Registry streamRegistry;
+ new YangInstanceIdentifierSerializer(input.databind()).serializePath(path))
.transform(stream -> input.newOperationOutput(ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(SubscribeDeviceNotificationOutput.QNAME))
- .withChild(ImmutableNodes.leafNode(DEVICE_NOTIFICATION_STREAM_PATH_NODEID, stream.name()))
+ .withChild(ImmutableNodes.leafNode(DEVICE_NOTIFICATION_STREAM_NAME_NODEID, stream.name()))
.build()));
}
}