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

LicenseAsset.getEntitledSwidTagsByUser

Method fetches all the available SwidTags from LUM based on particular user.

// where cdsClient is instance of ICommonDataServiceRestClient
// LUM_SERVER is url of the LUM service
// NEXUS_SERVER is the url of the nexus service
LicenseAsset licenseAsset = new LicenseAsset(cdsClient, LUM_SERVER, NEXUS_SERVER);
String userId;
    String action;
    CompletableFuture<GetEntitledSwidTagsResponse> getEntitledSwidTagsFuture =
    licenseAsset.getEntitledSwidTagsByUser(userId, action);
GetEntitledSwidTagsResponse response = getEntitledSwidTagsFuture.get();

LicenseAsset.getAssetUsageAgreement

Method is used for import the data from LUM.

// where cdsClient is instance of ICommonDataServiceRestClient
// LUM_SERVER is url of the LUM service
// NEXUS_SERVER is the url of the nexus service
LicenseAsset licenseAsset = new LicenseAsset(cdsClient, LUM_SERVER, NEXUS_SERVER);
String softwareLicensorId;
    String assetUsageAgreementId;
    CompletableFuture<GetAssetUsageAgreementResponse> responseFuture =
    licenseAsset.getAssetUsageAgreement(softwareLicensorId, assetUsageAgreementId);
GetAssetUsageAgreementResponse response = responseFuture.get();

LicenseAsset.putAssetUsageAgreement

Method is used for export the data into LUM.

// where cdsClient is instance of ICommonDataServiceRestClient
// LUM_SERVER is url of the LUM service
// NEXUS_SERVER is the url of the nexus service
LicenseAsset licenseAsset = new LicenseAsset(cdsClient, LUM_SERVER, NEXUS_SERVER);
String softwareLicensorId;
    String assetUsageAgreementId;
    PutAssetUsageAgreementRequest request = new PutAssetUsageAgreementRequest();
    CompletableFuture<PutAssetUsageAgreementResponse> responseFuture =
    licenseAsset.putAssetUsageAgreement(softwareLicensorId, assetUsageAgreementId,request);
PutAssetUsageAgreementResponse response = responseFuture.get();

LicenseAsset.putAssetUsageAgreementRestriction

Method is used for export the data into LUM with Restriction.

// where cdsClient is instance of ICommonDataServiceRestClient
// LUM_SERVER is url of the LUM service
// NEXUS_SERVER is the url of the nexus service
LicenseAsset licenseAsset = new LicenseAsset(cdsClient, LUM_SERVER, NEXUS_SERVER);
String softwareLicensorId;
    String assetUsageAgreementId;
    PutAssetUsageAgreementRestrictionRequest request = new PutAssetUsageAgreementRestrictionRequest();
    CompletableFuture<PutAssetUsageAgreementResponse> responseFuture =
    licenseAsset.putAssetUsageAgreementRestriction(softwareLicensorId, assetUsageAgreementId,request);
PutAssetUsageAgreementResponse response = responseFuture.get();