SDKs
Python SDK
Floating Server
26min
the user has the ability to utilize either a floating server docid\ f7mhpfdnpmazrtdq8iyxi or a floating server docid\ f7mhpfdnpmazrtdq8iyxi floating client this object is responsible for managing the operations on floating server docid\ uzgcwydxkcluyusc1lcsg floating manager this object is responsible for managing operations with the floating server docid\ uzgcwydxkcluyusc1lcsg , while also integrating the local license file docid\ fkfzhha n838tznrzu0sz 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 from licensespring floating server import floatingapiclient from licensespring hardware import hardwareidprovider api client = floatingapiclient(api protocol="http", api domain="localhost 8080",hardware id provider=hardwareidprovider) auth authenticate parameters username (str) username password (str) password from licensespring floating server import floatingapiclient api client = floatingapiclient(api protocol="http", api domain="localhost 8080",hardware id provider=hardwareidprovider) api client auth(username="admin",password="tetejac") 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 api client = floatingapiclient(api protocol="http", api domain="localhost 8080") response = api client register user( product="lkprod1", user="user 1", os hostname="bla", ip local="bla", user info="bla", license id=1728377159207169 ) print(response) 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 api client = floatingapiclient(api protocol="http", api domain="localhost 8080") response = api client unregister user(product="lkprod1",user="user 1",license id=1728377159207169) print(response) return (str) "user unregistered" unregister all unregister all users api client = floatingapiclient(api protocol="http", api domain="localhost 8080") api client unregister all() 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 api client = floatingapiclient(api protocol="http", api domain="localhost 8080") response = api client borrow( product="lkprod1", user="user 1", borrowed until="2029 05 06t00 00 00z", os hostname="bla", ip local="bla", user info="bla", license id=1728377159207169, ) print(response) 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 api client = floatingapiclient(api protocol="http", api domain="localhost 8080") response = api client add consumption(product="fs", consumptions=1) 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 api client = floatingapiclient(api protocol="http", api domain="localhost 8080") response = api client add feature consumption(product="fs", feature code="f2", consumptions=1) 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 api client = floatingapiclient(api protocol="http", api domain="localhost 8080") response = api client feature register( product="fs", feature code="f1", os hostname="w", ip local="1 0", user info="info" ) print(response) 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 api client = floatingapiclient(api protocol="http", api domain="localhost 8080") response = api client feature register( product="fs", feature code="f1", os hostname="w", ip local="1 0", user info="info" ) response = api client feature release(product="fs", feature code="f1") return (str) "feature released" floating manager to intialize floating manager python sdk configuration docid\ itdflahi s4knwy1gersk 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 from licensespring licensefile config import configuration from licensespring licensefile floating manager import floatingmanager fs manager = floatingmanager(conf=conf) fs manager auth(username="admin",password="tetejac") 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 from licensespring licensefile config import configuration from licensespring licensefile floating manager import floatingmanager conf = configuration( product=product, api key="arbitrary", shared key="arbitrary", file key="your file key", file iv="your file iv", api domain="api domain", api protocol="http/https", ) fs manager = floatingmanager(conf=conf) license = fs manager register() return (license) license object unregister unregister license parameters license id (int, optional) license id defaults to none fs manager = floatingmanager(conf=conf) \# there are multiple options to unregister a license \# 1 floating client > this one is documanted fs manager unregister() \# 2 1 license object > deactivate method license deactivate() \#2 2 license object > floating release license floating release(false) return (str) "user unregistered" unregister all unregister all users fs manager = floatingmanager(conf=conf) fs manager unregister all() 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 fs manager = floatingmanager(conf=conf) license = fs manager borrow("2031 05 06t00 00 00z") \# borrow can be also used within the license object license floating borrow("2031 05 06t00 00 00z") 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 fs manager = floatingmanager(conf=conf) response = fs manager is online() raises ex exception return (bool) true if server is online, otherwise false methods supported inside license object licensefile setup and usage docid\ vj8 jhyxrf8n3zkcamdy0 , licensefile setup and usage docid\ vj8 jhyxrf8n3zkcamdy0 , licensefile setup and usage docid\ vj8 jhyxrf8n3zkcamdy0 , licensefile setup and usage docid\ vj8 jhyxrf8n3zkcamdy0 are supported with licensefile setup and usage docid\ vj8 jhyxrf8n3zkcamdy0 object for floating server