<< Back to GForge REST API

Entity: Scm

GET

getAcl

Parameters (1)

Name Type Description
request \RequestParameters

Return: array

getAssociation

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

getBranch

Lists the branches available in this repository, or returns info about a specific branch.

Parameters (1)

Name Type Description
request \RequestParameters
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Return: \api\ScmBranch[]|\api\ScmBranch

Zero or more ScmBranch records for a search. Zero or one ScmBranch record for a name retrieval.

Example 1

Get a single branch by name:
  GET http://api.mygforge.tld/scm/{unixName}/branch/gforge-next

{"name":"gforge-next","type":"branch"}

Example 2

Get branches that begin with next:
  GET http://api.mygforge.tld/scm/{unixName}/branch/?filter=next

{"paging":{"page_size":10,"page_num":1,"sort_field":"id","sort_dir":"asc"},
"items":[{"name":"next\/activitytype-filter#24004","type":"branch"},
{"name":"next\/angular_files_#20823","type":"branch"},
{"name":"next\/anon-ti-edit-redirect-#24330","type":"branch"},
{"name":"next\/anonymous-poll-query-#24322","type":"branch"},
{"name":"next\/audit-display-net-#23881","type":"branch"},
{"name":"next\/avatar-mydashboard-bug#23838","type":"branch"},
{"name":"next\/avatar-none-bug#23841","type":"branch"},
{"name":"next\/beta-users-mailchimp-#25079","type":"branch"},
{"name":"next\/blockquoyed-text-#24966","type":"branch"},
{"name":"next\/burndown-rendering-#24261","type":"branch"}],"links":[]}

Example 3

List the branches:
  GET http://api.mygforge.tld/scm/{unixName}/branch

{"paging":{"page_size":10,"page_num":1,"sort_field":"id","sort_dir":"asc"},
"items":[{"name":"add_gitwebjs_gitignore#23837","type":"branch"},{"name":"angularjs","type":"branch"},
{"name":"api#20980","type":"branch"},{"name":"api-ga-#19613","type":"branch"},
{"name":"api-jsfooter-#19558","type":"branch"},{"name":"apidoc-css-#21234","type":"branch"},
{"name":"atmel-master","type":"branch"},{"name":"audit-text-fields-#23878","type":"branch"},
{"name":"auto_close_#15134","type":"branch"},{"name":"autoapproveproject#25365","type":"branch"}],"links":[]}
Note: Branches are always sorted by name (asc). There are no other sort fields.

getComment

Get the comments associated with any commits between the from and to parameters.

Parameters (1)

Name Type Description
request \RequestParameters

Return: \models\ScmMergeComment[]

Zero or more comments for the specified range of commits.

getCommit

Parameters (1)

Name Type Description
request \RequestParameters
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Related Entities (1)

Return: \api\ScmCommitBasic|\api\ScmCommitBasic[]

Zero or more records.

getFile

Get the properties for a single file, on the specified branch, tag, or commit.

Parameters (1)

Name Type Description
request \RequestParameters

Related Entities (2)

Return: \api\ScmFile

Basic info about the file

getLfs

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

getMerge

Get information about the differences between two revisions Route: /api/scm/{id-unixname}/merge?from=&to=&rel=

Parameters (1)

Name Type Description
request \RequestParameters

Related Entities (2)

Return: \api\ScmMerge

Information about the proposed merge.

getPromotionModel

Get the promotion model associated with this repository.

Parameters (1)

Name Type Description
request \RequestParameters

Return: string[]

The list of promotion branches to be tracked.

getRaw

Get the raw content for a single file, on the specified branch, tag, or commit.

Parameters (1)

Name Type Description
request \RequestParameters

Return: string

The contents of the requested file & version.

getRequestCommitish

Parameters (2)

Name Type Description
request \RequestParameters
project \cm\Project

Return: string[]

Branch, tag name or commit hash, and branch type

getRequestTree

Parameters (1)

Name Type Description
request \RequestParameters

Return: string

The path elements from the request, separated by / characters.

getScm

