여러 스케줄 일괄 조회(Get Schedules Batch) (V2)
스케줄 RID 배열로 최대 1,000개를 조회합니다. 찾을 수 없거나 사용자에게 접근 권한이 없는 스케줄은 응답에서 생략합니다. 반환되는 data는 스케줄 RID에서 Schedule 객체로 대응하는 맵입니다.
이 엔드포인트는 미리보기 기능이며 언제든 변경되거나 제거될 수 있습니다. 사용하려면 preview=true를 지정합니다.
HTTP 요청
POST /api/v2/orchestration/schedules/getBatch
작업 식별자는 v2.getSchedulesBatch입니다. OAuth2로 호출하는 타사 애플리케이션에는 api:orchestration-read 권한 범위가 필요합니다. 각 요청에 Authorization: Bearer <접근 토큰>을 전달합니다.
경로 매개변수
지정할 경로 매개변수가 없습니다.
쿼리 매개변수
| 이름 | 자료형 | 필수 여부 | 의미와 조건 | 예시 값 |
|---|---|---|---|---|
preview | boolean | 선택 | 미리보기 기능 사용을 활성화합니다. | true |
요청 본문
본문 형식은 list<GetSchedulesBatchRequestElement>이며 필수입니다.
배열 항목은 GetSchedulesBatchRequestElement이며 자료형은 object입니다.
| 이름 | 자료형 | 필수 여부 | 의미와 조건 | 예시 값 |
|---|---|---|---|---|
scheduleRid | string | 필수 | 스케줄의 RID입니다. | ri.scheduler.main.schedule.5ad5c340-59f3-4a60-9fc6-161bb984f871 |
다음은 조회할 스케줄 RID를 지정하는 요청 본문 예시입니다.
[
{
"scheduleRid": "ri.scheduler.main.schedule.5ad5c340-59f3-4a60-9fc6-161bb984f871"
}
]
응답
응답 형식은 GetSchedulesBatchResponse입니다.
| 이름 | 자료형 | 필수 여부 | 의미와 조건 | 예시 값 |
|---|---|---|---|---|
data | map<ScheduleRid, Schedule> | 선택 |
data의 구조
맵의 키는 ScheduleRid(string), 값은 Schedule(object)입니다.
키: 스케줄의 RID입니다.
전체 필드는 Schedule 모델을 따릅니다.
스케줄 RID별 조회 결과의 응답 예시입니다.
{
"data": {
"ri.scheduler.main.schedule.5ad5c340-59f3-4a60-9fc6-161bb984f871": {
"updatedTime": "2024-09-25T17:29:35.974Z",
"paused": false,
"updatedBy": "f05f8da4-b84c-4fca-9c77-8af0b13d11de",
"createdBy": "f05f8da4-b84c-4fca-9c77-8af0b13d11de",
"displayName": "My Daily Schedule",
"currentVersionRid": "ri.scheduler.main.schedule-version.4d1eb55f-6c13-411c-a911-5d84e08d8017",
"description": "Run all the transforms at midnight",
"createdTime": "2024-09-25T17:29:35.974Z",
"action": {
"abortOnFailure": false,
"forceBuild": false,
"retryBackoffDuration": {
"unit": "SECONDS",
"value": 30
},
"retryCount": 1,
"fallbackBranches": [],
"branchName": "master",
"notificationsEnabled": false,
"target": {
"type": "manual",
"targetRids": [
"ri.foundry.main.dataset.b737e24d-6b19-43aa-93d5-da9fc4073f6e",
"ri.foundry.main.dataset.d2452a94-a755-4778-8bfc-a315ab52fc43"
]
}
},
"trigger": {
"type": "time",
"cronExpression": "0 0 * * *",
"timeZone": "UTC"
},
"rid": "ri.scheduler.main.schedule.5ad5c340-59f3-4a60-9fc6-161bb984f871",
"scopeMode": {
"type": "user"
}
}
}
}
개별 오류
오류 응답 처리는 공통 API 오류 계약을 따릅니다.
요청 예제
FOUNDRY_HOST에는 https://를 제외한 Foundry 호스트를, FOUNDRY_TOKEN에는 유효한 토큰을 환경 변수로 제공합니다. 예시 식별자와 매개변수 값은 실제 작업 대상에 맞게 바꿉니다.
cURL
curl -X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer ${FOUNDRY_TOKEN}" \
"https://${FOUNDRY_HOST}/api/v2/orchestration/schedules/getBatch?preview=true" \
-d '[{"scheduleRid":"ri.scheduler.main.schedule.5ad5c340-59f3-4a60-9fc6-161bb984f871"}]'
Python
Requests 라이브러리가 설치된 Python 환경에서 사용합니다.
import os
import requests
HOSTNAME = os.environ["FOUNDRY_HOST"]
TOKEN = os.environ["FOUNDRY_TOKEN"]
headers = {
"content-type": "application/json",
"authorization": "Bearer {}".format(TOKEN)
}
request_body = [
{
"scheduleRid": "ri.scheduler.main.schedule.5ad5c340-59f3-4a60-9fc6-161bb984f871"
}
]
response = requests.post('https://{}/api/v2/orchestration/schedules/getBatch?preview=true'.format(HOSTNAME), headers=headers, json=request_body)
print(response)
Java
Apache HttpClient 4.5 API와 try-with-resources를 사용합니다. 클래스 이름에 맞는 GetSchedulesBatchExample.java 파일에서 사용합니다.
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
public class GetSchedulesBatchExample {
public static void main(String[] args) throws Exception {
String HOSTNAME = System.getenv("FOUNDRY_HOST");
String TOKEN = System.getenv("FOUNDRY_TOKEN");
try (CloseableHttpClient httpClient = HttpClientBuilder.create().build()) {
HttpPost request = new HttpPost("https://" + HOSTNAME + "/api/v2/orchestration/schedules/getBatch?preview=true");
request.addHeader("content-type", "application/json");
request.addHeader("authorization", String.format("Bearer %s", TOKEN));
request.setEntity(new StringEntity("[{\"scheduleRid\":\"ri.scheduler.main.schedule.5ad5c340-59f3-4a60-9fc6-161bb984f871\"}]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpClient.execute(request)) {
System.out.println(response);
}
}
}
}
JavaScript
fetch를 제공하는 Node.js 환경에서 사용합니다. 서비스 사용자 토큰을 브라우저로 전달하지 않습니다.
const HOSTNAME = process.env.FOUNDRY_HOST;
const TOKEN = process.env.FOUNDRY_TOKEN;
fetch(`https://${HOSTNAME}/api/v2/orchestration/schedules/getBatch?preview=true`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${TOKEN}`,
},
body: '[{"scheduleRid":"ri.scheduler.main.schedule.5ad5c340-59f3-4a60-9fc6-161bb984f871"}]'
}).then((response) => {
console.log(response)
});
PowerShell
$ErrorActionPreference = 'Stop'
$TOKEN = $env:FOUNDRY_TOKEN
$HOSTNAME = $env:FOUNDRY_HOST
$headers = @{
"authorization" = "Bearer $TOKEN"
}
$response = Invoke-WebRequest -Uri "https://$HOSTNAME/api/v2/orchestration/schedules/getBatch?preview=true" `
-Method Post `
-Headers $headers `
-ContentType application/json `
-Body "[{`"scheduleRid`":`"ri.scheduler.main.schedule.5ad5c340-59f3-4a60-9fc6-161bb984f871`"}]"
$response.content