Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

체크포인트 기록 배치 조회(Get Records Batch) (V2)

한 요청으로 최대 100개의 체크포인트 기록을 조회합니다. 본문에는 recordRid를 가진 항목들의 배열을 전달합니다. 존재하지 않거나 호출자가 접근할 수 없는 기록은 응답에서 빠집니다.

응답에 없는 RID만으로 기록이 삭제되었다고 단정하지 않습니다. 필요한 경우 단건 조회의 오류와 접근 권한을 확인합니다. 이 POST는 기록을 조회하는 작업입니다.

이 엔드포인트는 미리보기 기능이며 언제든 변경되거나 제거될 수 있습니다. 사용하려면 preview=true를 지정합니다.

HTTP 요청

POST /api/v2/checkpoints/records/getBatch

작업 식별자는 v2.getRecordsBatch입니다. OAuth2로 호출하는 타사 애플리케이션에는 api:checkpoints-read 권한 범위가 필요합니다. 각 요청에 Authorization: Bearer <접근 토큰>을 전달합니다.

경로 매개변수

지정할 경로 매개변수가 없습니다.

쿼리 매개변수

이름자료형필수 여부의미와 조건예시 값
previewboolean선택미리보기 기능 사용을 활성화합니다.true

요청 본문

본문 형식은 list<GetRecordsBatchRequestElement>이며 필수입니다.

배열 항목은 GetRecordsBatchRequestElement이며 자료형은 object입니다.

이름자료형필수 여부의미와 조건예시 값
recordRidstring필수체크포인트 기록의 식별자입니다.ri.checkpoints.main.checkpoint.a1b2c3d4-e5f6-7890-abcd-ef1234567890

다음 본문의 식별자와 값은 가상 예시입니다.

[
  {
    "recordRid": "ri.checkpoints.main.checkpoint.a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
]

응답

응답 형식은 GetRecordsBatchResponse입니다. data는 기록 RID를 키로 하고 Record를 값으로 하는 맵이므로, 요청 순서의 배열로 가정하지 말고 RID로 대응시킵니다.

이름자료형필수 여부의미와 조건예시 값
datamap<RecordRid, Record>선택

data의 구조

맵의 키는 RecordRid(string), 값은 Record(object)입니다.

키: 체크포인트 기록의 식별자입니다.

Record의 필드, 통과 근거 4가지와 체크포인트 유형 84개는 기록 자료형을 따릅니다. 대상 스냅샷의 19가지 분기는 대상 자료형에 정의되어 있습니다.

가상 체크포인트 기록 배치의 응답 예시입니다.

{
  "data": {
    "ri.checkpoints.main.checkpoint.a1b2c3d4-e5f6-7890-abcd-ef1234567890": {
      "projectRid": "ri.compass.main.folder.d4e5f6a7-b8c9-0123-defa-234567890123",
      "delegateUserId": "0d1fe74e-2b70-4a93-9b1a-80070637788b",
      "configRid": "ri.checkpoints.main.config.b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "organizationRid": "ri.multipass..organization.e5f6a7b8-c9d0-1234-efab-345678901234",
      "checkpointedItems": [
        {
          "type": "checkpointedResource",
          "rid": "ri.foundry.main.dataset.c26f11c8-cdb3-4f44-9f5d-9816ea1c82da",
          "resourceType": "DATASET",
          "compassPath": {
            "value": "/My Project/My Dataset"
          },
          "orgMarkings": []
        }
      ],
      "rid": "ri.checkpoints.main.checkpoint.a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "type": "CONTOUR_EXPORT",
      "actingUser": {
        "userId": "f05f8da4-b84c-4fca-9c77-8af0b13d11de",
        "username": {
          "value": "admin"
        }
      },
      "createdAt": "2023-11-14T09:30:00.000Z",
      "approvalsMetadata": {
        "approvalsTaskId": "e3f4a5b6-c7d8-9012-efab-123456789012",
        "approvalsSubtaskIds": [
          "f4a5b6c7-d8e9-0123-fabc-234567890123"
        ]
      },
      "scope": "USER_SCOPED",
      "interactionRid": "ri.checkpoints.main.checkpointable-interaction.c3d4e5f6-a7b8-9012-cdef-123456789012",
      "namespaceRid": "ri.compass.main.folder.f6a7b8c9-d0e1-2345-fabc-456789012345",
      "justification": {
        "type": "acknowledgementJustification",
        "prompt": "I acknowledge this action",
        "title": "Export Confirmation"
      }
    }
  }
}

개별 오류

오류 응답 처리는 공통 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/checkpoints/records/getBatch?preview=true" \
	-d '[{"recordRid":"ri.checkpoints.main.checkpoint.a1b2c3d4-e5f6-7890-abcd-ef1234567890"}]'

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 = [
    {
        "recordRid": "ri.checkpoints.main.checkpoint.a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    }
]

response = requests.post('https://{}/api/v2/checkpoints/records/getBatch?preview=true'.format(HOSTNAME), headers=headers, json=request_body)
print(response)

Java

Apache HttpClient 4.5 API와 try-with-resources를 사용합니다. 클래스 이름에 맞는 GetRecordsBatchExample.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 GetRecordsBatchExample {
    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/checkpoints/records/getBatch?preview=true");
            request.addHeader("content-type", "application/json");
            request.addHeader("authorization", String.format("Bearer %s", TOKEN));
            request.setEntity(new StringEntity("[{\"recordRid\":\"ri.checkpoints.main.checkpoint.a1b2c3d4-e5f6-7890-abcd-ef1234567890\"}]", 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/checkpoints/records/getBatch?preview=true`, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${TOKEN}`,
    },
    body: '[{"recordRid":"ri.checkpoints.main.checkpoint.a1b2c3d4-e5f6-7890-abcd-ef1234567890"}]'
}).then((response) => {
    console.log(response)
});

PowerShell

$TOKEN = $env:FOUNDRY_TOKEN
$HOSTNAME = $env:FOUNDRY_HOST

$headers = @{
    "authorization" = "Bearer $TOKEN"
}

$response = Invoke-WebRequest -Uri "https://$HOSTNAME/api/v2/checkpoints/records/getBatch?preview=true" `
	-Method Post `
	-Headers $headers `
	-ContentType application/json `
	-Body "[{`"recordRid`":`"ri.checkpoints.main.checkpoint.a1b2c3d4-e5f6-7890-abcd-ef1234567890`"}]"

$response.content