0

I have the following build config for TeamCity (in XML):

<?xml version="1.0"?>
<build>
  <buildType id="my_build_config_id"/>
  <comment>
    <text>mybuild</text>
  </comment>
  <properties>
    <property name="env.PARAM1" value="abc"/>
    <property name="env.PARAM2" value="xyz"/>
    <property name="env.PARAM3" value="123"/>
  </properties>
</build>

I'm able to trigger a build with their REST API as documented with this XML config:

curl -v -u myuser:mypass http://teamcity.url:8111/app/rest/buildQueue --request POST --header "Content-Type:application/xml" --data-binary @build.xml

However, I want to encode all of my build parameters inside the URI itself. it doesn't seem clearly documented how to trigger the same build with all of the XML encoded as URI parameters. Reading between the lines, it would look something like this:

curl -v -u  http://teamcity.url:8111/httpAuth/app/rest/buildQueue?buildType(id:my_build_config_id),comment(text:mybuild),properties(property:((name:env.PARAM1,value:abc),(name:env.PARAM2,value:xyz),(name:env.PARAM2,value:123))) --request POST

What am I missing?

Katie
  • 918
  • 1
  • 5
  • 18
  • 1
    Why do you conclude this is at all possible? As far as I can see, the docs do not mention that. This is a `POST` request which expects a `body` to be in place. What's the initial problem you're trying to solve? – Yan Sklyarenko Oct 20 '20 at 05:48
  • Oh good point, I think this was a GET request on an older version of the API with a `xml` parameter so I presumed there was some backward compatibility. :/ – Katie Oct 20 '20 at 05:52

0 Answers0