From c5894b0fe3036763702003adc8421c2e715c90b6 Mon Sep 17 00:00:00 2001 From: Sagar Srivastav Date: Fri, 16 Dec 2016 00:42:48 -0800 Subject: ioam: add subtrees for pot-profile-list and node-interfaces to pot and trace customizers -updated postman collection Change-Id: Iebeebb1e12c52bf564e38b1cb65ce5425fc5fa22 Signed-off-by: Sagar Srivastav --- .../vppioam/impl/config/VppIoamWriterFactory.java | 14 +++- ioam/ioam_postman_collection.json | 86 ++++++++++++++++++++++ ioam/ioam_trace_postman_collection.json | 61 --------------- 3 files changed, 96 insertions(+), 65 deletions(-) create mode 100644 ioam/ioam_postman_collection.json delete mode 100644 ioam/ioam_trace_postman_collection.json (limited to 'ioam') diff --git a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/VppIoamWriterFactory.java b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/VppIoamWriterFactory.java index f4b2cea19..9d812467f 100755 --- a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/VppIoamWriterFactory.java +++ b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/VppIoamWriterFactory.java @@ -16,20 +16,22 @@ package io.fd.hc2vpp.vppioam.impl.config; +import com.google.common.collect.Sets; import com.google.inject.Inject; import io.fd.honeycomb.translate.impl.write.GenericListWriter; import io.fd.honeycomb.translate.write.WriterFactory; import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; import io.fd.vpp.jvpp.ioampot.future.FutureJVppIoampot; import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtrace; +import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.IoamTraceConfig; import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfig; +import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.trace.config.NodeInterfaces; import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.ioam.sb.pot.rev160615.PotProfiles; +import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.ioam.sb.pot.rev160615.pot.profile.PotProfileList; import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.ioam.sb.pot.rev160615.pot.profiles.PotProfileSet; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import javax.annotation.Nonnull; - public class VppIoamWriterFactory implements WriterFactory { @Nonnull @@ -49,11 +51,15 @@ public class VppIoamWriterFactory implements WriterFactory { // Trace Config final InstanceIdentifier trId = InstanceIdentifier.create(IoamTraceConfig.class).child(TraceConfig.class); - registry.add(new GenericListWriter<>(trId, new IoamTraceWriterCustomizer(jVppIoamtrace))); + registry.subtreeAdd(Sets.newHashSet(InstanceIdentifier.create(TraceConfig.class) + .child(NodeInterfaces.class)), + new GenericListWriter<>(trId, new IoamTraceWriterCustomizer(jVppIoamtrace))); // POT Config final InstanceIdentifier potId = InstanceIdentifier.create(PotProfiles.class).child(PotProfileSet.class); - registry.add(new GenericListWriter<>(potId, new IoamPotWriterCustomizer(jVppIoampot))); + registry.subtreeAdd(Sets.newHashSet(InstanceIdentifier.create(PotProfileSet.class) + .child(PotProfileList.class)), + new GenericListWriter<>(potId, new IoamPotWriterCustomizer(jVppIoampot))); } } diff --git a/ioam/ioam_postman_collection.json b/ioam/ioam_postman_collection.json new file mode 100644 index 000000000..e79eab88b --- /dev/null +++ b/ioam/ioam_postman_collection.json @@ -0,0 +1,86 @@ +{ + "variables": [], + "info": { + "name": "Honeycomb RESTCONF calls for iOAM Trace", + "_postman_id": "014389fd-d55b-9b35-ad71-81eda31779bc", + "description": "To enable iOAM trace on VPP management nodes.", + "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" + }, + "item": [ + { + "name": "iaom trace - config", + "request": { + "url": "http://localhost:8183/restconf/config/ioam-sb-trace:ioam-trace-config/trace-config/trace", + "method": "PUT", + "header": [ + { + "key": "Authorization", + "value": "Basic YWRtaW46YWRtaW4=", + "description": "" + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\"trace-config\":{\n \"trace-config-name\":\"trace\",\n \"acl-name\":\"testAcl\",\n \"trace-type\":31,\n \"trace-num-elt\":3,\n \"trace-tsp\":\"milliseconds\",\n \"trace-op\":\"add\",\n \"trace-app-data\":1234,\n \"data-export-profile-name\":\"dataProfileName\",\n \"transport-encap-profile-name\":\"transProfileName\",\n \"node-id\":1,\n \"node-interfaces\":[\n {\n \"index\":5,\n \"intf-name\":\"GigabitEthernetb/0/0\"\n }\n ]\n }\n}\n" + }, + "description": "Configure ioam trace config on VPP" + }, + "response": [] + }, + { + "name": "iaom trace - oper", + "request": { + "url": "http://localhost:8183/restconf/operational/ioam-sb-trace:ioam-trace-config/trace-config/*", + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Basic YWRtaW46YWRtaW4=", + "description": "" + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\"trace-config\":{\n \"trace-config-name\":\"trace\",\n \"acl-name\":\"testAcl\",\n \"trace-type\":31,\n \"trace-num-elt\":3,\n \"trace-tsp\":\"milliseconds\",\n \"trace-op\":\"add\",\n \"trace-app-data\":1234,\n \"data-export-profile-name\":\"dataProfileName\",\n \"transport-encap-profile-name\":\"transProfileName\",\n \"node-id\":1,\n \"node-interfaces\":[\n {\n \"index\":5,\n \"intf-name\":\"GigabitEthernetb/0/0\"\n }\n ]\n }\n}\n" + }, + "description": "Read ioam trace config from VPP" + }, + "response": [] + }, + { + "name": "iaom pot - config", + "request": { + "url": "http://localhost:8183/restconf/config/sfc-ioam-sb-pot:pot-profiles/pot-profile-set/potprofile", + "method": "PUT", + "header": [ + { + "key": "Authorization", + "value": "Basic YWRtaW46YWRtaW4=", + "description": "" + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\"pot-profile-set\":[\n\t\t{\n\t \"name\":\"potprofile\",\n\t \"path-identifier\":\"ACL\",\n\t \"active-profile-index\":1,\n\t \"pot-profile-list\":[{\n\t \t\"index\":1,\n\t \t\"prime-number\":7,\n\t \t\"secret-share\":1234,\n\t \t\"public-polynomial\":1234,\n\t \t\"lpc\":1234,\n\t \t\"validator\":\"true\",\n\t \t\"validator-key\":1234,\n\t \t\"bitmask\":1111111111\n\t }]\n\t }\n ]\n}\n" + }, + "description": "Configure ioam pot config on VPP" + }, + "response": [] + } + ] +} \ No newline at end of file diff --git a/ioam/ioam_trace_postman_collection.json b/ioam/ioam_trace_postman_collection.json deleted file mode 100644 index 61505ac89..000000000 --- a/ioam/ioam_trace_postman_collection.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "variables": [], - "info": { - "name": "Honeycomb RESTCONF calls for iOAM Trace", - "_postman_id": "4117bd46-e112-6cfc-9d18-e566b66ba610", - "description": "To enable iOAM trace on VPP management nodes.", - "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" - }, - "item": [ - { - "name": "iaom trace - config", - "request": { - "url": "http://localhost:8183/restconf/config/ioam-sb-trace:ioam-trace-config/", - "method": "PUT", - "header": [ - { - "key": "Authorization", - "value": "Basic YWRtaW46YWRtaW4=", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\"trace-config\":{\n \"trace-config-name\":\"trace\",\n \"acl-name\":\"testAcl\",\n \"trace-type\":31,\n \"trace-num-elt\":3,\n \"trace-tsp\":\"milliseconds\",\n \"trace-op\":\"add\",\n \"trace-app-data\":1234,\n \"data-export-profile-name\":\"dataProfileName\",\n \"transport-encap-profile-name\":\"transProfileName\",\n \"node-id\":1,\n \"node-interfaces\":[\n {\n \"index\":5,\n \"intf-name\":\"GigabitEthernetb/0/0\"\n }\n ]\n }\n}\n" - }, - "description": "Configure ioam trace config on VPP" - }, - "response": [] - }, - { - "name": "iaom trace - oper", - "request": { - "url": "http://localhost:8183/restconf/operational/ioam-sb-trace:ioam-trace-config/trace-config/*", - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Basic YWRtaW46YWRtaW4=", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\"trace-config\":{\n \"trace-config-name\":\"trace\",\n \"acl-name\":\"testAcl\",\n \"trace-type\":31,\n \"trace-num-elt\":3,\n \"trace-tsp\":\"milliseconds\",\n \"trace-op\":\"add\",\n \"trace-app-data\":1234,\n \"data-export-profile-name\":\"dataProfileName\",\n \"transport-encap-profile-name\":\"transProfileName\",\n \"node-id\":1,\n \"node-interfaces\":[\n {\n \"index\":5,\n \"intf-name\":\"GigabitEthernetb/0/0\"\n }\n ]\n }\n}\n" - }, - "description": "Read ioam trace config from VPP" - }, - "response": [] - } - ] -} \ No newline at end of file -- cgit 1.2.3-korg