28.2.4. Branches
The Knowledge Store REST API supports the following endpoints for managing branches in Business Central. The Knowledge Store REST API base URL is http://SERVER:PORT/decision-central/rest/. All requests require HTTP Basic authentication or token-based authentication for the rest-all user role.
- [GET] /spaces/{spaceName}/projects/{projectName}/branches
Returns all branches in a specified project and space.
Expand 表28.16 Request parameters Name Description Type Requirement spaceNameName of the space for which you are retrieving projects
String
Required
projectNameName of the project for which you are retrieving branches
String
Required
Example server response (JSON)
[ { "name":"master" } ]- [POST] /spaces/{spaceName}/projects/{projectName}/branches
Adds a specified branch in a specified project and space.
Expand 表28.17 Request parameters Name Description Type Requirement spaceNameName of the space where the project is located
String
Required
projectNameName of the project in which the new branch needs to be created
String
Required
body
The
newBranchNameandbaseBranchNameof a projectRequest body
Required
Example request body (JSON)
{ "newBranchName": "branch01", "baseBranchName": "master" }Example server response (JSON)
{ "jobId": "1576175811141-3", "status": "APPROVED", "spaceName": "Space123", "projectName": "ProjABC", "newBranchName": "b1", "baseBranchName": "master", "userIdentifier": "bc" }- [DELETE] /spaces/{spaceName}/projects/{projectName}/branches/{branchName}
Deletes a specified branch in a specified project and space.
Expand 表28.18 Request parameters Name Description Type Requirement spaceNameName of the space where the project is located
String
Required
projectNameName of the project where the branch is located
String
Required
branchNameName of the branch to be deleted
String
Required
Example server response (JSON)
{ "jobId": "1576175811421-5", "status": "APPROVED", "spaceName": "Space123", "projectName": "ProjABC", "branchName": "b1", "userIdentifier": "bc" }- [POST] /spaces/{spaceName}/projects/{projectName}/branches/{branchName}/maven/compile
Compiles a specified branch in a specified project and space. If
branchNameis not specified, then request applies to the master branch.Expand 表28.19 Request parameters Name Description Type Requirement spaceNameName of the space where the project is located
String
Required
projectNameName of the project where the branch is located
String
Required
branchNameName of the branch to be compiled
String
Required
Example server response (JSON)
{ "jobId": "1576175811233-4", "status": "APPROVED", "spaceName": "Space123", "projectName": "ProjABC", "branchName": "b1", }- [POST] /spaces/{spaceName}/projects/{projectName}/branches/{branchName}/maven/install
Installs a specified branch in a specified project and space. If
branchNameis not specified, then request applies to the master branch.Expand 表28.20 Request parameters Name Description Type Requirement spaceNameName of the space where the project is located
String
Required
projectNameName of the project where the branch is located
String
Required
branchNameName of the branch to be installed
String
Required
Example server response (JSON)
{ "jobId": "1576175811233-4", "status": "APPROVED", "spaceName": "Space123", "projectName": "ProjABC", "branchName": "b1", }- [POST] /spaces/{spaceName}/projects/{projectName}/branches/{branchName}/maven/test
Tests a specified branch in a specified project and space. If
branchNameis not specified, then request applies to the master branch.Expand 表28.21 Request parameters Name Description Type Requirement spaceNameName of the space where the project located
String
Required
projectNameName of the project where the branch is located
String
Required
branchNameName of the branch to be tested
String
Required
Example server response (JSON)
{ "jobId": "1576175811233-4", "status": "APPROVED", "spaceName": "Space123", "projectName": "ProjABC", "branchName": "b1", }- [POST] /spaces/{spaceName}/projects/{projectName}/branches/{branchName}/maven/deploy
Deploys a specified branch in a specified project and space. If
branchNameis not specified, then request applies to the master branch.Expand 表28.22 Request parameters Name Description Type Requirement spaceNameName of the space where the project is located
String
Required
projectNameName of the project where the branch is located
String
Required
branchNameName of the branch to be deployed
String
Required
Example server response (JSON)
{ "jobId": "1576175811233-4", "status": "APPROVED", "spaceName": "Space123", "projectName": "ProjABC", "branchName": "b1", }