背景
- 我有一个使用REST API获取运行手册作业列表的应用程序
- 我想对属性参数应用 $filter(最后见 JSON)。参数是类型
IDictionary<string,string>
问题
- $filter 适用于大多数属性,但失败
IDictionary<string,string>
- 这就是我正在尝试的
https://management.azure.com/subscriptions/XXX/resourceGroups/XXX/providers/Microsoft.Automation/automationAccounts/XXX/jobs?$filter=properties/parameters/any(keyValue: keyValue/owner eq 'Adam@test.com')&api-version=2015-10-31
- 请求失败并出现错误
{ "code": "BadRequest", "message": "Could not find a property named 'owner' on type 'System.Collections.Generic.KeyValuePair_2OfString_String'." }
问题
- 是否可以过滤我正在尝试的内容?
- 如果是,那么我做错了什么?
我要对其应用过滤器的 JSON 响应
"value": [
{
"id": "/subscriptions/XXX/resourceGroups/XXX/providers/Microsoft.Automation/automationAccounts/XXX/jobs/XXX",
"properties": {
"jobId": "XXX",
"runbook": {
"name": "HelloWorldRunbook"
},
"schedule": null,
"provisioningState": "Succeeded",
"status": "Completed",
"creationTime": "2018-06-17T05:44:12.197+00:00",
"startTime": "2018-06-17T05:44:21.227+00:00",
"lastModifiedTime": "2018-06-17T05:44:43.43+00:00",
"endTime": "2018-06-17T05:44:43.43+00:00",
"jobScheduleId": "7fc134ac-d8bd-464e-b041-6e6b50f83f0c",
"runOn": null,
"parameters": {
"Owner": "Adam@test.com",
"mailBox": "test_mailbox@test.com"
}
}
............removed for brevity