Verify Snapshot Repository API (스냅샷 리포지토리 검증 API)
Verify Snapshot Repository API는 스냅샷 리포지토리가 정상적으로 동작하는지 검증하는 API예요. 클러스터의 각 노드에서 리포지토리를 검증합니다.
검증이 성공하면 Verify Snapshot Repository API는 스냅샷 리포지토리에 연결된 노드 목록을 반환해요. 검증이 실패하면 API는 오류를 반환합니다.
Security 플러그인을 사용한다면 manage cluster 권한이 있어야 합니다.
출처: OpenSearch 문서
본문
Endpoints
GET _snapshot/{repository}/
Path parameters
경로 파라미터는 선택 사항입니다.
| Parameter | Data type | Description |
|---|---|---|
repository |
String | Name of repository to verify. |
Query parameters
| Parameter | Data type | Description |
|---|---|---|
cluster_manager_timeout |
Time | Amount of time to wait for a connection to the cluster manager node. Optional, defaults to30s. |
timeout |
Time | The period of time to wait for a response. If a response is not received before the timeout value, the request fails and returns an error. Defaults to30s. |
Example request
다음 요청은 my-opensearch-repo가 정상 동작하는지 검증합니다.
REST Python
POST /_snapshot/my-opensearch-repo/_verify?timeout=0s&cluster_manager_timeout=50s
Copy Copy as cURL
response = client.snapshot.verify_repository(
repository = "my-opensearch-repo",
params = { "timeout": "0s", "cluster_manager_timeout": "50s" }
)
Copy
Example response
아래 예제는 위 Example request 섹션의 요청에 해당하는 응답입니다.
POST /_snapshot/my-opensearch-repo/_verify?timeout=0s&cluster_manager_timeout=50s 요청은 다음 필드들을 반환합니다.
{
"nodes" : {
"by1kztwTRoeCyg4iGU5Y8A" : {
"name" : "opensearch-node1"
}
}
}
위 예제에서는 하나의 노드가 스냅샷 리포지토리에 연결되어 있습니다. 더 많은 노드가 연결되어 있다면 응답에서 그것들을 볼 수 있을 텐데, 예를 들면 다음과 같습니다.
{
"nodes" : {
"lcfL6jv2jo6sMEtp4idMvg" : {
"name" : "node-1"
},
"rEPtFT/B+cuuOHnQn0jy4s" : {
"name" : "node-2"
}
}
Response body fields
| Field | Data type | Description |
|---|---|---|
nodes |
Object | A list (not an array) of nodes connected to the snapshot repository. Each node itself is a property where the node ID is the key and the name has an ID (Object) and a name (String). |
Required permissions
Security 플러그인을 사용한다면 cluster:admin/repository/verify 권한이 있는지 확인하세요.
더 알아보기 (Learn more)
스냅샷 리포지토리에 문제가 있는지 빨리 확인하고 싶을 때 유용한 API예요. 검증 결과 어떤 노드들이 리포지토리에 연결되어 있는지 알 수 있으므로, 백업 인프라가 정상인지 운영 중에 점검하기 좋습니다. 스냅샷 리포지토리 종류와 설정에 대한 내용은 OpenSearch docs의 snapshot repository 문서를 참고해 보세요.