diff --git a/elasticsearchdashboard/client.go b/elasticsearchdashboard/client.go index b604c196d..ffea20b9c 100644 --- a/elasticsearchdashboard/client.go +++ b/elasticsearchdashboard/client.go @@ -30,9 +30,11 @@ import ( ) const ( - SavedObjectsReqBody = `{"type": ["dashboard", "config", "index-pattern", "url", "query", "tag", "canvas-element", "canvas-workpad", "action", "alert", "visualization", + SavedObjectsReqBodyES = `{"type": ["dashboard", "config", "index-pattern", "url", "query", "tag", "canvas-element", "canvas-workpad", "action", "alert", "visualization", "graph-workspace", "map", "lens", "cases", "search", "osquery-saved-query", "osquery-pack", "uptime-dynamic-settings", "infrastructure-ui-source", "metrics-explorer-view", "inventory-view", "apm-indices"]}` + SavedObjectsReqBodyOS = `{"type": ["config", "url", "index-pattern", "query", "dashboard", "visualization", "visualization-visbuilder", "augment-vis", "map", +"observability-panel", "observability-visualization", "search"]}` SavedObjectsExportURL = "/api/saved_objects/_export" SavedObjectsImportURL = "/api/saved_objects/_import" ) diff --git a/elasticsearchdashboard/ed_client_v7.go b/elasticsearchdashboard/ed_client_v7.go index 2029b64e5..91dda15e9 100644 --- a/elasticsearchdashboard/ed_client_v7.go +++ b/elasticsearchdashboard/ed_client_v7.go @@ -114,7 +114,7 @@ func (h *EDClientV7) ExportSavedObjects() (*Response, error) { "Content-Type": "application/json", "kbn-xsrf": "true", }). - SetBody([]byte(SavedObjectsReqBody)) + SetBody([]byte(SavedObjectsReqBodyES)) res, err := req.Post(SavedObjectsExportURL) if err != nil { klog.Error(err, "Failed to send http request") diff --git a/elasticsearchdashboard/ed_client_v8.go b/elasticsearchdashboard/ed_client_v8.go index b4df628d7..f2a47fdd8 100644 --- a/elasticsearchdashboard/ed_client_v8.go +++ b/elasticsearchdashboard/ed_client_v8.go @@ -112,7 +112,7 @@ func (h *EDClientV8) ExportSavedObjects() (*Response, error) { "Content-Type": "application/json", "kbn-xsrf": "true", }). - SetBody([]byte(SavedObjectsReqBody)) + SetBody([]byte(SavedObjectsReqBodyES)) res, err := req.Post(SavedObjectsExportURL) if err != nil { klog.Error(err, "Failed to send http request") diff --git a/elasticsearchdashboard/os_client.go b/elasticsearchdashboard/os_client.go index 68ed8b215..abb78d3d9 100644 --- a/elasticsearchdashboard/os_client.go +++ b/elasticsearchdashboard/os_client.go @@ -114,7 +114,7 @@ func (h *OSClient) ExportSavedObjects() (*Response, error) { "Content-Type": "application/json", "osd-xsrf": "true", }). - SetBody([]byte(SavedObjectsReqBody)) + SetBody([]byte(SavedObjectsReqBodyOS)) res, err := req.Post(SavedObjectsExportURL) if err != nil { klog.Error(err, "Failed to send http request")