Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
jrevillard
Contributor
Contributor

repctl.sh importlicense format

Hello,

We have a perpetual license for Qlick Replicate that I would like to be able to register automatically in an ansible jobs (like you already have in your dockerfile construction script.

This license is in txt format but it seems that "repctl.sh importlicense ..." needs a json format isn't it ?

Could you tell me the exact format needed please ?

Best,

Jerome

 

Labels (2)
1 Solution

Accepted Solutions
Heinvandenheuvel
Specialist III
Specialist III

You should be able to use any scripting / editing language of your choice to transform a text style license to JSON.

The biggest 'trick' is that the various values need to be inside a block labeled: "cmd.license": {   ...   }

Below an example I named make_license_json.pl in Perl 

hth,

Hein.

#
# Usage: 
# Step 1: >> perl make_license_json.pl license.txt > license.json
# Step 2: >> repctl [-d <replicate_data_dir>] importlicense license_file=<location>license.json
#
# Enjoy! Hein van den Heuvel
#
$comma = q();              # Will become a a comma
for (<>) {
	next if /^\s*#/;       # Comment?
	if (/license_type=/) { # Looks like a license file?}
		$license=1;
		print qq({\n\t"cmd.license":\t{);  # Open up the JSON structure
	}
	next unless $license and /=/;
	chomp;                 # Remove New-line
	s/=/":"/;
	print qq(${comma}\n\t\t"${_}");
	$comma = q(,);         # Now it must become real
}
print qq(\n\t}\n}\n);      # And close the JSON structure

View solution in original post

5 Replies
john_wang
Support
Support

Hello @jrevillard ,

Yes, the command line request a JSON format.

Can you please send the license file (by private message!) to me ? I can try to convert it to JSON.

BTW, let me know your Replicate Version.

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
jrevillard
Contributor
Contributor
Author

Private message sent @john_wang . Thanks for your help !

Heinvandenheuvel
Specialist III
Specialist III

You should be able to use any scripting / editing language of your choice to transform a text style license to JSON.

The biggest 'trick' is that the various values need to be inside a block labeled: "cmd.license": {   ...   }

Below an example I named make_license_json.pl in Perl 

hth,

Hein.

#
# Usage: 
# Step 1: >> perl make_license_json.pl license.txt > license.json
# Step 2: >> repctl [-d <replicate_data_dir>] importlicense license_file=<location>license.json
#
# Enjoy! Hein van den Heuvel
#
$comma = q();              # Will become a a comma
for (<>) {
	next if /^\s*#/;       # Comment?
	if (/license_type=/) { # Looks like a license file?}
		$license=1;
		print qq({\n\t"cmd.license":\t{);  # Open up the JSON structure
	}
	next unless $license and /=/;
	chomp;                 # Remove New-line
	s/=/":"/;
	print qq(${comma}\n\t\t"${_}");
	$comma = q(,);         # Now it must become real
}
print qq(\n\t}\n}\n);      # And close the JSON structure
john_wang
Support
Support

Hi @jrevillard ,

Sorry I just come back from a 2 hours remote session. 

It's great @Heinvandenheuvel is around here and provide a great option. thank you so much.

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
jrevillard
Contributor
Contributor
Author

Thanks to both of you ! I will try it as soon as possible.

Best,

Jerome