SYSTEM$LIST_ALERT_TEMPLATES
SYSTEM$LIST_ALERT_TEMPLATES
계정에서 사용할 수 있는 알림 템플릿(alert template)을 제품별로 묶어 나열하는 시스템 함수예요. 특정 템플릿을 SYSTEM$GET_ALERT_TEMPLATE로 자세히 확인하거나 CREATE ALERT … FROM TEMPLATE로 알림을 만들기 전에, 어떤 템플릿이 존재하는지 이 함수로 먼저 파악할 수 있어요.
본문
Syntax
SYSTEM$LIST_ALERT_TEMPLATES( [ '<product>' ] )
Arguments
product:
선택적인 제품 카테고리로, 결과를 필터링해 해당 제품이 소유한 템플릿만 반환하게 해요 (예: TASKS, OPENFLOW, DATA_QUALITY). 반환되는 페이로드의 product 필드에 보고되는 값과 같아요. 이 값은 대소문자를 구분하지 않아요. 이 인자를 생략하면 모든 제품의 템플릿을 반환해요.
Returns
사용 가능한 템플릿을 설명하는 JSON 객체를 반환해요. 최상위 필드는:
- catalog_version. 계정에 활성화된 알림 템플릿 카탈로그의 버전이에요.
- template_groups. 제품 그룹의 배열이에요. 각 그룹은 다음을 포함해요.
- product. 템플릿을 소유한 제품 카테고리예요 (예: TASKS, OPENFLOW, DATA_QUALITY).
- templates. 해당 그룹의 템플릿 배열이에요.
templates의 각 객체는 다음 필드를 가져요:
- template_id. SYSTEM$GET_ALERT_TEMPLATE와 CREATE ALERT의 FROM TEMPLATE 절에 전달하는 식별자예요.
- template_version. 템플릿의 버전이에요.
- display_name. 템플릿을 위한 사람이 읽을 수 있는 이름이에요.
- alert_description. 템플릿이 모니터링하는 내용에 대한 설명이에요.
- product. 템플릿을 소유한 제품 카테고리예요.
- supports_new_data_schedule. 템플릿이 예약된 알림(scheduled alert) 외에 새 데이터에 대한 알림에도 사용될 수 있는지 여부예요 (true).
- default_schedule. 별도로 지정하지 않을 때 적용되는 일정이에요 (예: 30 MINUTES).
- scope. 템플릿이 지원하는 모니터링 범위예요 (예: ["Account", "Database", "Schema"]).
- subcategories. 선택적인 제품 하위 카테고리이거나 null이에요.
- runbook. 템플릿을 위한 선택적인 런북(runbook) 참조이거나 null이에요.
Usage notes
- 읽기 전용 함수라 실행 중인 웨어하우스가 필요하지 않아요.
- 사용 가능한 템플릿과 그 변수 집합은 Snowflake가 관리하며 카탈로그 버전에 따라 바뀔 수 있어요. 템플릿 식별자와 변수 정의를 하드코딩하지 말고, 항상 SYSTEM$GET_ALERT_TEMPLATE와 함께 이 함수를 써서 현재 값을 가져오세요.
Examples
모든 사용 가능한 알림 템플릿 나열하기:
SELECT SYSTEM$LIST_ALERT_TEMPLATES();
특정 제품이 소유한 템플릿만 나열하기:
SELECT SYSTEM$LIST_ALERT_TEMPLATES('TASKS');
함수는 다음과 유사한 JSON 객체를 반환해요 (축약됨):
{
"catalog_version": 5,
"template_groups": [
{
"product": "TASKS",
"templates": [
{
"template_id": "TASKS_ERROR_RATE",
"template_version": "4.0.0",
"display_name": "Error rate alert",
"alert_description": "Monitors when the cumulative error rate of tasks exceeds a threshold, indicating systematic task failures that require attention.",
"product": "TASKS",
"supports_new_data_schedule": false,
"default_schedule": "30 MINUTES",
"scope": ["Account", "Database", "Schema"],
"subcategories": null,
"runbook": "https://docs.snowflake.com/en/user-guide/tasks-ts"
}
]
},
{
"product": "DATA_QUALITY",
"templates": [
{
"template_id": "DQ_ANOMALY_DETECTION",
"template_version": "3.0.0",
"display_name": "Anomaly detection alert",
"alert_description": "Monitors for anomalies detected in data quality metrics, alerting when unusual patterns or outliers are identified.",
"product": "DATA_QUALITY",
"supports_new_data_schedule": true,
"default_schedule": "1 HOUR",
"scope": ["Account", "Database", "Schema", "Table"],
"subcategories": null,
"runbook": null
}
]
}
]
}