Return basic information about the SCM configuration for the specified project unix name or ID.

Parameters (1)

Name Type Description
request \RequestParameters

Return: \api\ScmBasic

Zero or one ScmBasic record for the specified project.

Example 1

Get SCM info for a project with unix name = myproject
  GET http://api.mygforge.tld/api/scm/myproject

  {"unixName":"myproject","scmType":"git","defaultBranchName":"master","hostName":"gforge.com",
  "options":{"useSsh":false,"anonymousRead":true,"requireTrackerItemId":false,"mailCommits":false}}

Example 2

Get SCM info for a project with database ID = 12345
  GET http://api.mygforge.tld/api/scm/12345

  {"unixName":"myproject","scmType":"git","defaultBranchName":"master","hostName":"gforge.com",
"options":{"useSsh":false,"anonymousRead":true,"requireTrackerItemId":false,"mailCommits":false}}

getSummary

Get a summary of activity data for the specified project's SCM, over the specified (or default) date range

NOTE: The date range will be filled in by day, even if no data is found for that day, so that the array is continuous across the specified range.

Parameters (1)

Name Type Description
request \RequestParameters

Related Entities (3)

Return: \api\ScmSummary

The summary data, including a stats array with date, checkouts, commits and adds. Not all values are valid for all SCM types, may be empty or zero.

Example 1

Get stats for a given data range
  GET http://api.mygforge.tld/scm/{unixName}/summary?start=2019-01-01&end=2019-01-10
{
  "stats": [
  {
"statDate": "2019-01-01",
"title": "",
"measure": 0,
"section": "",
"refId": 0,
"url": ""
},
{
"statDate": "2019-01-02",
"title": "commits",
"measure": 6,
"section": "",
"refId": 0,
"url": ""
},
{
"statDate": "2019-01-03",
"title": "commits",
"measure": 15,
"section": "",
"refId": 0,
"url": ""
},
{
"statDate": "2019-01-04",
"title": "commits",
"measure": 8,
"section": "",
"refId": 0,
"url": ""
},
{
"statDate": "2019-01-05",
"title": "",
"measure": 0,
"section": "",
"refId": 0,
"url": ""
},
{
"statDate": "2019-01-06",
"title": "",
"measure": 0,
"section": "",
"refId": 0,
"url": ""
},
{
"statDate": "2019-01-07",
"title": "commits",
"measure": 2,
"section": "",
"refId": 0,
"url": ""
},
{
"statDate": "2019-01-08",
"title": "commits",
"measure": 5,
"section": "",
"refId": 0,
"url": ""
},
{
"statDate": "2019-01-09",
"title": "commits",
"measure": 4,
"section": "",
"refId": 0,
"url": ""
}
],
"totalCommits": 40,
"startDate": "2019-01-01",
"endDate": "2019-01-10",
"unixName": "gforge5",
"scmType": null,
"defaultBranchName": null,
"hostName": "localhost",
"options": {
"useSsh": false,
"anonymousRead": false,
"requireTrackerItemId": true,
"validateEmail": false,
"mailCommits": true,
"requireAssignment": false,
"restrictAssocCurrentProject": false,
"accessText": "",
"browseText": ""
},
"rel": []
}

getTag

Lists the tags available in this repository, or returns info about a specific tag.

Parameters (1)

Name Type Description
request \RequestParameters
Sortable
Use the sort_field and sort_dir parameters to control the order in which records are returned.
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Return: \api\ScmBranch

Zero or more ScmBranch records for a search. Zero or one ScmBranch record for a name retrieval.

Example 1

List the tags:
  GET http://api.mygforge.tld/scm/{unixName}/tag

