- Status ret = switchManager.removeNodeProp(node, propertyName);
- if (ret.isSuccess()) {
- return Response.ok().build();
+
+ SwitchConfig switchConfig = switchManager.getSwitchConfig(node.toString());
+ Status status;
+ if (switchConfig == null) {
+ status = new Status(StatusCode.NOTFOUND, "Switch Configuration does not exist");
+ } else {
+ Map<String, Property> nodeProperties = new HashMap<String, Property>(switchConfig.getNodeProperties());
+ if (!nodeProperties.containsKey(propertyName.toLowerCase())) {
+ String msg = "Property " + propertyName + " does not exist or not configured for switch " + nodeId;
+ status = new Status(StatusCode.NOTFOUND, msg);
+ } else {
+ nodeProperties.remove(propertyName.toLowerCase());
+ SwitchConfig newSwitchConfig = new SwitchConfig(node.toString(), nodeProperties);
+ status = switchManager.updateNodeConfig(newSwitchConfig);
+ if(status.isSuccess()){
+ NorthboundUtils.auditlog("Static Route", username, "updated", nodeId, containerName);
+ }
+ }