우리의 REST API는 New Relic 경고 설정을 프로그래밍 방식으로 구성하기 위한 New Relic의 원래 API입니다( 우리가 선호하는 API인 NerdGraph에 대해 알아보십시오 ).
REST API Explorer 에는 사용 가능한 각 API 호출에 대한 컬 요청 형식, 사용 가능한 매개변수, 잠재적 응답 상태 코드 및 JSON 응답 구조도 포함됩니다. UI에서 경고 조건을 만들 수도 있습니다.
REST API를 사용하기 전에
REST API를 사용하여 경고 데이터를 관리하기 전에 경고 및 적용된 인텔리전스를 위한 API 소개 를 읽으십시오.
인프라 알림 은 인프라 모니터링 알림을 위한 REST API를 참조하세요.
REST API를 통해 사용 가능한 데이터 및 기능
REST API 함수 | 코멘트 |
---|---|
계정 데이터 보기 | 일반적으로 모든 역할 은 GET > 목록 기능과 함께 사용자 키 또는 REST API 키 를 사용하여 경고 데이터를 볼 수 있습니다 . 계정 소유자 및 관리자는 API 키를 사용할 수 있습니다. 목록 출력은 페이지가 매겨 집니다. 사용 가능한 기능은 다음과 같습니다.
|
계정 데이터 유지 | POST > 생성 , PUT > 추가 , PUT > 업데이트 를 포함한 유지 관리 기능을 사용하기 위해 계정 및 사용자 키 에 소유자 또는 관리자 역할이 있거나 경고 및 사용자 키 를 관리할 수 있는 권한을 부여하는 사용자 지정 역할이 있을 수 있습니다. 및 삭제 . |
REST API에서 제외된 조건
이러한 유형의 조건에는 API에서 사용 가능한 엔드포인트가 없습니다.
- APM: 웹 트랜잭션 백분위수, 레이블 및 이상을 대상으로 하는 조건
- NRQL: 이상
경고 정책
이러한 API 기능에는 정책 을 생성, 삭제 또는 나열할 수 있는 API 탐색기에 대한 링크가 포함됩니다.
중요
계정이 EU 데이터 센터의 데이터를 호스팅하는 경우 EU 지역 계정에 적절한 API 엔드포인트를 사용하고 있는지 확인하십시오.
새 정책을 추가하려면 사용자 키 를 사용하고 API 호출에 다음 두 값을 포함합니다.
필수 값 | 정의 |
---|---|
사건 | 경고가 인시던트 및 그룹 위반을 생성 하는 방법을 결정합니다. 다음 중 하나여야 합니다. |
|
API Explorer > Alerts Policies > POST > Create
curl -X POST 'https://api.newrelic.com/v2/alerts_policies.json' \
-H 'X-Api-Key:$API_KEY' -i \
-H 'Content-Type: application/json' \
-d \
'{
"policy": {
"incident_preference": "string",
"name": "string"
}
}'
이 API를 사용하여 기존 정책의 name
및 incident_preference
을 업데이트합니다. 사용자 키 가 필요합니다.
필수 값 | 정의 |
---|---|
| 필수의. 정책의 ID를 찾으려면 다음 옵션 중 하나를 사용하십시오.
|
사건 | 경고가 인시던트 및 그룹 위반을 생성 하는 방법을 결정합니다. 다음 중 하나여야 합니다. |
필수의. 이름을 변경하지 않으면 기본적으로 문자열이라는 정책이 사용됩니다. 정책의 정확한 이름을 찾으려면 List Policies API 를 사용하십시오. |
API Explorer > Alerts Policies > PUT > Update
curl -X PUT 'https://api.newrelic.com/v2/alerts_policies/{id}.json' \
-H 'X-Api-Key:$API_KEY' -i \
-H 'Content-Type: application/json' \
-d \
'{
"policy": {
"incident_preference": "string",
"name": "string"
}
}'
기존 정책을 삭제하려면 사용자 키 를 사용하고 API 호출에 policy_id
( API Explorer > Alerts Policies > GET > List 에서 사용 가능)을 포함합니다.
API Explorer > Alerts Policies > DELETE > Delete
curl -X DELETE 'https://api.newrelic.com/v2/alerts_policies/$POLICY_ID.json' \
-H 'X-Api-Key:$API_KEY' -i
계정에 대한 기존 정책 목록을 보려면 사용자 키 를 사용하고 API 호출에 다음과 같은 선택적 값을 포함합니다.
선택적 정책
name
필터선택적 페이지 매김 값
API Explorer > Alerts Policies > GET > List
curl -X GET 'https://api.newrelic.com/v2/alerts_policies.json' \ -H 'X-Api-Key:$API_KEY' -i
알림 채널
이러한 API 기능에는 경고 알림 채널 을 생성, 삭제 또는 나열할 수 있는 API 탐색기에 대한 링크가 포함됩니다.
중요
계정이 EU 데이터 센터의 데이터를 호스팅하는 경우 EU 지역 계정에 적절한 API 엔드포인트를 사용하고 있는지 확인하십시오.
새 알림 채널을 추가하려면 사용자 키 를 사용하고 API 호출에 다음 값을 포함합니다.
새 채널 이름
구성 값
API Explorer는 각 알림 채널 유형에 필요한 구성 값의 형식을 보여줍니다.
API Explorer > Alerts Channels > POST > Create
curl -X POST 'https://api.newrelic.com/v2/alerts_channels.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json' \ -d \ '{ "channel": { "name": "string", "type": "string", "configuration": "hash" } }'
이 예에서
"hash"
자리 표시자는 적절한 값으로 대체된 다음 JSON 블록 중 하나로 대체되어야 합니다.{"recipients" : "test@google.com","include_json_attachment" : true}{"api_key": "abc123","teams": "team1","tags": "tag1","recipients": "me@me.com"}{"url": "http://example.com","channel": "channel1"}{"key": "mykey","route_key": "theroute"}{"service_key": "myservicekey"}이 예는 삽입된 기본
payload
을 보여줍니다. (payload
속성은 선택 사항입니다.)payload
은(는) 표시된 것과 다른 키를 갖도록 사용자 정의할 수 있으며 전달 전에 보간된$
접두어 속성과 함께 전송됩니다.중요
condition_id
은(는) 더 이상 사용되지 않습니다. 대신condition_family_id
을(를) 사용하십시오.{"base_url": "http://example.com","auth_username": "username","auth_password": "password","payload_type": "application/json","headers": {"header1": "test","header2": "test"}"payload": {"account_id": "$ACCOUNT_ID","account_name": "$ACCOUNT_NAME","closed_violations_count_critical": "$CLOSED_VIOLATIONS_COUNT_CRITICAL","closed_violations_count_warning": "$CLOSED_VIOLATIONS_COUNT_WARNING","condition_family_id": "$CONDITION_FAMILY_ID","condition_id": "$CONDITION_ID","condition_name": "$CONDITION_NAME","current_state": "$EVENT_STATE","details": "$EVENT_DETAILS","duration": "$DURATION","event_type": "$EVENT_TYPE","incident_acknowledge_url": "$INCIDENT_ACKNOWLEDGE_URL","incident_id": "$INCIDENT_ID","incident_url": "$INCIDENT_URL","open_violations_count_critical": "$OPEN_VIOLATIONS_COUNT_CRITICAL","open_violations_count_warning": "$OPEN_VIOLATIONS_COUNT_WARNING","owner": "$EVENT_OWNER","policy_name": "$POLICY_NAME","policy_url": "$POLICY_URL","runbook_url": "$RUNBOOK_URL","severity": "$SEVERITY","targets": "$TARGETS","timestamp": "$TIMESTAMP","violation_callback_url": "$VIOLATION_CALLBACK_URL","violation_chart_url": "$VIOLATION_CHART_URL"}}이 예는 삽입된 기본
payload
을 보여줍니다. (payload
속성은 선택 사항입니다.)payload
은(는) 표시된 것과 다른 키를 갖도록 사용자 정의할 수 있으며 전달 전에 보간된$
접두어 속성과 함께 전송됩니다.중요
condition_id
은(는) 더 이상 사용되지 않습니다. 대신condition_family_id
을(를) 사용하십시오.{"base_url": "http://example.com","auth_username": "username","auth_password": "password","payload_type": "application/x-www-form-urlencoded","headers": {"header1": "test","header2": "test"},"payload": {"account_id": "$ACCOUNT_ID","account_name": "$ACCOUNT_NAME","closed_violations_count_critical": "$CLOSED_VIOLATIONS_COUNT_CRITICAL","closed_violations_count_warning": "$CLOSED_VIOLATIONS_COUNT_WARNING","condition_family_id": "$CONDITION_FAMILY_ID","condition_id": "$CONDITION_ID","condition_name": "$CONDITION_NAME","current_state": "$EVENT_STATE","details": "$EVENT_DETAILS","duration": "$DURATION","event_type": "$EVENT_TYPE","incident_acknowledge_url": "$INCIDENT_ACKNOWLEDGE_URL","incident_id": "$INCIDENT_ID","incident_url": "$INCIDENT_URL","open_violations_count_critical": "$OPEN_VIOLATIONS_COUNT_CRITICAL","open_violations_count_warning": "$OPEN_VIOLATIONS_COUNT_WARNING","owner": "$EVENT_OWNER","policy_name": "$POLICY_NAME","policy_url": "$POLICY_URL","runbook_url": "$RUNBOOK_URL","severity": "$SEVERITY","targets": "$TARGETS","timestamp": "$TIMESTAMP","violation_callback_url": "$VIOLATION_CALLBACK_URL","violation_chart_url": "$VIOLATION_CHART_URL"}}
기존 알림 채널을 삭제하려면 사용자 키 를 사용하고 API 호출에 channel_id
( API Explorer > Alerts Channels > GET > List 에서 사용 가능)을 포함합니다.
API Explorer > Alerts Channels > DELETE > Delete
curl -X DELETE 'https://api.newrelic.com/v2/alerts_channels/{channel_id}.json' \
-H 'X-Api-Key:$API_KEY' -i
계정의 기존 알림 채널 목록을 보려면 API 호출에서 사용자 키 와 선택적 페이지 매김 값을 사용하십시오.
API Explorer > Alerts Channels > GET > List
curl -X GET 'https://api.newrelic.com/v2/alerts_channels.json' \
-H 'X-Api-Key:$API_KEY' -i
정책을 하나 이상의 알림 채널과 연결할 수 있습니다. 알림 채널을 하나 이상의 정책과 연결할 수도 있습니다. 정책에 알림 채널을 추가하려면 API 호출에서 사용자 키 와 다음 값을 사용하십시오.
policy_id
값( API Explorer > Alerts Policies > GET > List 에서 사용 가능)쉼표 또는 새 줄로 구분된 배열의 하나 이상의
channel_id
값( API Explorer > Alerts Channels > GET > List 에서 사용 가능)API Explorer > Alerts Policy Channels > PUT > Update
curl -X PUT 'https://api.newrelic.com/v2/alerts_policy_channels.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json' \ -G -d 'policy_id=$POLICY_ID&channel_ids=channel_id'
정책을 하나 이상의 알림 채널과 연결할 수 있습니다. 알림 채널을 하나 이상의 경고 정책과 연결할 수도 있습니다.
채널에서 정책을 제거하거나 정책에서 채널을 제거하려면 API 호출에서 사용자 키 와 다음 값을 사용하십시오.
policy_id
( API Explorer > Alerts Policies > GET > List 에서 사용 가능)channel_id
( API Explorer > Alerts Channels > GET > List 에서 사용 가능)API Explorer > Alerts Policy Channels > DELETE > Delete
curl -X DELETE 'https://api.newrelic.com/v2/alerts_policy_channels.json' \ -H 'X-Api-Key:$API_KEY' -i \ -d 'channel_id=CHANNEL_ID&policy_id=POLICY_ID'
APM, 브라우저, 모바일에 대한 조건
이러한 API 기능에는 정책 조건 을 생성, 업데이트, 삭제 또는 나열할 수 있는 API 탐색기에 대한 링크가 포함됩니다. 이러한 호출은 다음 유형의 엔터티가 있는 조건에 대한 것입니다.
- APM: 앱 및 주요 거래
- 브라우저: 앱 및 주요 거래
- 모바일: 모바일 앱
예외: 다음 APM 조건은 이 API 끝점에서 사용할 수 없습니다 .
- 조건 타겟팅 라벨(동적 타겟팅)
- 웹 트랜잭션 백분위수 조건
- 이상 조건
중요
API Explorer는 외부 서비스 (APM 및 모바일) 및 종합 모니터링 을 포함하여 별도의 엔드포인트 를 사용하여 다른 유형의 조건에 대한 정보를 제공합니다. 검색 또는 업데이트 시 모든 유형의 경고 조건을 고려하십시오. 계정이 EU 데이터 센터의 데이터를 호스팅하는 경우 EU 지역 계정에 적절한 API 엔드포인트를 사용하고 있는지 확인하십시오.
정책에 조건을 추가하려면 API 호출에 다음 값을 포함합니다.
policy_id
( API Explorer > Alerts Policies > GET > List 에서 사용 가능)API 호출의 필수
condition
값(API 탐색기 페이지 및 경고 조건 API 용어집 에 설명됨)API Explorer > Alerts Conditions > POST > Create
curl -X POST 'https://api.newrelic.com/v2/alerts_conditions/policies/$POLICY_ID.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json' \ -d \ '{ "condition": { "type": "string", "name": "string", "enabled": boolean, "entities": [ integer ], "metric": "string", "gc_metric": "string", "condition_scope": "string", "violation_close_timer": integer, "runbook_url": "string", "terms": [ { "duration": "string", "operator": "string", "priority": "string", "threshold": "string", "time_function": "string" } ], "user_defined": { "metric": "string", "value_function": "string" } } }'
JSON 응답은 조건을 업데이트하거나 삭제해야 하는
id
조건을 반환합니다. API Explorer > Alerts Conditions > GET > List 에서id
조건을 볼 수도 있습니다.
정책 조건을 업데이트하려면 API 호출에 다음 값을 포함합니다.
조건의
id
( API Explorer > Alerts Conditions > GET > List 에서 사용 가능)API 호출의 필수
condition
값(API 탐색기 페이지 및 경고 조건 API 용어집 에 설명됨)API Explorer > Alerts Conditions > PUT > Update
curl -X PUT 'https://api.newrelic.com/v2/alerts_conditions/$CONDITION_ID.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json' \ -d \ '{ "condition": { "type": "string", "name": "string", "enabled": boolean, "entities": [ integer ], "metric": "string", "metric": "string", "gc_metric": "string", "condition_scope": "string", "violation_close_timer": integer, "runbook_url": "string", "terms": [ { "duration": "string", "operator": "string", "priority": "string", "threshold": "string", "time_function": "string" } ], "user_defined": { "metric": "string", "value_function": "string" } } }'
정책에서 조건을 삭제하려면 API 호출에 다음 값을 포함합니다.
condition_id
( API Explorer > Alerts Conditions > GET > List 에서 사용 가능)API Explorer > Alerts Conditions > DELETE > Delete
curl -X DELETE 'https://api.newrelic.com/v2/alerts_conditions/$CONDITION_ID.json' \ -H 'X-Api-Key:$API_KEY' -i
정책에 대한 기존 조건 목록을 보려면 API 호출에서 REST API 키 또는 사용자 키 및 연결된 policy_id
를 사용하세요.
API Explorer > Alerts Conditions > GET > List
curl -X GET 'https://api.newrelic.com/v2/alerts_conditions.json?policy_id=$POLICY_ID' \
-H 'X-Api-Key:$API_KEY' -i
NRQL의 조건
이러한 API 기능에는 정책에 대한 NRQL 조건 을 생성, 업데이트, 삭제 또는 나열할 수 있는 API 탐색기에 대한 링크가 포함됩니다.
예외: NRQL 이상 조건은 이 끝점에서 사용할 수 없습니다 .
중요
계정이 EU 데이터 센터의 데이터를 호스팅하는 경우 EU 지역 계정에 적절한 API 엔드포인트를 사용하고 있는지 확인하십시오.
권장 사항: NRQL 데이터가 스트리밍되는 방식으로 인해 aggregation_method
을 EVENT_FLOW
로 설정하고 aggregation_window
에는 60
, aggregation_delay
}에는 120
의 기본 설정을 사용하십시오. EVENT_FLOW
은 대부분의 사용 사례에서 작동하지만 EVENT_TIMER
에서 더 잘 작동하는 사용 사례에 대한 논의는 어떤 집계 방법을 사용할 것인가를 참조하세요. .
API Explorer > Alerts NRQL Conditions > POST > Create
정책에 대한 NRQL 조건을 생성하려면:
curl -X POST 'https://api.newrelic.com/v2/alerts_nrql_conditions/policies/$POLICY_ID.json' \
-H 'X-Api-Key:$API_KEY' -i \
-H 'Content-Type: application/json' \
-d \
'{
"nrql_condition": {
"type": "string",
"name": "string",
"runbook_url": "string",
"enabled": boolean,
"terms": [
{
"duration": "string",
"operator": "string",
"priority": "string",
"threshold": "string",
"time_function": "string"
}
],
"value_function": "string",
"nrql": {
"query": "string"
},
"signal": {
"aggregation_window": "string",
"slide_by": "integer",
"aggregation_method": "string",
"aggregation_delay": integer,
"aggregation_timer": integer,
"fill_option": "string",
"fill_value": "string"
},
"expiration": {
"expiration_duration": "string",
"open_violation_on_expiration": boolean,
"close_violations_on_expiration": boolean
}
}
}'
type
을 생략하거나 static
로 설정하면 기본적으로 표준 NRQL 경고가 설정됩니다.
정책에 대한 NRQL 조건을 업데이트하려면 API 호출에 다음 값을 포함합니다.
조건의
id
( API Explorer Alerts NRQL Conditions > GET > List 에서 사용 가능)API 호출의 필수
condition
값(API 탐색기 페이지 및 경고 조건 API 용어집 에 설명됨)API Explorer > Alerts NRQL Conditions > PUT > Update
curl -X PUT 'https://api.newrelic.com/v2/alerts_nrql_conditions/$CONDITION_ID.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json' \ -d \ '{ "nrql_condition": { "name": "string", "runbook_url": "string", "enabled": boolean, "terms": [ { "duration": "string", "operator": "string", "priority": "string", "threshold": "string", "time_function": "string" } ], "value_function": "string", "nrql": { "query": "string" } } }'
정책에서 NRQL 조건을 삭제하려면 API 호출에 다음 값을 포함합니다.
조건의
id
( API Explorer Alerts NRQL Conditions > GET > List 에서 사용 가능)API Explorer > Alerts NRQL Conditions > DELETE > Delete
curl -X DELETE 'https://api.newrelic.com/v2/alerts_nrql_conditions/$CONDITION_ID.json' \ -H 'X-Api-Key:$API_KEY' -i
알림 정책에 대한 기존 조건 목록을 보려면 API 호출에서 사용자 키 또는 REST API 키 및 연결된 policy_id
를 사용하세요.
API Explorer > Alerts NRQL Conditions > GET > List
curl -X GET 'https://api.newrelic.com/v2/alerts_nrql_conditions.json' \
-H 'X-Api-Key:$API_KEY' -i \
-d 'policy_id=$POLICY_ID'
외부 서비스에 대한 조건
이러한 API 기능에는 정책 조건 을 생성, 업데이트, 삭제 또는 나열할 수 있는 API 탐색기에 대한 링크가 포함됩니다. 이러한 호출은 외부 서비스에 대한 조건입니다. API 호출은 APM 및 모바일 모니터링 앱과 함께 사용할 수 있습니다.
중요
계정이 EU 데이터 센터의 데이터를 호스팅하는 경우 EU 지역 계정에 적절한 API 엔드포인트를 사용하고 있는지 확인하십시오.
APM 또는 모바일 모니터링 앱이 있는 정책에 외부 서비스에 대한 조건을 추가하려면 API 호출에 다음 값을 포함합니다.
policy_id
( API Explorer > Alerts Policies > GET > List 에서 사용 가능)API 호출의 필수
external_service_condition
값(API 탐색기 페이지 및 경고 조건 API 용어집 에 설명됨)API Explorer Alerts External Service Conditions > POST > Create
curl -X POST 'https://api.newrelic.com/v2/alerts_external_service_conditions/policies/$POLICY_ID.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json' \ -d \ '{ "external_service_condition": { "type": "string", "name": "string", "enabled": boolean, "entities": [ integer ], "external_service_url": "string", "metric": "string", "runbook_url": "string", "terms": [ { "duration": "string", "operator": "string", "priority": "string", "threshold": "string", "time_function": "string" } ] } }'
JSON 응답은 조건을 업데이트하거나 삭제해야 하는
id
조건을 반환합니다. API Explorer > Alerts External Service Conditions > GET > List 에서id
조건을 볼 수도 있습니다.
외부 서비스에 대한 조건을 APM 또는 모바일 모니터링 앱이 있는 정책으로 업데이트하려면 API 호출에 다음 값을 포함합니다.
외부 서비스 조건의
id
( API Explorer > Alerts External Service Conditions > GET > List 에서 사용 가능)API 호출의 필수
external_service_condition
값(API 탐색기 페이지 및 경고 조건 API 용어집 에 설명됨)API Explorer > Alerts External Service Conditions > PUT > Update
curl -X PUT 'https://api.newrelic.com/v2/alerts_external_service_conditions/$CONDITION_ID.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json' \ -d \ '{ "external_service_condition": { "type": "string", "name": "string", "enabled": boolean, "entities": [ integer ], "external_service_url": "string", "metric": "string", "runbook_url": "string", "terms": [ { "duration": "string", "operator": "string", "priority": "string", "threshold": "string", "time_function": "string" } ] } }'
APM 또는 모바일 모니터링 앱이 있는 정책에서 외부 서비스에 대한 조건을 삭제하려면 API 호출에 다음 값을 포함합니다.
condition_id
( API Explorer > Alerts External Service Conditions > GET > List 에서 사용 가능)API Explorer > Alerts External Service Conditions > DELETE > Delete
curl -X DELETE 'https://api.newrelic.com/v2/alerts_external_service_conditions/$CONDITION_ID.json' \ -H 'X-Api-Key:$API_KEY' -i
외부 서비스 앱(APM 또는 모바일 모니터링)이 있는 정책에 대한 기존 조건 목록을 보려면 API 호출에서 사용자 키 또는 REST API 키 및 연결된 policy_id
를 사용하세요.
API Explorer > Alerts External Service Conditions > GET > List
curl -X GET 'https://api.newrelic.com/v2/alerts_external_service_conditions.json' \
-H 'X-Api-Key:$API_KEY' -i \
-d 'policy_id=$POLICY_ID'
종합 모니터링 조건
이러한 API 기능에는 경고 정책에 대한 조건 을 생성, 업데이트, 삭제 또는 나열할 수 있는 API 탐색기에 대한 링크가 포함됩니다. API 호출은 합성 모니터링과 함께 사용할 수 있습니다.
합성 모니터링을 위한 정책에 조건을 추가하려면 API 호출에 다음 값을 포함합니다.
policy_id
( API Explorer > Alerts Policies > GET > List 에서 사용 가능)API 호출의 필수
synthetics_condition
값(API 탐색기 페이지 및 경고 조건 API 용어집 에 설명됨)API Explorer > Alerts Synthetics Conditions > POST > Create
curl -X POST 'https://api.newrelic.com/v2/alerts_synthetics_conditions/policies/$POLICY_ID.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json' \ -d \ '{ "synthetics_condition": { "name": "string", "monitor_id": "string", "runbook_url": "string", "enabled": boolean } }'
JSON 응답은 조건을 업데이트하거나 삭제해야 하는
id
조건을 반환합니다. API Explorer > Alerts Synthetics Conditions > GET > List 에서id
조건을 볼 수도 있습니다.
종합 모니터링에 대한 정책 조건을 업데이트하려면 API 호출에 다음 값을 포함합니다.
조건
id
( API Explorer > Alerts Synthetics Conditions > GET > List 에서 사용 가능)API 호출에 필요한
synthetics_condition
값( 합성에 대한 경고 조건을 생성 하기 위한 API 탐색기 페이지 및 경고 조건 API 용어집 에 설명됨)API Explorer > Alerts Synthetics Conditions > PUT > Update
curl -X PUT 'https://api.newrelic.com/v2/alerts_synthetics_conditions/$CONDITION_ID.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json' \ -d \ '{ "synthetics_condition": { "name": "string", "monitor_id": "string", "runbook_url": "string", "enabled": boolean } }'
종합 모니터링에 대한 정책 조건을 삭제하려면 API 호출에 다음 값을 포함합니다.
condition_id
( API Explorer > Alerts Synthetics Conditions > GET > List 에서 사용 가능)API Explorer > Alerts Synthetics Conditions > DELETE > Delete
curl -X DELETE 'https://api.newrelic.com/v2/alerts_synthetics_conditions/$CONDITION_ID.json' \ -H 'X-Api-Key:$API_KEY' -i
종합 모니터링을 위한 기존 정책 조건 목록을 보려면 API 호출에서 사용자 키 또는 REST API 키 및 연결된 policy_id
를 사용하세요.
API Explorer > Alerts Synthetics Conditions > GET > List
curl -X GET 'https://api.newrelic.com/v2/alerts_synthetics_conditions.json' \
-H 'X-Api-Key:$API_KEY' -i \
-d 'policy_id=$POLICY_ID'
종합 모니터링을 위한 다중 위치 조건
이러한 API 기능에는 경고 정책에 대한 조건 을 생성, 업데이트, 삭제 또는 나열할 수 있는 API 탐색기에 대한 링크가 포함됩니다. API 호출은 합성 모니터링을 통해 다중 위치 조건에 사용할 수 있습니다. 조건을 생성하거나 업데이트하기 전에 다중 위치 경고 조건에 대한 규칙을 읽으십시오.
다중 위치 종합 모니터링을 위한 정책에 조건을 추가하려면 API 호출에 다음 값을 포함하십시오.
policy_id
( API Explorer > Alerts Policies > GET > List 에서 사용 가능)API 호출의 필수
location_failure_condition
값(API 탐색기 페이지 및 경고 조건 API 용어집 에 설명됨)API Explorer > Alerts Location Failure Conditions > POST > Create
curl -X POST 'https://api.newrelic.com/v2/alerts_location_failure_conditions/policies/$POLICY_ID.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json' \ -d \ '{ "location_failure_condition": { "name": "string", "runbook_url": "string", "enabled": boolean, "entities": [ "string" ], "terms": [ { "priority": "string", "threshold": integer, } ], "violation_time_limit_seconds": integer } }'
JSON 응답은 조건을 업데이트하거나 삭제해야 하는
id
조건을 반환합니다. API Explorer > Alerts Location Failure Conditions > GET > List 에서id
조건을 볼 수도 있습니다.
다중 위치 종합 모니터링에 대한 정책 조건을 업데이트하려면 API 호출에 다음 값을 포함하십시오.
id
조건( API Explorer > Alerts Location Failure Conditions > GET > List 에서 사용 가능)API 호출의 필수
location_failure_condition
값(API 탐색기 페이지 및 경고 조건 API 용어집 에 설명됨)API Explorer > Alerts Location Failure Conditions > PUT > Update
curl -X PUT 'https://api.newrelic.com/v2/alerts_location_failure_conditions/$CONDITION_ID.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json' \ -d \ '{ "location_failure_condition": { "name": "string", "runbook_url": "string", "enabled": boolean, "entities": [ "string" ], "terms": [ { "priority": "string", "threshold": integer, } ], "violation_time_limit_seconds": integer } }'
다중 위치 종합 모니터링에 대한 정책 조건을 삭제하려면 API 호출에 다음 값을 포함하십시오.
condition_id
( API Explorer > Alerts Location Failure Conditions > GET > List 에서 사용 가능)API Explorer > Alerts Location Failure Conditions > DELETE > Delete
curl -X DELETE 'https://api.newrelic.com/v2/alerts_location_failure_conditions/$CONDITION_ID.json' \ -H 'X-Api-Key:$API_KEY' -i
다중 위치 종합 모니터링에 대한 기존 정책 조건 목록을 보려면 API 호출에서 사용자 키 또는 REST API 키 및 연결된 policy_id
를 사용합니다.
API Explorer > Alerts Location Failure Conditions > GET > List
curl -X GET 'https://api.newrelic.com/v2/alerts_location_failure_conditions/policies/$POLICY_ID.json' \
-H 'X-Api-Key:$API_KEY' -i
경보 활동: 이벤트, 위반, 사건
이러한 API 기능에는 경고 정책에 대한 이벤트, 위반 및 인시던트에 대한 정보를 볼 수 있는 API 탐색기에 대한 링크가 포함됩니다.
중요
계정이 EU 데이터 센터의 데이터를 호스팅하는 경우 EU 지역 계정에 적절한 API 엔드포인트를 사용하고 있는지 확인하십시오.
APM, 브라우저, 모바일, 종합 모니터링 및 경고에서 모니터링하는 엔터티 에 대한 이벤트 를 보려면 API 호출에 다음 값을 포함합니다.
사용자 키 또는 REST API 키
제품 유형(브라우저 모니터링, 모바일 모니터링 등), 엔터티(APM용 앱 또는 주요 트랜잭션, 종합 모니터링 등)에 따라 필터( API 탐색기 페이지 에 설명됨)로 사용할 기타 선택적 값, 및 이벤트 유형(알림, 배포, 계측 등)
선택적 페이지 매김 값
API Explorer > Alerts Events > GET > List
curl -X GET 'https://api.newrelic.com/v2/alerts_events.json' \ -H 'X-Api-Key:$API_KEY' -i
계정에 대해 모니터링되는 엔티티 에 대한 위반 을 보려면 API 호출에 다음 값을 포함하십시오.
사용자 키 또는 REST API 키
현재 열려 있는 위반 사항만 표시하는 선택적 플래그
선택적 페이지 매김 값
API Explorer > Alerts Violations > GET > List
curl -X GET 'https://api.newrelic.com/v2/alerts_violations.json' \ -H 'X-Api-Key:$API_KEY' -i
팁
정책, 조건 및 사고 정보를 찾으려면
violations
속성의links
섹션에서 찾은 ID를 가져와 페이로드의 외부links
속성에 포함된 URL에 배치합니다.
계정에 대해 모니터링되는 엔터티 에 대한 인시던트 를 보려면 API 호출에 다음 값을 포함합니다.
사용자 키 또는 REST API 키
현재 열려 있는 사건만 표시하는 선택적 플래그
응답에서 위반 데이터를 제외하는 선택적 플래그
선택적 페이지 매김 값
API Explorer > Alerts Incidents > GET > List
curl -X GET 'https://api.newrelic.com/v2/alerts_incidents.json' \ -H 'X-Api-Key:$API_KEY' -i
계정과 연결된 단일 인시던트 를 표시하려면 API 호출에 다음 값을 포함합니다.
사용자 키 또는 REST API 키
사건 ID
API Explorer > Alerts Incidents > GET > Show
curl -X GET 'https://api.newrelic.com/v2/alerts_incidents/{id}.json' \ -H 'X-Api-Key:$API_KEY' -i
계정과 관련된 사건 을 확인하려면 API 호출에 다음 값을 포함하십시오.
사건 ID
API Explorer > Alerts Incidents > PUT > Acknowledge
curl -X PUT 'https://api.newrelic.com/v2/alerts_incidents/{id}/acknowledge.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json'
계정과 연결된 인시던트 를 종료하려면 API 호출에 다음 값을 포함합니다.
사건 ID
API Explorer > Alerts Incidents > PUT > Close
curl -X PUT 'https://api.newrelic.com/v2/alerts_incidents/{id}/close.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json'
경보 엔티티 조건
이러한 API 기능에는 경고 정책에 대한 조건에서 엔터티를 나열, 추가 및 제거할 수 있는 API 탐색기에 대한 링크가 포함됩니다.
중요
계정이 EU 데이터 센터의 데이터를 호스팅하는 경우 EU 지역 계정에 적절한 API 엔드포인트를 사용하고 있는지 확인하십시오.
APM, 브라우저, 모바일 또는 키 트랜잭션의 엔터티 에 적용되는 조건 을 보려면 API 호출에 다음 값을 포함합니다.
사용자 키 또는 REST API 키
entity_id
모니터링할 특정 엔터티(경고 대상) 입니다.entity_type
, 다음 중 하나여야 합니다.- 애플리케이션
- 브라우저응용 프로그램
- 모바일 애플리케이션
- 키 트랜잭션
API Explorer > Alerts Entity Conditions > GET > list
curl -X GET 'https://api.newrelic.com/v2/alerts_entity_conditions/$ENTITY_ID.json' \ -H 'X-Api-Key:$API_KEY' -i \ -G -d 'entity_type=$ENTITY_TYPE'
항목 을 조건에 추가하려면 API 호출에 다음 값을 포함합니다.
entity_id
모니터링할 엔티티(경고 대상) 입니다. APM 애플리케이션, 브라우저 앱, 키 트랜잭션 또는 모바일 앱의 숫자 ID입니다.condition_id
( API Explorer > Alerts Conditions > GET > List 에서 사용 가능)entity_type
, 다음 중 하나여야 합니다.- 애플리케이션
- 브라우저응용 프로그램
- 모바일 애플리케이션
- 키 트랜잭션
API Explorer > Alerts Entity Conditions > PUT > Add
curl -X PUT 'https://api.newrelic.com/v2/alerts_entity_conditions/$ENTITY_ID.json' \ -H 'X-Api-Key:$API_KEY' -i \ -H 'Content-Type: application/json' \ -G -d 'entity_type=$ENTITY_TYPE&condition_id=$CONDITION_ID'
조건에서 모니터링 중인 엔터티 를 제거하려면 API 호출에 다음 값을 포함합니다.
entity_id
제거할 특정 모니터링 항목(경고 대상) 입니다. APM 애플리케이션, 브라우저 앱, 키 트랜잭션 또는 모바일 앱의 숫자 ID입니다.condition_id
( API Explorer > Alerts Conditions > GET > List 에서 사용 가능)entity_type
, 다음 중 하나여야 합니다.- 애플리케이션
- 브라우저응용 프로그램
- 모바일 애플리케이션
- 키 트랜잭션
API Explorer > Alerts Entity Conditions > DELETE > Remove
curl -X DELETE 'https://api.newrelic.com/v2/alerts_entity_conditions/$ENTITY_ID.json' \ -H 'X-Api-Key:$API_KEY' -i \ -G -d 'entity_type=$ENTITY_ID&condition_id=$CONDITION_ID'