Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Automating license upload

 I am trying to automate the install of an environment for various testing and education purposes. I would like, as part of my scripted setup, to be able to upload a license file. However, I've hit a brick wall. I can find no ANT or REST api to access the license service. I was able to find the ILicenseAdminService in the Java API however. The problem, though is that when trying to upload a license file, I get a Java error (MarshallerNotDefinedException)  that I cannot get past. The code I use is posted below.


Is anyone aware of any method to automate uploading a license without having to go through the Web UI manually?

  private static void setupLicenses(Properties props, ITeamRepository repo)
throws IOException, TeamRepositoryException {
// Add a complete developer license to allow all students to access
// ILicenseAdminService2 licenseAdminService = (ILicenseAdminService2)
// ((TeamRepository) repo)
// .getServiceInterface(ILicenseAdminService2.class);
ILicenseAdminService licenseAdminService = (ILicenseAdminService) ((IClientLibraryContext) repo)
.getServiceInterface(ILicenseAdminService.class);
UsedLicenseInfoDTO licenseInfo;
// licenseInfo = licenseAdminService.
String iepFileLocation = props.getProperty("license.developer.iep");
Path path = Paths.get(iepFileLocation);

byte[] licenseFileContents = Files.readAllBytes(path);
///Below line generates the following error:
Mar 15, 2019 10:44:26 AM com.strongback.rtc.setup.SetupManager setupProject
WARNING: com.ibm.team.repository.common.internal.marshal.MarshallerNotDefinedException: CRJAZ0131I Marshaller not defined for type "byte[]".
/
licenseAdminService.addLicense(licenseFileContents);
String iepLicenseId = "com.ibm.rtc.developer-iep.floating";
licenseAdminService.setLicensePurchaseCount(iepLicenseId, 60);
}

0 votes


Be the first one to answer this question!

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927
× 7,487

Question asked: Mar 29 '19, 4:55 p.m.

Question was seen: 1,421 times

Last updated: Mar 29 '19, 4:57 p.m.

Confirmation Cancel Confirm