I am trying to export connectors from few of my spaces using saved objects api
the request body looks like
body ={
"type": "connector",
"includeReferencesDeep": True
}
but when i do the request it says
"statusCode":400,"error":"Bad Request","message":"Trying to export non-exportable type(s): connector"
so the type of connector is not supported for now or am i missing something?
the full code looks something like
import requests
import json
from requests.auth import HTTPBasicAuth
import ndjson
kibana_url = 'https://{correct url}/kibana'
headers = {
'kbn-xsrf': 'true'
}
body ={
"type": "connector",
"includeReferencesDeep": True
}
# Get a list of all spaces in Kibana
spaces_url = f'{kibana_url}/api/spaces/space'
response = requests.get(spaces_url, headers=headers, verify=True,auth=HTTPBasicAuth(CORRECT VALUES))
spaces = response.json()
# print(spaces)
for space in spaces:
space_id = space['id']
space_name = space['name']
print("for space id: " + space_id)
saved_object_url = f'{kibana_url}/s/{space_id}/api/saved_objects/_export'
res = requests.post(saved_object_url, headers = headers,json=body ,verify=True,auth=HTTPBasicAuth(CORRECT VALUES))
connector = res.text
print(connector)