Interact with Changes

You are viewing an old version (v. 14) of this page.
The latest version is v. 27, last edited on Jun 13, 2011 (view differences | )
<< View previous version | view page history | view next version >>
TOC

Since QuickBuild 4.0, you can retrieve changes via RESTful APIs. The base URI for changes RESTful APIs is:

/rest/changes

List all supported APIs

URI Response Type Params
/rest/changes/help text/html  

Get the data version of changes

URI Response Type Params
/rest/changes/version text/plain  

Get the commit stats

URI Response Type Params
/rest/changes/stats/{configuration_id} application/xml
  • configuration_id
    Id of the configuration.
  • build_id
    The build id you want.
  • from_build
    Specify the from build when finding changes in a build range.
  • to_build
    Specify the to build when finding changes in a build range.
  • from_date
    Specify the from date when finding changes in a build range.
  • to_date
    Specify the to date when finding changes in a build range.
  • date_pattern
    Specify the date pattern when query by a date range, by default, the pattern is yyyyMMdd.
  • repository
    Get the changes only in a specific repository.
  • committer
    Get the changes only committed by the specified committer

Query stats of a specific build

http://quickbuild:8810/rest/changes/stats/25?build_id=102

the response looks like:

<stats commits="5" modifications="7" added="2" modified="3" deleted="2"/>

Query stats for a build range

http://quickbuild:8810/rest/changes/stats/25?from_build=100&to_build=120

Query stats for a date range

http://quickbuild:8810/rest/changes/stats/25?from_date=20110501&to_date=20110601

by default, the date pattern is yyyyMMdd, you can also specify the date pattern by adding parameter date_pattern, the valid date pattern can be found here, for example:

http://quickbuild:8810/rest/changes/stats/25?from_date=2011-05-01&to_date=2011-06-01&date_pattern=yyyy-MM-dd

Query stats of a specific repository or committer
By adding repository or committer parameter, you can get the stats of a specific repository or committer, for example:

http://quickbuild:8810/rest/changes/stats/25?build_id=102&repository=mysvn

this will get the stats data for repository mysvn.

Retrieve the commits

URI Response Type Params
/rest/changes/commits/{configuration_id} application/xml
  • configuration_id
    The id of configuration.
  • build_id
    The id of a specific build.
  • from_build
    Specify the from build when finding changes in a build range, must be specified with to_build.
  • to_build
    Specify the to build when finding changes in a build range, must be specified with from_build.
  • date_pattern
    Specify the date pattern when query by a date range, by default, the pattern is yyyyMMdd.
  • from_date
    Specify the from date when finding changes in a build range.
  • to_date
    Specify the to date when finding changes in a build range.
  • repository
    Get the changes only in a specific repository.
  • committer
    Get the changes only committed by the specified committer.
  • offset
    Specify the first record when iterate the records, by default, the offset is 0.
  • limit
    Specify the number of total records you want to retrieve, by default, the limit is 50.
  • asc
    Boolean type, specify the order by commit date ascendent or descendent, by default, it is false.

Query the commits of a build

http://quickbuild:8810/rest/changes/commits/19?build_id=102&offset=10&limit=20

the response looks like:

<report name="changesets" version="0.0" locale="en_US">
  <row ID="10" buildId="320" changeId="f090cd04725c5551f8a439fe0a53591193ea79c3" repository="hg" commitDate="2011-05-31T03:45:55.000+08:00" modifications="1" committer="steve" userId="2" added="1" modified="0" deleted="0">
    <comment><![CDATA[some comments]]></comment>
    <additional><![CDATA[ 13 ]]></additional>
  </row>
  <row ID="11" buildId="320" changeId="f090cd04725c5551f8a439fe0a53591193ea79c3" repository="hg" commitDate="2011-05-31T03:45:55.000+08:00" modifications="1" committer="steve" userId="2" added="1" modified="0" deleted="0">
    <comment><![CDATA[some comments]]></comment>
    <additional><![CDATA[ 13 ]]></additional>
  </row>
	
	... ...
</report>

the format of commit date here is using ISO8601 standard. Element additional stores some additional information of the commits. For mercurial (hg) or bazaar, the additional stores the revision no.

Query the commits of a build range

http://quickbuild:8810/rest/changes/commits/19?from_build=10&to_build=20

Query the commits of a date range

http://quickbuild:8810/rest/changes/commits/19?from_date=20110501&to_date=20110601

Query the commits of a specific repository or committer
By adding repository or committer parameter, you can get the commits of a specific repository or committer, for example:

http://quickbuild:8810/rest/changes/commits/25?build_id=102&repository=mysvn
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.