Teamcity Data Model

Hi All,


We are in the development of designing dashboards. We want to incorporate teamcity data in our existing dashboard.
For this purpose we need teamcity data model design diagram. So that this data can be extracted using ETL tools.

Please provide data model details as eraly as possible.

Thanks in advance.

22 comments
Comment actions Permalink

Hi

I see you've got an answer by email already. But again, feel free to ask any additional question about our APIs or plugins.

Michael

0
Comment actions Permalink

Thanks for the reply.

I need to understand how can i access teamcity and REST API when teamcity is not available on my machine.

As i already mentioned that my requirement is to get the teamcity data and extract the metrics for our dashbord purpose.

Through solution provided in the mail (Added at the end of this post) i come accross that i need to use REST API for my requirement and i will get the data in XML format.

When i further googled to know how to use REST API i got to know that use http://teamcity.server.url/httpAuth/app/rest/buildTypes/id:bt284/builds?status=SUCCESS&count=20 URL and pass some parameters. But unfortuneatly this URL is not working at my end.

Then i browsed http://confluence.jetbrains.net/display/TW/REST+API+Plugin URL where instructed to access this server using http://teamcity:8111/http://confluence.jetbrains.net/display/TW/REST+API+Plugin URL which is failed.

So i need help from you to let me know what steps i need to follow  so that i can access REST API.

What are the parameters that needs to be passed so that i can get the data in XML file.

Note: Following are the limitation/Challanges at my end.

1> Never worked on teamcity.

2> Don't have teamcity and REST API on my machine.

3> I am not the technical person to write any plugin or java related code. Also currently don't have java plateform available.

4> What are the parameters that needs to be passed to get the required info?

5> How to access teamcity server?

Attaching the document regarding all the challenges facing with teamcity.Please take time to go through it.

______________________________________________________________________________________________________________________________________________________________

I am also posting the solution which is sent through mail by Yegor Yarko:

Hello,

Seems you can try to use REST API: http://confluence.jetbrains.net/display/TW/REST+API+Plugin which is not fully documented, but you can ask us any related questions on it.

Another approach can be writing your own TeamCity Java/Groovy/JRuby plugin that will be exposing necessary data to your application.
Here is the documentation on writing TeamCity plugins:
http://confluence.jetbrains.net/display/TCD6/Developing+TeamCity+Plugins

You can also find some examples or related TeamCity plugins in the plugin listing: http://www.jetbrains.net/confluence/display/TW/TeamCity+Plugins

Do not hesitate to contact us with specific questions on data retrieval.

--
Best regards,


Yegor Yarko
QA Engineer (TeamCity)
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"



Attachment(s):
Teamcity.doc
0
Comment actions Permalink

Hi

teamcity.server.url and teamcity:8111 in these links are just examples. You need to replace it by an actual name of TeamCity instance deployed in your organization.
The server can be accessed remotely, and no special client lib for REST API is required - it works over pure HTTP requests.

Michael

0
Comment actions Permalink

Thanks Michael for  replying.

But i need to understand about the parameters that needs to be passed so that we can get the understanding of teamcity data model.

Your quick response will be helpful.

0
Comment actions Permalink
Thanks Michael for  replying.

But i need to understand about the parameters that needs to be passed so that we can get the understanding of teamcity data model and accordingly can extract the data to get the required metrics.

Your quick response will be helpful.
0
Comment actions Permalink

Not sure I understand the question.

For example, /httpAuth/app/rest/projects request shows a list of registered projects.
Using this info you can obtain settings of specific project, then build history, and so on.

Michael

0
Comment actions Permalink

Thanks Michael, i followed your advice and accessed the actual sever/instance name.
 
I was successfully able to access all the configured projects while using following URL http://teamcity:8111/overview.html
where http://teamcity:8111/ = Actual Server/Instance name.
 
Then i tried to access REST API using the following link:
http://teamcity:8111//httpAuth/app/rest/projects where http://teamcity:8111/ = Actual Server/Instance name
 
