summaryrefslogtreecommitdiffstats
path: root/nokia/vnfmdriver
diff options
context:
space:
mode:
authorFu Jinhua <fu.jinhua@zte.com.cn>2017-10-19 10:03:18 +0000
committerGerrit Code Review <gerrit@onap.org>2017-10-19 10:03:18 +0000
commitf089d0903beb6b87cccc7aad62352469c93189ea (patch)
treead021979e96705e4d10608744dfc78862854d030 /nokia/vnfmdriver
parent11543d661527fca4bab167ee50ff1886465dadb4 (diff)
parent15d0a2646c2fb6ce75fdd90fd972df70fb9acee0 (diff)
Merge "add swagger.json display part"
Diffstat (limited to 'nokia/vnfmdriver')
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/pom.xml7
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java7
2 files changed, 13 insertions, 1 deletions
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/pom.xml b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/pom.xml
index 89b06760..b12c681e 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/pom.xml
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/pom.xml
@@ -97,7 +97,12 @@
<scope>test</scope>
</dependency>
-
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.5</version>
+ </dependency>
+
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java
index 25fef06d..c4826862 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java
@@ -21,6 +21,7 @@ import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.apache.http.HttpStatus;
+import org.apache.commons.io.IOUtils;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.exception.VnfmDriverException;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.HealVnfRequest;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.HealVnfResponse;
@@ -56,6 +57,12 @@ public class VnfmDriverController {
private Gson gson = new Gson();
+ @RequestMapping(value = "/swagger.json", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ public String apidoc() throws IOException {
+ ClassLoader classLoader = getClass().getClassLoader();
+ return IOUtils.toString(classLoader.getResourceAsStream("swagger.json"));
+ }
+
@RequestMapping(value = "/{vnfmId}/vnfs", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public InstantiateVnfResponse instantiateVnf(@RequestBody InstantiateVnfRequest request, @PathVariable("vnfmId") String vnfmId, HttpServletResponse httpResponse)