AgentAdministrationClient Class

Definition

The AgentAdministrationClient sub-client.

public class AgentAdministrationClient
type AgentAdministrationClient = class
Public Class AgentAdministrationClient
Inheritance
AgentAdministrationClient

Constructors

Name Description
AgentAdministrationClient()

Initializes a new instance of AgentAdministrationClient for mocking.

AgentAdministrationClient(AgentAdministrationClientSettings)

Initializes a new instance of AgentAdministrationClient from a AgentAdministrationClientSettings.

AgentAdministrationClient(Uri, AgentAdministrationClientOptions)

Initializes a new instance of AgentsClient.

AgentAdministrationClient(Uri, AuthenticationTokenProvider, AgentAdministrationClientOptions)

Initializes a new AgentAdministrationClient with the specified service endpoint and authentication token provider.

AgentAdministrationClient(Uri, AuthenticationTokenProvider)

Initializes a new instance of AgentAdministrationClient.

Properties

Name Description
Pipeline

The HTTP pipeline for sending and receiving REST requests and responses.

Methods

Name Description
CreateAgentVersion(String, ProjectsAgentVersionCreationOptions, String, CancellationToken)

Create a new agent version.

CreateAgentVersionAsync(String, ProjectsAgentVersionCreationOptions, String, CancellationToken)

Create a new agent version.

CreateAgentVersionFromCode(String, String, AgentVersionFromCodeMetadata, CancellationToken)

CreateAgentVersionFromCode

CreateAgentVersionFromCodeAsync(String, String, AgentVersionFromCodeMetadata, CancellationToken)

CreateAgentVersionFromCode

CreateAgentVersionFromManifest(String, String, AgentManifestOptions, CancellationToken)

Creates a new version of an agent from an agent manifest.

CreateAgentVersionFromManifestAsync(String, String, AgentManifestOptions, CancellationToken)

Creates a new version of an agent from an agent manifest.

CreateSession(String, VersionIndicator, String, CancellationToken)

Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from version_indicator and enforces session ownership using the provided isolation key for session-mutating operations.

CreateSessionAsync(String, VersionIndicator, String, CancellationToken)

Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from version_indicator and enforces session ownership using the provided isolation key for session-mutating operations.

DeleteAgent(String, CancellationToken)

Deletes an agent.

DeleteAgent(String, Nullable<Boolean>, CancellationToken)

Deletes an agent.

DeleteAgentAsync(String, CancellationToken)

Deletes an agent.

DeleteAgentAsync(String, Nullable<Boolean>, CancellationToken)

Deletes an agent.

DeleteAgentVersion(String, String, CancellationToken)

Deletes a specific version of an agent.

DeleteAgentVersion(String, String, Nullable<Boolean>, CancellationToken)

Deletes a specific version of an agent.

DeleteAgentVersionAsync(String, String, CancellationToken)

Deletes a specific version of an agent.

DeleteAgentVersionAsync(String, String, Nullable<Boolean>, CancellationToken)

Deletes a specific version of an agent.

DeleteSession(String, String, CancellationToken)

Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not exist.

DeleteSessionAsync(String, String, CancellationToken)

Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not exist.

DisableAgent(String, CancellationToken)

Disables the specified agent, preventing it from accepting new sessions or processing requests. Existing active sessions are allowed to drain gracefully but no new sessions can be created. This operation is idempotent — disabling an already-disabled agent returns success with no side effects.

DisableAgent(String, RequestOptions)

[Protocol Method] Disables the specified agent, preventing it from accepting new sessions or processing requests. Existing active sessions are allowed to drain gracefully but no new sessions can be created. This operation is idempotent — disabling an already-disabled agent returns success with no side effects.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
DisableAgentAsync(String, CancellationToken)

Disables the specified agent, preventing it from accepting new sessions or processing requests. Existing active sessions are allowed to drain gracefully but no new sessions can be created. This operation is idempotent — disabling an already-disabled agent returns success with no side effects.

DisableAgentAsync(String, RequestOptions)

[Protocol Method] Disables the specified agent, preventing it from accepting new sessions or processing requests. Existing active sessions are allowed to drain gracefully but no new sessions can be created. This operation is idempotent — disabling an already-disabled agent returns success with no side effects.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
DownloadAgentCode(String, String, String, CancellationToken)

Download the code zip for the latest version of a code-based hosted agent. And unpacks ut to the user directory; returns the zip content as a binary data. Returns the previously-uploaded zip (application/zip). The SHA-256 digest of the returned bytes matches the content_hash on the latest version's code_configuration.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
DownloadAgentCodeAsync(String, String, String, CancellationToken)

