1 package org.onap.vid.controllers;
3 import org.onap.vid.services.RoleGeneratorService;
4 import org.onap.portalsdk.core.controller.UnRestrictedBaseController;
5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.http.HttpStatus;
7 import org.springframework.http.ResponseEntity;
8 import org.springframework.web.bind.annotation.PathVariable;
9 import org.springframework.web.bind.annotation.RequestMapping;
10 import org.springframework.web.bind.annotation.RequestMethod;
11 import org.springframework.web.bind.annotation.RestController;
14 public class RoleGeneratorController extends UnRestrictedBaseController {
16 private RoleGeneratorService roleGeneratorService;
17 public static final String GENERATE_ROLE_SCRIPT = "generateRoleScript";
18 @RequestMapping(value = GENERATE_ROLE_SCRIPT +"/{firstRun}", method = RequestMethod.GET )
19 public ResponseEntity<String> generateRoleScript (@PathVariable("firstRun") boolean firstRun) {
20 ResponseEntity<String> response = null;
21 String query = roleGeneratorService.generateRoleScript(firstRun);
22 response = new ResponseEntity<String>(query, HttpStatus.OK);