【问题标题】:Multiple resource filters in ARM REST APIARM REST API 中的多个资源过滤器
【发布时间】:2019-05-23 10:11:25
【问题描述】:

我正在尝试使用 ARM rest api 上的 $filter 属性来过滤标签、值和资源类型。过滤标签及其值有效,资源类型仅有效。但是它们的组合返回了一个错误的请求

我正在使用此端点检索一个 Azure 订阅中的所有资源。 https://docs.microsoft.com/en-us/rest/api/resources/resources/list#code-try-0

我想用特定标签和值检索我的所有 VM。因此,我需要使用 filter 属性。

基本上,这些过滤器中的任何一个都可以独立工作

resourceType eq 'Microsoft.Compute/virtualMachines'tagname eq 'serverType' and tagvalue eq 'Citrix'

但不是这个: resourceType eq 'Microsoft.Compute/virtualMachines' and tagname eq 'serverType' and tagvalue eq 'Citrix'

  "error": {
    "code": "InvalidFilterInQueryString",
    "message": "Invalid $filter 'resourceType eq 'Microsoft.Compute/virtualMachines' and tagname eq 'serverType' and tagvalue eq 'Citrix'' specified in the query string."
  }
}

【问题讨论】:

    标签: azure rest azure-resource-manager


    【解决方案1】:

    这是一个已知的错误,更多细节是here。注意是sdk的bug,但是sdk也调用了这个api。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-03-28
    • 2021-05-15
    • 2014-04-11
    • 1970-01-01
    • 2018-01-13
    • 2017-03-05
    • 1970-01-01
    • 2019-11-08
    相关资源
    最近更新 更多