AgentOptimizationJobs.CancelAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| CancelAsync(String, RequestOptions) |
[Protocol Method] Requests cancellation of a running or queued job. Returns 409 Conflict if the job is already in a terminal state.
|
| CancelAsync(String, CancellationToken) |
Requests cancellation of a running or queued job. Returns 409 Conflict if the job is already in a terminal state. |
CancelAsync(String, RequestOptions)
- Source:
- AgentOptimizationJobs.cs
- Source:
- AgentOptimizationJobs.cs
[Protocol Method] Requests cancellation of a running or queued job. Returns 409 Conflict if the job is already in a terminal state.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual System.Threading.Tasks.Task<System.ClientModel.ClientResult> CancelAsync(string jobId, System.ClientModel.Primitives.RequestOptions options);
abstract member CancelAsync : string * System.ClientModel.Primitives.RequestOptions -> System.Threading.Tasks.Task<System.ClientModel.ClientResult>
override this.CancelAsync : string * System.ClientModel.Primitives.RequestOptions -> System.Threading.Tasks.Task<System.ClientModel.ClientResult>
Public Overridable Function CancelAsync (jobId As String, options As RequestOptions) As Task(Of ClientResult)
Parameters
- jobId
- String
The ID of the job to cancel.
- options
- RequestOptions
The request options, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
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
CancelAsync(String, CancellationToken)
- Source:
- AgentOptimizationJobs.cs
- Source:
- AgentOptimizationJobs.cs
Requests cancellation of a running or queued job. Returns 409 Conflict if the job is already in a terminal state.
public virtual System.Threading.Tasks.Task<System.ClientModel.ClientResult<Azure.AI.Projects.Agents.AgentOptimizationJob>> CancelAsync(string jobId, System.Threading.CancellationToken cancellationToken = default);
abstract member CancelAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult<Azure.AI.Projects.Agents.AgentOptimizationJob>>
override this.CancelAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult<Azure.AI.Projects.Agents.AgentOptimizationJob>>
Public Overridable Function CancelAsync (jobId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ClientResult(Of AgentOptimizationJob))
Parameters
- jobId
- String
The ID of the job to cancel.
- 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.