@POST @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @CheckPermission(roles={Role.TENANT_ADMIN},acls={ACL.OWN}) @Path("") public CatalogServiceRestRep createCatalogService(CatalogServiceCreateParam createParam){
  StorageOSUser user=getUserFromContext();
  CatalogCategory parentCatalogCategory=catalogCategoryManager.getCatalogCategoryById(createParam.getCatalogCategory());
  verifyAuthorizedInTenantOrg(uri(parentCatalogCategory.getTenant()),user);
  validateParam(createParam,null);
  CatalogService catalogService=createNewObject(createParam,parentCatalogCategory);
  List<CatalogServiceField> catalogServiceFields=createNewObjectList(catalogService,createParam.getCatalogServiceFields());
  catalogServiceManager.createCatalogService(catalogService,catalogServiceFields);
  auditOpSuccess(OperationTypeEnum.CREATE_CATALOG_SERVICE,catalogService.auditParameters());
  catalogService=catalogServiceManager.getCatalogServiceById(catalogService.getId());
  catalogServiceFields=catalogServiceManager.getCatalogServiceFields(catalogService.getId());
  ServiceDescriptor serviceDescriptor=getServiceDescriptor(catalogService);
  return map(catalogService,serviceDescriptor,catalogServiceFields);
}

@ POST @ Consumes ( { MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) @ Produces ( { MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) @ CheckPermission ( roles = { Role . TENANT_ADMIN } , acls = { ACL . OWN } ) @ Path ( "" ) public CatalogServiceRestRep createCatalogService ( CatalogServiceCreateParam createParam ) { StorageOSUser user = getUserFromContext ( ) ; CatalogCategory parentCatalogCategory = catalogCategoryManager . getCatalogCategoryById ( createParam . getCatalogCategory ( ) ) ; verifyAuthorizedInTenantOrg ( uri ( parentCatalogCategory . getTenant ( ) ) , user ) ; validateParam ( createParam , null ) ; CatalogService catalogService = createNewObject ( createParam , parentCatalogCategory ) ; List < CatalogServiceField > catalogServiceFields = createNewObjectList ( catalogService , createParam . getCatalogServiceFields ( ) ) ; catalogServiceManager . createCatalogService ( catalogService , catalogServiceFields ) ; auditOpSuccess ( OperationTypeEnum . CREATE_CATALOG_SERVICE , catalogService . auditParameters ( ) ) ; catalogService = catalogServiceManager . getCatalogServiceById ( catalogService . getId ( ) ) ; catalogServiceFields = catalogServiceManager . getCatalogServiceFields ( catalogService . getId ( ) ) ; ServiceDescriptor serviceDescriptor = getServiceDescriptor ( catalogService ) ; return map ( catalogService , serviceDescriptor , catalogServiceFields ) ; }
creates a new catalog service
