Commit 7628c9f5 authored by Spiros Koulouzis's avatar Spiros Koulouzis

added preferred provider parameter

parent 93c1f020
...@@ -78,16 +78,17 @@ public class PlannerController { ...@@ -78,16 +78,17 @@ public class PlannerController {
* Plans resources (number, size of VMs etc). * Plans resources (number, size of VMs etc).
* *
* @param toscaId. The id of the TOSCA description * @param toscaId. The id of the TOSCA description
* @param preferred_Provider * @param preferredProvider
* @return the id of the created plan * @return the id of the created plan
*/ */
@RequestMapping(value = "/plan/{tosca_id}", method = RequestMethod.GET, params = {"preferred_provider"}) @RequestMapping(value = "/plan/{tosca_id}", method = RequestMethod.GET, params = {"preferred_provider"})
@RolesAllowed({UserService.USER, UserService.ADMIN}) @RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody public @ResponseBody
String plan(@PathVariable("tosca_id") String toscaId, @RequestParam(value = "preferred_provider", required = false) String preferred_Provider) { String plan(@PathVariable("tosca_id") String toscaId,
@RequestParam(value = "preferred_provider", required = false) String preferredProvider) {
try { try {
PlanResponse plan = plannerService.getPlan(toscaId, preferred_Provider); PlanResponse plan = plannerService.getPlan(toscaId, preferredProvider);
if (plan == null) { if (plan == null) {
throw new NotFoundException("Could not make plan"); throw new NotFoundException("Could not make plan");
} }
......
...@@ -26,7 +26,7 @@ public class P2PConverter { ...@@ -26,7 +26,7 @@ public class P2PConverter {
public static SimplePlanContainer transfer(String plannerOutputJson, public static SimplePlanContainer transfer(String plannerOutputJson,
String userName, String domainName, String cloudProvider) throws JsonParseException, JsonMappingException, IOException, JSONException { String userName, String domainName, String cloudProvider) throws JsonParseException, JsonMappingException, IOException, JSONException {
cloudProvider = cloudProvider.toUpperCase();
List<Object> vmList = Converter.jsonString2List(plannerOutputJson); List<Object> vmList = Converter.jsonString2List(plannerOutputJson);
TopTopology topTopology = new TopTopology(); TopTopology topTopology = new TopTopology();
...@@ -166,7 +166,7 @@ public class P2PConverter { ...@@ -166,7 +166,7 @@ public class P2PConverter {
map = Converter.jsonString2Map((String) element); map = Converter.jsonString2Map((String) element);
} }
curVM.name = (String) map.get("name"); curVM.name = (String) map.get("name");
if (curVM.name==null){ if (curVM.name == null) {
curVM.name = "node_vm"; curVM.name = "node_vm";
} }
curVM.type = (String) map.get("type"); curVM.type = (String) map.get("type");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment