A project is a container for one or more repositories, a secret for accessing the repositories and further configuration.
The REST API provides support for a number of operations:
Creates a new project with specified parameters.
/api/v1/org/${orgName}/project
POST
Authorization
, Content-Type: application/json
{
"name": "myProject",
"description": "my project",
"repositories": {
"myRepo": {
"url": "...",
"branch": "...",
"path": "...",
"secret": "..."
}
},
"cfg": {
...
}
}
All parameters except name
are optional.
The project configuration is a JSON object of the following structure:
{
"group1": {
"subgroup": {
"key": "value"
}
},
"group2": {
...
}
}
Most of the parameter groups are defined by used plugins.
Content-Type: application/json
{
"ok": true,
"result": "CREATED"
}
Updates parameters of an existing project.
/api/v1/org/${orgName}/project
POST
Authorization
, Content-Type: application/json
{
"name": "New name",
"id": "---",
"description": "my updated project",
"repositories": {
"myRepo": {
"url": "...",
"branch": "...",
"secret": "..."
}
},
"cfg": {
...
}
}
All parameters are optional.
Omitted parameters are not updated.
Project id
is mandatory, in case of updating project name
, .
An empty value must be specified in order to remove a project’s value:
e.g. an empty repositories
object to remove all repositories from a project.
See also: project configuration.
Content-Type: application/json
json
{
"ok": true,
"result": "UPDATED",
"id": "---"
}
**
Removes a project and its resources.
/api/v1/org/${orgName}/project/${projectName}
DELETE
Authorization
Content-Type: application/json
{
"ok": true,
"result": "DELETED"
}
Lists all existing projects.
/api/v1/org/${orgName}/project
sortBy
: projectId
, name
;asc
: direction of sorting, true
- ascending, false
- descendingGET
Content-Type: application/json
[
{ "name": "..." },
{ "name": "...", "description": "my project", ... }
]
Returns project’s configuration JSON or its part.
/api/v1/org/${orgName}/project/${projectName}/cfg/${path}
path
: path to a sub-object in the configuration, can be emptyGET
Authorization
Content-Type: application/json
{
...
}
Updates project’s configuration or its part.
/api/v1/org/${orgName}/project/${projectName}/cfg/${path}
path
: path to a sub-object in the configuration, can be emptyPUT
Authorization
, Content-Type: application/json
Content-Type: application/json
{
"group1": {
"param1": 123
}
}
Content-Type: application/json
{
"ok": true,
"result": "UPDATED"
}
Returns project’s current access rules.
/api/v1/org/${orgName}/project/${projectName}/access
GET
Authorization
Content-Type: application/json
[
{"teamId": "...", "level": "..."},
...
]
Updates project’s access rules for a specific team.
/api/v1/org/${orgName}/project/${projectName}/access
POST
Authorization
, Content-Type: application/json
Content-Type: application/json
{
"teamId": "9304748c-81e6-11e9-b909-0fe0967f269a",
"orgName": "myOrg",
"teamName": "myTeam",
"level": "READER"
}
Either teamId
or orgName
and teamName
combinations are allowed.
The level
parameter accepts one of the three possible values:
READER
WRITER
OWNER
Content-Type: application/json
{
"ok": true,
"result": "UPDATED"
}
curl -ikn -H 'Content-Type: application/json' \
-d '{"orgName": "MyOrg", "teamName": "myTeam", "level": "READER"}' \
http://concord.example.com/api/v1/org/MyOrg/project/MyProject/access
Updates project’s access rules for multiple teams.
/api/v1/org/${orgName}/project/${projectName}/access/bulk
POST
Authorization
, Content-Type: application/json
Content-Type: application/json
[{
"teamId": "9304748c-81e6-11e9-b909-0fe0967f269a",
"orgName": "myOrg",
"teamName": "myTeam",
"level": "READER"
}]
Accepts a list of access rule elements. See the non-bulk version of this method for description.
Content-Type: application/json
{
"ok": true,
"result": "UPDATED"
}
Moves the project to the specified Organization (through Organization name ID)
/api/v1/org/${orgName}/project
POST
Authorization
, Content-Type: application/json
Content-Tupe: application/json
{
"name": "myProject",
"orgName": "anotherOrg"
}
Also accepts orgId
(Unique Organization ID) instead of orgName
in the request body.
Content-Type: application/json
{
"ok": true,
"result": "UPDATED"
}