Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

테이블 가져오기 비동기 실행(Execute Table Import) (V2)

지정한 TableImport를 Foundry 빌드로 비동기 실행합니다. api:connectivity-table-import-execute는 생성 및 변경용 권한 범위와 별도로 필요합니다.

반환된 빌드 RID로 Orchestration API의 실행 상태를 조회하거나 빌드 화면에서 결과를 확인합니다. 요청 응답만으로 표 데이터가 출력에 반영되었다고 처리하지 않습니다. 실제 원천 조회와 출력 데이터셋 변경을 시작하므로 실행 전에 연결, 쿼리, 대상 및 모드를 확인합니다.

HTTP 요청

POST /api/v2/connectivity/connections/{connectionRid}/tableImports/{tableImportRid}/execute

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

경로 매개변수

이름자료형필수 여부의미와 조건예시 값
connectionRidstring필수소스라고도 부르는 Connection의 RID입니다.ri.magritte..source.c078b71b-92f9-41b6-b0df-3760f411120b
tableImportRidstring필수배치 동기화라고도 부르는 TableImport의 RID입니다.ri.magritte..extract.27bb4f2b-63b8-44b8-a579-4e2bd65ba158

쿼리 매개변수

지정할 쿼리 매개변수가 없습니다.

요청 본문

요청 본문을 사용하지 않습니다.

응답

BuildRid는 빌드의 식별자를 담는 JSON 문자열입니다. 객체에서 rid 필드를 찾는 방식과 구분합니다.

가상 테이블 가져오기 실행 빌드의 응답 예시입니다.

"ri.foundry.main.build.a4386b7e-d546-49be-8a36-eefc355f5c58"

개별 오류

오류 이름오류 코드HTTP의미와 조건추가 매개변수
ExecuteTableImportPermissionDeniedPERMISSION_DENIED403테이블 가져오기를 실행할 수 없습니다.tableImportRid, connectionRid
TableImportNotFoundNOT_FOUND404지정한 테이블 가져오기를 찾을 수 없습니다.tableImportRid, connectionRid

요청 예제

FOUNDRY_HOST에는 https://를 제외한 Foundry 호스트를, FOUNDRY_TOKEN에는 유효한 토큰을 환경 변수로 제공합니다. 예시 식별자와 매개변수 값은 실제 작업 대상에 맞게 바꿉니다.

cURL

curl -X POST \
	-H "Authorization: Bearer ${FOUNDRY_TOKEN}" \
	"https://${FOUNDRY_HOST}/api/v2/connectivity/connections/ri.magritte..source.c078b71b-92f9-41b6-b0df-3760f411120b/tableImports/ri.magritte..extract.27bb4f2b-63b8-44b8-a579-4e2bd65ba158/execute"

Python

Requests 라이브러리가 설치된 Python 환경에서 사용합니다.

import os
import requests

HOSTNAME = os.environ["FOUNDRY_HOST"]
TOKEN = os.environ["FOUNDRY_TOKEN"]
headers = {
    "authorization": "Bearer {}".format(TOKEN)
}

response = requests.post('https://{}/api/v2/connectivity/connections/ri.magritte..source.c078b71b-92f9-41b6-b0df-3760f411120b/tableImports/ri.magritte..extract.27bb4f2b-63b8-44b8-a579-4e2bd65ba158/execute'.format(HOSTNAME), headers=headers)
print(response)

Java

Apache HttpClient 4.5 API와 try-with-resources를 사용합니다. 클래스 이름에 맞는 ExecuteTableImportExample.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;

public class ExecuteTableImportExample {
    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/connectivity/connections/ri.magritte..source.c078b71b-92f9-41b6-b0df-3760f411120b/tableImports/ri.magritte..extract.27bb4f2b-63b8-44b8-a579-4e2bd65ba158/execute");
            request.addHeader("authorization", String.format("Bearer %s", TOKEN));
            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/connectivity/connections/ri.magritte..source.c078b71b-92f9-41b6-b0df-3760f411120b/tableImports/ri.magritte..extract.27bb4f2b-63b8-44b8-a579-4e2bd65ba158/execute`, {
    method: 'POST',
    headers: {
        'Authorization': `Bearer ${TOKEN}`,
    }
}).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/connectivity/connections/ri.magritte..source.c078b71b-92f9-41b6-b0df-3760f411120b/tableImports/ri.magritte..extract.27bb4f2b-63b8-44b8-a579-4e2bd65ba158/execute" `
	-Method Post `
	-Headers $headers

$response.content