Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

연결 전체 정보 조회(Get Connection) (V2)

연결 RID로 상위 폴더, 표시 이름, 워커, 내보내기 설정과 외부 시스템 구성을 조회합니다. 외부 시스템 구성만 필요하면 더 적은 정보를 반환하는 Get Configuration을 사용합니다.

암호화 속성은 평문 대신 비밀 이름으로 반환됩니다. 이 이름은 비밀 갱신의 대상을 준비할 때 사용할 수 있습니다.

HTTP 요청

GET /api/v2/connectivity/connections/{connectionRid}

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

경로 매개변수

이름자료형필수 여부의미와 조건예시 값
connectionRidstring필수소스라고도 부르는 Connection의 RID입니다.ri.magritte..source.c078b71b-92f9-41b6-b0df-3760f411120b

쿼리 매개변수

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

요청 본문

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

응답

응답 형식은 Connection입니다.

Connection의 필수 메타데이터, 워커와 내보내기 설정은 Connection 자료형을 따릅니다. 외부 시스템별 필드는 연결 구성에서 확인합니다.

가상 JDBC 연결의 응답 예시입니다.

{
  "parentFolderRid": "ri.compass.main.folder.c410f510-2937-420e-8ea3-8c9bcb3c1791",
  "configuration": {
    "type": "jdbc",
    "url": "jdbc:postgresql://db.example.com:5432/example",
    "driverClass": "org.postgresql.Driver"
  },
  "displayName": "Connection to my external system",
  "exportSettings": {
    "exportsEnabled": true,
    "exportEnabledWithoutMarkingsValidation": false
  },
  "rid": "ri.magritte..source.c078b71b-92f9-41b6-b0df-3760f411120b",
  "worker": {
    "type": "foundryWorker"
  }
}

개별 오류

오류 이름오류 코드HTTP의미와 조건추가 매개변수
ParentFolderNotFoundForConnectionNOT_FOUND404해당 연결의 상위 폴더를 찾을 수 없습니다.connectionRid
ConnectionTypeNotSupportedINVALID_ARGUMENT400해당 연결 유형은 Platform API에서 아직 지원하지 않습니다.connectionType
ConnectionNotFoundNOT_FOUND404지정한 연결을 찾을 수 없습니다.connectionRid

요청 예제

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

cURL

curl \
	-H "Authorization: Bearer ${FOUNDRY_TOKEN}" \
	"https://${FOUNDRY_HOST}/api/v2/connectivity/connections/ri.magritte..source.c078b71b-92f9-41b6-b0df-3760f411120b"

Python

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

import os
import requests

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

response = requests.get('https://{}/api/v2/connectivity/connections/ri.magritte..source.c078b71b-92f9-41b6-b0df-3760f411120b'.format(HOSTNAME), headers=headers)
print(response)

Java

Apache HttpClient 4.5 API와 try-with-resources를 사용합니다. 클래스 이름에 맞는 GetConnectionExample.java 파일에서 사용합니다.

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;

public class GetConnectionExample {
    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()) {
            HttpGet request = new HttpGet("https://" + HOSTNAME + "/api/v2/connectivity/connections/ri.magritte..source.c078b71b-92f9-41b6-b0df-3760f411120b");
            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`, {
    method: 'GET',
    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" `
	-Headers $headers

$response.content