private static void correrPipesEspeciales(DataFactoryManagementClient client) { //var nombres = DatosGrales.traerTablas(true); //// //Exception exp = null; //for (int i = 0; i < nombres.Length; i++) //{ // if (esTablaEspecial(nombres[i])) // { // exp = new Exception(); // while (exp != null) // { // try // { // client.Pipelines.CreateRun(DatosGrales.resourceGroup, DatosGrales.dataFactoryName, "Pipeline-Sql-DataLake-ConCompresion-Claim-" + nombres[i], null); // exp = null; // } // catch (Exception ex) { exp = ex; } // } // Console.Write((i + 1) + ". Run para pipe: Pipeline-Sql-DataLake-ConCompresion-Claim-" + nombres[i] + " creado.\n"); // } //} string pipeName = Console.ReadLine(); DateTime today = DateTime.Now; DateTime lastWeek = DateTime.Now.AddDays(-7); PipelineRunFilterParameters prfp = new PipelineRunFilterParameters(lastWeek, today); var x = client.PipelineRuns.QueryByFactory("GR_BI_DW_01", "datafactorybi02", prfp); var enumerator = x.Value.GetEnumerator(); PipelineRun pipeRun; string runId; while (enumerator.MoveNext()) { pipeRun = enumerator.Current; if (pipeRun.PipelineName == pipeName) { runId = pipeRun.RunId; break; } } }
public virtual List <PSPipelineRun> ListPipelineRuns(PipelineRunFilterOptions pipelineRunFilter) { var pipelineRuns = new List <PSPipelineRun>(); var runFilters = new PipelineRunFilterParameters() { LastUpdatedAfter = pipelineRunFilter.LastUpdatedAfter, LastUpdatedBefore = pipelineRunFilter.LastUpdatedBefore, Filters = new List <PipelineRunQueryFilter>(), OrderBy = new List <PipelineRunQueryOrderBy>(), }; if (pipelineRunFilter.PipelineName != null) { runFilters.Filters.Add( new PipelineRunQueryFilter() { Operand = PipelineRunQueryFilterOperand.PipelineName, OperatorProperty = PipelineRunQueryFilterOperator.Equals, Values = new List <string>() { pipelineRunFilter.PipelineName } }); } else if (pipelineRunFilter.Filters != null) { runFilters.Filters = pipelineRunFilter.Filters; } if (pipelineRunFilter.OrderBy != null) { runFilters.OrderBy = pipelineRunFilter.OrderBy; } else { runFilters.OrderBy.Add( new PipelineRunQueryOrderBy() { Order = PipelineRunQueryOrder.DESC, OrderBy = PipelineRunQueryOrderByField.RunEnd }); } PipelineRunQueryResponse response = this.DataFactoryManagementClient.PipelineRuns.QueryByFactory(pipelineRunFilter.ResourceGroupName, pipelineRunFilter.DataFactoryName, runFilters); pipelineRuns.AddRange(response.Value.Select(pr => new PSPipelineRun(pr, pipelineRunFilter.ResourceGroupName, pipelineRunFilter.DataFactoryName))); string continuationToken = response.ContinuationToken; while (!string.IsNullOrWhiteSpace(continuationToken)) { runFilters.ContinuationToken = continuationToken; response = this.DataFactoryManagementClient.PipelineRuns.QueryByFactory(pipelineRunFilter.ResourceGroupName, pipelineRunFilter.DataFactoryName, runFilters); pipelineRuns.AddRange(response.Value.Select(pr => new PSPipelineRun(pr, pipelineRunFilter.ResourceGroupName, pipelineRunFilter.DataFactoryName))); continuationToken = response.ContinuationToken; } return(pipelineRuns); }