SDKs
Python SDK

Floating Server

26min

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:

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.
Python


auth

Authenticate

Parameters:

  • username (str): username
  • password (str): password
Python


Return(dict): Response

register_user

Register user

Parameters:

  • product (str): 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.
Python


Return(dict): Response

unregister_user

Unregister user

Parameters

  • product (str): product short code.
  • user (str,optional): user. Defaults uses hardware id.
  • license_id (int, optional): license id. Defaults to None.
Python


Return(str): "user_unregistered"

unregister_all

Unregister all users

Python


borrow

Borrow license

Parameters

  • product (str): 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.
Python


Return(dict): Response

add_consumption

Add license consumption

Parameters

  • product (str): 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.
Python


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.
Python


Return(dict): Response

feature_register

Register feature

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.
  • 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.
Python


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.
Python


Return(str): "feature_released"

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.

auth

Authenticate

Parameters:

  • username (str): username
  • password (str): password
Python


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.
Python


Return(License): License object

unregister

Unregister license

Parameters

  • license_id (int, optional): license id. Defaults to None.
Python


Return(str): "user_unregistered"

unregister_all

Unregister all users

Python


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.
Python


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.
Python


Raises:

  • ex: Exception

Return(bool): True if server is online, otherwise False

Methods supported inside License object

License consumptions, feature consumptions, register feature, release feature are supported with License object for Floating Server.