파이프라인 스케줄 API

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

pipeline schedules에 대해 자세히 알아보실 수 있습니다.

모든 파이프라인 스케줄 가져오기

프로젝트의 파이프라인 스케줄 목록을 가져옵니다.

GET /projects/:id/pipeline_schedules
속성 유형 필수 설명
id integer/string Yes 프로젝트의 ID 또는 URL 인코딩된 경로
scope string No 파이프라인 스케줄의 범위, active, inactive 중 하나여야 함
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules"
[
    {
        "id": 13,
        "description": "테스트 스케줄 파이프라인",
        "ref": "refs/heads/main",
        "cron": "* * * * *",
        "cron_timezone": "Asia/Tokyo",
        "next_run_at": "2017-05-19T13:41:00.000Z",
        "active": true,
        "created_at": "2017-05-19T13:31:08.849Z",
        "updated_at": "2017-05-19T13:40:17.727Z",
        "owner": {
            "name": "관리자",
            "username": "root",
            "id": 1,
            "state": "active",
            "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
            "web_url": "https://gitlab.example.com/root"
        }
    }
]

단일 파이프라인 스케줄 가져오기

프로젝트의 파이프라인 스케줄을 가져옵니다.

GET /projects/:id/pipeline_schedules/:pipeline_schedule_id
속성 유형 필수 설명
id integer/string Yes 프로젝트의 ID 또는 URL 인코딩된 경로
pipeline_schedule_id integer Yes 파이프라인 스케줄 ID
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13"
{
    "id": 13,
    "description": "테스트 스케줄 파이프라인",
    "ref": "refs/heads/main",
    "cron": "* * * * *",
    "cron_timezone": "Asia/Tokyo",
    "next_run_at": "2017-05-19T13:41:00.000Z",
    "active": true,
    "created_at": "2017-05-19T13:31:08.849Z",
    "updated_at": "2017-05-19T13:40:17.727Z",
    "last_pipeline": {
        "id": 332,
        "sha": "0e788619d0b5ec17388dffb973ecd505946156db",
        "ref": "refs/heads/main",
        "status": "pending"
    },
    "owner": {
        "name": "관리자",
        "username": "root",
        "id": 1,
        "state": "active",
        "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
        "web_url": "https://gitlab.example.com/root"
    },
    "variables": [
        {
            "key": "TEST_VARIABLE_1",
            "variable_type": "env_var",
            "value": "TEST_1",
            "raw": false
        }
    ]
}

파이프라인 스케줄에 의해 트리거된 모든 파이프라인 가져오기

프로젝트에서 파이프라인 스케줄에 의해 트리거된 모든 파이프라인을 가져옵니다.

GET /projects/:id/pipeline_schedules/:pipeline_schedule_id/pipelines

지원되는 속성:

속성 유형 필수 설명
id integer/string Yes 프로젝트의 ID 또는 URL 인코딩된 경로
pipeline_schedule_id integer Yes 파이프라인 스케줄 ID

예시 요청:

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/pipelines"

예시 응답:

[
  {
    "id": 47,
    "iid": 12,
    "project_id": 29,
    "status": "pending",
    "source": "scheduled",
    "ref": "new-pipeline",
    "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
    "web_url": "https://example.com/foo/bar/pipelines/47",
    "created_at": "2016-08-11T11:28:34.085Z",
    "updated_at": "2016-08-11T11:32:35.169Z"
  },
  {
    "id": 48,
    "iid": 13,
    "project_id": 29,
    "status": "pending",
    "source": "scheduled",
    "ref": "new-pipeline",
    "sha": "eb94b618fb5865b26e80fdd8ae531b7a63ad851a",
    "web_url": "https://example.com/foo/bar/pipelines/48",
    "created_at": "2016-08-12T10:06:04.561Z",
    "updated_at": "2016-08-12T10:09:56.223Z"
  }
]

새로운 파이프라인 일정 생성

프로젝트의 새로운 파이프라인 일정을 생성합니다.

