自动化REST API过滤器

编程入门 行业动态 更新时间:2024-10-10 05:21:39
本文介绍了自动化REST API过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图达到自动化REST API的终点,即作业,以获取作业运行的状态.它在文档docs.microsoft/zh-cn/rest/api/automation/job/listbyautomationaccount中指定,我们可以使用$ filter发送查询 REST API.任何人都可以让我知道,查询的格式必须发送.

I am trying to hits the automation REST API end point, jobs, to get the status of job runs. It is specified here in the documentation, docs.microsoft/en-us/rest/api/automation/job/listbyautomationaccount, that we can use $filter to send a query to REST API. Can anyone please let me know, the format the query has to be sent.

没有任何过滤器的端点的JSON响应就像

The JSON response of that endpoint without any filter is like,

{ "value":[ { "properties":{ "status":"Completed", "endTime":"2018-10-22T08:11:12.6009936+00:00", "runOn":"None", "creationTime":"2018-10-22T08:01:20.2425504+00:00", "jobId":"XXXX-XXXXX-XXXX-XXXX", "startTime":"2018-10-22T08:02:06.7175749+00:00", "lastModifiedTime":"2018-10-22T08:11:12.6009936+00:00", "runbook":{ "name":"$runbook_name" }, "provisioningState":"Succeeded" }, "type":"Microsoft.Automation/AutomationAccounts/Jobs", "id":"/subscriptions/XXXX-XXXXX-XXXX-XXXX/resourceGrops/XXXX-XXXXX-XXXX-XXXX/providers/Microsoft.Automation/automationAccounts/XXXX-XXXXX-XXXX-XXXX/jobs/XXXX-XXXXX-XXXX-XXXX", "name":"XXXX-XXXXX-XXXX-XXXX" } ] }

我尝试了$ filter = {"properties":{"runbook":{"name":"filter_runbook_name"}}}等过滤器.我收到类似$ filter应该只有布尔值的错误.任何人都可以帮助我查询的类型,我需要通过发送 此过滤器为REST API.我正在使用Python发送此请求.

I tried filters like $filter={"properties": {"runbook": {"name": "filter_runbook_name"}}}. I get errors like, $filter should have only boolean value. Can anyone help me with the type of query, I need to send through this filter to REST API. I am using Python to send this requests.

预先感谢

Santhosh

推荐答案

我确实尝试了您的请求,但仍找不到答案.但是我想我可以为您提供一些有关

I did tried your request, but i couldn't able to find the answer yet. But I think i can shed some lights for you about this

过滤器查询的信息.

基本上

过滤器是一个OData表达式,它遵循一些搜索规范 filter is a OData Expression which follows some specifications for the searching

docs.microsoft/en-us/rest/api/searchservice/odata-expression-syntax-for-azure-search

为.例如,您需要提供 eq, ne,gt,lt,ge,le

For. E.g, Comparision you need to provideeq, ne, gt, lt, ge, le

例如,resourceType eq'Microsoft.Insights/alertRules'

E.g,resourceType eq 'Microsoft.Insights/alertRules'

请参见 回答

See this Answer

当我尝试使用嵌套的JSON查询时,我发现此 解决方案

While I tried with the nested JSON Query I find this solution

一旦找到解决问题的方法,我会通知您.同时,请尝试使用我提供的信息从您的角度进行尝试.

I'll let you know once I find any solution for your problem.Meantime please try some thing from yourend with the information I provide.

感谢

更多推荐

自动化REST API过滤器

本文发布于:2023-10-12 04:13:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1483688.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:过滤器   REST   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!