rest update
diff --git a/.gitignore b/.gitignore
index 22535db..0c99d5b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
*.iml
*.log
+*.pyc
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/rest/FpcWebApplication.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/rest/FpcWebApplication.java
index 156edb8..c745500 100644
--- a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/rest/FpcWebApplication.java
+++ b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/rest/FpcWebApplication.java
@@ -1,12 +1,12 @@
package org.onosproject.fpcagent.rest;
+import org.onlab.rest.AbstractWebApplication;
+
+import java.util.Set;
+
public class FpcWebApplication extends AbstractWebApplication {
@Override
public Set<Class<?>> getClasses() {
- return getClasses(
- LinkWebResource.class,
- NodeWebResource.class,
- CellWebResource.class,
- SliceWebResource.class);
+ return getClasses(FpcWebResource.class);
}
}
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/rest/FpcWebResource.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/rest/FpcWebResource.java
index 2e7c964..16b891e 100644
--- a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/rest/FpcWebResource.java
+++ b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/rest/FpcWebResource.java
@@ -20,8 +20,10 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.ws.rs.GET;
+import javax.ws.rs.POST;
import javax.ws.rs.Path;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.Consumes;
import javax.ws.rs.core.Response;
@Path("/")
@@ -29,21 +31,25 @@
private static final Logger log =
LoggerFactory.getLogger(FpcWebResource.class);
- @GET
+ @POST
+ @Consumes(MediaType.APPLICATION_JSON)
@Path("/response")
public Response getResponse() {
return Response.ok().build();
}
- @GET
+ @POST
+ @Consumes(MediaType.APPLICATION_JSON)
@Path("/request")
public Response getRequest() {
return Response.ok().build();
}
- @GET
+ @POST
+ @Consumes(MediaType.APPLICATION_JSON)
@Path("/notification")
public Response getNotification() {
return Response.ok().build();
}
}
+
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/workers/HTTPNotifier.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/workers/HTTPNotifier.java
index 926734a..6f10664 100644
--- a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/workers/HTTPNotifier.java
+++ b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/workers/HTTPNotifier.java
@@ -105,6 +105,8 @@
StringEntity params = new StringEntity(mapper.writeValueAsString(jsonNodes));
httpPost.setEntity(params);
+
+ log.info("Sending HTTP POST {}", httpPost);
HttpResponse response = client.execute(httpPost);
if (notify.value() instanceof DownlinkDataNotification) {
diff --git a/apps/fpcagent/src/webapp/WEB-INF/web.xml b/apps/fpcagent/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from apps/fpcagent/src/webapp/WEB-INF/web.xml
rename to apps/fpcagent/src/main/webapp/WEB-INF/web.xml
diff --git a/scripts/get-topology.sh b/scripts/get-topology.sh
new file mode 100755
index 0000000..834cf8b
--- /dev/null
+++ b/scripts/get-topology.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+# ------------------------------------------------------------------
+# Copyright © 2016 - 2017 Copyright (c) Sprint, Inc. and others. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0 which accompanies this distribution,
+# and is available at http://www.eclipse.org/legal/epl-v10.html
+# ------------------------------------------------------------------
+
+echo ""
+curl -i -s \
+--header "Content-type: application/json" \
+--request GET \
+-u onos:rocks \
+http://localhost:8181/onos/restconf/data/ietf-dmm-fpcagent:tenants/tenant=default/fpc-topology
+echo ""
diff --git a/scripts/httpserver.py b/scripts/httpserver.py
index 9dd33d8..39a29a3 100755
--- a/scripts/httpserver.py
+++ b/scripts/httpserver.py
@@ -40,7 +40,7 @@
do_DELETE = do_GET
def main():
- port = 9997
+ port = 8181
print('Listening on localhost:%s' % port)
server = HTTPServer(('', port), RequestHandler)
server.serve_forever()
@@ -53,4 +53,4 @@
" reflect")
(options, args) = parser.parse_args()
- main()
\ No newline at end of file
+ main()