summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
*/