Search in sources :

Example 11 with License

use of com.emc.vipr.model.sys.licensing.License in project coprhd-controller by CoprHD.

the class Licensing method set.

/**
 * Add a license to the system.
 * <p>
 * API Call: POST /license
 *
 * @param licenseText The text for the license file to upload.
 */
public void set(String licenseText) {
    License license = new License();
    license.setLicenseText(licenseText);
    client.post(String.class, license, LICENSE_URL);
}
Also used : License(com.emc.vipr.model.sys.licensing.License)

Example 12 with License

use of com.emc.vipr.model.sys.licensing.License in project coprhd-controller by CoprHD.

the class ApiTestBase method isControllerLicensed.

protected boolean isControllerLicensed() {
    License license = rSys.path("/license").get(License.class);
    List<LicenseFeature> features = license.getLicenseFeatures();
    if (features == null) {
        return false;
    }
    for (LicenseFeature feature : features) {
        if (feature.getModelId().startsWith("ViPR_Controller") && feature.isLicensed()) {
            return true;
        }
    }
    return false;
}
Also used : LicenseFeature(com.emc.vipr.model.sys.licensing.LicenseFeature) License(com.emc.vipr.model.sys.licensing.License)

Example 13 with License

use of com.emc.vipr.model.sys.licensing.License in project coprhd-controller by CoprHD.

the class ApiTestBase method addControllerLicense.

protected void addControllerLicense() {
    License license = new License();
    license.setLicenseText(LICENSE_FILE);
    ClientResponse resp = rSys.path("/license").post(ClientResponse.class, license);
    Assert.assertEquals(200, resp.getStatus());
    Assert.assertTrue(isControllerLicensed());
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) License(com.emc.vipr.model.sys.licensing.License)

Aggregations

License (com.emc.vipr.model.sys.licensing.License)13 LicenseFeature (com.emc.vipr.model.sys.licensing.LicenseFeature)7 ELMFeatureDetail (com.emc.cams.elm.ELMFeatureDetail)1 ELMLicenseProps (com.emc.cams.elm.ELMLicenseProps)1 ELMLicenseSource (com.emc.cams.elm.ELMLicenseSource)1 ELMLicenseException (com.emc.cams.elm.exception.ELMLicenseException)1 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)1 InternalServerErrorException (com.emc.storageos.svcs.errorhandling.resources.InternalServerErrorException)1 CoordinatorClientException (com.emc.storageos.systemservices.exceptions.CoordinatorClientException)1 LocalRepositoryException (com.emc.storageos.systemservices.exceptions.LocalRepositoryException)1 SysClientException (com.emc.storageos.systemservices.exceptions.SysClientException)1 ClientResponse (com.sun.jersey.api.client.ClientResponse)1 Restrictions (controllers.deadbolt.Restrictions)1 IOException (java.io.IOException)1 Override (java.lang.Override)1 ParseException (java.text.ParseException)1 Date (java.util.Date)1 Test (org.junit.Test)1 Promise (play.libs.F.Promise)1 StorageStatsWrapper (util.StorageStatsWrapper)1