How To Programmatically Pull License Information

Overview

This article will show you how to programmatically pull license information including the amount of VMs used, how many VMs remaining, and the expiration date of your license.

Procedure

The code example below can be used to print out information about your CloudBolt License.

from product_license.cb_license import CloudBoltLicense

license = CloudBoltLicense()
expiration = license.expiry
active_srvrs = license.get_servers_used()
max_srvrs = license._feature.get("maximum_server_count")
rem_srvrs = max_srvrs - active_srvrs

print("Your license is valid until {}".format(expiration))
print("You are currently using {} VMs of your total {} VMs".format(active_srvrs, max_srvrs))
print("You have {} remaining VMs on your license".format(rem_srvrs))

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.