Unfortunately getting "HTTP Status 404" error (Apache Tomcat/6.0.18). Attached is the screenshot of the error.
 
Can you pls advice me what can be wrong here and what can be done here to resolve it?
 
Your quick response will be helpful.


0
Comment actions Permalink

I think two slashes cause this:
http://teamcity:8111//httpAuth/app/rest/projects

Try to change the address to

http://teamcity:8111/httpAuth/app/rest/projects


0
Comment actions Permalink

Here is the attachment.



Attachment(s):
REST API.bmp
0
Comment actions Permalink

Please show on screenshot successful connection to overview.html page.
Maybe our forum engine converts links within message text, so I need to understand real server name.

Thanks

0
Comment actions Permalink

I hope these screenshots from my lab will be helpful.



Attachment(s):
rest.PNG
overview.PNG
0
Comment actions Permalink

what can be the issue?

0
Comment actions Permalink

What version of TeamCity do you have?
This REST functionality is available since 5.0 only.

0
Comment actions Permalink

Thanks for the updates Michael.

Will get back to you soon.

0
Comment actions Permalink

Hi Michale ,

Through REST API got the following information:
<project webUrl='' description = '' archived = '' name = '' id ='' href=''>
<buildType id = '' name = '' href ='' projectName = '' projectId= '' webURL =''>

How can i get the useful statistical metrics with the help of these parameters?
In other words what is the next step now?

Thanks in advance

0
Comment actions Permalink

Hi

These XMLs show raw data. Statistics can be counted on your side.
For example /projects page shows all the created projects, just count number of <project> elements.
Following href's you can obtain build history, and so on.

Michael

0
Comment actions Permalink

Michael, let me againg mention the requirement which is as follows :

We are in the development of designing dashboards. We want to incorporate teamcity data in our existing dashboard.

For this purpose we need teamcity data model design diagram. So that this data can be extracted using ETL tools.

For this purpose we were trying to use REST API. When we accessed REST API we are getting the raw xml which i mentioned in previous post.

I am struggling to find out how REST API can provide teamcity metrics so that we can show that metrics in our dashboard.

It will be great help if you can provide the step by step approch to fulfill the requirement.

Thanks in advance

0
Comment actions Permalink

Hello,

Can you please list the metrics that you want to get from TeamCity?

As to data model design diagram:

There are several layers of data representation in TeamCity: database+data directory settings; Java open API; REST API.
Database model is not "public" in the sense that we generally do not recommend directly accessing it as it can change from one relese to another without any notice.
Java open API model is the most comprehensive one, but requires writing a Java plugin for TeamCity to be used. The description can be found in the JavaDoc available with the TeamCity distribution.
REST API data model is limited comparing to the above but can be used from external tools and is relatively stable. As I've mentioned, is is not fully documented, but you can crawl the data structures served via the API to learn what is available.

Also, feel free to ask questions on how to retrieve specific data that you need.

We do not have any special support for ETL tools. Specific information in the required format can be extracted via a custom Java plugin.

0
Comment actions Permalink

Hi,

As per the above discussion following are my observation:

To extract the data from the following link


need to write a Java plugin for TeamCity for which documentation is available in the following link (pls correct if i am wrong here)
http://confluence.jetbrains.net/display/TCD6/Developing+TeamCity+Plugins

Note: It is not for the latest version. Can you share the link for latest version doc.

Please confirm thanks asap.

0
Comment actions Permalink

Please help by replying the above post as need to work on the Java Plugin to fetch the data.

Please help.

0
Comment actions Permalink

Hi

The link you provided does not look like an instance of our product.

As my colleague stated above, the approach very depends on your project - what kind of charts and metrics do you need to generate?

We provide two APIs:

  1. RESTful API to access the data using HTTP-requests
  2. Java API to develop you own plugins


First way is much simplier, but has limitations.

Michael

0

Please sign in to leave a comment.