[英]Multiple resource filters in ARM REST API
我正在嘗試使用ARM rest api上的$ filter屬性來過濾標記,值和資源類型。 根據標簽及其值進行過濾,僅資源類型有效。 但是它們的組合返回了錯誤的請求
我正在使用此終結點來檢索一個Azure訂閱中的所有資源。 https://docs.microsoft.com/zh-cn/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'
和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."
}
}
這是一個已知的錯誤,更多詳細信息在這里 。 請注意,這是一個sdk錯誤,但sdk也調用此api。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.