use of com.emc.vipr.model.catalog.CatalogUpgrade in project coprhd-controller by CoprHD.
the class CatalogCategories method upgradeAvailable.
/**
* Determines if an upgrade is available to the service catalog
* <p>
* API Call: <tt>GET /catalog/upgrade</tt>
*
* @param tenantId
* the ID of the tenant
*/
public boolean upgradeAvailable(URI tenantId) {
UriBuilder uriBuilder = client.uriBuilder(PathConstants.CATALOG_UPGRADE_URI);
if (tenantId != null) {
uriBuilder = uriBuilder.queryParam(SearchConstants.TENANT_ID_PARAM, tenantId);
}
CatalogUpgrade response = client.getURI(CatalogUpgrade.class, uriBuilder.build());
return response != null && response.getUpgradeAvailable();
}
use of com.emc.vipr.model.catalog.CatalogUpgrade in project coprhd-controller by CoprHD.
the class CatalogCategoryService method upgradeAvailable.
/**
* Check to see if an update to the service catalog is available
*
* @prereq none
* @brief Check for Service Catalog Update
* @return True if Update Available
*/
@GET
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.TENANT_ADMIN })
@Path("/upgrade")
public CatalogUpgrade upgradeAvailable(@DefaultValue("") @QueryParam(SearchConstants.TENANT_ID_PARAM) String tenantId) {
StorageOSUser user = getUserFromContext();
if (StringUtils.isBlank(tenantId)) {
tenantId = user.getTenantId();
}
verifyAuthorizedInTenantOrg(uri(tenantId), user);
CatalogUpgrade catalogUpgrade = new CatalogUpgrade();
catalogUpgrade.setUpgradeAvailable(catalogCategoryManager.isCatalogUpdateAvailable(uri(tenantId)));
return catalogUpgrade;
}
Aggregations