通过管道运行进行的活动运行查询api过滤器条件未按预期工作 [英] Activity Runs Query By Pipeline Run api filter criteria not working as expected

查看:52
本文介绍了通过管道运行进行的活动运行查询api过滤器条件未按预期工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试执行此处记录的api,以获取特定ActivityRun的详细信息- 

I am trying to execute the api documented here to get details of a particular ActivityRun - 

https://docs.microsoft.com/zh-cn/rest/api/datafactory/activityruns/querybypipelinerun

https://docs.microsoft.com/en-us/rest/api/datafactory/activityruns/querybypipelinerun

在没有任何过滤条件的情况下运行API会成功返回如下所示的所有活动运行信息

Running the API without any filter criteria successfully returns all the activity run information like below

{
	"value": [
		{
			"activityRunEnd": "2018-10-09T17:52:14.8201773Z",
			"activityName": "RunPrecheck",
			"activityRunStart": "2018-10-09T17:51:58.8655743Z",
			"activityType": "Lookup",
			.
			.
			.
		},
		{
			"activityRunEnd": "2018-10-09T17:53:36.4313983Z",
			"activityName": "IfPreCheckPasses",
			"activityRunStart": "2018-10-09T17:52:16.8515142Z",
			"activityType": "IfCondition",
			.
			.
			.
		},
		{
			"activityRunEnd": "2018-10-09T17:53:31.4978189Z",
			"activityName": "ExecLoadEventCsvToAdw",
			"activityRunStart": "2018-10-09T17:52:17.1327529Z",
			"activityType": "ExecutePipeline",
			.
			.
			.
		},
		{
			"activityRunEnd": "2018-10-09T17:53:34.5251208Z",
			"activityName": "CompleteBatch",
			"activityRunStart": "2018-10-09T17:53:32.2478458Z",
			"activityType": "SqlServerStoredProcedure",
			.
			.
			.
		}
	]
}


但是,如果我按如下所示在正文"中添加过滤条件,则即使活动名称为"RunPrecheck",该api也会返回一个空数组.存在.

However if I add a filter criteria in the Body as follows, the api returns a empty array even though there is a Activity name "RunPrecheck" exists.

{
	"filters": [
		{
			"operand": "ActivityName",
			"operator": "Equals",
			"values": [
				"RunPrecheck"
			]
		}
	]
}

响应- 

{
  "value": []
}

此api是否不支持所记录的过滤或ti损坏?

Does this api not support filtering as documented or is ti broken?

推荐答案

您好,尼克,

我在与您相同的场景下测试了此API调用,这会触发管道运行并调用

I tested this API call under the same scenario with yours, which is trigger a pipeline run and call

https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelineruns/{runId}/queryActivityruns?api-version=2018-06-01

一切顺利.我设置的请求正文为:

everything goes well. The request body I set is:

{
  "filters": [
    {
      "operand": "ActivityName",
      "operator": "Equals",
      "values": ["Get Metadata1"]
    }
  ],
  "lastUpdatedAfter": "2018-10-10T01:39:14.2647393Z",
  "lastUpdatedBefore": "2018-10-10T01:39:25.7708105Z"
}

我注意到您没有设置" ,然后再尝试一次.它应该工作.谢谢.

I notice you didn't set "lastUpdatedAfter" and "lastUpdatedBefore". Consider these two properties are required, please append them into request body and have another try. It should work. Thanks.




这篇关于通过管道运行进行的活动运行查询api过滤器条件未按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