diff --git a/docs/how/updating-datahub.md b/docs/how/updating-datahub.md index d8fe06abad..073f68db23 100644 --- a/docs/how/updating-datahub.md +++ b/docs/how/updating-datahub.md @@ -39,6 +39,7 @@ This file documents any backwards-incompatible changes in DataHub and assists pe - #11742: For PowerBi ingestion, `use_powerbi_email` is now enabled by default when extracting ownership information. - #12056: The DataHub Airflow plugin no longer supports Airflow 2.1 and Airflow 2.2. - #12056: The DataHub Airflow plugin now defaults to the v2 plugin implementation. +- OpenAPI Update: PIT Keep Alive parameter added to scroll. NOTE: This parameter requires the `pointInTimeCreationEnabled` feature flag to be enabled and the `elasticSearch.implementation` configuration to be `elasticsearch`. This feature is not supported for OpenSearch at this time and the parameter will not be respected without both of these set. ### Breaking Changes diff --git a/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/controller/GenericEntitiesController.java b/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/controller/GenericEntitiesController.java index c17a4a6294..425646d428 100644 --- a/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/controller/GenericEntitiesController.java +++ b/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/controller/GenericEntitiesController.java @@ -199,7 +199,9 @@ public abstract class GenericEntitiesController< @RequestParam(value = "skipCache", required = false, defaultValue = "false") Boolean skipCache, @RequestParam(value = "includeSoftDelete", required = false, defaultValue = "false") - Boolean includeSoftDelete) + Boolean includeSoftDelete, + @RequestParam(value = "pitKeepAlive", required = false, defaultValue = "5m") + String pitKeepALive) throws URISyntaxException { EntitySpec entitySpec = entityRegistry.getEntitySpec(entityName); @@ -241,7 +243,7 @@ public abstract class GenericEntitiesController< null, sortCriteria, scrollId, - null, + pitKeepALive, count); if (!AuthUtil.isAPIAuthorizedResult(opContext, result)) { diff --git a/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/v3/OpenAPIV3Generator.java b/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/v3/OpenAPIV3Generator.java index d179ea8f3a..68ed316573 100644 --- a/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/v3/OpenAPIV3Generator.java +++ b/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/v3/OpenAPIV3Generator.java @@ -45,6 +45,7 @@ public class OpenAPIV3Generator { private static final String NAME_VERSION = "version"; private static final String NAME_SCROLL_ID = "scrollId"; private static final String NAME_INCLUDE_SOFT_DELETE = "includeSoftDelete"; + private static final String NAME_PIT_KEEP_ALIVE = "pitKeepAlive"; private static final String PROPERTY_VALUE = "value"; private static final String PROPERTY_URN = "urn"; private static final String PROPERTY_PATCH = "patch"; @@ -502,6 +503,12 @@ public class OpenAPIV3Generator { .name(NAME_SKIP_CACHE) .description("Skip cache when listing entities.") .schema(new Schema().type(TYPE_BOOLEAN)._default(false)), + new Parameter() + .in(NAME_QUERY) + .name(NAME_PIT_KEEP_ALIVE) + .description( + "Point In Time keep alive, accepts a time based string like \"5m\" for five minutes.") + .schema(new Schema().type(TYPE_STRING)._default("5m")), new Parameter().$ref("#/components/parameters/PaginationCount" + MODEL_VERSION), new Parameter().$ref("#/components/parameters/ScrollId" + MODEL_VERSION), new Parameter().$ref("#/components/parameters/SortBy" + MODEL_VERSION), diff --git a/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/v3/controller/EntityController.java b/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/v3/controller/EntityController.java index aa659b196f..5544fb845b 100644 --- a/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/v3/controller/EntityController.java +++ b/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/v3/controller/EntityController.java @@ -146,6 +146,8 @@ public class EntityController Boolean skipCache, @RequestParam(value = "includeSoftDelete", required = false, defaultValue = "false") Boolean includeSoftDelete, + @RequestParam(value = "pitKeepAlive", required = false, defaultValue = "5m") + String pitKeepALive, @RequestBody @Nonnull GenericEntityAspectsBodyV3 entityAspectsBody) throws URISyntaxException { @@ -202,7 +204,7 @@ public class EntityController null, sortCriteria, scrollId, - null, + pitKeepALive, count); if (!AuthUtil.isAPIAuthorizedResult(opContext, result)) {