CCNet API documents?

I want to query my CCNet server to find out the build status. I heard rumors that there is a (ReST?) API, but I cannot find any documentation for it.

Is there any documentation for it, or do I need to download the CCNet source code and start reading?

EDIT: I found the endpoint /XmlStatusReport.aspx which gives a general overview of all projects. The same file name in any folder gives exactly the same answer, so I am afraid that this may be the only API.

+8
api ccnet-config
source share
1 answer

As an alternative to the XML that you already mentioned, you can use remote access, as the CCTray application does. If you link to ThoughtWorks.CruiseControl.Remote.dll from the CruiseControl.NET \ server folder, you can create an instance of CruiseServerRemotingClient and use it to extract information from the server.

The following snippet prints a list of projects on the server and their build statuses:

 CruiseServerRemotingClient client = new CruiseServerRemotingClient("tcp://ccnetserver:21234/CruiseManager.rem"); ProjectStatus[] statusList = client.GetProjectStatus(); foreach (ProjectStatus status in statusList) { Console.WriteLine("{0}: {1}", status.Name, status.BuildStatus); } 

You can also get the log for the latest build in XML format as follows:

 string buildName = client.GetLatestBuildName("Jasenje"); Console.WriteLine(client.GetLog("Jasenje", buildName)); 

I could not find any real documentation for the API, but at least there are XML comments with brief descriptions of the methods and parameters.

+4
source share

Source: https://habr.com/ru/post/651005/


All Articles