AgentOptimizationJobs.DeleteAsync Method

Definition

Delete the job and its candidate artifacts. Cancels first if non-terminal.

public virtual System.Threading.Tasks.Task<System.ClientModel.ClientResult> DeleteAsync(string jobId, bool? force = default, System.Threading.CancellationToken cancellationToken = default);
abstract member DeleteAsync : string * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult>
override this.DeleteAsync : string * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult>
Public Overridable Function DeleteAsync (jobId As String, Optional force As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ClientResult)

Parameters

jobId
String

The ID of the job to delete.

force
Nullable<Boolean>

When true, force-delete even if the job is in a non-terminal state.

cancellationToken
CancellationToken

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

Returns

Exceptions

jobId is null.

jobId is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Applies to