public async Task OnGet(string url) { using (var client = new HttpClient()) { var result = await client.GetAsync(url); QueryResult = await result.Content.ReadAsAsync <OrchestrationQueryResult>(); Response.Headers.Add("X-Orchestration-Status", QueryResult.RuntimeStatus); if (QueryResult.RuntimeStatus == "Completed" || QueryResult.RuntimeStatus == "Failed") { TempData.Remove("cur-orchestration-id"); } if (!string.IsNullOrEmpty(QueryResult.Output)) { Response.Headers.Add("X-Orchestration-Output", $"{ResultsFileUrl}/{QueryResult.Output}"); } } }
public async Task <OrchestrationQueryResult> GetOrchestrationsAsync( OrchestrationQuery query, CancellationToken cancellationToken = default) { var queryCondition = new OrchestrationInstanceStatusQueryCondition { InstanceIdPrefix = query.InstanceId, CreatedTimeFrom = query.CreatedTimeFrom ?? default, CreatedTimeTo = query.CreatedTimeTo ?? default, RuntimeStatus = query.RuntimeStatus }; var azureQueryResult = await _azureStorageOrchestrationService.GetOrchestrationStateAsync(queryCondition, query.Top, query.ContinuationToken); var queryResult = new OrchestrationQueryResult { Orchestrations = azureQueryResult.OrchestrationState.ToArray(), ContinuationToken = azureQueryResult.ContinuationToken, }; return(queryResult); }