본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

팀 파이프라인 API

원문 보기 위키 갱신

팀 파이프라인 API 엔드포인트를 이용하면 여러분 조직의 팀과 연결된 파이프라인을 조회하고, 만들고, 수정하고, 삭제할 수 있어요. 어떤 팀이 어떤 파이프라인에 어떤 접근 수준으로 접근할 수 있는지 관리하고 싶을 때 활용하면 좋답니다.

출처: 문서

본문

팀 파이프라인 데이터 모델

pipeline_id 파이프라인의 UUID예요.
access_level 사용자가 연결된 파이프라인에 갖는 접근 수준이에요. read_only, build_and_read, manage_build_and_read 중 하나예요.
pipeline_url 파이프라인의 URL이에요.
created_at 팀과 파이프라인의 연결이 생성된 시점이에요.

팀 파이프라인 목록 조회

팀과 연결된 파이프라인의 페이지네이션된 목록을 반환해요.

curl -H "Authorization: Bearer ***" \
  -X GET "https://api.buildkite.com/v2/organizations/{org.slug}/teams/{team.uuid}/pipelines"
[
  {
    "access_level": "manage_build_and_read",
    "created_at": "2023-12-12T21:57:40.306Z",
    "pipeline_id": "018c5ad7-28f1-45d4-867e-b59fa04511b2",
    "pipeline_url": "http://api.buildkite.com/v2/organizations/acme-inc/pipelines/test-pipeline"
  },
]

필요한 범위(scope): view_teams

성공 응답: 200 OK

팀 파이프라인 조회

curl -H "Authorization: Bearer ***" \
  -X GET "https://api.buildkite.com/v2/organizations/{org.slug}/teams/{team.uuid}/pipelines/{pipeline.uuid}"
{
  "access_level": "read_only",
  "created_at": "2023-12-12T21:57:40.306Z",
  "pipeline_id": "018c5ad7-28f1-45d4-867e-b59fa04511b2",
  "pipeline_url": "http://api.buildkite.com/v2/organizations/acme-inc/pipelines/test-pipeline"
}

필요한 범위(scope): view_teams

성공 응답: 200 OK

팀 파이프라인 생성

팀과 파이프라인 사이의 연결을 만들어요.

curl -H "Authorization: Bearer ***" \
  -X POST "https://api.buildkite.com/v2/organizations/{org.slug}/teams/{team.uuid}/pipelines/" \
  -H "Content-Type: application/json" \
  -d '{
    "pipeline_id": "pipeline.uuid",
    "access_level": "read_only"
  }'
{
  "access_level": "read",
  "created_at": "2023-12-12T21:57:40.306Z",
  "pipeline_id": "018c5ad7-28f1-45d4-867e-b59fa04511b2",
  "pipeline_url": "http://api.buildkite.com/v2/organizations/acme-inc/pipelines/test-pipeline"
}

필요한 요청 본문 속성:

pipeline_id 파이프라인의 UUID예요.
access_level 파이프라인에 대한 접근 수준이에요. read_only, build_and_read 또는 manage_build_and_read 중 하나예요.

필요한 범위(scope): write_teams

성공 응답: 201 Created

오류 응답:

422 Unprocessable Entity { "message": "Validation failed: Reason for failure" }

팀 파이프라인 수정

팀과 파이프라인 사이의 연결을 업데이트해요.

curl -H "Authorization: Bearer ***" \
  -X PATCH "https://api.buildkite.com/v2/organizations/{org.slug}/teams/{team.uuid}/pipelines/{pipeline.uuid}" \
  -H "Content-Type: application/json" \
  -d '{
    "access_level": "read_only"
  }'
{
  "access_level": "read_only",
  "created_at": "2023-12-12T21:57:40.306Z",
  "pipeline_id": "018c5ad7-28f1-45d4-867e-b59fa04511b2",
  "pipeline_url": "http://api.buildkite.com/v2/organizations/acme-inc/pipelines/test-pipeline"
}

필요한 요청 본문 속성:

access_level 파이프라인에 대한 접근 수준이에요. read_only, build_and_read 또는 manage_build_and_read 중 하나예요.

필요한 범위(scope): write_teams

성공 응답: 200 OK

오류 응답:

422 Unprocessable Entity { "message": "Validation failed: Reason for failure" }

팀 파이프라인 삭제

팀과 파이프라인 사이의 연결을 제거해요.

curl -H "Authorization: Bearer ***" \
  -X DELETE "https://api.buildkite.com/v2/organizations/{org.slug}/teams/{team.uuid}/pipelines/{pipeline.uuid}"

필요한 범위(scope): write_teams

성공 응답: 204 No Content

오류 응답:

422 Unprocessable Entity { "message": "Reason the team pipeline couldn't be deleted" }

더 알아보기 (Learn more)

이 문서에서는 팀 파이프라인 API로 팀에 연결된 파이프라인의 목록 조회, 생성, 수정, 삭제를 다루는 방법을 살펴봤어요. 팀별 파이프라인 접근 권한을 관리하고 싶을 때 유용하답니다. 관련한 자세한 내용은 팀 API와 팀 멤버 API 문서에서 이어서 확인해 보세요.