Share via


AgentAdministrationClient.DeleteSessionAsync Method

Definition

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

public virtual System.Threading.Tasks.Task<System.ClientModel.ClientResult> DeleteSessionAsync(string agentName, string sessionId, string isolationKey, System.Threading.CancellationToken cancellationToken = default);
abstract member DeleteSessionAsync : string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult>
override this.DeleteSessionAsync : string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult>
Public Overridable Function DeleteSessionAsync (agentName As String, sessionId As String, isolationKey As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ClientResult)

Parameters

agentName
String

The name of the agent.

sessionId
String

The session identifier.

isolationKey
String

Isolation key used by the agent endpoint to enforce session ownership for session-mutating operations.

cancellationToken
CancellationToken

The cancellation token that can be used to cancel the operation.

Returns

Exceptions

agentName, sessionId or isolationKey is null.

agentName, sessionId or isolationKey is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Applies to