Available in Classic and VPC
Change pipeline settings.
Request
This section describes the request format. The method and URI are as follows:
Method | URI |
---|---|
PATCH | /api/v1/project/{projectId} |
Request headers
For information about the headers common to all SourcePipeline APIs, see SourcePipeline request headers.
Request path parameters
You can use the following path parameters with your request:
Field | Type | Required | Description |
---|---|---|---|
projectId |
String | Required | Pipeline ID
|
Request body
You can include the following data in the body of your request:
Field | Type | Required | Description |
---|---|---|---|
description |
String | Optional | Pipeline description |
tasks |
Array | Required | Job list |
trigger |
Object | Optional | Trigger settings |
trigger.repository |
Array | Optional | Push trigger settings |
trigger.sourcepipeline |
Array | Optional | Pipeline trigger settings |
trigger.schedule |
Array | Optional | Reserved trigger settings |
tasks
The following describes tasks
.
Field | Type | Required | Description |
---|---|---|---|
name |
String | Required | Job name
|
type |
String | Required | Job type
|
config |
Object | Required | Set jobs. |
config.projectId |
Number | Required | Job project ID
|
config.stageId |
Number | Conditional | Deployment stage ID
|
config.scenarioId |
Number | Conditional | Deployment scenario ID
|
config.target |
Object | Optional | Connection information |
config.target.info |
Object | Optional | Detailed connection information |
config.target.info.branch |
String | Optional | Branch name
|
linkedTasks |
Array | Required | Preceding job name
|
repository
The following describes repository
.
Field | Type | Required | Description |
---|---|---|---|
type |
String | Conditional | Repository type
|
name |
String | Conditional | Repository name
|
branch |
String | Conditional | Branch name
|
sourcepipeline
The following describes sourcepipeline
.
Field | Type | Required | Description |
---|---|---|---|
id |
Number | Conditional | Pipeline ID
|
schedule
The following describes schedule
.
Field | Type | Required | Description |
---|---|---|---|
day |
Array | Conditional | List of reserved execution days of the week
|
time |
String | Conditional | Reserved execution time
|
timeZone |
String | Conditional | Reserved trigger time zone
|
scheduleOnlyWithChange |
Boolean | Conditional | Whether to execute when changing SourceCommit and SourcePipeline
|
Request example
The request example is as follows:
curl --location --request PATCH 'https://vpcsourcepipeline.apigw.ntruss.com/api/v1/project/2***' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'Content-Type: application/json' \
--data '{
"tasks": [
{
"name": "task1",
"type": "SourceBuild",
"config": {
"projectId": 20***,
"target": {
"info": {
"branch": "master"
}
}
},
"linkedTasks": []
},
{
"name": "task2",
"type": "SourceDeploy",
"config": {
"projectId": 2***,
"stageId": 3***,
"scenarioId": 2***
},
"linkedTasks": [
"task1"
]
}
],
"trigger": {
"schedule": [
{
"day": [
"MON",
"WED",
"FRI",
"SUN"
],
"time": "01:00",
"timeZone": "Asia/Seoul (UTC+09:00)",
"scheduleOnlyWithChange": true
}
]
}
}'
Response
This section describes the response format.
Response body
The response body includes the following data:
Field | Type | Required | Description |
---|---|---|---|
result |
Object | - | Response result |
result.result |
Boolean | - | API call success status
|
Response status codes
For information about the HTTP status codes common to all SourcePipeline APIs, see SourcePipeline response status codes.
Response example
The response example is as follows:
{
"result": {
"result": true
}
}