{"paging":{"page_size":115,"page_num":1,"sort_field":"id","sort_dir":"asc"},
"items":[{"name":"6_0b2","type":"tag"},{"name":"V5_7_ce","type":"tag"},{"name":"V5_7texinst","type":"tag"},
{"name":"V_5_2_6","type":"tag"},{"name":"ge-6.1.0","type":"tag"},{"name":"ge-v6.1.2","type":"tag"},
{"name":"ge_6.0.2","type":"tag"},{"name":"noaa_5.2.4.5","type":"tag"},{"name":"raytheon-6.1.2","type":"tag"},
{"name":"raytheon-6.1.3-alpha1","type":"tag"},{"name":"raytheon-6.1.3-beta1","type":"tag"},
{"name":"raytheon-6.1.3b1","type":"tag"},{"name":"remove","type":"tag"},{"name":"sandia_5_2_7b","type":"tag"},
{"name":"siemens-v6.3.1","type":"tag"},{"name":"v5_0","type":"tag"},{"name":"v5_0_1","type":"tag"},
{"name":"v5_0_2","type":"tag"},{"name":"v5_0_3","type":"tag"},{"name":"v5_1","type":"tag"},
{"name":"v5_1_1","type":"tag"},{"name":"v5_1_2","type":"tag"},{"name":"v5_1_3","type":"tag"},
{"name":"v5_1_4","type":"tag"},{"name":"v5_1_a","type":"tag"},{"name":"v5_2","type":"tag"},
{"name":"v5_2_1","type":"tag"},{"name":"v5_2_2","type":"tag"},{"name":"v5_2_4","type":"tag"},
{"name":"v5_2_5","type":"tag"},{"name":"v5_2_6","type":"tag"},{"name":"v5_2_6b","type":"tag"},
{"name":"v5_2_7","type":"tag"},{"name":"v5_2_7b","type":"tag"},{"name":"v5_3","type":"tag"},
{"name":"v5_3_1","type":"tag"},{"name":"v5_3_2","type":"tag"},{"name":"v5_3_2_siemens","type":"tag"},
{"name":"v5_3_2_siemens2","type":"tag"},{"name":"v5_3_3","type":"tag"},{"name":"v5_3b1","type":"tag"},
{"name":"v5_3b3","type":"tag"},{"name":"v5_3b4","type":"tag"},{"name":"v5_3b5","type":"tag"},
{"name":"v5_4_1","type":"tag"},{"name":"v5_4_1ge","type":"tag"},{"name":"v5_4_1noaa","type":"tag"},
{"name":"v5_4_1sandia","type":"tag"},{"name":"v5_4_1siemens","type":"tag"},{"name":"v5_4_2","type":"tag"},
{"name":"v5_4_2ge","type":"tag"},{"name":"v5_4_3","type":"tag"},{"name":"v5_4_4","type":"tag"},
{"name":"v5_4_ge_b1","type":"tag"},{"name":"v5_4_noaa-final","type":"tag"},
{"name":"v5_4_sandia","type":"tag"},{"name":"v5_4_siemens","type":"tag"},{"name":"v5_4fb","type":"tag"},
{"name":"v5_4fb2","type":"tag"},{"name":"v5_4noaa","type":"tag"},{"name":"v5_5","type":"tag"},
{"name":"v5_5_1","type":"tag"},{"name":"v5_5b2","type":"tag"},{"name":"v5_5b3","type":"tag"},
{"name":"v5_5raytheon","type":"tag"},{"name":"v5_5rc1","type":"tag"},{"name":"v5_5rc2","type":"tag"},
{"name":"v5_5sandia","type":"tag"},{"name":"v5_5siemens","type":"tag"},{"name":"v5_6","type":"tag"},
{"name":"v5_6_1","type":"tag"},{"name":"v5_6_1_asterisk","type":"tag"},{"name":"v5_6a","type":"tag"},
{"name":"v5_6rc2","type":"tag"},{"name":"v5_6rc3","type":"tag"},{"name":"v5_6rc4","type":"tag"},
{"name":"v5_7","type":"tag"},{"name":"v5_7_1","type":"tag"},{"name":"v5_7_1_b1_cisco","type":"tag"},
{"name":"v5_7_1_b1_oracle","type":"tag"},{"name":"v5_7_1_ge","type":"tag"},
{"name":"v5_7_1_raytheon","type":"tag"},{"name":"v5_7_1_siemens","type":"tag"},
{"name":"v5_7_1_texinst","type":"tag"},{"name":"v5_7_1ge","type":"tag"},{"name":"v5_7_2","type":"tag"},
{"name":"v5_7_2_ge","type":"tag"},{"name":"v5_7_2_raytheon","type":"tag"},{"name":"v5_7_b2_ge","type":"tag"},
{"name":"v5_7_ge","type":"tag"},{"name":"v5_7_raytheon","type":"tag"},{"name":"v5_7_sandia","type":"tag"},
{"name":"v5_7_siemens","type":"tag"},{"name":"v5_7b1","type":"tag"},{"name":"v5_7b1_oracle","type":"tag"},
{"name":"v5_7ce","type":"tag"},{"name":"v5_7rc1","type":"tag"},{"name":"v5_7rc1-ce","type":"tag"},
{"name":"v5_7texinst","type":"tag"},{"name":"v6.0.3","type":"tag"},{"name":"v6.1","type":"tag"},
{"name":"v6.1.1","type":"tag"},{"name":"v6.1.2","type":"tag"},{"name":"v6.2","type":"tag"},
{"name":"v6.2.1","type":"tag"},{"name":"v6.3.0","type":"tag"},{"name":"v6.3.1","type":"tag"},
{"name":"v6.4.0","type":"tag"},{"name":"v6.4.1","type":"tag"},{"name":"v6_0_1","type":"tag"},
{"name":"v6_0b1","type":"tag"},{"name":"v6_0b2","type":"tag"},{"name":"v6_1b1","type":"tag"},
{"name":"v6_1b2","type":"tag"},{"name":"v_5_2_5","type":"tag"}],"links":[]}

