summaryrefslogtreecommitdiffstats
path: root/ResmanagementService/service
diff options
context:
space:
mode:
authorYan Yang <yangyanyj@chinamobile.com>2018-07-26 01:11:02 +0000
committerGerrit Code Review <gerrit@onap.org>2018-07-26 01:11:02 +0000
commitf352d0b8cc95a425ab1593689eac06224b6f485c (patch)
tree7e3982cf5358f3edc8d7b9f58b9ad9e1f403a8e2 /ResmanagementService/service
parente3332f29723ffbdea6f20dacdc3743da23f81a79 (diff)
parent1a67d23396355b08033a7c8680084f224c3d9ec8 (diff)
Merge "Update VimID in grant interface as optional"
Diffstat (limited to 'ResmanagementService/service')
-rw-r--r--ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/group/impl/GrantResServiceImpl.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/group/impl/GrantResServiceImpl.java b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/group/impl/GrantResServiceImpl.java
index 6efa099..a2a82fd 100644
--- a/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/group/impl/GrantResServiceImpl.java
+++ b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/group/impl/GrantResServiceImpl.java
@@ -72,10 +72,18 @@ public class GrantResServiceImpl implements GrantResService {
return result;
}
+ private String getVimId(JSONObject object) {
+ String vimId = "";
+ if (object.containsKey(ParamConstant.PARAM_VIMID)){
+ vimId = object.getString(ParamConstant.PARAM_VIMID);
+ }
+ // TODO: Need integrate OOF to get vimID in R3.
+ return vimId;
+ }
@Override
public JSONObject grantResourceReal(JSONObject object) throws ServiceException {
LOGGER.info("function=grantResource; object: {}", object.toString());
- String vimId = object.getString(ParamConstant.PARAM_VIMID);
+ String vimId = getVimId(object);
JSONObject vimJson = VimUtil.getVimById(vimId);
JSONObject vim = parseVim(vimJson);
String resType = "";
@@ -168,7 +176,7 @@ public class GrantResServiceImpl implements GrantResService {
/**
* <br>
*
- * @param addResource
+ * @param getGrantResource
* @return
* @since VFC 1.0
*/