Floating Server
The user has the ability to utilize either a Floating Client or a Floating Manager:
Floating Client:
This object is responsible for managing the operations on Floating Server
Floating Manager:
This object is responsible for managing operations with the Floating Server, while also integrating the Local License File
Floating Client
Initialization
To initialize a Floating Client, the user must specify the API protocol and domain.
api_protocol: Defines the communication protocol between the client and the server (e.g., "http").
api_domain: Specifies the domain or IP address and port of the Floating Server (e.g., "localhost:8080").
hardware_id_provider (optional): Provides the client's hardware ID, which can be used to uniquely identify the client machine.
certificate_chain_path (optional, str): The certificate path is provided during provisioning and is only applicable to Floating Server v2 (e.g "path_to_chain.chain.pem").
verify_license_signature (optional, bool): Signature verification, if enforced, is only applicable to Floating Server v2. Default
true
from licensespring.floating_server import FloatingAPIClient
from licensespring.hardware import HardwareIdProvider
api_client = FloatingAPIClient(api_protocol="http",api_domail="localhost:8080",certificate_chain_path="path_to_pem_file/chain.pem") auth
Authenticate
Parameters:
username (str): username
password (str): password
Return (dict): Response
register_user
Register user
Parameters:
product (str,optional): product short code.
user (str,optional): user. Defaults uses hardware id.
os_hostname (str, optional): os hostname. Defaults to None.
ip_local (str, optional): ip local. Defaults to None.
user_info (str, optional): user info. Defaults to None.
license_id (int, optional): license id. Defaults to None.
Return (dict): Response
unregister_user
Unregister user
Parameters
product (str,optional): product short code.
user (str,optional): user. Defaults uses hardware id.
license_id (int, optional): license id. Defaults to None.
Return (str): "user_unregistered"
unregister_all
Unregister all users
borrow
Borrow license
Parameters
product (str, optional): product short code.
user (str,optional): user. Defaults uses hardware id.
borrowed_until (str): borrow until date
os_hostname (str, optional): os hostname. Defaults to None.
ip_local (str, optional): ip local. Defaults to None.
user_info (str, optional): user info. Defaults to None.
license_id (int, optional): license id. Defaults to None.
Return (dict): Response
add_consumption
Add license consumption
Parameters
product (str, optional): product short code
consumptions (int, optional): consumptions. Defaults to 1.
max_overages (int, optional): max overages. Defaults to None.
allow_overages (bool, optional): allow overages. Defaults to None.
user (str, optional): user (default uses hardware id)
license_id (int, optional): license id. Defaults to None.
Return (dict): Response
add_feature_consumption
Add feature consumption
Parameters
product (str): product short code
feature_code (str): feature code
user (str, optional): user (default uses hardware id)
consumptions (int, optional): consumptions. Defaults to 1.
license_id (int, optional): license id. Defaults to None.
Return (dict): Response
feature_register
Register feature
Parameters
product (str,optional): product short code
feature_code (str): feature short code
user (str, optional): user (default uses hardware id)
license_id (int, optional): license id. Defaults to None.
borrowed_until (str): borrow until (e.g. 2029-05-06T00:00:00Z)
os_hostname (str, optional): os hostname. Defaults to None.
ip_local (str, optional): ip local. Defaults to None.
user_info (str, optional): user info. Defaults to None.
Return (dict): Response
feature_release
Feature release
Parameters
product (str): product short code
feature_code (str): feature short code
user (str, optional): user (default uses hardware id)
license_id (int, optional): license id. Defaults to None.
Return (str): "feature_released"
fetch_licenses
List licenses
Parameters
product (str,optional): product short code filter
Floating Manager
To intialize Floating Manager Python SDK Configuration needs to be created. For Floating server you can set arbitrary values for shared_key and api_key keys. Signature verification is available in Floating Server v2. To enable it in the SDK, provide the .pem certificate path in the Configuration object.
auth
Authenticate
Parameters:
username (str): username
password (str): password
Return (dict): Response
register
Register license
Parameters:
os_hostname (str, optional): os hostname. Defaults to None.
ip_local (str, optional): ip local. Defaults to None.
user_info (str, optional): user info. Defaults to None.
license_id (int, optional): license id. Defaults to None.
Return (License): License object
unregister
Unregister license
Parameters
license_id (int, optional): license id. Defaults to None.
Return (str): "user_unregistered"
unregister_all
Unregister all users
borrow
Borrow license
Parameters
borrowed_until (str): borrow until date
os_hostname (str, optional): os hostname. Defaults to None.
ip_local (str, optional): ip local. Defaults to None.
user_info (str, optional): user info. Defaults to None.
license_id (int, optional): license id. Defaults to None.
Return (License): License object
is_online
Checks if floating server is online
Parameters
throw_e (bool, optional): True if you want to raise an exception. Defaults to False.
Raises:
ex: Exception
Return (bool): True if server is online, otherwise False
fetch_licenses
List licenses
Parameters
product (str,optional): product short code filter
Return (dict): Response
Methods supported inside License object
License consumptions, feature consumptions, register feature, release feature are supported with License object for Floating Server.
Was this helpful?