Connections

Connections provide access to agent platforms and to storage used by monitoring datasets. A connection is distinct from an Agent Management platform: creating the connection does not create or scan a platform.

In the following examples, client is an AgentManagementClient created as described in The main AgentManagementClient class. Connection administration requires instance administration rights.

Listing connections

names = client.list_connections_names("all")
for name in names:
    print(name)

connections = client.list_connections(as_type="objects")

The default list_connections() result is a dictionary keyed by connection name. as_type="listitems" returns listing entries and as_type="objects" returns connection handles.

Inspecting a connection

connection = client.get_connection("dataiku-production")
info = connection.get_info()
print(info)

settings = connection.get_settings()

get_settings() returns editable connection settings. Their fields depend on the connection type. Use the returned handle’s documented settings methods to update a connection; see Connections.

Creating a connection

This example creates a connection to a remote Dataiku instance. Use that instance’s base URL and a personal or global API key with the required remote permissions.

import getpass

connection = client.create_connection(
    name="dataiku-production",
    type="RemoteDSSNode",
    params={
        "url": "https://dss.example.com",
        "apiKey": getpass.getpass("Remote Dataiku API key: "),
    },
    usable_by="ALLOWED",
    allowed_groups=["agent-operators"],
    description="Production Dataiku instance",
)

Once configured, pass the connection name to client.create_platform(), agent.setup_monitoring(), or platform.setup_monitoring() as appropriate. See Managing platforms and Setting up monitoring and fetching data.

Reference documentation

Classes

dataikuapi.dss.admin.DSSConnection(client, name)

A connection on the DSS instance.

dataikuapi.dss.admin.DSSConnectionSettings(...)

Settings of a DSS connection.

Functions

create_connection(name, type[, params, ...])

Create a connection, and return a handle to interact with it

get_connection(name)

Get a handle to interact with a specific connection

get_info([contextual_project_key])

Get information about this connection.

get_settings()

Get the settings of the connection.

list_connections([as_type])

List all connections setup on the Agent Management instance.

list_connections_names(connection_type)

List all connections names on the Agent Management instance.