CI/CD
Description of the JSON object structure describing a pipeline
Field | Type | Description |
---|---|---|
id |
String | Pipeline ID |
status |
String | Pipeline status. Possible values: CREATED , PENDING , WAITING_FOR_RESOURCE , RUNNING , SUCCESS , FAILED , CANCELED , SKIPPED , MANUAL , WARNING |
duration |
String | Pipeline execution duration in seconds |
localId |
String | Local pipeline ID |
commitId |
String | Commit hash for which the pipeline was created |
projectId |
String | Project ID where the pipeline was started |
userId |
String | User ID who started the pipeline |
beforeCommitId |
String | Deprecated parameter. Returns null by default |
ref |
String | Indicates the ref for which the pipeline was started - branch or tag |
source |
String | Source that triggered the pipeline. Possible values: PUSH , TRIGGER , SCHEDULE , WEB , API , PARENT_PIPELINE , MERGE_REQUEST_EVENT |
configSource |
String | Deprecated parameter. Returns null by default |
failureReason |
String | Reason why the pipeline finished with FAILED status |
startedAt |
String | Time when the pipeline started execution |
finishedAt |
String | Time when the pipeline finished execution |
createdAt |
String | Time when the pipeline was created |
tag |
String | Deprecated parameter. Returns false by default |
Description of the JSON object structure describing a job
Field | Type | Description |
---|---|---|
id |
String | Job ID |
localId |
Integer | Local job ID |
finishedAt |
Date | Finish time |
startedAt |
Date | Start time |
name |
String | Job name |
stageName |
String | Stage name to which the job is attached |
tag |
Boolean | Whether the job is attached to a tag true or not false |
ref |
String | Indicates the ref for which the pipeline was started - branch or tag |
artifactsExpireAt |
Date | Date when the artifact will expire |
status |
String | Job status. Possible values: CREATED , PENDING , WAITING_FOR_RESOURCE , RUNNING , SUCCESS , FAILED , CANCELED , SKIPPED , MANUAL , WARNING |
pipelineLocalId |
Integer | Local pipeline ID |
erasedAt |
Deprecated | Deprecated parameter. Returns null by default |
Description of the JSON object structure describing an artifact
Field | Type | Description |
---|---|---|
id |
String | Artifact ID |
fileType |
Integer | File type |
size |
String | Size in bytes |
expireAt |
Date | Date when the artifact expires |
fileName |
String | File name |
downloadUrl |
String | Artifact download path |
jobLocalId |
Integer | Local job ID |
Description of the JSON object structure describing pipeline lifetime settings
You can find out about pipeline lifetime settings here
Field | Type | Description |
---|---|---|
lifetime |
Integer | Pipeline lifetime before automatic deletion (in days) |
ownerType |
String | Settings owner type. Possible values: COMPANY , TEAM |
uuid |
String | Pipeline lifetime settings UUID |
enabled |
Boolean | Automatic pipeline deletion enabled true or disabled false |
Methods for pipelines
Method to get the list of project pipelines
GET /project/{ownerAlias}/{projectAlias}/cicd/pipeline
The request returns a list of project pipelines, with the ability to configure pagination
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
Responses
STATUS 200
- List of pipelines successfully returned.
Example response
{
"_embedded": {
"restPipelineModelList": [
{
"id": "d4b27a95-aaaa-aaaa-aaaa-97632f700b27",
"status": "SUCCESS",
"duration": 3,
"localId": 2,
"commitId": "86d949be6ec074aaaaaaaaaaaad98acef85341f7",
"projectId": "f980649d-aaaa-aaaa-aaaa-40102294aa2d",
"userId": "02d57aff-aaaa-aaaa-aaaa-9edc50257a42",
"beforeCommitId": null,
"ref": "master",
"source": "WEB",
"configSource": null,
"failureReason": null,
"startedAt": null,
"finishedAt": "2024-09-19T15:08:11.026116",
"createdAt": "2024-09-19T15:08:06.97725",
"tag": false
},
{
"id": "19975dcd-aaaa-aaaa-aaaa-bbd6494c5bc0",
"status": "SUCCESS",
"duration": 3,
"localId": 1,
"commitId": "6d8b6e82f18c5eaaaaaaaaaaaa21e1e1e3a16f2b",
"projectId": "f980649d-aaaa-aaaa-aaaa-40102294aa2d",
"userId": "02d57aff-aaaa-aaaa-aaaa-9edc50257a42",
"beforeCommitId": null,
"ref": "master",
"source": "PUSH",
"configSource": null,
"failureReason": null,
"startedAt": null,
"finishedAt": "2024-09-19T15:07:50.840049",
"createdAt": "2024-09-19T15:06:11.109839",
"tag": false
}
]
},
"page": {
"size": 10,
"totalElements": 2,
"totalPages": 1,
"number": 0
}
}
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to get job information
GET /project/{ownerAlias}/{projectAlias}/cicd/pipeline/{localId}/jobs
The request returns a list of pipeline jobs, with the ability to configure pagination
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Pipeline number |
Responses
STATUS 200
- List of jobs for the specified pipeline successfully returned.
Example response
{
"_embedded": {
"restPipelineJobModelList": [
{
"id": "a550da80-aaaa-aaaa-aaaa-1698bac3e8e9",
"localId": 1,
"finishedAt": "2023-01-01T00:00:00.00000Z",
"startedAt": null,
"name": "job 1",
"stageName": "build",
"tag": false,
"ref": "master",
"erasedAt": null,
"artifactsExpireAt": null,
"status": "SUCCESS",
"pipelineLocalId": 1
}
]
},
"page": {
"size": 10,
"totalElements": 1,
"totalPages": 1,
"number": 0
}
}
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to get artifact information
GET /project/{ownerAlias}/{projectAlias}/cicd/pipeline/{localId}/artifacts
The request returns a list of pipeline artifacts, with the ability to configure pagination
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Pipeline number |
Responses
STATUS 200
- List of artifacts for the specified pipeline successfully returned.
Example response
{
"_embedded": {
"restPipelineJobArtifactModelList": [
{
"id": "g4i6tfl6-aaaa-aaaa-aaaa-i4t0707fl194",
"fileType": "metadata",
"size": 125667,
"expireAt": "2023-06-13T15:40:26.145095Z",
"fileName": "d00c197c-aaaa-aaaa-aaaa-a902b51f230f.log",
"downloadUrl": "api.gitflic.ru/project/username/projectname/cicd/job/1/artifact/g4i6tfl6-aaaa-aaaa-aaaa-i4t0707fl194/download",
"jobLocalId": 1
}
]
},
"page": {
"size": 1,
"totalElements": 1,
"totalPages": 1,
"number": 0
}
}
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to download artifacts
GET /project/{ownerAlias}/{projectAlias}/cicd/pipeline/{localId}/artifacts-download
The request downloads a pipeline artifact
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Pipeline number |
Responses
STATUS 200
- File download process starts.
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to start a pipeline
POST /project/{ownerAlias}/{projectAlias}/cicd/pipeline/start
The request starts a new pipeline for the default project branch
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
Request
Supported format: application/json
POST request body structure:
Field | Type | Description |
---|---|---|
refName |
String | Optional parameter. Branch or tag name to start the pipeline on |
isTag |
Boolean | Required if refName is specified. Indicates whether refName is a tag true or a branch false |
variables |
Object |
Optional parameter. Object containing variable names and values that will exist only for this pipeline |
Example JSON object
{
"refName": "master",
"isTag": "false",
"variables": [
{
"key": "pass",
"value" : "123"
},
{
"key": "name",
"value" : "adminuser"
}
]
}
Responses
STATUS 200
- New pipeline execution started.
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to restart a pipeline
POST /project/{ownerAlias}/{projectAlias}/cicd/pipeline/{localId}/restart
The request restarts the pipeline
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Pipeline number |
Responses
STATUS 200
- Pipeline restarted.
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to cancel pipeline execution
POST /project/{ownerAlias}/{projectAlias}/cicd/pipeline/{localId}/cancel
The request cancels pipeline execution
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Pipeline number |
Responses
STATUS 200
- Pipeline execution stopped.
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to delete a pipeline
DELETE /project/{ownerAlias}/{projectAlias}/cicd/pipeline/{localId}/delete
The request deletes the pipeline
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Pipeline number |
Responses
STATUS 200
- Pipeline deleted.
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Methods for jobs
Method to get job information by id
GET /project/{ownerAlias}/{projectAlias}/cicd/job/{localId}
The request returns information about a job
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Job number |
Responses
STATUS 200
- Job successfully returned.
Example response
{
"id": "g00i197t-aaaa-aaaa-aaaa-4902i51t230f",
"localId": 1,
"finishedAt": "2023-01-01T00:00:00.00000Z",
"startedAt": null,
"name": "job 1",
"stageName": "stage",
"tag": false,
"ref": "master",
"erasedAt": null,
"artifactsExpireAt": null,
"status": "FAILED",
"pipelineLocalId": 1
}
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to get job artifact information
GET /project/{ownerAlias}/{projectAlias}/cicd/job/{localId}/artifacts
The request returns information about job artifacts, with the ability to configure pagination
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Job number |
Responses
STATUS 200
- List of job artifacts successfully returned.
Example response
{
"_embedded": {
"restPipelineJobArtifactModelList": [
{
"id": "g4i6tfl6-aaaa-aaaa-aaaa-i4t0707fl194",
"fileType": "metadata",
"size": 125667,
"expireAt": "2023-01-01T00:00:0.00000Z",
"fileName": "g4i6tfl6-aaaa-aaaa-aaaa-i4t0707fl194.log",
"downloadUrl": "api.gitflic.ru/project/username/projectname/cicd/job/1/artifact/g4i6tfl6-aaaa-aaaa-aaaa-i4t0707fl194/download",
"jobLocalId": 1
}
]
},
"page": {
"size": 1,
"totalElements": 1,
"totalPages": 1,
"number": 0
}
}
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to lock job artifacts
POST /project/{ownerAlias}/{projectAlias}/cicd/job/{localId}/{artifactUuid}/lock
The request locks a job artifact
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Job number |
artifactUuid |
String | Artifact UUID |
Responses
STATUS 200
- Artifact locked.
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to unlock job artifacts
POST /project/{ownerAlias}/{projectAlias}/cicd/job/{localId}/{artifactUuid}/unlock
The request unlocks a job artifact
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Job number |
artifactUuid |
String | Artifact UUID |
Responses
STATUS 200
- Artifact unlocked.
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to download job artifacts
GET /project/{ownerAlias}/{projectAlias}/cicd/job/{localId}/artifacts-download
The request starts the process of downloading job artifacts
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Job number |
Responses
STATUS 200
- Artifacts downloaded.
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to download artifact by uuid
GET /project/{ownerAlias}/{projectAlias}/cicd/job/{localId}/artifact/{artifactUuid}/download
The request starts the process of downloading a job artifact
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Job number |
artifactUuid |
String | Artifact UUID |
Responses
STATUS 200
- Artifacts downloaded.
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to restart a job
POST /project/{ownerAlias}/{projectAlias}/cicd/job/{localId}/restart
The request restarts a job
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Job number |
Responses
STATUS 200
- Job restarted.
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to cancel job execution
POST /project/{ownerAlias}/{projectAlias}/cicd/job/{localId}/cancel
The request cancels job execution. You can only cancel jobs that are NOT in Success
, Canceled
, or Failed
status
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Job number |
Responses
STATUS 200
- Job execution canceled.
STATUS 400
- Error when trying to cancel a job in Success
, Failed
, or Canceled
status
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to delete an artifact
DELETE /project/{ownerAlias}/{projectAlias}/cicd/job/{localId}/artifact/{artifactUuid}/delete
The request deletes a job artifact
Path variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
localId |
String | Job number |
artifactUuid |
String | Artifact UUID |
Responses
STATUS 200
- Artifact deleted.
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Methods for CI/CD settings
Method to get pipeline lifetime settings
Company: GET /company/{companyAlias}/cicd/pipeline-lifetime
Team: GET /team/{teamAlias}/cicd/pipeline-lifetime
The request returns pipeline lifetime settings for the specified entity with the given alias.
Path variable | Type | Description |
---|---|---|
companyAlias |
String | Company alias |
teamAlias |
String | Team alias |
Responses
STATUS 200
- Pipeline lifetime settings returned:
Example response
{
"lifetime": 90,
"ownerType": "COMPANY",
"uuid": "986313a5-aaaa-aaaa-aaaa-56f719abb3a0",
"enabled": true
}
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Method to edit pipeline lifetime settings
Company: PATCH /company/{companyAlias}/cicd/pipeline-lifetime/edit
Team: PATCH /team/{teamAlias}/cicd/pipeline-lifetime/edit
The request edits and returns pipeline lifetime settings for the specified entity with the given alias.
Path variable | Type | Description |
---|---|---|
companyAlias |
String | Company alias |
teamAlias |
String | Team alias |
Request
Supported format: JSON
PATCH request body structure:
Field | Type | Description |
---|---|---|
enabled |
Boolean | Automatic pipeline deletion enabled true or disabled false |
lifetime |
Integer | Pipeline lifetime before automatic deletion (in days) |
Example JSON object
{
"enabled": true
"lifetime": 90,
}
Responses
STATUS 200
- Pipeline lifetime settings changed:
Example response
{
"lifetime": 90,
"ownerType": "COMPANY",
"uuid": "986313a5-aaaa-aaaa-aaaa-56f719abb3a0",
"enabled": true
}
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
STATUS 422
- Required field not specified in the request body.
Method to apply pipeline lifetime settings to projects
Company: POST /company/{companyAlias}/cicd/apply-settings-to-projects
Team: POST /team/{teamAlias}/cicd/apply-settings-to-projects
The request applies pipeline lifetime settings to all projects of the specified entity with the given alias.
Path variable | Type | Description |
---|---|---|
companyAlias |
String | Company alias |
teamAlias |
String | Team alias |
Responses
STATUS 204
- Pipeline lifetime settings applied to all child projects.
STATUS 403
- No access rights.
STATUS 404
- No data found for the request.
Automated translation!
This page was translated using automatic translation tools. The text may contain inaccuracies.