POST /projects/:id/pipeline_schedules
속성 유형 필수 여부 설명
cron string Yes cron 스케줄, 예: 0 1 * * *
description string Yes 파이프라인 일정의 설명
id integer/string Yes 프로젝트의 ID 또는 URL 인코딩된 경로.
ref string Yes 트리거가 되는 브랜치 또는 태그 이름. 짧은 형식 (예: main) 및 완전한 형식 (예: refs/heads/main 또는 refs/tags/main) 모두 허용됩니다. 짧은 버전이 제공되면 자동으로 완전한 참조 버전으로 확장되지만, 모호한 경우 거부됩니다.
active boolean No 파이프라인 일정의 활성화. false로 설정하면 파이프라인 일정이 초기에 비활성화됩니다(기본값: true).
cron_timezone string No ActiveSupport::TimeZone에서 지원하는 시간대, 예: 태평양 시간 (미국 및 캐나다) (기본값: UTC).
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
     --form description="빌드 패키지" --form ref="main" --form cron="0 1 * * 5" --form cron_timezone="UTC" \
     --form active="true" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules"
{
    "id": 14,
    "description": "빌드 패키지",
    "ref": "refs/heads/main",
    "cron": "0 1 * * 5",
    "cron_timezone": "UTC",
    "next_run_at": "2017-05-26T01:00:00.000Z",
    "active": true,
    "created_at": "2017-05-19T13:43:08.169Z",
    "updated_at": "2017-05-19T13:43:08.169Z",
    "last_pipeline": null,
    "owner": {
        "name": "Administrator",
        "username": "root",
        "id": 1,
        "state": "active",
        "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
        "web_url": "https://gitlab.example.com/root"
    }
}

파이프라인 일정 수정

프로젝트의 파이프라인 일정을 업데이트합니다. 업데이트 후 자동으로 다시 예약됩니다.

PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id
속성 유형 필수 여부 설명
id integer/string Yes 프로젝트의 ID 또는 URL 인코딩된 경로.
pipeline_schedule_id integer Yes 파이프라인 일정 ID.
active boolean No 파이프라인 일정의 활성화. false로 설정하면 파이프라인 일정이 초기에 비활성화됩니다.
cron_timezone string No ActiveSupport::TimeZone에서 지원하는 시간대 (예: 태평양 시간 (미국 및 캐나다)), 또는 TZInfo::Timezone (예: America/Los_Angeles).
cron string No cron 스케줄, 예: 0 1 * * *.
description string No 파이프라인 일정의 설명
ref string No 트리거가 되는 브랜치 또는 태그 이름. 짧은 형식 (예: main) 및 완전한 형식 (예: refs/heads/main 또는 refs/tags/main) 모두 허용됩니다. 짧은 버전이 제공되면 자동으로 완전한 참조 버전으로 확장되지만, 모호한 경우 거부됩니다
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
     --form cron="0 2 * * *" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13"
{
    "id": 13,
    "description": "테스트 일정 파이프라인",
    "ref": "refs/heads/main",
    "cron": "0 2 * * *",
    "cron_timezone": "Asia/Tokyo",
    "next_run_at": "2017-05-19T17:00:00.000Z",
    "active": true,
    "created_at": "2017-05-19T13:31:08.849Z",
    "updated_at": "2017-05-19T13:44:16.135Z",
    "last_pipeline": {
        "id": 332,
        "sha": "0e788619d0b5ec17388dffb973ecd505946156db",
        "ref": "refs/heads/main",
        "status": "pending"
    },
    "owner": {
        "name": "Administrator",
        "username": "root",
        "id": 1,
        "state": "active",
        "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
        "web_url": "https://gitlab.example.com/root"
    }
}

파이프라인 일정 소유권 가져오기

프로젝트의 파이프라인 일정의 소유자를 업데이트합니다.

POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/take_ownership
속성 유형 필수여부 설명
id integer/string Yes 프로젝트의 ID 또는 URL로 인코딩된 경로
pipeline_schedule_id integer Yes 파이프라인 일정 ID
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/take_ownership"
{
    "id": 13,
    "description": "Test schedule pipeline",
    "ref": "refs/heads/main",
    "cron": "0 2 * * *",
    "cron_timezone": "Asia/Tokyo",
    "next_run_at": "2017-05-19T17:00:00.000Z",
    "active": true,
    "created_at": "2017-05-19T13:31:08.849Z",
    "updated_at": "2017-05-19T13:46:37.468Z",
    "last_pipeline": {
        "id": 332,
        "sha": "0e788619d0b5ec17388dffb973ecd505946156db",
        "ref": "refs/heads/main",
        "status": "pending"
    },
    "owner": {
        "name": "shinya",
        "username": "maeda",
        "id": 50,
        "state": "active",
        "avatar_url": "http://www.gravatar.com/avatar/8ca0a796a679c292e3a11da50f99e801?s=80&d=identicon",
        "web_url": "https://gitlab.example.com/maeda"
    }
}

