Skip to content

Client Controller API client for kdb Insights Enterprise.

Use ClientController to enrol and remove clients from the kdb Insights Enterprise Client Controller service.

Example
from kxi.publish.client_controller import ClientController, Client, Topics

cc = ClientController(host="https://<host>")

# Define a client with custom topics
client = Client(
    name="my-app",
    topics=Topics(insert="my-insert-topic", subscribe="my-sub-topic"),
)

# Enrol the client
result = cc.enrol(client)
print(result["config_url"])

# List enrolled client names (requires the Administrator role)
print(cc.list_clients())

# Remove the client when done
cc.leave(client)

Classes:

  • Client – Client registration payload for the Client Controller.
  • ClientController – REST client for the kdb Insights Enterprise Client Controller.
  • Topics – RT topic configuration for a client.

Client

Bases: BaseModel

Client registration payload for the Client Controller.

Attributes:

  • name (str) – Unique client name used to identify it in the controller.
  • topics (Topics) – RT topic configuration for this client.

ClientController

Bases: ApiClient

REST client for the kdb Insights Enterprise Client Controller.

Manages client enrolment and removal via the /clientcontroller service path.

Example
from kxi.publish.client_controller import ClientController, Client

cc = ClientController(host="https://<host>")

client = Client(name="my-app")
result = cc.enrol(client)
print(result["config_url"])

cc.leave(client)

See Connection Parameters for shared constructor arguments.

Functions:

  • alive – Check whether the Client Controller service is alive.
  • enrol – Enrol a client with the Client Controller.
  • id_to_url – Build the Information Service URL for an enrolled client's config.
  • leave – Remove an enrolled client from the Client Controller.
  • list_clients – List the names of the enrolled clients.

alive

alive()

Check whether the Client Controller service is alive.

Returns:

  • Optional[str] – Alive status string from the service, or None if unreachable.

enrol

enrol(client, force=False)

Enrol a client with the Client Controller.

Parameters:

  • client (Client) – Client definition to enrol.
  • force (bool) – If True, remove and re-enrol the client when it already exists. Default: False.

Returns:

  • dict[str, str] – Enrolment response dict containing config_url with the full
  • dict[str, str] – Information Service URL for the enrolled client.

Raises:

id_to_url

id_to_url(config_id)

Build the Information Service URL for an enrolled client's config.

Parameters:

  • config_id (str) – Config ID from the enrolment response url field.

Returns:

  • – Full URL pointing to the Information Service details endpoint for
  • – the given config ID.

leave

leave(client)

Remove an enrolled client from the Client Controller.

Parameters:

Returns:

  • dict – API response for the leave operation.

Raises:

list_clients

list_clients()

List the names of the enrolled clients.

Only client names are returned. Client IDs are secrets and are never exposed. Requires the insights.client.list role, which is part of the Administrator bundled role.

Returns:

  • list[str] – Names of all enrolled clients.

Raises:

Topics

Bases: BaseModel

RT topic configuration for a client.

Attributes:

  • insert (str) – Topic name for insert operations. Default: "".
  • query (str) – Topic name for query operations. Default: "requests".
  • subscribe (str) – Topic name for subscribe operations. Default: "".
Back to top