Download the code zip for the latest version of a code-based hosted agent and unpacks it to the user directory; returns the zip content as a binary data. Returns the previously-uploaded zip (application/zip). The SHA-256 digest of the returned bytes matches the content_hash on the latest version's code_configuration.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
EnableAgent(String, CancellationToken)

Enables the specified agent, allowing it to accept new sessions and process requests. This operation is idempotent — enabling an already-enabled agent returns success with no side effects.

EnableAgent(String, RequestOptions)

[Protocol Method] Enables the specified agent, allowing it to accept new sessions and process requests. This operation is idempotent — enabling an already-enabled agent returns success with no side effects.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
EnableAgentAsync(String, CancellationToken)

Enables the specified agent, allowing it to accept new sessions and process requests. This operation is idempotent — enabling an already-enabled agent returns success with no side effects.

EnableAgentAsync(String, RequestOptions)

[Protocol Method] Enables the specified agent, allowing it to accept new sessions and process requests. This operation is idempotent — enabling an already-enabled agent returns success with no side effects.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
GetAgent(String, CancellationToken)

Retrieves the agent.

GetAgentAsync(String, CancellationToken)

Retrieves the agent.

GetAgentOptimizationJobs()

Gets the lazily-initialized agent optimization jobs sub-client.

GetAgents(Nullable<ProjectsAgentKind>, Nullable<Int32>, Nullable<AgentListOrder>, String, String, CancellationToken)

Returns the list of all agents.

GetAgentsAsync(Nullable<ProjectsAgentKind>, Nullable<Int32>, Nullable<AgentListOrder>, String, String, CancellationToken)

Returns the list of all agents.

GetAgentSessionFiles(String, String)

Gets the lazily-initialized agent session files sub-client.

GetAgentSkills()

Gets the lazily-initialized project agent skills sub-client.

GetAgentToolboxes()

Gets the lazily-initialized agent toolboxes sub-client.

GetAgentVersion(String, String, CancellationToken)

Retrieves a specific version of an agent.

GetAgentVersionAsync(String, String, CancellationToken)

Retrieves a specific version of an agent.

GetAgentVersions(Nullable<Boolean>, String, Nullable<Int32>, Nullable<AgentListOrder>, String, String, CancellationToken)

Returns the list of versions of an agent.

GetAgentVersions(String, Nullable<Int32>, Nullable<AgentListOrder>, String, String, CancellationToken)

Returns the list of versions of an agent.

GetAgentVersionsAsync(Nullable<Boolean>, String, Nullable<Int32>, Nullable<AgentListOrder>, String, String, CancellationToken)

Returns the list of versions of an agent.

GetAgentVersionsAsync(String, Nullable<Int32>, Nullable<AgentListOrder>, String, String, CancellationToken)

Returns the list of versions of an agent.

GetSession(String, String, CancellationToken)

Retrieves a session by ID.

GetSessionAsync(String, String, CancellationToken)

Retrieves a session by ID.

GetSessionLogStream(String, String, String, CancellationToken)

Streams console logs (stdout / stderr) for a specific hosted agent session as a Server-Sent Events (SSE) stream. Each SSE frame contains:

  • `event`: always `"log"`
  • `data`: a plain-text log line (currently JSON-formatted, but the schema
is not contractual and may include additional keys or change format over time — clients should treat it as an opaque string) Example SSE frames: ``` event: log data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"} event: log data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} event: log data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} event: log data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} ``` The stream remains open until the client disconnects or the server terminates the connection. Clients should handle reconnection as needed.
GetSessionLogStreamAsync(String, String, String, CancellationToken)

Streams console logs (stdout / stderr) for a specific hosted agent session as a Server-Sent Events (SSE) stream. Each SSE frame contains:

  • `event`: always `"log"`
  • `data`: a plain-text log line (currently JSON-formatted, but the schema
is not contractual and may include additional keys or change format over time — clients should treat it as an opaque string) Example SSE frames: ``` event: log data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"} event: log data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} event: log data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} event: log data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} ``` The stream remains open until the client disconnects or the server terminates the connection. Clients should handle reconnection as needed.
GetSessions(String, Nullable<Int32>, Nullable<AgentListOrder>, String, String, CancellationToken)

Returns a list of sessions for the specified agent.

GetSessionsAsync(String, Nullable<Int32>, Nullable<AgentListOrder>, String, String, CancellationToken)

Returns a list of sessions for the specified agent.

PatchAgent(String, PatchAgentOptions, CancellationToken)

Updates an agent endpoint.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
PatchAgentAsync(String, PatchAgentOptions, CancellationToken)

Updates an agent endpoint.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
StopSession(String, String, CancellationToken)

Stops a session. Returns 204 No Content when the stop succeeds.

StopSessionAsync(String, String, CancellationToken)

Stops a session. Returns 204 No Content when the stop succeeds.

Applies to