CAT Aliases API
CAT Aliases API는 별칭(alias)이 어떤 인덱스에 매핑되어 있는지, 그리고 라우팅(routing)과 필터링(filtering) 정보까지 함께 보여주는 작업이에요. 여러 인덱스를 하나의 이름으로 묶어 편하게 다루고 싶을 때, 이 API로 현재 별칭 상태를 한눈에 확인할 수 있어요. 이 기능은 OpenSearch 1.0에서 처음 소개되었어요.
출처: OpenSearch 문서
본문
엔드포인트
GET /_cat/aliases
GET /_cat/aliases/{name}
쿼리 매개변수
다음 표는 사용 가능한 쿼리 매개변수 목록이에요. 모든 쿼리 매개변수는 선택 사항이에요.
| Parameter | Data type | Description | Default | | expand_wildcards | List or String | Specifies the type of index that wildcard expressions can match. Supports comma-separated values. Valid values are: - all: Match any index, including hidden ones. - closed: Match closed, non-hidden indexes. - hidden: Match hidden indexes. Must be combined with open, closed, or both. - none: Wildcard expressions are not accepted. - open: Match open, non-hidden indexes. | N/A | | format | String | A short version of the Accept header, such as json or yaml. | N/A | | h | List | A comma-separated list of column names to display. | N/A | | help | Boolean | Returns help information. | false | | local | Boolean | Whether to return information from the local node only instead of from the cluster manager node. | false | | s | List | A comma-separated list of column names or column aliases to sort by. | N/A | | v | Boolean | Enables verbose mode, which displays column headers. | false |
예제 요청
GET /_cat/aliases?v
response = client.cat.aliases(
params = { "v": "true" }
)
정보를 특정 별칭으로 제한하고 싶다면 쿼리 뒤에 별칭 이름을 붙이면 돼요:
GET /_cat/aliases/?v
response = client.cat.aliases(
name = "",
params = { "v": "true" }
)
여러 별칭의 정보를 한 번에 얻고 싶다면 별칭 이름을 쉼표로 구분하면 돼요:
GET /_cat/aliases/alias1,alias2,alias3
response = client.cat.aliases(
name = "alias1,alias2,alias3"
)
예제 응답
아래 응답은 다양한 유형의 별칭 설정을 보여줘요:
alias | index | filter | routing.index | routing.search | is_write_index
current-logs | app-logs-2024 | - | - | - | -
filtered-data | customer-data | * | - | - | -
regional-orders | orders-2024 | - | west | west | -
multi-route | products | - | 1 | 1,2 | -
이 응답이 보여주는 내용은 다음과 같아요:
- current-logs: 필터나 라우팅이 없는 단순한 별칭
- filtered-data: 필터가 설정된 별칭(*로 표시됨)
- regional-orders: 색인과 검색 모두에 라우팅이 설정된 별칭
- multi-route: 색인(1)과 검색(1,2)에 서로 다른 라우팅을 사용하는 별칭
인덱스 별칭에 대해 더 자세히 알고 싶다면 Index aliases 문서를, 별칭 관리 API에 대해서는 Alias APIs 문서를 참고해 주세요.
필요한 권한
Security 플러그인을 사용한다면 적절한 권한이 있는지 확인해 주세요: indices:admin/aliases/get.
더 알아보기 (Learn more)
이 API를 더 깊이 이해하고 싶다면 원문 OpenSearch 문서를 확인해 주세요.