The main AgentManagementClient class

Use the AgentManagementClient class from the dataikuapi Python package to connect to Dataiku Agent Management and manage platforms, agents, metrics, and alerts.

Creating an Agent Management client

Create an AgentManagementClient object to connect to Dataiku Agent Management. Use this object to call the API methods.

To use the Python client from outside Dataiku Agent Management, install it via pip in the Python environment from which you want to connect.

pip install dataiku-api-client

Note that this will always install the latest version of the API client. You might need to request a version compatible with your Dataiku Agent Management version.

When connecting from outside Dataiku Agent Management, you need a personal or global API key. See Authentication and API keys for more information on how to create an API key and the associated privileges.

You also need to connect using the base URL of your Dataiku Agent Management instance.

import dataikuapi

host = "http(s)://AGENT_MANAGEMENT_HOST:AGENT_MANAGEMENT_PORT"
apiKey = "Your API key secret"
client = dataikuapi.AgentManagementClient(host, apiKey)

# client is now an AgentManagementClient and can perform all authorized actions.
# For example, list the agents for which the API key has access
client.list_agents()

Disabling SSL certificate check

When you connect over HTTPS, the client verifies the server certificate. If your instance uses a private certificate authority (CA), you may need to configure your Python environment to trust its CA certificate. See your operating system or Python documentation for instructions.

To disable certificate verification, pass no_check_certificate=True when creating the client: AgentManagementClient(host, apiKey, no_check_certificate=True).

Creating a client from inside Agent Management

From Python code running inside Agent Management, reuse the instance client and its authentication. No API key is needed.

import dataiku

client = dataiku.api_client().get_agent_management_client()
client.list_agents()

The client uses the same user and permissions as the Python code that creates it.

Reference documentation

Classes

dataikuapi.agentmanagement_client.AgentManagementClient(host)

Entry point for the Dataiku Agent Management API client.

Functions

api_client()

Build an API client for the current DSS instance.

get_agent_management_client()

Creates an Agent Management client for this DSS instance, reusing this client's host, authentication, HTTP headers and certificate settings.

list_agents([as_type, agent_filter])

Lists readable agents matching an optional filter.