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. The commands are valid for CloudBolt version 2022.2.x - 2022.3.x

Procedure

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

from product_license.license_service import LicenseService

license = LicenseService()
expiration = license.get_license().get('expiration_date')
active_srvrs = license.get_servers_used()
max_srvrs = license.get_license().get('quantity')
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.