> For the complete documentation index, see [llms.txt](https://docs.licensespring.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.licensespring.com/sdks/python-sdk/floating-server.md).

# Floating Server

The user has the ability to utilize either a [**Floating Client**](/sdks/python-sdk/floating-server.md#floating-client) or a [**Floating Manager**](file:///#floating-manager):

Floating Client:

* This object is responsible for managing the operations on [**Floating Server**](/floating-server/floating-server.md)

Floating Manager:

* This object is responsible for managing operations with the [**Floating Server**](/floating-server/floating-server.md), while also integrating the [**Local License File**](/sdks/tutorials/best-practices/local-license-file.md)

### 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`

```python
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

```python
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,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.

```python
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,optional): product short code.
* **user** (str,optional): user. Defaults uses hardware id.
* **license\_id** (int, optional): license id. Defaults to None.

```python
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

```python
api_client = FloatingAPIClient(api_protocol="http", api_domain="localhost:8080")

api_client.unregister_all()
```

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

```python
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, 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.

```python
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.

```python
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,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.

```python
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.

```python
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"

#### fetch\_licenses

List licenses

Parameters

* **product** (str,optional): product short code filter

```python
api_client = FloatingAPIClient(api_protocol="http", api_domain="localhost:8080")

response = api_client.fetch_licenses(product="test")
print(response)
```

### Floating Manager

To intialize Floating Manager [**Python SDK Configuration**](/sdks/tutorials/getting-started/python/python-sdk-configuration.md#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

```python
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.

```python
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",
    certificate_chain_path="path_to_chain.pem"
)

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.

```python
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

```python
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.

```python
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.

```python
fs_manager = FloatingManager(conf=conf)
response = fs_manager.is_online()
```

Raises:

* **ex**: Exception

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

#### fetch\_licenses

List licenses

Parameters

* **product** (str,optional): product short code filter

```python
fs_manager = FloatingManager(conf=conf)

response = fs_manager.fetch_licenses(product="test")
print(response)
```

Return (dict): Response

#### Methods supported inside License object

[**License consumptions**](/sdks/python-sdk/licensefile-setup-and-usage.md#add_local_consumption), [**feature consumptions**](/sdks/python-sdk/licensefile-setup-and-usage.md#add_local_feature_consumption), [**register feature**](/sdks/python-sdk/licensefile-setup-and-usage.md#check_feature), [**release feature**](/sdks/python-sdk/licensefile-setup-and-usage.md#release_feature) are supported with [**License**](/sdks/python-sdk/licensefile-setup-and-usage.md#license) object for **Floating Server.**


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.licensespring.com/sdks/python-sdk/floating-server.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