Example 2

Get a single tag by name:
  GET http://api.mygforge.tld/scm/{unixName}/tag/{branchname}

{"name":"6_0b2","type":"tag"}

Example 3

Get tags that begin with v (e.g., v1.0, v0.1):
  GET http://api.mygforge.tld/scm/{unixName}/tag/?filter=v

{"paging":{"page_size":10,"page_num":1,"sort_field":"id","sort_dir":"asc"},
"items":[{"name":"V5_7_ce","type":"tag"},{"name":"V5_7texinst","type":"tag"},
{"name":"V_5_2_6","type":"tag"},{"name":"v5_0","type":"tag"},{"name":"v5_0_1","type":"tag"},
{"name":"v5_0_2","type":"tag"},{"name":"v5_0_3","type":"tag"},{"name":"v5_1","type":"tag"},
{"name":"v5_1_1","type":"tag"},{"name":"v5_1_2","type":"tag"}],"links":[]}

getTree

Get the list of files and folders associated with the specified branch, tag, commit and tree path.

Parameters (1)

Name Type Description
request \RequestParameters

Return: \api\ScmFile[]

Zero or more files and folders

POST

postAcl

Parameters (1)

Name Type Description
request \RequestParameters

Return: \api\ScmModuleApi

postAssociation

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

postComment

Add a comment to the specified commit, file and line. A new record will always be created.

Parameters (1)

Name Type Description
request \RequestParameters

Return: \api\ScmMergeComment

to the newly-created comment, or a set of validation error(s).

postLfs

Parameters (1)

Name Type Description
request \RequestParameters

Return: array

postMerge

Merge one set of changes into another branch/tag/revision.

Parameters (1)

Name Type Description
request \RequestParameters

Related Entities (2)

Return: \api\ScmMerge

Information about the proposed merge.

postPromotionModel

Update the promotion model associated with this repository

Parameters (1)

Name Type Description
request \RequestParameters

Return: array

The updated model

postRepo

Parameters (1)

Name Type Description
requestParameters \RequestParameters

Return: (none)

postScm

Update the SCM configuration for the specified project.

Parameters (1)

Name Type Description
request \RequestParameters

Return: \api\ScmBasic

PUT

putLfs

Parameters (1)

Name Type Description
request \RequestParameters

Return: void

putSshKeys

Parameters (1)

Name Type Description
requestParameters \RequestParameters

Return: (none)

DELETE

deleteAcl

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

deleteAssociation

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)