1 package org.onap.vid.controller;
3 import org.onap.portalsdk.core.controller.RestrictedBaseController;
4 import org.onap.vid.properties.Features;
5 import org.springframework.http.MediaType;
6 import org.springframework.web.bind.annotation.RequestMapping;
7 import org.springframework.web.bind.annotation.RequestMethod;
8 import org.springframework.web.bind.annotation.ResponseBody;
9 import org.springframework.web.bind.annotation.RestController;
11 import java.util.HashMap;
15 @RequestMapping("flags")
16 public class FeatureTogglingController extends RestrictedBaseController {
18 @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
19 public @ResponseBody Map<String,Boolean> getFeatureToggles()
21 HashMap<String,Boolean> flags = new HashMap <>();
22 for(Features flag : Features.values()){
23 flags.put(flag.name(), flag.isActive());