Python Rest / Teamcity Backup
I am trying to develop a python script to run REST backup procedure as shown in http://confluence.jetbrains.com/display/TW/REST+API+Plugin#RESTAPIPlugin-DataBackup here is my code:
Solution 1:
Python code was good - the only thing that was not exactly clear from TC docs - the URL still has to be built as
"POST http://teamcity:8111/httpAuth/app/rest/server/backup?
includeConfigs=true&includeDatabase=true&includeBuildLogs=true&
fileName=backup"
even if urllib2 POST params are passed to Request.
oh well
Solution 2:
In my case, I was doing everything alright except the URL was not enclosed in double quotes.
So I had to do something like this with curl
to get it to work
curl -d "" -X POST "http://<TeamCityUserName>:<TeamCityPassword>@teamcity.pi.home/httpAuth/app/rest/server/backup?includeConfigs=true&includeDatabase=true&includeBuildLogs=true&fileName=testBackup.bak"
Post a Comment for "Python Rest / Teamcity Backup"