@ RequestMapping ( value = "api/servergroup" , method = RequestMethod . POST ) public @ ResponseBody ServerGroup createServerGroup ( Model model , @ RequestParam ( value = "name" ) String name , @ RequestParam ( value = "profileId" , required = false ) Integer profileId , @ RequestParam ( value = "profileIdentifier" , required = false ) String profileIdentifier ) throws Exception { if ( profileId == null && profileIdentifier == null ) { throw new Exception ( "profileId required" ) ; } if ( profileId == null ) { profileId = ProfileService . getInstance ( ) . getIdFromName ( profileIdentifier ) ; } int groupId = ServerRedirectService . getInstance ( ) . addServerGroup ( name , profileId ) ; return ServerRedirectService . getInstance ( ) . getServerGroup ( groupId , profileId ) ; }
Create a new server group for a profile