dohq-teamcity
is a Python package providing access to the JetBrains TeamCity server API. This library support ALL TeamCity API methods, if you don't find some - create issue, please.
# Latest release
pip install dohq-teamcity
# Develop branch
git clone https://github.com/devopshq/teamcity
cd teamcity
python setup.py install
from dohq_teamcity import TeamCity
# username/password authentication
tc = TeamCity("https://teamcity.example.com", auth=('username', 'password'))
# list all the projects
projects = tc.projects.get_projects()
# OR
# projects = tc.project_api.get_projects()
for project in projects:
print(project)
# get the group with name = groupname
group = tc.group.get('name:groupname')
print(group)
# get the user with name = username
user = tc.user.get('username:devopshq')
print(user)
# create a new user and delete
from dohq_teamcity import User
new_user = User(name='New user', username='new_user')
new_user = tc.users.create_user(body=new_user)
new_user.delete()
# other way - create object, connect with exist instance and load it
import dohq_teamcity
bt = dohq_teamcity.BuildType(id='MyBuildTypeId', teamcity=tc)
bt = bt.read()
See more examples and full documantation on page: https://devopshq.github.io/teamcity
- Bump version in
dohq_teamcity/version.py
- Merge changes to master branch
- Create Github Release