summaryrefslogtreecommitdiffstats
path: root/ResmanagementService/service/src
diff options
context:
space:
mode:
authorVictor Gao <victor.gao@huawei.com>2018-05-03 11:51:35 +0800
committerVictor Gao <victor.gao@huawei.com>2018-05-03 11:56:07 +0800
commit1a67d23396355b08033a7c8680084f224c3d9ec8 (patch)
tree63be10594d8442a2242c66dc85475382c09eb2ba /ResmanagementService/service/src
parentf73b93c5aeaa3380afb326e53180ed36967b65f5 (diff)
Update VimID in grant interface as optional
it should be optional from VNFM and Resouce Manager could provide the specific vim by specific rules (e.g. storage first or performance first). but for now,we dont have the interface/capability to pass the "rules"to resource Manager. resource Manager could integrate OOF which may provide this capabilities or interface. Change-Id: I91faba8d573680beecf81dc88a252e34150b3b0b Issue-ID: VFC-604 Signed-off-by: victor.gao <victor.gao@huawei.com>
Diffstat (limited to 'ResmanagementService/service/src')
-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 1afbcbb..c379571 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
*/