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¶
|
A connection on the DSS instance. |
Settings of a DSS connection. |
Functions¶
|
Create a connection, and return a handle to interact with it |
|
Get a handle to interact with a specific connection |
|
Get information about this connection. |
Get the settings of the connection. |
|
|
List all connections setup on the Agent Management instance. |
|
List all connections names on the Agent Management instance. |
