@Id GetESAliases @Summary Get index alias for compatible ES @security BasicAuth @Tags Index @Produce json @Param target path string false "Target Index" @Param target_alias path string false "Target Alias" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPRespo
(c *gin.Context)
| 115 | // @Failure 400 {object} meta.HTTPResponseError |
| 116 | // @Router /es/{target}/_alias/{target_alias} [get] |
| 117 | func GetESAliases(c *gin.Context) { |
| 118 | targetIndex := c.Param("target") |
| 119 | |
| 120 | var targetIndexes []string |
| 121 | if targetIndex != "" { |
| 122 | targetIndexes = strings.Split(targetIndex, ",") |
| 123 | } |
| 124 | |
| 125 | targetAlias := c.Param("target_alias") |
| 126 | |
| 127 | var targetAliases []string |
| 128 | if targetAlias != "" { |
| 129 | targetAliases = strings.Split(targetAlias, ",") |
| 130 | } |
| 131 | |
| 132 | m := core.ZINC_INDEX_ALIAS_LIST.GetAliasMap(targetIndexes, targetAliases) |
| 133 | |
| 134 | zutils.GinRenderJSON(c, http.StatusOK, m) |
| 135 | } |
| 136 | |
| 137 | func indexNameMatches(name, indexName string) bool { |
| 138 | if name == indexName { |