Changing parameter via api
I'm mostly using this discussion for directions.
https://devnet.jetbrains.com/message/5522130#5522130
But I cannot get it to work for me.
I pull down this xml using
curl -v -k -H "Content-Type: application/xml" -u admin:admin https://domain/app/rest/buildTypes/id:ClearingRedisCach_ClearRedisCach/parameters/system.environment > prop.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><property name="system.environment" value="" own="true"><type rawValue="select data_2='xxx' data_1='yyy' display='prompt' data_3='zzz'"/></property>
OK, Everything tells me to put that back to make modifications.
curl -v -k -X PUT -d @prop.xml -H "Content-Type: application/xml" -u admin:admin https://domain/app/rest/buildTypes/id:ClearingRedisCach_ClearRedisCach/parameters/
But I keep getting these results.
Error has occurred during request processing (Bad Request).
Error: java.lang.IllegalArgumentException: argument type mismatch
* Closing connection #0
Most probably the URL requires submitting different data type. Please check the request URL and data are correct
Please sign in to leave a comment.
Hi Kevin,
If you get a specific parameter, you should put back the xml for the same parameter. For example:
Or you can get the list of all parameters:
modify resulted xml and put it back using the same url.
OK,
So I've tried your put request.
curl -k -u admin:admin --request PUT https://domain.com/httpAuth/app/rest/buildTypes/id:ClearingRedisCach_ClearRedisCach/parameters/system.environment --data @prop.xml --header "Content-Type: application/xml"
contents of prop.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><property name="system.environment" value="" own="true"><type rawValue="select data_2='xxx' data_1='yyy' display='prompt' data_3='zzz'"/></property>
Still getting
Error has occurred during request processing (Unsupported Media Type).
I tried the request and prop.xml you posted and it works for me.
What TeamCity version do you use?
Could you please enable debug-rest logging preset on Administration > Diagnostics page in TeamCity, send the same request and attach teamcity-rest.log and also your prop.xml file?