Managing platforms¶
In the following examples, client is an AgentManagementClient created as described in The main AgentManagementClient class.
Listing platforms¶
By default, client.list_platforms()
returns PlatformListItem objects
containing basic platform information, such as ID, name, and type.
Call item.to_platform()
to get a Platform handle without making another API request.
for item in client.list_platforms():
print(item.id, item.display_name, item.type)
platform = item.to_platform()
To get Platform handles directly,
pass as_type="objects" to
client.list_platforms().
Retrieving a platform¶
Use the platform identifier, rather than its display name.
platform = client.get_platform("production")
status = platform.get_status().get_raw()
print(status)
get_platform() creates a handle without contacting the server.
Subsequent calls such as get_status() retrieve data and check access rights.
For diagnostic logs, open the platform’s Logs page. See Accessing logs for the available logs and required privileges.
Creating a platform¶
For a platform receiving OTLP traces, see Creating an OpenTelemetry receiver platform below.
This example uses an existing Dataiku platform connection named dataiku-production and an existing local project AGENTMONITORING for monitoring resources. The caller must have permission to create platforms and use the connection and project.
platform = client.create_platform(
platform_id="production",
platform_type="Dataiku",
display_name="Production agents",
connection_name="dataiku-production",
default_project_key="AGENTMONITORING",
)
The platform identifier must contain only lowercase letters, digits, underscores, and hyphens. platform_type uses the provider identifier, such as Dataiku, Bedrock, AzureFoundry, or OpenTelemetryReceiver. Configuration requirements and available monitoring capabilities depend on the provider.
Creating an OpenTelemetry receiver platform¶
OpenTelemetry receiver platforms do not use a platform connection. Agents are added manually and send traces to Agent Management; see Managing agents.
platform = client.create_platform(
platform_id="otel-production",
platform_type="OpenTelemetryReceiver",
display_name="Production OpenTelemetry agents",
default_project_key="AGENTMONITORING",
)
Updating platform settings¶
You need platform administration permissions to read or update a platform’s settings.
Call platform.get_settings(),
update the settings.raw dictionary,
then call settings.save().
platform = client.get_platform("production")
settings = platform.get_settings()
settings.raw["displayName"] = "Production support agents"
settings.raw["defaultProjectKey"] = "AGENTMONITORING"
settings.save()
Keep the retrieved fetchedRevision: saving uses it to detect concurrent changes. If another caller changes the platform, retrieve the settings again and reapply your changes.
Deleting a platform¶
client.get_platform("unused-platform").delete()
Deletion removes the platform and its Agent Management agent records. Discovered or managed agents prevent deletion by default.
To explicitly allow their deletion as well, use delete(allow_deletion_if_platform_contains_agents=True).
Ignored and archived agents are deleted with the platform and do not prevent deletion.
Reference documentation¶
Classes¶
An Agent Management platform. |
|
A Platform listing entry with local accessors and conversion to a resource handle. |
|
The status of an Agent Management platform. |
|
The settings of an Agent Management platform. |
Functions¶
|
Creates an Agent Management platform with default settings and returns a handle to it. |
|
Deletes the platform and all its Agent Management agent records. |
|
Returns a handle to an Agent Management platform. |
|
Returns the raw status of this platform. |
Returns the settings of this platform. |
|
Returns status information about this platform. |
|
|
Lists Agent Management platforms. |
|
Saves the settings of this platform, using |
Return a |
