use of com.emc.storageos.db.client.model.uimodels.CatalogCategory in project coprhd-controller by CoprHD.
the class CatalogCategoryService method updateCatalogCategory.
/**
* Update info for catalog category
*
* @param catalogCategoryUpdate Catalog Category update parameters
* @param id the URN of a Catalog Category
* @prereq none
* @brief Update Catalog Category
* @return No data returned in response body
*/
@PUT
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}")
@CheckPermission(roles = { Role.TENANT_ADMIN }, acls = { ACL.OWN })
public CatalogCategoryRestRep updateCatalogCategory(@PathParam("id") URI id, CatalogCategoryUpdateParam catalogCategoryUpdate) {
CatalogCategory catalogCategory = getCatalogCategoryById(id, true);
StorageOSUser user = getUserFromContext();
verifyAuthorizedInTenantOrg(uri(catalogCategory.getTenant()), user);
URI parentCategoryId = getTargetParentCategoryId(catalogCategory, catalogCategoryUpdate);
validateCatalogCategoryParam(parentCategoryId, catalogCategoryUpdate, catalogCategory);
CatalogCategory parentCatalogCategory = parentCategoryId != null ? queryResource(parentCategoryId) : null;
updateCatalogCategoryObject(parentCatalogCategory, catalogCategory, catalogCategoryUpdate);
catalogCategoryManager.updateCatalogCategory(catalogCategory);
auditOpSuccess(OperationTypeEnum.UPDATE_CATALOG_CATEGORY, catalogCategory.auditParameters());
catalogCategory = catalogCategoryManager.getCatalogCategoryById(catalogCategory.getId());
return map(catalogCategory);
}
use of com.emc.storageos.db.client.model.uimodels.CatalogCategory in project coprhd-controller by CoprHD.
the class CatalogCategoryService method getCatalogCategoryById.
private CatalogCategory getCatalogCategoryById(URI id, boolean checkInactive) {
CatalogCategory catalogCategory = catalogCategoryManager.getCatalogCategoryById(id);
ArgValidator.checkEntity(catalogCategory, id, isIdEmbeddedInURL(id), checkInactive);
return catalogCategory;
}
use of com.emc.storageos.db.client.model.uimodels.CatalogCategory in project coprhd-controller by CoprHD.
the class CatalogServiceService method createCatalogService.
/**
* Creates a new catalog service
*
* @param createParam
* the parameter to create a new catalog service
* @prereq none
* @brief Create Catalog Service
* @return none
*/
@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());
// Refresh Objects
catalogService = catalogServiceManager.getCatalogServiceById(catalogService.getId());
catalogServiceFields = catalogServiceManager.getCatalogServiceFields(catalogService.getId());
ServiceDescriptor serviceDescriptor = getServiceDescriptor(catalogService);
return map(catalogService, serviceDescriptor, catalogServiceFields);
}
use of com.emc.storageos.db.client.model.uimodels.CatalogCategory in project coprhd-controller by CoprHD.
the class CatalogServiceService method getTenantOwner.
@Override
protected URI getTenantOwner(URI id) {
CatalogService catalogService = queryResource(id);
CatalogCategory parentCatalogCategory = catalogCategoryManager.getCatalogCategoryById(catalogService.getCatalogCategoryId().getURI());
return uri(parentCatalogCategory.getTenant());
}
use of com.emc.storageos.db.client.model.uimodels.CatalogCategory in project coprhd-controller by CoprHD.
the class CatalogCategoryMapper method createNewCatalogCategory.
public static CatalogCategory createNewCatalogCategory(CatalogCategory parentCatalogCategory, CatalogCategoryCreateParam param) {
CatalogCategory newCatalogCategory = new CatalogCategory();
newCatalogCategory.setId(URIUtil.createId(CatalogCategory.class));
newCatalogCategory.setTenant(param.getTenantId());
updateCatalogCategoryObject(parentCatalogCategory, newCatalogCategory, param);
return newCatalogCategory;
}
Aggregations