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);
}
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;
}
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());
}
Aggregations