REST API 개요
Buildkite REST API는 Buildkite를 확장·통합·자동화해 여러분의 필요에 맞추기 위한 완전한 프로그래매틱 접근과 제어를 제공하는 것을 목표로 해요.
현재 Buildkite API 버전은 v2예요.
REST API와 GraphQL API 사이의 기존 차이점 목록은 API differences를 참고해요.
출처: 문서
본문
스키마
모든 API 접근은 HTTPS를 통해 이루어지며, api.buildkite.com 도메인에서 접근해요. 모든 데이터는 JSON으로 전송돼요.
다음 curl 명령:
curl https://api.buildkite.com
다음과 같은 응답을 생성해요.
{"message":"🛠","timestamp":1719276157}
여기서 timestamp 값은 현재 Unix time 값이에요.
엔드포인트
이 섹션은 리소스 유형별로 정리된 사용 가능한 모든 엔드포인트를 나열해요. 각 엔드포인트에는 HTTP 메서드, 경로 구조, 요청·응답 예시와 추가 관련 정보가 포함된 자세한 문서로의 링크가 포함돼요.
조직 (Organizations)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations |
List organizations |
| GET | /v2/organizations/{org.slug} |
Get an organization |
| GET | /v2/organizations/{org.slug}/rate_limit |
Get organization rate limits |
| GET | /v2/organizations/{org.slug}/usage |
Get organization usage |
| {: class="responsive-table"} |
감사 이벤트 (Audit events)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/audit_events |
List audit events |
| GET | /v2/organizations/{org.slug}/audit_events/{uuid} |
Get an audit event |
| {: class="responsive-table"} |
조직 멤버 (Organization members)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/members |
List organization members |
| GET | /v2/organizations/{org.slug}/members/{user.uuid} |
Get an organization member |
| PATCH | /v2/organizations/{org.slug}/members/{user.uuid} |
Update an organization member |
| DELETE | /v2/organizations/{org.slug}/members/{user.uuid} |
Remove an organization member |
| {: class="responsive-table"} |
조직 API 설정 (Organization API settings)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/api-settings |
Get API settings |
| PATCH | /v2/organizations/{org.slug}/api-settings |
Update API settings |
| {: class="responsive-table"} |
조직 파이프라인 설정 (Organization pipeline settings)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/pipeline-settings |
Get pipeline settings |
| PATCH | /v2/organizations/{org.slug}/pipeline-settings |
Update pipeline settings |
| PUT | /v2/organizations/{org.slug}/pipeline-settings/hosted-agents-ssh |
Enable hosted agents remote access |
| DELETE | /v2/organizations/{org.slug}/pipeline-settings/hosted-agents-ssh |
Disable hosted agents remote access |
| PUT | /v2/organizations/{org.slug}/pipeline-settings/public-pipelines |
Enable public pipeline creation |
| DELETE | /v2/organizations/{org.slug}/pipeline-settings/public-pipelines |
Disable public pipeline creation |
| PUT | /v2/organizations/{org.slug}/pipeline-settings/advanced-queue-metrics |
Enable advanced queue metrics |
| PUT | /v2/organizations/{org.slug}/pipeline-settings/build-export |
Configure build export |
| DELETE | /v2/organizations/{org.slug}/pipeline-settings/build-export |
Disable build export |
| {: class="responsive-table"} |
저장소 연결 (Repository connections)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/repository_connections |
List repository connections |
| GET | /v2/organizations/{org.slug}/repository_connections/{id} |
Get a repository connection |
| {: class="responsive-table"} |
알림 서비스 (Notification services)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/services |
List notification services |
| GET | /v2/organizations/{org.slug}/services/{uuid} |
Get a notification service |
| POST | /v2/organizations/{org.slug}/services |
Create a notification service |
| PATCH | /v2/organizations/{org.slug}/services/{uuid} |
Update a notification service |
| DELETE | /v2/organizations/{org.slug}/services/{uuid} |
Delete a notification service |
| PUT | /v2/organizations/{org.slug}/services/{uuid}/enable |
Enable a notification service |
| PUT | /v2/organizations/{org.slug}/services/{uuid}/disable |
Disable a notification service |
| {: class="responsive-table"} |
파이프라인 (Pipelines)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/pipelines |
List pipelines |
| GET | /v2/organizations/{org.slug}/pipelines/{slug} |
Get a pipeline |
| POST | /v2/organizations/{org.slug}/pipelines |
Create a pipeline |
| PATCH | /v2/organizations/{org.slug}/pipelines/{slug} |
Update a pipeline |
| DELETE | /v2/organizations/{org.slug}/pipelines/{slug} |
Delete a pipeline |
| POST | /v2/organizations/{org.slug}/pipelines/{slug}/archive |
Archive a pipeline |
| POST | /v2/organizations/{org.slug}/pipelines/{slug}/unarchive |
Unarchive a pipeline |
| POST | /v2/organizations/{org.slug}/pipelines/{slug}/webhook |
Add a webhook |
| {: class="responsive-table"} |
파이프라인 트리거 (Pipeline triggers)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/triggers |
List pipeline triggers |
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/triggers/{id} |
Get a pipeline trigger |
| POST | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/triggers |
Create a pipeline trigger |
| PATCH | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/triggers/{id} |
Update a pipeline trigger |
| DELETE | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/triggers/{id} |
Delete a pipeline trigger |
| {: class="responsive-table"} |
파이프라인 트리거 전달 (Pipeline trigger deliveries)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/triggers/{trigger.id}/deliveries |
List a trigger's deliveries |
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/triggers/{trigger.id}/deliveries/{delivery.id} |
Get a delivery |
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/triggers/{trigger.id}/deliveries/{delivery.id}/request |
Get a delivery's request |
| {: class="responsive-table"} |
빌드 (Builds)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/builds |
List all builds |
| GET | /v2/organizations/{org.slug}/builds |
List builds for an organization |
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds |
List builds for a pipeline |
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number} |
Get a build |
| POST | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds |
Create a build |
| PUT | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/cancel |
Cancel a build |
| PUT | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/rebuild |
Rebuild a build |
| {: class="responsive-table"} |
작업 (Jobs)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| POST | /v2/organizations/{org.slug}/jobs/{job.id}/vnc-session |
Create a remote desktop session |
| POST | /v2/organizations/{org.slug}/jobs/{job.id}/ssh-session |
Create an SSH session |
| PUT | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/jobs/{job.id}/retry |
Retry a job |
| PUT | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/jobs/{job.id}/reprioritize |
Reprioritize a job |
| PUT | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/jobs/{job.id}/unblock |
Unblock a job |
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/jobs/{job.id}/log |
Get a job's log |
| DELETE | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/jobs/{job.id}/log |
Delete a job's log |
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/jobs/{job.id}/env |
Get a job's environment |
| {: class="responsive-table"} |
어노테이션 (Annotations)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/annotations |
List annotations |
| POST | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/annotations |
Create an annotation |
| DELETE | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/annotations/{uuid} |
Delete an annotation |
| {: class="responsive-table"} |
아티팩트 (Artifacts)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/artifacts |
List artifacts for a build |
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/jobs/{job.id}/artifacts |
List artifacts for a job |
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/jobs/{job.id}/artifacts/{id} |
Get an artifact |
| GET | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/jobs/{job.id}/artifacts/{id}/download |
Download an artifact |
| DELETE | /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{number}/jobs/{job.id}/artifacts/{id} |
Delete an artifact |
| {: class="responsive-table"} |
에이전트 (Agents)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/agents |
List agents |
| GET | /v2/organizations/{org.slug}/agents/{id} |
Get an agent |
| PUT | /v2/organizations/{org.slug}/agents/{id}/stop |
Stop an agent |
| PUT | /v2/organizations/{org.slug}/agents/{id}/pause |
Pause an agent |
| PUT | /v2/organizations/{org.slug}/agents/{id}/resume |
Resume an agent |
| {: class="responsive-table"} |
팀 (Teams)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/teams |
List teams |
| GET | /v2/organizations/{org.slug}/teams/{team.uuid} |
Get a team |
| POST | /v2/organizations/{org.slug}/teams |
Create a team |
| POST | /v2/organizations/{org.slug}/teams/enable |
Enable teams |
| PATCH | /v2/organizations/{org.slug}/teams/{team.uuid} |
Update a team |
| DELETE | /v2/organizations/{org.slug}/teams/{team.uuid} |
Delete a team |
| {: class="responsive-table"} |
팀 멤버 (Team members)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/teams/{team.uuid}/members |
List team members |
| GET | /v2/organizations/{org.slug}/teams/{team.uuid}/members/{user.uuid} |
Get a team member |
| POST | /v2/organizations/{org.slug}/teams/{team.uuid}/members |
Create a team member |
| PATCH | /v2/organizations/{org.slug}/teams/{team.uuid}/members/{user.uuid} |
Update a team member |
| DELETE | /v2/organizations/{org.slug}/teams/{team.uuid}/members/{user.uuid} |
Delete a team member |
| {: class="responsive-table"} |
팀 파이프라인 (Team pipelines)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/teams/{team.uuid}/pipelines |
List team pipelines |
| GET | /v2/organizations/{org.slug}/teams/{team.uuid}/pipelines/{uuid} |
Get a team pipeline |
| POST | /v2/organizations/{org.slug}/teams/{team.uuid}/pipelines |
Create a team pipeline |
| PATCH | /v2/organizations/{org.slug}/teams/{team.uuid}/pipelines/{uuid} |
Update a team pipeline |
| DELETE | /v2/organizations/{org.slug}/teams/{team.uuid}/pipelines/{uuid} |
Delete a team pipeline |
| {: class="responsive-table"} |
팀 스위트 (Team suites)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/teams/{team.uuid}/suites |
List team suites |
| GET | /v2/organizations/{org.slug}/teams/{team.uuid}/suites/{uuid} |
Get a team suite |
| POST | /v2/organizations/{org.slug}/teams/{team.uuid}/suites |
Create a team suite |
| PATCH | /v2/organizations/{org.slug}/teams/{team.uuid}/suites/{uuid} |
Update a team suite |
| DELETE | /v2/organizations/{org.slug}/teams/{team.uuid}/suites/{uuid} |
Delete a team suite |
| {: class="responsive-table"} |
클러스터 (Clusters)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/clusters |
List clusters |
| GET | /v2/organizations/{org.slug}/clusters/{id} |
Get a cluster |
| POST | /v2/organizations/{org.slug}/clusters |
Create a cluster |
| PUT | /v2/organizations/{org.slug}/clusters/{id} |
Update a cluster |
| DELETE | /v2/organizations/{org.slug}/clusters/{id} |
Delete a cluster |
| {: class="responsive-table"} |
호스티드 에이전트 이미지 (Hosted agent images)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/clusters/{cluster.id}/agent-images |
List agent images |
| GET | /v2/organizations/{org.slug}/clusters/{cluster.id}/agent-images/{id} |
Get an agent image |
| POST | /v2/organizations/{org.slug}/clusters/{cluster.id}/agent-images |
Create an agent image |
| DELETE | /v2/organizations/{org.slug}/clusters/{cluster.id}/agent-images/{id} |
Delete an agent image |
| {: class="responsive-table"} |
호스티드 에이전트 네트워크 범위 (Hosted agent network ranges)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/clusters/{cluster.id}/network_ranges |
List network ranges |
| {: class="responsive-table"} |
호스티드 에이전트 캐시 볼륨 (Hosted agent cache volumes)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/clusters/{cluster.id}/cache_volumes |
List cache volumes |
| DELETE | /v2/organizations/{org.slug}/clusters/{cluster.id}/cache_volumes |
Delete a cache volume |
| {: class="responsive-table"} |
큐 (Queues)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/clusters/{cluster.id}/queues |
List queues |
| GET | /v2/organizations/{org.slug}/clusters/{cluster.id}/queues/{id} |
Get a queue |
| POST | /v2/organizations/{org.slug}/clusters/{cluster.id}/queues |
Create a self-hosted queue |
| POST | /v2/organizations/{org.slug}/clusters/{cluster.id}/queues |
Create a Buildkite hosted queue |
| PUT | /v2/organizations/{org.slug}/clusters/{cluster.id}/queues/{id} |
Update a queue |
| DELETE | /v2/organizations/{org.slug}/clusters/{cluster.id}/queues/{id} |
Delete a queue |
| POST | /v2/organizations/{org.slug}/clusters/{cluster.id}/queues/{id}/pause_dispatch |
Pause a queue |
| POST | /v2/organizations/{org.slug}/clusters/{cluster.id}/queues/{id}/resume_dispatch |
Resume a paused queue |
| {: class="responsive-table"} |
에이전트 토큰 (Agent tokens)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/clusters/{cluster.id}/tokens |
List agent tokens |
| GET | /v2/organizations/{org.slug}/clusters/{cluster.id}/tokens/{id} |
Get an agent token |
| POST | /v2/organizations/{org.slug}/clusters/{cluster.id}/tokens |
Create an agent token |
| PUT | /v2/organizations/{org.slug}/clusters/{cluster.id}/tokens/{id} |
Update an agent token |
| DELETE | /v2/organizations/{org.slug}/clusters/{cluster.id}/tokens/{id} |
Revoke an agent token |
| {: class="responsive-table"} |
파이프라인 템플릿 (Pipeline templates)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/pipeline-templates |
List pipeline templates |
| GET | /v2/organizations/{org.slug}/pipeline-templates/{uuid} |
Get a pipeline template |
| POST | /v2/organizations/{org.slug}/pipeline-templates |
Create a pipeline template |
| PATCH | /v2/organizations/{org.slug}/pipeline-templates/{uuid} |
Update a pipeline template |
| DELETE | /v2/organizations/{org.slug}/pipeline-templates/{uuid} |
Delete a pipeline template |
| {: class="responsive-table"} |
규칙 (Rules)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/rules |
List rules |
| GET | /v2/organizations/{org.slug}/rules/{uuid} |
Get a rule |
| POST | /v2/organizations/{org.slug}/rules |
Create a rule |
| DELETE | /v2/organizations/{org.slug}/rules/{uuid} |
Delete a rule |
| {: class="responsive-table"} |
포털 (Portals)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/portals |
List portals |
| GET | /v2/organizations/{org.slug}/portals/{portal.slug} |
Get a portal |
| POST | /v2/organizations/{org.slug}/portals |
Create a portal |
| PUT | /v2/organizations/{org.slug}/portals/{portal.slug} |
Update a portal |
| DELETE | /v2/organizations/{org.slug}/portals/{portal.slug} |
Delete a portal |
| {: class="responsive-table"} |
이모지 (Emojis)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/organizations/{org.slug}/emojis |
List emojis |
| {: class="responsive-table"} |
사용자 (User)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/user |
Get current user |
| {: class="responsive-table"} |
액세스 토큰 (Access token)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/access-token |
Get current token |
| DELETE | /v2/access-token |
Revoke current token |
| {: class="responsive-table"} |
메타 (Meta)
| 메서드 | 엔드포인트 | 설명 |
|---|---|---|
| GET | /v2/meta |
Get meta information |
| {: class="responsive-table"} |
쿼리 문자열 매개변수
일부 API 엔드포인트는 URL 끝에 추가되는 쿼리 문자열 매개변수를 허용해요. 예를 들어 빌드 목록 API는 다음 curl 명령으로 state로 필터링할 수 있어요.
curl -H "Authorization: Bearer ***" \
-X GET "https://api.buildkite.com/v2/organizations/my-org/pipelines/my-pipeline/builds?state=passed"
요청 본문 속성
일부 API 요청은 데이터를 지정하기 위해 JSON 요청 본문을 허용해요. 예를 들어 빌드 생성 API에 다음 curl 명령으로 필수 속성을 전달할 수 있어요.
curl -H "Authorization: Bearer ***" \
-X POST "https://api.buildkite.com/v2/organizations/my-org/pipelines/my-pipeline/builds" \
-H "Content-Type: application/json" \
-d '{
"key": "value"
}'
데이터 인코딩은 application/json으로 가정해요. 명시적으로 명시되지 않는 한 속성을 www-form-urlencoded나 multipart/form-data로 인코딩할 수 없어요.
인증
Buildkite API에 액세스 토큰으로 인증할 수 있어요. 이 문서 전반에 걸쳐 $TOKEN 값으로 표시돼요.
API 액세스 토큰은 API 호출을 인증하며, API access tokens 페이지에서 생성할 수 있어요. API 액세스 토큰을 구성할 때 개별 조직과 권한으로 그 접근을 제한할 수 있고, 이 토큰은 웹 인터페이스 또는 REST API에서 언제든지 철회할 수 있어요.
토큰은 활성 요금제가 없는 조직에 대한 접근을 부여하지 않아요. API는 그런 조직을 생략해요. 조직 범위 요청은 {"message":"No organization found"}와 함께 404를 반환해요. Organizations API를 참고해요.
액세스 토큰으로 API 호출을 인증하려면 Authorization HTTP 헤더를 Bearer라는 단어, 공백, 액세스 토큰 순으로 설정해요. 예를 들어:
curl -H "Authorization: Bearer ***" \
-X GET "https://api.buildkite.com/v2/user"
기본 HTTP 인증을 사용한 API 접근은 지원되지 않아요.
공개 키 (Public key)
📘 이 기능은 현재 미리 보기 상태이며 Buildkite가 여러분의 조직에 대해 활성화해야 해요. Public Key 자격 증명 유형은 기능이 활성화된 후에만 나타나요. 접근을 요청하려면 Buildkite 지원에 연락해요.
API 액세스 토큰은 정적 토큰 대신 RSA 공개 키로 생성할 수 있어요. 키 쌍을 생성하고, 공개 키를 Buildkite에 등록하고, 개인 키로 JWT에 서명해 API 호출을 인증해요. Buildkite는 절대 여러분의 개인 키를 받지 않아요.
OpenSSL을 사용해 키 쌍을 생성하려면:
openssl genrsa -out private_key.pem 2048
openssl rsa -in private_key.pem -pubout -out public_key.pem
토큰을 생성할 때 Credential Type으로 Public Key를 선택해요. public_key.pem의 내용을 RSA public key (PEM) 필드에 붙여넣어요. Buildkite는 2048~4096비트의 RSA 키를 허용해요.
API 호출을 인증하려면 RS256 알고리즘으로 개인 키로 JWT에 서명해요. 액세스 토큰의 UUID를 iss 클레임으로 사용하고, iat를 현재 시간의 10초 이내로, exp를 iat의 5분 이내로 설정해요.
예를 들어 Ruby에서—private_key.pem이 개인 키를 담고 있고 $UUID가 액세스 토큰의 UUID라면:
require "net/http"
require "openssl"
require "jwt" # https://rubygems.org/gems/jwt
claims = {
"iss" => "$UUID",
"iat" => Time.now.to_i - 5,
"exp" => Time.now.to_i + 60,
}
private_key = OpenSSL::PKey::RSA.new(File.read("private_key.pem"))
jwt = JWT.encode(claims, private_key, "RS256")
Net::HTTP.get(URI("https://api.buildkite.com/v2/access-token"), "Authorization" => "Bearer #{jwt}")
페이지네이션
페이지네이션을 지원하는 엔드포인트의 경우, 페이지네이션 정보는 next, prev, first, last 중 0개 이상을 포함하는 Link HTTP 응답 헤더에서 찾을 수 있어요.
curl -i -H "Authorization: Bearer ***" \
-X GET "https://api.buildkite.com/v2/organizations/my-great-org/pipelines/my-pipeline/builds"
HTTP/1.1 200 OK
...
Link: <https://api.buildkite.com/v2/organizations/my-great-org/pipelines/my-pipeline/builds?api_key=f8582f070276d764ce3dd4c6d57be92574dccf86&page=3>; rel="next", <https://api.buildkite.com/v2/organizations/my-great-org/pipelines/my-pipeline/builds?api_key=f8582f070276d764ce3dd4c6d57be92574dccf86&page=6>; rel="last"
다음 쿼리 문자열 매개변수로 페이지를 설정할 수 있어요.
page |
반환할 결과의 페이지 기본값: 1 |
|---|---|
per_page |
페이지당 반환할 결과 수 기본값: 30 최대값: 100 |
속도 제한 (Rate limiting)
REST API는 모든 고객에 걸쳐 안정성과 공정한 사용을 보장하기 위해 속도 제한을 적용해요. 각 요청에는 두 가지 제한이 적용돼요.
- 여러분 조직의 모든 사용자가 공유하는 조직 수준 제한
- API 액세스 토큰과 연관된 인증 사용자에 대한 사용자당 제한
모든 API 응답은 두 개의 독립적인 속도 제한 헤더 세트—조직 수준 제한용 RateLimit-*와 사용자당 제한용 RateLimit-User-*—를 포함해서, 둘 다 모니터링하고 어느 쪽에 더 가까워지고 있는지 판단할 수 있어요.
RateLimit-Scope: rest
RateLimit-Remaining: 80
RateLimit-Limit: 200
RateLimit-Reset: 42
RateLimit-User-Scope: rest_user
RateLimit-User-Remaining: 35
RateLimit-User-Limit: 50
RateLimit-User-Reset: 42
둘 중 한 제한이라도 초과하면 요청은 429 Too Many Requests 상태 코드로 거부돼요. 재시도하기 전에 RateLimit-Reset 또는 RateLimit-User-Reset 헤더가 보고하는 초 수만큼 기다려요.
전체 헤더 목록, 429 응답 본문, 백오프 모범 사례는 REST API rate limits를 참고해요. 여러분 조직의 요금제에 적용되는 기본 제한 값은 Limits를 참고해요.
CORS 헤더
API 응답은 브라우저에서 API를 직접 사용할 수 있게 해 주는 다음 CORS 헤더를 포함해요.
Access-Controller-Allow-Origin: *Access-Control-Expose-Headers: Link
사용 예시는 여러분의 브라우저 기반 대시보드와 빌드 화면에 이모지 지원을 추가하는 Emojis API example on CodePen을 참고해요.
OpenAPI 명세
Buildkite Test Engine REST API는 일반 소비를 위한 /v2/analytics 엔드포인트를 설명하는 머신이 읽을 수 있는 OpenAPI 명세를 게시해요.
RFC 9727 API 카탈로그 엔드포인트로 명세를 찾아보세요.
curl "https://api.buildkite.com/.well-known/api-catalog"
{
"linkset": [
{
"anchor": "https://api.buildkite.com/v2/analytics",
"service-desc": [
{
"href": "https://api.buildkite.com/v2/analytics/openapi.yaml",
"type": "application/openapi+yaml"
}
],
"service-doc": [
{
"href": "https://buildkite.com/docs/apis/rest-api",
"type": "text/html"
}
]
}
]
}
명세를 직접 가져올 수도 있어요.
curl "https://api.buildkite.com/v2/analytics/openapi.yaml"
두 엔드포인트 모두 인증되지 않아요.
v1에서 v2로 마이그레이션
API의 v2에서 다음 변경 사항이 있었어요.
POST /v1/organizations/{org.slug}/agents가 제거됐어요DELETE /v1/organizations/{org.slug}/agents/{id}가 제거됐어요- JSON 응답과 요청의 모든 프로젝트 관련 속성이 pipeline으로 이름이 바뀌었어요
featured_build파이프라인 속성이 제거됐어요- 더 이상 사용되지 않는
/accountsURL이 제거됐어요 /projects를 포함하는 URL이/pipelines로 이름이 바뀌었어요
클라이언트
시작을 더 쉽게 하기 위해, 우리 기여자들이 만든 다음 클라이언트를 확인해 보세요.
- Buildkit(Ruby용)
- go-buildkite(Go용)
- PSBuildkite(PowerShell용)
- pybuildkite(Python용)
- buildkite-php(PHP용)
- buildkite-swift(Swift용)
- buildkite-api-client(Java용)
더 알아보기 (Learn more)
REST API 개요는 API의 전반적인 동작 방식을 설명해요. 모든 접근은 Authorization: Bearer <token> 헤더로 인증하며, v2가 현재 버전이에요. 리소스별 엔드포인트 표를 참고해 원하는 기능(조직, 파이프라인, 빌드, 작업, 클러스터, 에이전트 등)의 세부 문서로 이동하고, 페이지네이션(page/per_page), 속도 제한(RateLimit-* 헤더), 공개 키 JWT 인증 같은 기본 개념을 익혀두면 API를 바로 활용할 수 있답니다.