use of com.vip.saturn.job.console.domain.NamespaceDomainInfo in project Saturn by vipshop.
the class NamespaceManagementRestApiController method create.
@Audit(type = AuditType.REST)
@RequestMapping(value = "/namespaces", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity<Object> create(@RequestBody Map<String, Object> reqParams, HttpServletRequest request) throws SaturnJobConsoleException {
try {
NamespaceDomainInfo namespaceInfo = constructNamespaceDomainInfo(reqParams);
registryCenterService.createNamespace(namespaceInfo);
return new ResponseEntity<>(HttpStatus.CREATED);
} catch (SaturnJobConsoleException e) {
throw e;
} catch (Exception e) {
throw new SaturnJobConsoleHttpException(HttpStatus.INTERNAL_SERVER_ERROR.value(), e.getMessage(), e);
}
}
use of com.vip.saturn.job.console.domain.NamespaceDomainInfo in project Saturn by vipshop.
the class NamespaceManagementRestApiController method constructNamespaceDomainInfo.
private NamespaceDomainInfo constructNamespaceDomainInfo(Map<String, Object> reqParams) throws SaturnJobConsoleException {
NamespaceDomainInfo namespaceInfo = new NamespaceDomainInfo();
namespaceInfo.setNamespace(checkAndGetParametersValueAsString(reqParams, "namespace", true));
namespaceInfo.setZkCluster(checkAndGetParametersValueAsString(reqParams, "zkCluster", true));
namespaceInfo.setContent("");
return namespaceInfo;
}
Aggregations