add alias mock api

This commit is contained in:
silenceqi 2021-04-12 21:38:05 +08:00 committed by medcl
parent 8d10429057
commit e6be0c7534
2 changed files with 90 additions and 0 deletions

58
web/mock/search/alias.js Normal file
View File

@ -0,0 +1,58 @@
export default {
'GET /elasticsearch/:id/alias': function (req, res) {
res.send({
".kibana": {
"alias": ".kibana",
"index": [
".kibana_1"
]
},
".kibana-event-log-7.10.0": {
"alias": ".kibana-event-log-7.10.0",
"index": [
".kibana-event-log-7.10.0-000003",
".kibana-event-log-7.10.0-000005",
".kibana-event-log-7.10.0-000004",
".kibana-event-log-7.10.0-000002"
],
"write_index": ".kibana-event-log-7.10.0-000005"
},
".kibana_task_manager": {
"alias": ".kibana_task_manager",
"index": [
".kibana_task_manager_1"
]
},
"custom": {
"alias": "custom",
"index": [
"test-custom"
]
},
"ilm-history-3": {
"alias": "ilm-history-3",
"index": [
"ilm-history-3-000004",
"ilm-history-3-000005",
"ilm-history-3-000003",
"ilm-history-3-000002"
],
"write_index": "ilm-history-3-000005"
},
"metricbeat-7.10.0": {
"alias": "metricbeat-7.10.0",
"index": [
"metricbeat-7.10.0-2021.04.07-000003",
"metricbeat-7.10.0-2021.02.03-000001",
"metricbeat-7.10.0-2021.03.06-000002"
],
"write_index": "metricbeat-7.10.0-2021.04.07-000003"
}
})
},
'POST /elasticsearch/:id/alias': function (req, res) {
res.send({
"acknowledged": true
})
}
}

View File

@ -72,5 +72,37 @@ export default {
"_id": "c1nc0dkagrh0jobkn6s0",
"result": "deleted"
});
},
'GET /elasticsearch/:id/search_template_history/_search': function(req, res){
res.send({
"took": 0,
"timed_out": false,
"hits": {
"total": {
"relation": "eq",
"value": 1
},
"max_score": 0.5753642,
"hits": [
{
"_index": ".infini-search-center_searchtemplatehistory",
"_type": "_doc",
"_id": "c1o5k3kagrh1tfml0qfg",
"_source": {
"action": "update",
"content": {
"cluster_id": "c0octmtath23m973pf4g",
"created": "2021-04-08T16:35:02.746223+08:00",
"name": "test_search_template",
"source": "{\"query\":{\"match\":{\"{{my_field}}\":\"{{my_value}}\"}},\"size\":\"{{my_size}}\"}",
"updated": "2021-04-08T22:03:25.987193+08:00"
},
"created": "2021-04-09T21:43:42.611027+08:00",
"template_id": "c1nc0dkagrh0jobkn6s0"
}
}
]
}
});
}
}