Documentation
¶
Index ¶
- func AddOrRemoveESAlias(c zhttp.Context)
- func Analyze(c zhttp.Context)
- func AnalyzeIndexForSDK()
- func Create(c zhttp.Context)
- func CreateES(c zhttp.Context)
- func CreateIndexWorker(newIndex *meta.IndexSimple, indexName string) error
- func CreateTemplate(c zhttp.Context)
- func Delete(c zhttp.Context)
- func DeleteILMPolicy(c zhttp.Context)
- func DeleteTemplate(c zhttp.Context)
- func ESExists()
- func Exists(c zhttp.Context)
- func ExplainILM(c zhttp.Context)
- func FieldCaps(c zhttp.Context)
- func Flush(c zhttp.Context)
- func Get(c zhttp.Context)
- func GetESAliases(c zhttp.Context)
- func GetESMapping(c zhttp.Context)
- func GetILMPolicy(c zhttp.Context)
- func GetMapping(c zhttp.Context)
- func GetSettings(c zhttp.Context)
- func GetTemplate(c zhttp.Context)
- func GetTier(c zhttp.Context)
- func IndexNameList(c zhttp.Context)
- func List(c zhttp.Context)
- func ListILMPolicy(c zhttp.Context)
- func ListTemplate(c zhttp.Context)
- func PutILMPolicy(c zhttp.Context)
- func Refresh(c zhttp.Context)
- func Reindex(c zhttp.Context)
- func SetMapping(c zhttp.Context)
- func SetSettings(c zhttp.Context)
- func SetTier(c zhttp.Context)
- func UpdateTemplateForSDK()
- type Action
- type Alias
- type AnalyzeRequest
- type AnalyzeResponse
- type AnalyzeResponseToken
- type FieldCapsRequest
- type ILMPolicyRequest
- type IndexListResponse
- type ReindexDest
- type ReindexRequest
- type ReindexSource
- type TierRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOrRemoveESAlias ¶
@Id AddOrRemoveESAlias @Summary Add or remove index alias for compatible ES @security BasicAuth @Tags Index @Produce json @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponseError @Router /es/_aliases [post]
func Analyze ¶
@Id Analyze @Summary Analyze @security BasicAuth @Tags Index @Accept json @Produce json @Param query body object true "Query" @Success 200 {object} AnalyzeResponse @Failure 400 {object} meta.HTTPResponseError @Router /api/_analyze [post]
func AnalyzeIndexForSDK ¶
func AnalyzeIndexForSDK()
@Id AnalyzeIndex @Summary Analyze @security BasicAuth @Tags Index @Accept json @Produce json @Param index path string true "Index" @Param query body object true "Query" @Success 200 {object} AnalyzeResponse @Failure 400 {object} meta.HTTPResponseError @Router /api/{index}/_analyze [post]
func Create ¶
@Id CreateIndex @Summary Create index @security BasicAuth @Tags Index @Accept json @Produce json @Param data body meta.IndexSimple true "Index data" @Success 200 {object} meta.HTTPResponseIndex @Failure 400 {object} meta.HTTPResponseError @Router /api/index [post]
func CreateES ¶
@Id ESCreateIndex @Summary Create index for compatible ES @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Param data body meta.IndexSimple true "Index data" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponse @Router /es/{index} [put]
func CreateIndexWorker ¶
func CreateIndexWorker(newIndex *meta.IndexSimple, indexName string) error
func CreateTemplate ¶
@Id CreateTemplate @Summary Create update index template @security BasicAuth @Tags Index @Accept json @Produce json @Param template body meta.IndexTemplate true "Template data" @Success 200 {object} meta.HTTPResponseTemplate @Failure 400 {object} meta.HTTPResponseError @Router /es/_index_template [post]
func Delete ¶
Delete deletes a zed index and its associated data. Be careful using thus as you ca't undo this action.
@Id DeleteIndex @Summary Delete index @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} meta.HTTPResponseIndex @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /api/index/{index} [delete]
func DeleteILMPolicy ¶
@Id DeleteILMPolicy @Summary Delete an index lifecycle policy @security BasicAuth @Tags Index @Produce json @Param name path string true "Policy" @Success 200 {object} meta.HTTPResponse @Failure 500 {object} meta.HTTPResponseError @Router /es/_ilm/policy/{name} [delete]
func DeleteTemplate ¶
@Id DeleteTemplate @Summary Delete template @security BasicAuth @Tags Index @Produce json @Param name path string true "Template" @Success 200 {object} meta.HTTPResponse @Failure 400 {object} meta.HTTPResponseError @Router /es/_index_template/{name} [delete]
func ESExists ¶
func ESExists()
@Id EsExists @Summary Checks if the index exists for compatible ES @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} meta.HTTPResponse @Failure 404 {object} meta.HTTPResponse @Router /es/{index} [head]
func Exists ¶
@Id Exists @Summary Checks if the index exists @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} meta.HTTPResponse @Failure 404 {object} meta.HTTPResponse @Router /api/index/{index} [head]
func ExplainILM ¶
@Id ExplainILM @Summary Explain the lifecycle state of an index @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponseError @Router /es/{index}/_ilm/explain [get]
func FieldCaps ¶
FieldCaps returns the capabilities of the fields of the given indexes
@Id FieldCaps @Summary Get field capabilities for compatible ES @security BasicAuth @Tags Index @Accept json @Produce json @Param index path string true "Index" @Param fields query string false "Field patterns, comma separated" @Success 200 {object} elastic.FieldCapsResponse @Failure 400 {object} meta.HTTPResponseError @Router /es/{index}/_field_caps [post]
func Flush ¶ added in v1.3.0
@Id Flush @Summary Flush index @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} meta.HTTPResponse @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /es/{index}/_flush [post]
func Get ¶
@Id GetIndex @Summary Get index metadata @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} core.Index @Failure 404 {object} meta.HTTPResponseError @Router /api/index/{index} [get]
func GetESAliases ¶
@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.HTTPResponseError @Router /es/{target}/_alias/{target_alias} [get]
func GetESMapping ¶
@Id ESGetMapping @Summary Get index mappings for compatible ES @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponse @Router /es/{index}/_mapping [get]
func GetILMPolicy ¶
@Id GetILMPolicy @Summary Get an index lifecycle policy @security BasicAuth @Tags Index @Produce json @Param name path string true "Policy" @Success 200 {object} map[string]interface{} @Failure 404 {object} meta.HTTPResponseError @Router /es/_ilm/policy/{name} [get]
func GetMapping ¶
@Id GetMapping @Summary Get index mappings @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponseError @Router /api/{index}/_mapping [get]
func GetSettings ¶
@Id GetSettings @Summary Get index settings @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponseError @Router /api/{index}/_settings [get]
func GetTemplate ¶
@Id GetTemplate @Summary Get index template @security BasicAuth @Tags Index @Produce json @Param name path string true "Template" @Success 200 {object} meta.IndexTemplate @Failure 400 {object} meta.HTTPResponseError @Router /es/_index_template/{name} [get]
func GetTier ¶
@Id GetIndexTier @Summary Get index data tier @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponseError @Router /api/index/{index}/_tier [get]
func IndexNameList ¶
@Id IndexNameList @Summary List index Name @security BasicAuth @Tags Index @Param name query string false "IndexName" @Produce json @Success 200 {object} []string @Router /api/index_name [get]
func List ¶
@Id ListIndexes @Summary List indexes @security BasicAuth @Tags Index @Param page_num query integer false "page num" @Param page_size query integer false "page size" @Param sort_by query string false "sort by" @Param desc query bool false "desc" @Param name query string false "name" @Produce json @Success 200 {object} IndexListResponse @Router /api/index [get]
func ListILMPolicy ¶
@Id ListILMPolicy @Summary List index lifecycle policies @security BasicAuth @Tags Index @Produce json @Success 200 {object} map[string]interface{} @Failure 500 {object} meta.HTTPResponseError @Router /es/_ilm/policy [get]
func ListTemplate ¶
@Id ListTemplates @Summary List index teplates @security BasicAuth @Tags Index @Produce json @Success 200 {object} []meta.Template @Failure 400 {object} meta.HTTPResponseError @Router /es/_index_template [get]
func PutILMPolicy ¶
@Id PutILMPolicy @Summary Create or update an index lifecycle policy @security BasicAuth @Tags Index @Accept json @Produce json @Param name path string true "Policy" @Param policy body index.ILMPolicyRequest true "Policy" @Success 200 {object} meta.HTTPResponse @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /es/_ilm/policy/{name} [put]
func Refresh ¶
@Id Refresh @Summary Resfresh index @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} meta.HTTPResponse @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /api/index/{index}/refresh [post]
func Reindex ¶
Reindex copies the documents of one index into another one
@Id Reindex @Summary Reindex documents for compatible ES @security BasicAuth @Tags Index @Accept json @Produce json @Param query body ReindexRequest true "Reindex" @Success 200 {object} elastic.ReindexResponse @Failure 400 {object} meta.HTTPResponseError @Router /es/_reindex [post]
func SetMapping ¶
@Id SetMapping @Summary Set index mappings @security BasicAuth @Tags Index @Accept json @Produce json @Param index path string true "Index" @Param mapping body meta.Mappings true "Mapping" @Success 200 {object} meta.HTTPResponse @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /api/{index}/_mapping [put]
func SetSettings ¶
@Id SetSettings @Summary Set index Settings @security BasicAuth @Tags Index @Accept json @Produce json @Param index path string true "Index" @Param settings body meta.IndexSettings true "Settings" @Success 200 {object} meta.HTTPResponse @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /api/{index}/_settings [put]
func SetTier ¶
@Id SetIndexTier @Summary Move index to another data tier @security BasicAuth @Tags Index @Accept json @Produce json @Param index path string true "Index" @Param tier body index.TierRequest true "Tier" @Success 200 {object} meta.HTTPResponse @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /api/index/{index}/_tier [put]
func UpdateTemplateForSDK ¶
func UpdateTemplateForSDK()
@Id UpdateTemplate @Summary Create update index template @security BasicAuth @Tags Index @Accept json @Produce json @Param name path string true "Template" @Param template body meta.IndexTemplate true "Template data" @Success 200 {object} meta.HTTPResponseTemplate @Failure 400 {object} meta.HTTPResponseError @Router /es/_index_template/{name} [put]
Types ¶
type AnalyzeRequest ¶
type AnalyzeRequest struct {
Analyzer string `json:"analyzer"`
Filed string `json:"field"`
Text string `json:"text"`
Tokenizer interface{} `json:"tokenizer"`
CharFilter interface{} `json:"char_filter"`
TokenFilter interface{} `json:"token_filter"`
Filter interface{} `json:"filter"` // compatibility with es, alias for TokenFilter
}
type AnalyzeResponse ¶
type AnalyzeResponse struct {
Tokens []AnalyzeResponseToken `json:"tokens"`
}
type AnalyzeResponseToken ¶
type FieldCapsRequest ¶
type FieldCapsRequest struct {
Fields []string `json:"fields"`
}
FieldCapsRequest is the optional request body of the _field_caps API.
type ILMPolicyRequest ¶
ILMPolicyRequest is the Elasticsearch body of a policy update.
type IndexListResponse ¶
type ReindexDest ¶
type ReindexDest struct {
Index string `json:"index"`
}
type ReindexRequest ¶
type ReindexRequest struct {
Source ReindexSource `json:"source"`
Dest ReindexDest `json:"dest"`
// MaxDocs limits the number of copied documents, 0 means all of them.
MaxDocs int `json:"max_docs"`
}
ReindexRequest is the request body of the _reindex API.
type ReindexSource ¶
type ReindexSource struct {
Index string `json:"index"`
Query interface{} `json:"query"`
}
type TierRequest ¶
type TierRequest struct {
Tier string `json:"tier"`
}
TierRequest is the body of a tier change.