diff options
author | Ittay Stern <ittay.stern@att.com> | 2019-01-10 12:42:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-01-10 12:42:59 +0000 |
commit | 659874df80409170e57b6dd6197eb3a81eb3468e (patch) | |
tree | 08e79fd57aa0ed299586fd88f69f87a5a2f5ded1 /vid-app-common/src/main/java/org/onap/vid/controller/FeatureTogglingController.java | |
parent | 143784a849ece4fc35cc290e33f829b72bf1fc79 (diff) | |
parent | 6ad41e3ccd398a2721f41ad61c80b7bb03f7d127 (diff) |
Merge "Merge from ECOMP's repository"
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/controller/FeatureTogglingController.java')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/controller/FeatureTogglingController.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/FeatureTogglingController.java b/vid-app-common/src/main/java/org/onap/vid/controller/FeatureTogglingController.java new file mode 100644 index 00000000..a90e71d4 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/controller/FeatureTogglingController.java @@ -0,0 +1,29 @@ +package org.onap.vid.controller; + +import org.onap.portalsdk.core.controller.RestrictedBaseController; +import org.onap.vid.properties.Features; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping("flags") +public class FeatureTogglingController extends RestrictedBaseController { + + @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody Map<String,Boolean> getFeatureToggles() + { + HashMap<String,Boolean> flags = new HashMap <>(); + for(Features flag : Features.values()){ + flags.put(flag.name(), flag.isActive()); + } + return flags; + + + } +} |