我有一些構建。每個版本都有兩個標籤。標籤顯示模塊名稱和版本。所以標籤loogs喜歡one-module
和1.2.3
或two-module
和4.5.6
。如何通過TeamCity REST API指定多個標籤來獲取構建?
我可以這樣做:
/httpAuth/app/rest/builds/?locator=tags:one-module,branch:unspecified:any&fields=build(tags(tag))
我會得到這樣的:
{
"build": [
{
"tags": {
"tag": [
{
"name": "1.2.4"
},
{
"name": "one-module"
}
]
}
},
{
"tags": {
"tag": [
{
"name": "1.2.3"
},
{
"name": "one-module"
}
]
}
}
]
}
現在我想用標籤one-module
和1.2.4
獲取最新版本。我如何做到這一點?
我試試這個:
/httpAuth/app/rest/builds/?locator=tags:one-module,1.2.4,branch:unspecified:any&fields=build(tags(tag))
但我得到這個:
Error has occurred during request processing (Bad Request).
Error: jetbrains.buildServer.server.rest.errors.LocatorProcessException: Bad locator syntax: Invalid dimension name :'1.2.4'. Should contain only alpha-numeric symbols or be known one. Details: locator: 'tags:one-module,1.2.4,branch:unspecified:any', at position 16
Invalid request. Check locator is specified correctly.
我的TeamCity版本9.1.6。 TeamCity的REST API BuildLocator documentation說:
標籤: - 「」(逗號) - 構建標籤的分隔列表(僅適用於構建 包含所有指定標籤返回)
所以,我嘗試通過2個或更多標籤來選擇構建。這不行?
我做錯了什麼?如何通過2個或更多標籤獲得構建最新版本?