프로젝트, 폴더 또는 조직 수준에서 특정 통합에 대해 계보 수집을 선택적으로 사용 설정하거나 사용 중지할 수 있습니다.
지원되는 통합 및 구성 시나리오에 대한 자세한 내용은 데이터 계보 수집 제어를 참고하세요.
기본 요건
계보 수집을 제어하려면 Data Lineage API를 사용해야 합니다. Data Lineage API는 클라이언트 기반 API이므로 결제 및 할당량에 대해 구성된 클라이언트 프로젝트가 있어야 합니다.
역할 및 권한
데이터 계보 수집을 구성하고 제어하는 데 필요한 권한을 얻으려면 관리자에게 다음 Identity and Access Management (IAM) 역할을 부여해 달라고 요청하세요.
데이터 계보 수집을 구성하고 제어하는 데 필요한 권한을 얻으려면 관리자에게 프로젝트에 대한 다음 IAM 역할을 부여해 달라고 요청하세요.
-
데이터 계보 구성 및 관리:
데이터 계보 관리자 (
roles/datalineage.admin)
역할 부여에 대한 자세한 내용은 프로젝트, 폴더, 조직에 대한 액세스 관리를 참조하세요.
이러한 사전 정의된 역할에는 데이터 계보 수집을 구성하고 제어하는 데 필요한 권한이 포함되어 있습니다. 필요한 정확한 권한을 보려면 필수 권한 섹션을 펼치세요.
필수 권한
데이터 계보 수집을 구성하고 제어하려면 다음 권한이 필요합니다.
-
계보 구성 가져오기 및 업데이트:
-
datalineage.configs.get -
datalineage.configs.update
-
커스텀 역할이나 다른 사전 정의된 역할을 사용하여 이 권한을 부여받을 수도 있습니다.
클라이언트 프로젝트에서
datalineage.googleapis.comAPI를 사용 설정합니다. 자세한 내용은 데이터 계보 사용 설정을 참고하세요.클라이언트 프로젝트를 설정합니다. 다음 예시에서는
X-Goog-User-Project헤더를 사용합니다. 자세한 내용은 시스템 매개변수를 참고하세요.
현재 구성 가져오기
리소스에 계보 수집이 사용 설정되어 있는지 확인하거나 구성을 수정하기 전에 etag 값을 가져오려면 현재 구성을 가져옵니다.
C#
C#
이 샘플을 사용해 보기 전에 Knowledge Catalog 빠른 시작: 클라이언트 라이브러리 사용의 C# 설정 안내를 따르세요. 자세한 내용은 Knowledge Catalog C# API 참고 문서를 참고하세요.
Knowledge Catalog에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.
Go
Go
이 샘플을 사용해 보기 전에 Knowledge Catalog 빠른 시작: 클라이언트 라이브러리 사용의 Go 설정 안내를 따르세요. 자세한 내용은 Knowledge Catalog Go API 참고 문서를 참고하세요.
Knowledge Catalog에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.
자바
Java
이 샘플을 사용해 보기 전에 Knowledge Catalog 빠른 시작: 클라이언트 라이브러리 사용의 Java 설정 안내를 따르세요. 자세한 내용은 Knowledge Catalog Java API 참고 문서를 참고하세요.
Knowledge Catalog에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.
Python
Python
이 샘플을 사용해 보기 전에 Knowledge Catalog 빠른 시작: 클라이언트 라이브러리 사용의 Python 설정 안내를 따르세요. 자세한 내용은 Knowledge Catalog Python API 참고 문서를 참고하세요.
Knowledge Catalog에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.
gcloud
현재 계보 구성을 보려면 gcloud datalineage config describe 명령어를 사용합니다. 프로젝트, 폴더 또는 조직의 구성을 가져올 수 있습니다.
다음 예시에서는 현재 프로젝트의 구성을 가져오는 방법을 보여줍니다.
gcloud datalineage config describe
예를 들어 특정 프로젝트의 구성을 가져오려면 --project 플래그를 사용합니다.
gcloud datalineage config describe --project=PROJECT_ID
다음을 바꿉니다.
PROJECT_ID: 구성을 보려는 프로젝트의 ID입니다.
폴더 또는 조직의 서비스에 대한 현재 계보 수집 구성을 보려면 --project=을 다음 중 하나로 바꿉니다.PROJECT_ID
- 폴더의 데이터 수집 설정을 보려는 경우
--folder=입니다.FOLDER_ID - 조직의 데이터 수집 설정을 보려는 경우
--organization=입니다.ORGANIZATION_ID
REST
현재 계보 구성을 보려면 projects.locations.config.get 메서드를 사용합니다. 프로젝트, 폴더 또는 조직의 구성을 가져올 수 있습니다.
다음 예시에서는 프로젝트의 구성을 가져오는 방법을 보여줍니다.
요청 데이터를 사용하기 전에 다음을 바꿉니다.
CLIENT_PROJECT_ID: 결제 또는 할당량에 사용되는 클라이언트 프로젝트의 ID입니다.PROJECT_ID: 구성을 보려는 프로젝트의 ID입니다.
HTTP 메서드 및 URL:
GET https://datalineage.googleapis.com/v1/projects/PROJECT_ID/locations/global/config
요청을 보내려면 다음 옵션 중 하나를 펼칩니다.
이 명령어는 다음 출력 중 하나를 반환합니다.
- 계보 수집 설정을 제공하지 않으면 빈
ingestion객체가 포함된 출력이 표시됩니다.{ "name": "projects/123456789012/locations/global/config", "ingestion": {} }
즉, 서비스에서 기본 계보 수집 설정을 사용합니다. 이 예에서 Managed Service for Apache Spark의 계보 수집 설정은
enabled입니다. - 계보 수집을 명시적으로 사용 설정하면 다음 출력이 표시됩니다.
{ "name": "projects/123456789012/locations/global/config", "ingestion": { "rules": [ { "integrationSelector": { "integration": "DATAPROC" }, "lineageEnablement": { "enabled": true } } ] }, "etag": "1a2b3c4d5e" }
- 계보 수집이 사용 중지되면 다음 출력이 표시됩니다.
{ "name": "projects/123456789012/locations/global/config", "ingestion": { "rules": [ { "integrationSelector": { "integration": "DATAPROC" }, "lineageEnablement": { "enabled": false } } ] }, "etag": "1a2b3c4d5e" }
폴더 또는 조직의 구성을 가져오려면 projects/를 "PROJECT_IDfolders/ 또는 FOLDER_IDorganizations/로 바꿉니다.ORGANIZATION_ID
응답의 etag 필드는 구성의 현재 값을 기반으로 서버에서 생성된 체크섬입니다. patch 메서드를 사용하여 구성을 업데이트할 때 최근 get 요청에서 반환된 etag 값을 요청 본문에 포함할 수 있습니다. etag를 제공하면 Knowledge Catalog에서 이를 사용하여 마지막 읽기 요청 이후 구성이 변경되지 않았는지 확인합니다. 일치하지 않으면 업데이트 요청이 실패합니다. 이렇게 하면 읽기-수정-쓰기 시나리오에서 다른 사용자가 만든 구성을 실수로 덮어쓰는 것을 방지할 수 있습니다. patch 요청에 etag를 제공하지 않으면 Knowledge Catalog에서 무조건 구성을 덮어씁니다.
서비스의 계보 수집 사용 중지
비용을 관리하거나, 데이터 거버넌스 정책을 적용하거나, 계보 추적의 이점이 없는 개발 프로젝트 및 기타 워크로드를 제외하려면 서비스의 계보 수집을 사용 중지하세요.
자바
package com.google.cloud.datacatalog.lineage.configmanagement.v1.samples;
import com.google.api.gax.rpc.NotFoundException;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.Config;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.Config.Ingestion;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.Config.Ingestion.IngestionRule;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.Config.Ingestion.IngestionRule.IntegrationSelector;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.Config.Ingestion.IngestionRule.IntegrationSelector.Integration;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.Config.Ingestion.IngestionRule.LineageEnablement;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.ConfigManagementServiceClient;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.ConfigName;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.GetConfigRequest;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.UpdateConfigRequest;
public class DisableLineageIngestion {
public static void main(String[] args) throws Exception {
// TODO(developer): Replace these variables before running the sample.
String projectId = "your-project-id";
String location = "global";
disableLineageIngestion(projectId, location);
}
// Disables lineage ingestion for a specific service
// (Managed Service for Apache Spark).
public static void disableLineageIngestion(String projectId, String location) throws Exception {
// Initialize client that will be used to send requests. This client only needs to be created
// once, and can be reused for multiple requests.
try (ConfigManagementServiceClient client = ConfigManagementServiceClient.create()) {
// Format the resource name.
String name = ConfigName.ofProjectLocationName(projectId, location).toString();
Config.Builder configBuilder = Config.newBuilder().setName(name);
// It is a best practice to read the existing config to preserve other rules
// and use the etag for optimistic concurrency control.
try {
GetConfigRequest getRequest = GetConfigRequest.newBuilder().setName(name).build();
Config existingConfig = client.getConfig(getRequest);
configBuilder.mergeFrom(existingConfig);
} catch (NotFoundException e) {
// If config doesn't exist, we will proceed by creating a new one.
}
// Create an integration selector for the service you want to disable.
IntegrationSelector selector =
IntegrationSelector.newBuilder().setIntegration(Integration.DATAPROC).build();
// Set lineage enablement to false to disable tracking.
LineageEnablement enablement = LineageEnablement.newBuilder().setEnabled(false).build();
// Build the ingestion rule.
IngestionRule disableRule =
IngestionRule.newBuilder()
.setIntegrationSelector(selector)
.setLineageEnablement(enablement)
.build();
// Preserve existing rules except for the one we are modifying, then add the new rule.
// We clear the ingestion block out of the configBuilder entirely to reconstruct it.
Ingestion.Builder ingestionBuilder = Ingestion.newBuilder();
if (configBuilder.hasIngestion()) {
for (IngestionRule rule : configBuilder.getIngestion().getRulesList()) {
// Keep all existing rules EXCEPT the one targeting DATAPROC
if (rule.getIntegrationSelector().getIntegration() != Integration.DATAPROC) {
ingestionBuilder.addRules(rule);
}
}
}
ingestionBuilder.addRules(disableRule);
// Update the config builder with the reconstructed ingestion settings.
configBuilder.setIngestion(ingestionBuilder.build());
// Build the update request.
UpdateConfigRequest request = UpdateConfigRequest.newBuilder()
.setConfig(configBuilder.build())
.build();
// Update the config.
Config response = client.updateConfig(request);
System.out.printf("Successfully updated config: %s\n", response.getName());
}
}
}
Python
from google.api_core.exceptions import NotFound
from google.cloud.datacatalog.lineage import configmanagement_v1
def disable_lineage_ingestion(project_id: str, location: str = "global") -> configmanagement_v1.Config:
"""Disables lineage ingestion for a specific service.
Args:
project_id: The ID of your Google Cloud project.
location: The region location, usually 'global'.
Returns:
The updated Configuration object.
"""
# Initialize client that will be used to send requests.
client = configmanagement_v1.ConfigManagementServiceClient()
# The config name format
name = f"projects/{project_id}/locations/{location}/config"
try:
# Retrieve the existing config to preserve other configurations and
# obtain the latest etag for optimistic concurrency control.
config = client.get_config(name=name)
# Filter out existing rules for the integration we are updating
new_rules = [
rule for rule in config.ingestion.rules
if rule.integration_selector.integration != configmanagement_v1.Config.Ingestion.IngestionRule.IntegrationSelector.Integration.DATAPROC
]
except NotFound:
# If the config does not exist, start fresh
config = configmanagement_v1.Config(name=name)
new_rules = []
# Define the integration to disable tracking for (e.g., DATAPROC).
integration_selector = configmanagement_v1.Config.Ingestion.IngestionRule.IntegrationSelector(
integration=configmanagement_v1.Config.Ingestion.IngestionRule.IntegrationSelector.Integration.DATAPROC
)
# Set lineage enablement to False to disable tracking.
lineage_enablement = configmanagement_v1.Config.Ingestion.IngestionRule.LineageEnablement(
enabled=False
)
# Create the ingestion rule.
disable_rule = configmanagement_v1.Config.Ingestion.IngestionRule(
integration_selector=integration_selector,
lineage_enablement=lineage_enablement,
)
# Append the new disabling rule and assign it back to the config ingestion rules
new_rules.append(disable_rule)
config.ingestion = configmanagement_v1.Config.Ingestion(rules=new_rules)
# Create the update request using the config (which includes the etag if it existed).
request = configmanagement_v1.UpdateConfigRequest(
config=config,
)
# Make the request to update the config
response = client.update_config(request=request)
print(f"Successfully updated config: {response.name}")
return response
gcloud
특정 서비스의 계보 수집을 사용 중지하려면 인라인 JSON 문자열 또는 특정 integration의 lineageEnablement.enabled을 false로 설정하는 JSON 파일의 경로와 함께 gcloud datalineage config update 명령어를 사용합니다.
다음 예에서는 인라인 JSON 문자열을 사용하여 프로젝트의 서비스 계보 수집을 사용 중지하는 방법을 보여줍니다.
gcloud datalineage config update --project=PROJECT_ID \
--config='{
"ingestion": {
"rules": [
{
"integrationSelector": {
"integration": "INTEGRATION"
},
"lineageEnablement": {
"enabled": false
}
}
]
},
"etag": "ETAG"
}'
다음을 바꿉니다.
PROJECT_ID: 구성을 업데이트할 프로젝트의 ID입니다.INTEGRATION: 구성을 설정한 통합입니다. 예를 들면DATAPROC또는BIGQUERY입니다.ETAG: 요청 본문의 최근get요청에서 반환된etag값으로, 마지막 읽기 요청 이후 구성이 변경되지 않았는지 확인하는 데 사용됩니다.
JSON 파일을 사용하여 구성을 업데이트하려면 다음을 실행하세요.
gcloud datalineage config update --project=PROJECT_ID --config=CONFIG_FILE
다음을 바꿉니다.
CONFIG_FILE: 구성이 포함된 JSON 파일의 경로입니다.
폴더 또는 조직의 서비스 계보 수집을 사용 중지하려면 --project=를 다음 중 하나로 바꿉니다.PROJECT_ID
--folder=를 사용하여 폴더의 데이터 수집 설정을 업데이트합니다.FOLDER_ID--organization=조직의 데이터 수집 설정을 업데이트하려는 경우ORGANIZATION_ID
REST
특정 서비스의 계보 수집을 사용 중지하려면 특정 integration에 대해 lineageEnablement.enabled을 false로 설정하는 수집 규칙과 함께 projects.locations.config.patch 메서드를 사용합니다.
읽기-수정-쓰기 시나리오에서 다른 사용자가 만든 구성을 실수로 덮어쓰지 않으려면 요청 본문에 etag 필드를 포함하면 됩니다. 자세한 내용은 현재 구성 가져오기를 참고하세요.
요청 데이터를 사용하기 전에 다음을 바꿉니다.
CLIENT_PROJECT_ID: 결제 또는 할당량에 사용되는 클라이언트 프로젝트의 ID입니다.PROJECT_ID: 구성을 업데이트할 프로젝트의 ID입니다.ETAG: 최근get요청에서 반환된etag값입니다.INTEGRATION: 구성을 설정한integration입니다. 예를 들면DATAPROC입니다.
HTTP 메서드 및 URL:
PATCH https://datalineage.googleapis.com/v1/projects/PROJECT_ID/locations/global/config
JSON 요청 본문:
{
"ingestion": {
"rules": [
{
"integrationSelector": {
"integration": "INTEGRATION"
},
"lineageEnablement": {
"enabled": false
}
}
]
},
"etag": "ETAG"
}
요청을 보내려면 다음 옵션 중 하나를 펼칩니다.
다음과 비슷한 JSON 응답이 표시됩니다.
{
"name": "projects/PROJECT_ID/locations/global/config",
"ingestion": {
"rules": [
{
"integrationSelector": {
"integration": "INTEGRATION"
},
"lineageEnablement": {
"enabled": false
}
}
]
},
"etag": "1a2b3c4d5e"
}
폴더 또는 조직의 계보 수집을 사용 중지하려면 projects/를 "PROJECT_IDfolders/ 또는 FOLDER_IDorganizations/로 바꿉니다.ORGANIZATION_ID
서비스의 계보 수집 사용 설정
추적을 사용 중지한 후 다시 시작하거나 기본적으로 사용 중지된 통합을 사용 설정하려면 서비스의 계보 수집을 사용 설정하세요.
자바
package com.google.cloud.datacatalog.lineage.configmanagement.v1.samples;
import com.google.api.gax.rpc.NotFoundException;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.Config;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.Config.Ingestion;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.Config.Ingestion.IngestionRule;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.Config.Ingestion.IngestionRule.IntegrationSelector;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.Config.Ingestion.IngestionRule.IntegrationSelector.Integration;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.Config.Ingestion.IngestionRule.LineageEnablement;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.ConfigManagementServiceClient;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.ConfigName;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.GetConfigRequest;
import com.google.cloud.datacatalog.lineage.configmanagement.v1.UpdateConfigRequest;
public class EnableLineageIngestion {
public static void main(String[] args) throws Exception {
// TODO(developer): Replace these variables before running the sample.
String projectId = "your-project-id";
String location = "global";
enableLineageIngestion(projectId, location);
}
// Enables lineage ingestion for a specific service
// (Managed Service for Apache Spark).
public static void enableLineageIngestion(String projectId, String location) throws Exception {
// Initialize client that will be used to send requests. This client only needs to be created
// once, and can be reused for multiple requests.
try (ConfigManagementServiceClient client = ConfigManagementServiceClient.create()) {
// Format the resource name.
String name = ConfigName.ofProjectLocationName(projectId, location).toString();
Config.Builder configBuilder = Config.newBuilder().setName(name);
// It is a best practice to read the existing config to preserve other rules
// and use the etag for optimistic concurrency control.
try {
GetConfigRequest getRequest = GetConfigRequest.newBuilder().setName(name).build();
Config existingConfig = client.getConfig(getRequest);
configBuilder.mergeFrom(existingConfig);
} catch (NotFoundException e) {
// If config doesn't exist, we will proceed by creating a new one.
}
// Create an integration selector for the service you want to enable (e.g., DATAPROC).
IntegrationSelector selector =
IntegrationSelector.newBuilder().setIntegration(Integration.DATAPROC).build();
// Set lineage enablement to true to enable tracking.
LineageEnablement enablement = LineageEnablement.newBuilder().setEnabled(true).build();
// Build the ingestion rule.
IngestionRule enableRule =
IngestionRule.newBuilder()
.setIntegrationSelector(selector)
.setLineageEnablement(enablement)
.build();
// Preserve existing rules except for the one we are modifying, then add the new rule.
// We clear the ingestion block out of the configBuilder entirely to reconstruct it.
Ingestion.Builder ingestionBuilder = Ingestion.newBuilder();
if (configBuilder.hasIngestion()) {
for (IngestionRule rule : configBuilder.getIngestion().getRulesList()) {
// Keep all existing rules EXCEPT the one targeting DATAPROC
if (rule.getIntegrationSelector().getIntegration() != Integration.DATAPROC) {
ingestionBuilder.addRules(rule);
}
}
}
ingestionBuilder.addRules(enableRule);
// Update the config builder with the reconstructed ingestion settings.
configBuilder.setIngestion(ingestionBuilder.build());
// Build the update request.
UpdateConfigRequest request = UpdateConfigRequest.newBuilder()
.setConfig(configBuilder.build())
.build();
// Update the config.
Config response = client.updateConfig(request);
System.out.printf("Successfully updated config: %s\n", response.getName());
}
}
}
Python
from google.api_core.exceptions import NotFound
from google.cloud.datacatalog.lineage import configmanagement_v1
def enable_lineage_ingestion(project_id: str, location: str = "global") -> configmanagement_v1.Config:
"""Enables lineage ingestion for a specific service like Dataproc
(Managed Service for Apache Spark).
Args:
project_id: The ID of your Google Cloud project.
location: The region location, usually 'global'.
Returns:
The updated Configuration object.
"""
# Initialize client that will be used to send requests.
client = configmanagement_v1.ConfigManagementServiceClient()
# The config name format
name = f"projects/{project_id}/locations/{location}/config"
try:
# Retrieve the existing config to preserve other configurations and
# obtain the latest etag for optimistic concurrency control.
config = client.get_config(name=name)
# Filter out existing rules for the integration we are updating
new_rules = [
rule for rule in config.ingestion.rules
if rule.integration_selector.integration != configmanagement_v1.Config.Ingestion.IngestionRule.IntegrationSelector.Integration.DATAPROC
]
except NotFound:
# If the config does not exist, start fresh
config = configmanagement_v1.Config(name=name)
new_rules = []
# Define the integration to enable tracking for (e.g., DATAPROC).
integration_selector = configmanagement_v1.Config.Ingestion.IngestionRule.IntegrationSelector(
integration=configmanagement_v1.Config.Ingestion.IngestionRule.IntegrationSelector.Integration.DATAPROC
)
# Set lineage enablement to True to enable tracking.
lineage_enablement = configmanagement_v1.Config.Ingestion.IngestionRule.LineageEnablement(
enabled=True
)
# Create the ingestion rule.
enable_rule = configmanagement_v1.Config.Ingestion.IngestionRule(
integration_selector=integration_selector,
lineage_enablement=lineage_enablement,
)
# Append the new enabling rule and assign it back to the config ingestion rules
new_rules.append(enable_rule)
config.ingestion = configmanagement_v1.Config.Ingestion(rules=new_rules)
# Create the update request using the config (which includes the etag if it existed).
request = configmanagement_v1.UpdateConfigRequest(
config=config,
)
# Make the request to update the config
response = client.update_config(request=request)
print(f"Successfully updated config: {response.name}")
return response
gcloud
특정 서비스의 계보 수집을 사용 설정하려면 인라인 JSON 문자열 또는 특정 integration의 lineageEnablement.enabled을 true로 설정하는 JSON 파일의 경로와 함께 gcloud datalineage config update 명령어를 사용합니다. 현재 통합에는 Managed Service for Apache Spark, BigQuery, Managed Airflow가 포함됩니다.
다음 예시에서는 인라인 JSON 문자열을 사용하여 프로젝트의 서비스 계보 수집을 사용 설정하는 방법을 보여줍니다.
gcloud datalineage config update --project=PROJECT_ID \
--config='{
"ingestion": {
"rules": [
{
"integrationSelector": {
"integration": "INTEGRATION"
},
"lineageEnablement": {
"enabled": true
}
}
]
},
"etag": "ETAG"
}'
다음을 바꿉니다.
PROJECT_ID: 구성을 업데이트할 프로젝트의 ID입니다.INTEGRATION: 구성을 설정한 통합입니다 (예:DATAPROC또는BIGQUERY).ETAG: 요청 본문의 최근get요청에서 반환된etag값으로, 마지막 읽기 요청 이후 구성이 변경되지 않았는지 확인하는 데 사용됩니다.
JSON 파일을 사용하여 구성을 업데이트하려면 다음을 실행하세요.
gcloud datalineage config update --project=PROJECT_ID --config=CONFIG_FILE
다음을 바꿉니다.
CONFIG_FILE: 구성이 포함된 JSON 파일의 경로입니다.
폴더 또는 조직의 서비스 계보 수집을 사용 설정하려면 --project=를 다음 중 하나로 바꿉니다.PROJECT_ID
--folder=를 사용하여 폴더의 데이터 수집 설정을 업데이트합니다.FOLDER_ID--organization=조직의 데이터 수집 설정을 업데이트하려는 경우ORGANIZATION_ID
REST
특정 서비스의 계보 수집을 사용 설정하려면 특정 integration에 대해 lineageEnablement.enabled을 true로 설정하는 수집 규칙과 함께 projects.locations.config.patch 메서드를 사용합니다.
읽기-수정-쓰기 시나리오에서 다른 사용자가 만든 구성을 실수로 덮어쓰지 않으려면 요청 본문에 etag 필드를 포함하면 됩니다. 자세한 내용은 현재 구성 가져오기를 참고하세요.
요청 데이터를 사용하기 전에 다음을 바꿉니다.
CLIENT_PROJECT_ID: 결제 또는 할당량에 사용되는 클라이언트 프로젝트의 ID입니다.PROJECT_ID: 구성을 업데이트할 프로젝트의 ID입니다.ETAG: 최근get요청에서 반환된etag값입니다.INTEGRATION: 구성을 설정한integration입니다. 예를 들면DATAPROC입니다.
HTTP 메서드 및 URL:
PATCH https://datalineage.googleapis.com/v1/projects/PROJECT_ID/locations/global/config
JSON 요청 본문:
{
"ingestion": {
"rules": [
{
"integrationSelector": {
"integration": "INTEGRATION"
},
"lineageEnablement": {
"enabled": true
}
}
]
},
"etag": "ETAG"
}
요청을 보내려면 다음 옵션 중 하나를 펼칩니다.
다음과 비슷한 JSON 응답이 표시됩니다.
{
"name": "projects/PROJECT_ID/locations/global/config",
"ingestion": {
"rules": [
{
"integrationSelector": {
"integration": "INTEGRATION"
},
"lineageEnablement": {
"enabled": true
}
}
]
},
"etag": "1a2b3c4d5e"
}
폴더 또는 조직의 서비스에 계보 수집을 사용 설정하려면 projects/를 PROJECT_IDfolders/ 또는 FOLDER_IDorganizations/로 바꿉니다.ORGANIZATION_ID
여러 서비스의 계보 수집 구성
여러 통합의 계보 수집을 동시에 구성하려면 projects.locations.config.patch, folders.locations.config.patch 또는 organizations.locations.config.patch 메서드를 사용합니다. 요청 본문에 여러 규칙을 정의하여 프로젝트, 폴더 또는 조직 수준에서 구성을 업데이트할 수 있습니다. 자세한 내용은 다중 서비스 통합에서 데이터 수집 구성이 작동하는 방식을 참고하세요.
조직 수준
Managed Service for Apache Spark의 계보 수집을 사용 설정하도록 조직을 구성합니다.
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-H "X-Goog-User-Project: CLIENT_PROJECT_ID" \
"https://datalineage.googleapis.com/v1/organizations/ORGANIZATION_ID/locations/global/config" \
-d '{
"ingestion": {
"rules": [
{
"integrationSelector": {
"integration": "DATAPROC"
},
"lineageEnablement": {
"enabled": true
}
}
]
},
"etag": "ORGANIZATION_CONFIG_ETAG"
}'
다음을 바꿉니다.
ORGANIZATION_ID: 구성을 업데이트할 조직의 ID입니다.CLIENT_PROJECT_ID: 결제 또는 할당량에 사용되는 클라이언트 프로젝트의 ID입니다.ORGANIZATION_CONFIG_ETAG: 조직 구성에 대한 최근get요청에서 반환된etag값입니다.
폴더 수준
BigQuery의 계보 수집을 사용 설정하도록 폴더를 구성합니다.
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-H "X-Goog-User-Project: CLIENT_PROJECT_ID" \
"https://datalineage.googleapis.com/v1/folders/FOLDER_ID/locations/global/config" \
-d '{
"ingestion": {
"rules": [
{
"integrationSelector": {
"integration": "BIGQUERY"
},
"lineageEnablement": {
"enabled": true
}
}
]
},
"etag": "FOLDER_CONFIG_ETAG"
}'
다음을 바꿉니다.
FOLDER_ID: 업데이트하려는 구성이 포함된 폴더의 ID입니다.CLIENT_PROJECT_ID: 결제 또는 할당량에 사용되는 클라이언트 프로젝트의 ID입니다.FOLDER_CONFIG_ETAG: 폴더 구성에 대한 최근get요청에서 반환된etag값입니다.
프로젝트 수준
BigQuery의 계보 수집을 사용 중지하고 Managed Service for Apache Airflow의 계보 수집을 동시에 사용 설정하도록 프로젝트를 구성합니다.
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-H "X-Goog-User-Project: CLIENT_PROJECT_ID" \
"https://datalineage.googleapis.com/v1/projects/PROJECT_ID/locations/global/config" \
-d '{
"ingestion": {
"rules": [
{
"integrationSelector": {
"integration": "BIGQUERY"
},
"lineageEnablement": {
"enabled": false
}
},
{
"integrationSelector": {
"integration": "MANAGED_AIRFLOW"
},
"lineageEnablement": {
"enabled": true
}
}
]
},
"etag": "PROJECT_CONFIG_ETAG"
}'
다음을 바꿉니다.
PROJECT_ID: 구성을 업데이트할 프로젝트의 ID입니다.CLIENT_PROJECT_ID: 결제 또는 할당량에 사용되는 클라이언트 프로젝트의 ID입니다.PROJECT_CONFIG_ETAG: 프로젝트 구성에 대한 최근get요청에서 반환된etag값입니다.
다음 단계
- 데이터 계보 수집 제어에 대해 알아봅니다.
- 계보 정보를 보는 방법을 알아보세요.