官方網站
https://www.elastic.co/guide/en/kibana/current/api.html
APIs
Saved objects APIs
Create index-pattern
請求
POST api/saved_objects/index-pattern/my-pattern { "attributes": { "title": "my-pattern-*", "timeFieldName":"log_time" } }
響應
{ "id": "my-pattern", "type": "index-pattern", "version": 1, "attributes": { "title": "my-pattern-*" } }
Bulk create saved objects
請求
POST api/saved_objects/_bulk_create [ { "type": "index-pattern", "id": "my-pattern", "attributes": { "title": "my-pattern-*" } }, { "type": "dashboard", "id": "my-dashboard", "attributes": { "title": "Look at my dashboard" } } ]
響應
{ "saved_objects": [ { "id": "my-pattern", "type": "index-pattern", "version": 1, "attributes": { "title": "my-pattern-*" } }, { "id": "my-dashboard", "type": "dashboard", "error": { "statusCode": 409, "message": "version conflict, document already exists" } } ] }
Bulk get objects
請求
POST api/saved_objects/_bulk_get [ { "type": "index-pattern", "id": "my-pattern" }, { "type": "dashboard", "id": "my-dashboard" } ]
響應
{ "saved_objects": [ { "id": "my-pattern", "type": "index-pattern", "version": 1, "attributes": { "title": "my-pattern-*" } }, { "id": "my-dashboard", "type": "dashboard", "error": { "statusCode": 404, "message": "Not found" } } ] }