파이프라인 일정 삭제

프로젝트의 파이프라인 일정을 삭제합니다.

DELETE /projects/:id/pipeline_schedules/:pipeline_schedule_id
속성 유형 필수여부 설명
id integer/string Yes 프로젝트의 ID 또는 URL로 인코딩된 경로
pipeline_schedule_id integer Yes 파이프라인 일정 ID
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13"
{
    "id": 13,
    "description": "Test schedule pipeline",
    "ref": "refs/heads/main",
    "cron": "0 2 * * *",
    "cron_timezone": "Asia/Tokyo",
    "next_run_at": "2017-05-19T17:00:00.000Z",
    "active": true,
    "created_at": "2017-05-19T13:31:08.849Z",
    "updated_at": "2017-05-19T13:46:37.468Z",
    "last_pipeline": {
        "id": 332,
        "sha": "0e788619d0b5ec17388dffb973ecd505946156db",
        "ref": "refs/heads/main",
        "status": "pending"
    },
    "owner": {
        "name": "shinya",
        "username": "maeda",
        "id": 50,
        "state": "active",
        "avatar_url": "http://www.gravatar.com/avatar/8ca0a796a679c292e3a11da50f99e801?s=80&d=identicon",
        "web_url": "https://gitlab.example.com/maeda"
    }
}

예약된 파이프라인 즉시 실행

즉시 실행되는 새로운 예약된 파이프라인을 트리거합니다. 이 파이프라인의 다음 예약된 실행에는 영향을 주지 않습니다.

POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/play
속성 유형 필수여부 설명
id integer/string Yes 프로젝트의 ID 또는 URL로 인코딩된 경로
pipeline_schedule_id integer Yes 파이프라인 일정 ID

예시 요청:

curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/42/pipeline_schedules/1/play"

예시 응답:

{
  "message": "201 Created"
}

파이프라인 일정 변수

새로운 파이프라인 일정 변수 생성

파이프라인 일정의 새 변수를 생성합니다.

POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables
속성 타입 필수 설명
id integer/string Yes 프로젝트의 ID 또는 URL 인코딩된 경로
key string Yes 변수의 key; 255자를 넘지 않아야 하며, A-Z, a-z, 0-9, _만 허용됨
pipeline_schedule_id integer Yes 파이프라인 일정 ID
value string Yes 변수의 value
variable_type string No 변수의 유형. 사용 가능한 유형은: env_var (기본값) 및 file
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "key=NEW_VARIABLE" \
     --form "value=new value" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/variables"
{
    "key": "NEW_VARIABLE",
    "variable_type": "env_var",
    "value": "new value"
}

파이프라인 일정 변수 편집

파이프라인 일정의 변수를 업데이트합니다.

PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables/:key
속성 타입 필수 설명
id integer/string Yes 프로젝트의 ID 또는 URL 인코딩된 경로
key string Yes 변수의 key
pipeline_schedule_id integer Yes 파이프라인 일정 ID
value string Yes 변수의 value
variable_type string No 변수의 유형. 사용 가능한 유형은: env_var (기본값) 및 file
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
     --form "value=updated value" \
     "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/variables/NEW_VARIABLE"
{
    "key": "NEW_VARIABLE",
    "value": "updated value",
    "variable_type": "env_var"
}

파이프라인 일정 변수 삭제

파이프라인 일정의 변수를 삭제합니다.

DELETE /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables/:key
속성 타입 필수 설명
id integer/string Yes 프로젝트의 ID 또는 URL 인코딩된 경로
key string Yes 변수의 key
pipeline_schedule_id integer Yes 파이프라인 일정 ID
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/variables/NEW_VARIABLE"
{
    "key": "NEW_VARIABLE",
    "value": "updated value"
}