Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new Purging History API-s #498

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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