Application Programming Interfaces

This document defines the APIs that are being produced or consumed by the license management sub-component in Acumos.

LicenseProfile.validate

Validate given License Profile JSON text based on $schema property.

Example api call:

// where client is instance of ICommonDataServiceRestClient
LicenseProfile licProfile = new LicenseProfile(client);
LicenseProfileValidationResults results = licProfile.validate(licProfileJson);
boolean isValid = results.getJsonSchemaErrors().isEmpty();

Learn more in LicenseJsonValidationResults java docs

LicenseProfile.getTemplates

Fetch list of default License Profile Templates.

Example api call:

// where client is instance of ICommonDataServiceRestClient
LicenseProfile licProfile = new LicenseProfile(client);
List<MLPLicenseProfileTemplate> templates = licProfile.getTemplates();

Learn more in LicenseProfile java docs

LicenseProfile.getTemplate(templateID)

Fetch License Profile Template for given templateID.

Example api call:

// where client is instance of ICommonDataServiceRestClient
LicenseProfile licProfile = new LicenseProfile(client);
// where licProTplId is templateID of specific License Profile Template
// to fetch
MLPLicenseProfileTemplate licProTpl = licProfile.getTemplate(licProTplId);

Learn more in LicenseProfile java docs

LicenseAsset.register

Method fetches information about the ML model (nexus and CDS) and registers the software with License Usage Manager.

// where cdsClient is instance of ICommonDataServiceRestClient
// LUM_SERVER is url of the LUM service
// NEXUS_SERVER is the url of the nexus service
LicenseAsset asset = new LicenseAsset(cdsClient, LUM_SERVER, NEXUS_SERVER);
RegisterAssetRequest request = new RegisterAssetRequest();
request.setSolutionId(solutionId);
request.setRevisionId(revisionId);
request.setLoggedIdUser(loggedInUser);
CompletableFuture<RegisterAssetResponse> responseFuture = asset.register(request);
RegisterAssetResponse response = responseFuture.get();

Learn more in LicenseAsset java docs

LicenseRtuVerifier.verifyRtu

Method fetches information about the ML model (nexus and CDS) and registers the software with License Usage Manager.

VerifyLicenseRequest licenseDownloadRequest =
    new VerifyLicenseRequest(
        licenseAction, solutionId, revisionId, loggedInUserId, assetUsageId);
licenseDownloadRequest.setAction(licenseAction);
LicenseRtuVerifier licenseVerifier = new LicenseRtuVerifier(LUM_SERVER);
CompletableFuture<LicenseRtuVerification> verifyUserRTU =
    licenseVerifier.verifyRtu(licenseDownloadRequest);

Learn more in LicenseRtuVerifier java docs