Skip to content

Commit

Permalink
Adding new Purging History APIs (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
gled4er authored and cgillum committed Nov 7, 2018
1 parent 416a9c9 commit 24ed504
Show file tree
Hide file tree
Showing 6 changed files with 332 additions and 9 deletions.
16 changes: 16 additions & 0 deletions src/WebJobs.Extensions.DurableTask/DurableOrchestrationClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,22 @@ public override async Task<DurableOrchestrationStatus> GetStatusAsync(string ins
return results;
}

/// <inheritdoc />
public override Task PurgeInstanceHistoryAsync(string instanceId)
{
// TODO this cast is to avoid to change DurableTask.Core. Change it to use TaskHubClient.
AzureStorageOrchestrationService serviceClient = (AzureStorageOrchestrationService)this.client.ServiceClient;
return serviceClient.PurgeInstanceHistoryAsync(instanceId);
}

/// <inheritdoc />
public override Task PurgeInstanceHistoryAsync(DateTime createdTimeFrom, DateTime? createdTimeTo, IEnumerable<OrchestrationStatus> runtimeStatus)
{
// TODO this cast is to avoid to change DurableTask.Core. Change it to use TaskHubClient.
AzureStorageOrchestrationService serviceClient = (AzureStorageOrchestrationService)this.client.ServiceClient;
return serviceClient.PurgeInstanceHistoryAsync(createdTimeFrom, createdTimeTo, runtimeStatus);
}

/// <inheritdoc />
internal override async Task<OrchestrationStatusQueryResult> GetStatusAsync(
DateTime createdTimeFrom,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using DurableTask.Core;
using Microsoft.Azure.WebJobs.Extensions.DurableTask;

namespace Microsoft.Azure.WebJobs
Expand Down Expand Up @@ -251,6 +252,22 @@ public virtual Task<DurableOrchestrationStatus> GetStatusAsync(string instanceId
/// <returns>Returns orchestration status for all instances.</returns>
public abstract Task<IList<DurableOrchestrationStatus>> GetStatusAsync(DateTime createdTimeFrom, DateTime? createdTimeTo, IEnumerable<OrchestrationRuntimeStatus> runtimeStatus, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Purge the history for a concrete instance.
/// </summary>
/// <param name="instanceId">The ID of the orchestration instance to purge.</param>
/// <returns>Returns a task which completes when the purge has completed.</returns>
public abstract Task PurgeInstanceHistoryAsync(string instanceId);

/// <summary>
/// Purge the orchestration history for instances that match the conditions.
/// </summary>
/// <param name="createdTimeFrom">Start creation time for querying instances for purging.</param>
/// <param name="createdTimeTo">End creation time for querying instances for purging.</param>
/// <param name="runtimeStatus">List of runtime status for querying instances for purging. Only Completed, Terminated, or Failed will be processed.</param>
/// <returns>Returns a task which completes when the purge has completed.</returns>
public abstract Task PurgeInstanceHistoryAsync(DateTime createdTimeFrom, DateTime? createdTimeTo, IEnumerable<OrchestrationStatus> runtimeStatus);

/// <summary>
/// Gets the status of all orchestration instances with paging that match the specified conditions.
/// </summary>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 24ed504

Please sign in to comment.