diff options
author | 2018-11-02 10:42:43 +0800 | |
---|---|---|
committer | 2018-11-02 10:48:37 +0800 | |
commit | c8dd8fb4f264ee655d865c233938f28152291770 (patch) | |
tree | 94ae2593dd2589dec27947a6e5c129bf0c04ea2b /server | |
parent | 7f3cd4ccd60fea5f579d8e963531ae9d611dac8e (diff) |
Support NS Instance Restart for VF-C
Change-Id: I411ecfac1c848f314b8e1d5d06a79e58593232e9
Issue-ID: USECASEUI-163
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
Diffstat (limited to 'server')
4 files changed, 32 insertions, 0 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java index f580a9fc..64d5f591 100644 --- a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java @@ -248,4 +248,9 @@ public class PackageDistributionController { public String scaleNetworkServiceInstance(HttpServletRequest request,@RequestParam String ns_instance_id){ return packageDistributionService.scaleNetworkServiceInstance(request,ns_instance_id); } + + @RequestMapping(value = {"/uui-lcm/VnfInfo/{vnfinstid}"}, method = RequestMethod.POST , produces = "application/json") + public String getVnfInfoById(@PathVariable String vnfinstid){ + return packageDistributionService.getVnfInfoById(vnfinstid); + } } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java index cd490381..2c89dadd 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java @@ -95,4 +95,6 @@ public interface PackageDistributionService { String healNetworkServiceInstance(HttpServletRequest request,String networkServiceInstanceId); String scaleNetworkServiceInstance(HttpServletRequest request,String networkServiceInstanceId); + + String getVnfInfoById(String vnfinstid); } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java index 9495477f..fdc11b57 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java @@ -117,4 +117,7 @@ public interface VfcService { @DELETE("/api/nsd/v1/pnf_descriptors/{pnfdInfoId}") Call<ResponseBody> deletePnfdPackage(@Path("pnfdInfoId") String pnfdInfoId); + + @GET("/api/nslcm/v1/ns/vnfs/{vnfinstid}") + Call<ResponseBody> getVnfInfoById(@Path("vnfinstid") String vnfinstid); } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java index c4c6a20b..25598f09 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java @@ -737,4 +737,26 @@ public class DefaultPackageDistributionService implements PackageDistributionSer } return result; } + + @Override + public String getVnfInfoById(String vnfinstid) { + + String result=""; + try { + logger.info("vfc getVnfInfoById is starting!"); + Response<ResponseBody> response = this.vfcService.getVnfInfoById(vnfinstid).execute(); + logger.info("vfc getVnfInfoById has finished!"); + if (response.isSuccessful()) { + result=new String(response.body().bytes()); + } else { + logger.info(String.format("Can not get getVnfInfoById[code=%s, message=%s]", response.code(), response.message())); + result=Constant.CONSTANT_FAILED;; + } + } catch (IOException e) { + logger.error("getVnfInfoById occur exception:"+e); + result=Constant.CONSTANT_FAILED;; + } + return result; + + } } |