@RequestMapping(value = "/admin/accounts/{accountId}/pools", method = RequestMethod.POST) @ResponseBody public PoolConfigurationModel createAccountPool( @PathVariable("accountId") Long accountId, @RequestBody String poolSettingJson) { Long poolId = poolDao.createPool(accountId, poolSettingJson); nodeManagementExecutor.start(poolDao.readPoolById(poolId).poolSettings); return poolDao.readPoolById(poolId); }
@RequestMapping( value = "/admin/accounts/{accountId}/pools/{poolId}/delete", method = RequestMethod.POST) @ResponseBody public boolean deleteAccountPool( @PathVariable("accountId") Long accountId, @PathVariable("poolId") Long poolConfigurationId) { nodeManagementExecutor.stop(poolDao.readPoolById(poolConfigurationId).poolSettings); return poolDao.deletePool(poolConfigurationId, accountId); }
@RequestMapping(value = "/admin/accounts/{accountId}/pools/{poolId}", method = RequestMethod.POST) @ResponseBody public boolean updateAccountPool( @PathVariable("accountId") Long accountId, @PathVariable("poolId") Long poolConfigurationId, @RequestBody String newPoolSettingJson) { boolean updated = poolDao.updatePool(poolConfigurationId, accountId, newPoolSettingJson); nodeManagementExecutor.update(poolDao.readPoolById(poolConfigurationId).poolSettings); return updated; }