GET /v1/searchIndexes/{id}/versions
import json
from metadata.sdk import configure
from metadata.sdk.entities import SearchIndexes
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# List all versions
versions = SearchIndexes.get_versions("f5b0fa81-f241-4508-9219-dae31dcced18")
for v in versions:
version = json.loads(v)
print(f"Version {version['version']}: {version.get('description')}")
# Get a specific version
si_v1 = SearchIndexes.get_specific_version(
"f5b0fa81-f241-4508-9219-dae31dcced18",
"0.1"
)
print(f"Original description: {getattr(si_v1.description, 'root', si_v1.description)}")
import org.openmetadata.schema.entity.data.SearchIndex;
import org.openmetadata.schema.type.EntityHistory;
// client is an initialized OpenMetadataClient.
// List all versions
EntityHistory history = client.searchIndexes().getVersionList("f5b0fa81-f241-4508-9219-dae31dcced18");
for (Object version : history.getVersions()) {
System.out.println("Version: " + version);
}
// Get a specific version
SearchIndex v1 = client.searchIndexes().getVersion("f5b0fa81-f241-4508-9219-dae31dcced18", 0.1);
System.out.println("Description: " + v1.getDescription());
# List all versions
curl "{base_url}/api/v1/searchIndexes/f5b0fa81-f241-4508-9219-dae31dcced18/versions" \
-H "Authorization: Bearer {access_token}"
# Get a specific version
curl "{base_url}/api/v1/searchIndexes/f5b0fa81-f241-4508-9219-dae31dcced18/versions/0.1" \
-H "Authorization: Bearer {access_token}"
{
"entityType": "searchIndex",
"versions": [
"{\"id\":\"f5b0fa81-f241-4508-9219-dae31dcced18\",\"name\":\"table_search_index\",\"fullyQualifiedName\":\"elasticsearch_sample.table_search_index\",\"version\":0.2,\"description\":\"Updated search index for table entities\",\"serviceType\":\"ElasticSearch\"}",
"{\"id\":\"f5b0fa81-f241-4508-9219-dae31dcced18\",\"name\":\"table_search_index\",\"fullyQualifiedName\":\"elasticsearch_sample.table_search_index\",\"version\":0.1,\"description\":\"Search index for table entities\",\"serviceType\":\"ElasticSearch\"}"
]
}
Search Index Versions
List and retrieve historical versions of a search index
GET
/
v1
/
searchIndexes
/
{id}
/
versions
GET /v1/searchIndexes/{id}/versions
import json
from metadata.sdk import configure
from metadata.sdk.entities import SearchIndexes
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# List all versions
versions = SearchIndexes.get_versions("f5b0fa81-f241-4508-9219-dae31dcced18")
for v in versions:
version = json.loads(v)
print(f"Version {version['version']}: {version.get('description')}")
# Get a specific version
si_v1 = SearchIndexes.get_specific_version(
"f5b0fa81-f241-4508-9219-dae31dcced18",
"0.1"
)
print(f"Original description: {getattr(si_v1.description, 'root', si_v1.description)}")
import org.openmetadata.schema.entity.data.SearchIndex;
import org.openmetadata.schema.type.EntityHistory;
// client is an initialized OpenMetadataClient.
// List all versions
EntityHistory history = client.searchIndexes().getVersionList("f5b0fa81-f241-4508-9219-dae31dcced18");
for (Object version : history.getVersions()) {
System.out.println("Version: " + version);
}
// Get a specific version
SearchIndex v1 = client.searchIndexes().getVersion("f5b0fa81-f241-4508-9219-dae31dcced18", 0.1);
System.out.println("Description: " + v1.getDescription());
# List all versions
curl "{base_url}/api/v1/searchIndexes/f5b0fa81-f241-4508-9219-dae31dcced18/versions" \
-H "Authorization: Bearer {access_token}"
# Get a specific version
curl "{base_url}/api/v1/searchIndexes/f5b0fa81-f241-4508-9219-dae31dcced18/versions/0.1" \
-H "Authorization: Bearer {access_token}"
{
"entityType": "searchIndex",
"versions": [
"{\"id\":\"f5b0fa81-f241-4508-9219-dae31dcced18\",\"name\":\"table_search_index\",\"fullyQualifiedName\":\"elasticsearch_sample.table_search_index\",\"version\":0.2,\"description\":\"Updated search index for table entities\",\"serviceType\":\"ElasticSearch\"}",
"{\"id\":\"f5b0fa81-f241-4508-9219-dae31dcced18\",\"name\":\"table_search_index\",\"fullyQualifiedName\":\"elasticsearch_sample.table_search_index\",\"version\":0.1,\"description\":\"Search index for table entities\",\"serviceType\":\"ElasticSearch\"}"
]
}
Search Index Versions
Every change to a search index entity creates a new version. Use these endpoints to view the version history and retrieve specific versions.List Versions
string
required
UUID of the search index.
Get Specific Version
UseGET /v1/searchIndexes/{id}/versions/{version} to retrieve a specific version.
string
required
UUID of the search index.
string
required
Version number to retrieve, for example
0.2.GET /v1/searchIndexes/{id}/versions
import json
from metadata.sdk import configure
from metadata.sdk.entities import SearchIndexes
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# List all versions
versions = SearchIndexes.get_versions("f5b0fa81-f241-4508-9219-dae31dcced18")
for v in versions:
version = json.loads(v)
print(f"Version {version['version']}: {version.get('description')}")
# Get a specific version
si_v1 = SearchIndexes.get_specific_version(
"f5b0fa81-f241-4508-9219-dae31dcced18",
"0.1"
)
print(f"Original description: {getattr(si_v1.description, 'root', si_v1.description)}")
import org.openmetadata.schema.entity.data.SearchIndex;
import org.openmetadata.schema.type.EntityHistory;
// client is an initialized OpenMetadataClient.
// List all versions
EntityHistory history = client.searchIndexes().getVersionList("f5b0fa81-f241-4508-9219-dae31dcced18");
for (Object version : history.getVersions()) {
System.out.println("Version: " + version);
}
// Get a specific version
SearchIndex v1 = client.searchIndexes().getVersion("f5b0fa81-f241-4508-9219-dae31dcced18", 0.1);
System.out.println("Description: " + v1.getDescription());
# List all versions
curl "{base_url}/api/v1/searchIndexes/f5b0fa81-f241-4508-9219-dae31dcced18/versions" \
-H "Authorization: Bearer {access_token}"
# Get a specific version
curl "{base_url}/api/v1/searchIndexes/f5b0fa81-f241-4508-9219-dae31dcced18/versions/0.1" \
-H "Authorization: Bearer {access_token}"
{
"entityType": "searchIndex",
"versions": [
"{\"id\":\"f5b0fa81-f241-4508-9219-dae31dcced18\",\"name\":\"table_search_index\",\"fullyQualifiedName\":\"elasticsearch_sample.table_search_index\",\"version\":0.2,\"description\":\"Updated search index for table entities\",\"serviceType\":\"ElasticSearch\"}",
"{\"id\":\"f5b0fa81-f241-4508-9219-dae31dcced18\",\"name\":\"table_search_index\",\"fullyQualifiedName\":\"elasticsearch_sample.table_search_index\",\"version\":0.1,\"description\":\"Search index for table entities\",\"serviceType\":\"ElasticSearch\"}"
]
}
Returns
List versions returns an object withentityType and a versions array of serialized entity snapshots (newest first).
Get specific version returns the full search index object as it existed at that version.
Error Handling
| Code | Error Type | Description |
|---|---|---|
401 | UNAUTHORIZED | Invalid or missing authentication token |
404 | NOT_FOUND | Search index or version does not exist |
Was this page helpful?