Add Swagger comments and dependencies to appsm with REST APIs
ONOS-2704 and ONOS-2705
Change-Id: I77655af94f8b5aba647a94b3b786a6de8a285d7c
diff --git a/apps/virtualbng/pom.xml b/apps/virtualbng/pom.xml
index e42f888..835272a 100644
--- a/apps/virtualbng/pom.xml
+++ b/apps/virtualbng/pom.xml
@@ -34,6 +34,12 @@
<properties>
<onos.app.name>org.onosproject.virtualbng</onos.app.name>
<web.context>/onos/virtualbng</web.context>
+ <api.version>1.0.0</api.version>
+ <api.title>ONOS Virtual BNG Gateway REST API</api.title>
+ <api.description>
+ APIs for interacting with the Virtual Broadband Network Gateway (BNG) application.
+ </api.description>
+ <api.package>org.onosproject.virtualbng</api.package>
</properties>
<dependencies>
@@ -72,6 +78,10 @@
<configuration>
<instructions>
<_wab>src/main/webapp/</_wab>
+ <Include-Resource>
+ WEB-INF/classes/apidoc/swagger.json=target/swagger.json,
+ {maven-resources}
+ </Include-Resource>
<Bundle-SymbolicName>
${project.groupId}.${project.artifactId}
</Bundle-SymbolicName>
@@ -98,4 +108,4 @@
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
diff --git a/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngResource.java b/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngResource.java
index 36f8832..c6a9c9b 100644
--- a/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngResource.java
+++ b/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngResource.java
@@ -37,13 +37,21 @@
import org.slf4j.Logger;
/**
- * This class provides REST services to virtual BNG.
+ * REST services to interact with the virtual BNG.
*/
@Path("privateip")
public class VbngResource extends AbstractWebResource {
private final Logger log = getLogger(getClass());
+ /**
+ * Create a new virtual BNG connection.
+ *
+ * @param privateIp IP Address for the BNG private network
+ * @param mac MAC address for the host
+ * @param hostName name of the host
+ * @return public IP address for the new connection
+ */
@POST
@Path("{privateip}/{mac}/{hostname}")
public String privateIpAddNotification(@PathParam("privateip")
@@ -77,6 +85,12 @@
}
}
+ /**
+ * Delete a virtual BNG connection.
+ *
+ * @param privateIp IP Address for the BNG private network
+ * @return public IP address for the new connection
+ */
@DELETE
@Path("{privateip}")
public String privateIpDeleteNotification(@PathParam("privateip")
@@ -101,6 +115,11 @@
}
}
+ /**
+ * Query virtual BNG map.
+ *
+ * @return IP Address map
+ */
@GET
@Path("map")
@Produces(MediaType.APPLICATION_JSON)
@@ -119,4 +138,4 @@
return ok(result.toString()).build();
}
-}
\ No newline at end of file
+}