/// <summary> /// Cancels a job. This is an asynchronous operation. To know the status of the /// cancellation, call /// GetCancelOperationResult API. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='vaultName'> /// The name of the recovery services vault. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group where the recovery services vault is /// present. /// </param> /// <param name='jobName'> /// Name of the job to cancel. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task TriggerAsync(this IJobCancellationsOperations operations, string vaultName, string resourceGroupName, string jobName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.TriggerWithHttpMessagesAsync(vaultName, resourceGroupName, jobName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Cancels a job. This is an asynchronous operation. To know the status of the /// cancellation, call /// GetCancelOperationResult API. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='vaultName'> /// The name of the recovery services vault. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group where the recovery services vault is /// present. /// </param> /// <param name='jobName'> /// Name of the job to cancel. /// </param> public static void Trigger(this IJobCancellationsOperations operations, string vaultName, string resourceGroupName, string jobName) { operations.TriggerAsync(vaultName, resourceGroupName, jobName).GetAwaiter().GetResult(); }