diff --git a/ingestion/examples/sample_data/api_service/service.json b/ingestion/examples/sample_data/api_service/service.json index ded28abd509..22cda4eba76 100644 --- a/ingestion/examples/sample_data/api_service/service.json +++ b/ingestion/examples/sample_data/api_service/service.json @@ -1,9 +1,9 @@ { - "type": "REST", + "type": "rest", "serviceName": "sample_api_service", "serviceConnection": { "config": { - "type": "REST", + "type": "Rest", "openAPISchemaURL": "https://petstore3.swagger.io/", "token":"mock_token" } diff --git a/ingestion/examples/sample_data/ometa_api_service/service.json b/ingestion/examples/sample_data/ometa_api_service/service.json index 6e3c672e960..9552e9d04ea 100644 --- a/ingestion/examples/sample_data/ometa_api_service/service.json +++ b/ingestion/examples/sample_data/ometa_api_service/service.json @@ -1,9 +1,9 @@ { - "type": "REST", + "type": "rest", "serviceName": "ometa_api_service", "serviceConnection": { "config": { - "type": "REST", + "type": "Rest", "openAPISchemaURL": "https://docs.open-metadata.org/swagger.html", "token":"token" } diff --git a/ingestion/src/metadata/examples/workflows/rest.yaml b/ingestion/src/metadata/examples/workflows/rest.yaml index d155eaea5db..3469a02ba58 100644 --- a/ingestion/src/metadata/examples/workflows/rest.yaml +++ b/ingestion/src/metadata/examples/workflows/rest.yaml @@ -3,9 +3,9 @@ source: serviceName: openapi_rest serviceConnection: config: - type: REST + type: Rest openAPISchemaURL: https://docs.open-metadata.org/swagger.json - token: + # token: sourceConfig: config: type: ApiMetadata diff --git a/ingestion/src/metadata/ingestion/api/parser.py b/ingestion/src/metadata/ingestion/api/parser.py index 84aa898844c..08db6f2bf22 100644 --- a/ingestion/src/metadata/ingestion/api/parser.py +++ b/ingestion/src/metadata/ingestion/api/parser.py @@ -19,8 +19,8 @@ from metadata.generated.schema.entity.automations.workflow import ( Workflow as AutomationWorkflow, ) from metadata.generated.schema.entity.services.apiService import ( - ApiServiceConnection, - APIServiceType, + ApiConnection, + ApiServiceType, ) from metadata.generated.schema.entity.services.dashboardService import ( DashboardConnection, @@ -135,7 +135,7 @@ HAS_INNER_CONNECTION = {"Airflow"} # Build a service type map dynamically from JSON Schema covered types SERVICE_TYPE_MAP = { "Backend": PipelineConnection, # For Airflow backend - **{service: ApiServiceConnection for service in APIServiceType.__members__}, + **{service: ApiConnection for service in ApiServiceType.__members__}, **{service: DatabaseConnection for service in DatabaseServiceType.__members__}, **{service: DashboardConnection for service in DashboardServiceType.__members__}, **{service: MessagingConnection for service in MessagingServiceType.__members__}, @@ -183,7 +183,7 @@ class InvalidWorkflowException(Exception): def get_service_type( source_type: str, ) -> Union[ - Type[ApiServiceConnection], + Type[ApiConnection], Type[DashboardConnection], Type[DatabaseConnection], Type[MessagingConnection], @@ -233,7 +233,7 @@ def get_source_config_class( def get_connection_class( source_type: str, service_type: Union[ - Type[ApiServiceConnection], + Type[ApiConnection], Type[DashboardConnection], Type[DatabaseConnection], Type[MessagingConnection], @@ -557,6 +557,7 @@ def parse_automation_workflow_gracefully( message="Error parsing the service connection", ) + # raise ParsingConfigurationError( "Uncaught error when parsing the Ingestion Pipeline!" ) diff --git a/ingestion/src/metadata/ingestion/source/api/api_service.py b/ingestion/src/metadata/ingestion/source/api/api_service.py index 38bddd26082..b5f10c99c25 100644 --- a/ingestion/src/metadata/ingestion/source/api/api_service.py +++ b/ingestion/src/metadata/ingestion/source/api/api_service.py @@ -26,8 +26,8 @@ from metadata.generated.schema.api.data.createAPIEndpoint import ( from metadata.generated.schema.entity.data.apiCollection import APICollection from metadata.generated.schema.entity.data.apiEndpoint import APIEndpoint from metadata.generated.schema.entity.services.apiService import ( + ApiConnection, ApiService, - ApiServiceConnection, ) from metadata.generated.schema.metadataIngestion.apiServiceMetadataPipeline import ( ApiServiceMetadataPipeline, @@ -112,7 +112,7 @@ class ApiServiceSource(TopologyRunnerMixin, Source, ABC): source_config: ApiServiceMetadataPipeline config: WorkflowSource # Big union of types we want to fetch dynamically - service_connection: ApiServiceConnection.model_fields["config"].annotation + service_connection: ApiConnection.model_fields["config"].annotation topology = ApiServiceTopology() context = TopologyContextManager(topology) diff --git a/ingestion/src/metadata/ingestion/source/api/rest/connection.py b/ingestion/src/metadata/ingestion/source/api/rest/connection.py index 055ecbb0c0a..e48c28fc514 100644 --- a/ingestion/src/metadata/ingestion/source/api/rest/connection.py +++ b/ingestion/src/metadata/ingestion/source/api/rest/connection.py @@ -20,8 +20,8 @@ from requests.models import Response from metadata.generated.schema.entity.automations.workflow import ( Workflow as AutomationWorkflow, ) -from metadata.generated.schema.entity.services.connections.apiService.restConnection import ( - RESTConnection, +from metadata.generated.schema.entity.services.connections.api.restConnection import ( + RestConnection, ) from metadata.ingestion.connections.test_connections import test_connection_steps from metadata.ingestion.ometa.ometa_api import OpenMetadata @@ -39,7 +39,7 @@ class InvalidOpenAPISchemaError(Exception): """ -def get_connection(connection: RESTConnection) -> Response: +def get_connection(connection: RestConnection) -> Response: """ Create connection """ @@ -52,7 +52,7 @@ def get_connection(connection: RESTConnection) -> Response: def test_connection( metadata: OpenMetadata, client: Response, - service_connection: RESTConnection, + service_connection: RestConnection, automation_workflow: Optional[AutomationWorkflow] = None, ) -> None: """ diff --git a/ingestion/src/metadata/ingestion/source/api/rest/metadata.py b/ingestion/src/metadata/ingestion/source/api/rest/metadata.py index bd2776258fa..925c0f1e943 100644 --- a/ingestion/src/metadata/ingestion/source/api/rest/metadata.py +++ b/ingestion/src/metadata/ingestion/source/api/rest/metadata.py @@ -23,8 +23,8 @@ from metadata.generated.schema.api.data.createAPIEndpoint import ( ) from metadata.generated.schema.entity.data.apiCollection import APICollection from metadata.generated.schema.entity.data.apiEndpoint import ApiRequestMethod -from metadata.generated.schema.entity.services.connections.apiService.restConnection import ( - RESTConnection, +from metadata.generated.schema.entity.services.connections.api.restConnection import ( + RestConnection, ) from metadata.generated.schema.entity.services.ingestionPipelines.status import ( StackTraceError, @@ -62,10 +62,10 @@ class RestSource(ApiServiceSource): cls, config_dict, metadata: OpenMetadata, pipeline_name: Optional[str] = None ): config: WorkflowSource = WorkflowSource.model_validate(config_dict) - connection: RESTConnection = config.serviceConnection.root.config - if not isinstance(connection, RESTConnection): + connection: RestConnection = config.serviceConnection.root.config + if not isinstance(connection, RestConnection): raise InvalidSourceException( - f"Expected RESTConnection, but got {connection}" + f"Expected RestConnection, but got {connection}" ) return cls(config, metadata) diff --git a/ingestion/src/metadata/utils/class_helper.py b/ingestion/src/metadata/utils/class_helper.py index 281afb854db..ce2da245403 100644 --- a/ingestion/src/metadata/utils/class_helper.py +++ b/ingestion/src/metadata/utils/class_helper.py @@ -68,7 +68,7 @@ from metadata.generated.schema.metadataIngestion.testSuitePipeline import ( from metadata.generated.schema.metadataIngestion.workflow import SourceConfig SERVICE_TYPE_REF = { - ServiceType.API.value: "apiService", + ServiceType.Api.value: "apiService", ServiceType.Database.value: "databaseService", ServiceType.Dashboard.value: "dashboardService", ServiceType.Pipeline.value: "pipelineService", diff --git a/ingestion/tests/unit/test_workflow_parse.py b/ingestion/tests/unit/test_workflow_parse.py index 14d9463ed70..f14d4c20045 100644 --- a/ingestion/tests/unit/test_workflow_parse.py +++ b/ingestion/tests/unit/test_workflow_parse.py @@ -19,6 +19,9 @@ from pydantic import ValidationError from metadata.generated.schema.entity.automations.workflow import ( Workflow as AutomationWorkflow, ) +from metadata.generated.schema.entity.services.connections.api.restConnection import ( + RestConnection, +) from metadata.generated.schema.entity.services.connections.dashboard.tableauConnection import ( TableauConnection, ) @@ -115,6 +118,10 @@ class TestWorkflowParse(TestCase): connection = get_connection_class(source_type, get_service_type(source_type)) self.assertEqual(connection, KafkaConnection) + source_type = "Rest" + connection = get_connection_class(source_type, get_service_type(source_type)) + self.assertEqual(connection, RestConnection) + def test_get_source_config_class(self): """ Check that we can correctly build the connection module ingredients diff --git a/ingestion/tests/unit/topology/api/test_rest.py b/ingestion/tests/unit/topology/api/test_rest.py index 8e6d8e69f17..995b1de3a3a 100644 --- a/ingestion/tests/unit/topology/api/test_rest.py +++ b/ingestion/tests/unit/topology/api/test_rest.py @@ -21,9 +21,9 @@ from metadata.generated.schema.api.data.createAPICollection import ( CreateAPICollectionRequest, ) from metadata.generated.schema.entity.services.apiService import ( + ApiConnection, ApiService, - ApiServiceConnection, - APIServiceType, + ApiServiceType, ) from metadata.generated.schema.metadataIngestion.workflow import ( OpenMetadataWorkflowConfig, @@ -43,7 +43,7 @@ mock_rest_config = { "serviceName": "openapi_rest", "serviceConnection": { "config": { - "type": "REST", + "type": "Rest", "openAPISchemaURL": "https://petstore3.swagger.io/api/v3/openapi.json", } }, @@ -91,8 +91,8 @@ MOCK_API_SERVICE = ApiService( id="c3eb265f-5445-4ad3-ba5e-797d3a3071bb", name="openapi_rest", fullyQualifiedName=FullyQualifiedEntityName("openapi_rest"), - connection=ApiServiceConnection(), - serviceType=APIServiceType.REST, + connection=ApiConnection(), + serviceType=ApiServiceType.Rest, ) EXPECTED_COLLECTION_REQUEST = [ Either( diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/APICollectionRepository.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/APICollectionRepository.java index 538c5b8c114..8c6551c0988 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/APICollectionRepository.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/APICollectionRepository.java @@ -18,7 +18,7 @@ import lombok.extern.slf4j.Slf4j; import org.jdbi.v3.sqlobject.transaction.Transaction; import org.openmetadata.schema.EntityInterface; import org.openmetadata.schema.entity.data.APICollection; -import org.openmetadata.schema.entity.services.APIService; +import org.openmetadata.schema.entity.services.ApiService; import org.openmetadata.schema.type.EntityReference; import org.openmetadata.schema.type.Include; import org.openmetadata.schema.type.Relationship; @@ -108,7 +108,7 @@ public class APICollectionRepository extends EntityRepository { } private void populateService(APICollection apiCollection) { - APIService service = Entity.getEntity(apiCollection.getService(), "", Include.NON_DELETED); + ApiService service = Entity.getEntity(apiCollection.getService(), "", Include.NON_DELETED); apiCollection.setService(service.getEntityReference()); apiCollection.setServiceType(service.getServiceType()); } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/APIServiceRepository.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/APIServiceRepository.java index aab2ec3560b..5d6f9f61993 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/APIServiceRepository.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/APIServiceRepository.java @@ -1,19 +1,18 @@ package org.openmetadata.service.jdbi3; -import org.openmetadata.schema.entity.services.APIService; +import org.openmetadata.schema.entity.services.ApiService; import org.openmetadata.schema.entity.services.ServiceType; -import org.openmetadata.schema.type.APIServiceConnection; +import org.openmetadata.schema.type.ApiConnection; import org.openmetadata.service.Entity; import org.openmetadata.service.resources.services.apiservices.APIServiceResource; -public class APIServiceRepository - extends ServiceEntityRepository { +public class APIServiceRepository extends ServiceEntityRepository { public APIServiceRepository() { super( APIServiceResource.COLLECTION_PATH, Entity.API_SERVICE, Entity.getCollectionDAO().apiServiceDAO(), - APIServiceConnection.class, + ApiConnection.class, "", ServiceType.API); supportsSearch = true; diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java index 2e9336fb3a3..3b80f18245d 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java @@ -98,7 +98,7 @@ import org.openmetadata.schema.entity.domains.DataProduct; import org.openmetadata.schema.entity.domains.Domain; import org.openmetadata.schema.entity.events.EventSubscription; import org.openmetadata.schema.entity.policies.Policy; -import org.openmetadata.schema.entity.services.APIService; +import org.openmetadata.schema.entity.services.ApiService; import org.openmetadata.schema.entity.services.DashboardService; import org.openmetadata.schema.entity.services.DatabaseService; import org.openmetadata.schema.entity.services.MessagingService; @@ -288,7 +288,7 @@ public interface CollectionDAO { SearchServiceDAO searchServiceDAO(); @CreateSqlObject - APIServiceDAO apiServiceDAO(); + ApiServiceDAO apiServiceDAO(); @CreateSqlObject ContainerDAO containerDAO(); @@ -636,15 +636,15 @@ public interface CollectionDAO { } } - interface APIServiceDAO extends EntityDAO { + interface ApiServiceDAO extends EntityDAO { @Override default String getTableName() { return "api_service_entity"; } @Override - default Class getEntityClass() { - return APIService.class; + default Class getEntityClass() { + return ApiService.class; } @Override diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/services/apiservices/APIServiceResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/services/apiservices/APIServiceResource.java index 60335068a94..1a23c9b1c9a 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/services/apiservices/APIServiceResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/services/apiservices/APIServiceResource.java @@ -47,11 +47,11 @@ import javax.ws.rs.core.SecurityContext; import javax.ws.rs.core.UriInfo; import lombok.extern.slf4j.Slf4j; import org.openmetadata.schema.api.data.RestoreEntity; -import org.openmetadata.schema.api.services.CreateAPIService; -import org.openmetadata.schema.entity.services.APIService; +import org.openmetadata.schema.api.services.CreateApiService; +import org.openmetadata.schema.entity.services.ApiService; import org.openmetadata.schema.entity.services.ServiceType; import org.openmetadata.schema.entity.services.connections.TestConnectionResult; -import org.openmetadata.schema.type.APIServiceConnection; +import org.openmetadata.schema.type.ApiConnection; import org.openmetadata.schema.type.EntityHistory; import org.openmetadata.schema.type.Include; import org.openmetadata.schema.type.MetadataOperation; @@ -75,12 +75,12 @@ import org.openmetadata.service.util.ResultList; @Consumes(MediaType.APPLICATION_JSON) @Collection(name = "apiServices") public class APIServiceResource - extends ServiceEntityResource { + extends ServiceEntityResource { public static final String COLLECTION_PATH = "v1/services/apiServices/"; static final String FIELDS = "pipelines,owners,tags,domain"; @Override - public APIService addHref(UriInfo uriInfo, APIService service) { + public ApiService addHref(UriInfo uriInfo, ApiService service) { super.addHref(uriInfo, service); Entity.withHref(uriInfo, service.getPipelines()); return service; @@ -96,7 +96,7 @@ public class APIServiceResource return null; } - public static class APIServiceList extends ResultList { + public static class APIServiceList extends ResultList { /* Required for serde */ } @@ -118,7 +118,7 @@ public class APIServiceResource org.openmetadata.service.resources.services.apiservices .APIServiceResource.APIServiceList.class))) }) - public ResultList list( + public ResultList list( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @Parameter( @@ -165,12 +165,12 @@ public class APIServiceResource content = @Content( mediaType = "application/json", - schema = @Schema(implementation = APIService.class))), + schema = @Schema(implementation = ApiService.class))), @ApiResponse( responseCode = "404", description = "API service for instance {id} is not found") }) - public APIService get( + public ApiService get( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @PathParam("id") UUID id, @@ -185,7 +185,7 @@ public class APIServiceResource @QueryParam("include") @DefaultValue("non-deleted") Include include) { - APIService apiService = getInternal(uriInfo, securityContext, id, fieldsParam, include); + ApiService apiService = getInternal(uriInfo, securityContext, id, fieldsParam, include); return decryptOrNullify(securityContext, apiService); } @@ -202,12 +202,12 @@ public class APIServiceResource content = @Content( mediaType = "application/json", - schema = @Schema(implementation = APIService.class))), + schema = @Schema(implementation = ApiService.class))), @ApiResponse( responseCode = "404", description = "API service for instance {id} is not found") }) - public APIService getByName( + public ApiService getByName( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @PathParam("name") String name, @@ -222,7 +222,7 @@ public class APIServiceResource @QueryParam("include") @DefaultValue("non-deleted") Include include) { - APIService apiService = + ApiService apiService = getByNameInternal( uriInfo, securityContext, EntityInterfaceUtil.quoteName(name), fieldsParam, include); return decryptOrNullify(securityContext, apiService); @@ -241,9 +241,9 @@ public class APIServiceResource content = @Content( mediaType = "application/json", - schema = @Schema(implementation = APIService.class))) + schema = @Schema(implementation = ApiService.class))) }) - public APIService addTestConnectionResult( + public ApiService addTestConnectionResult( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @Parameter(description = "Id of the service", schema = @Schema(type = "UUID")) @@ -252,7 +252,7 @@ public class APIServiceResource @Valid TestConnectionResult testConnectionResult) { OperationContext operationContext = new OperationContext(entityType, MetadataOperation.CREATE); authorizer.authorize(securityContext, operationContext, getResourceContextById(id)); - APIService service = repository.addTestConnectionResult(id, testConnectionResult); + ApiService service = repository.addTestConnectionResult(id, testConnectionResult); return decryptOrNullify(securityContext, service); } @@ -283,7 +283,7 @@ public class APIServiceResource .map( json -> { try { - APIService apiService = JsonUtils.readValue((String) json, APIService.class); + ApiService apiService = JsonUtils.readValue((String) json, ApiService.class); return JsonUtils.pojoToJson(decryptOrNullify(securityContext, apiService)); } catch (Exception e) { return json; @@ -307,12 +307,12 @@ public class APIServiceResource content = @Content( mediaType = "application/json", - schema = @Schema(implementation = APIService.class))), + schema = @Schema(implementation = ApiService.class))), @ApiResponse( responseCode = "404", description = "API service for instance {id} and version {version} is not found") }) - public APIService getVersion( + public ApiService getVersion( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @Parameter(description = "API service Id", schema = @Schema(type = "string")) @PathParam("id") @@ -322,13 +322,13 @@ public class APIServiceResource schema = @Schema(type = "string", example = "0.1 or 1.1")) @PathParam("version") String version) { - APIService apiService = super.getVersionInternal(securityContext, id, version); + ApiService apiService = super.getVersionInternal(securityContext, id, version); return decryptOrNullify(securityContext, apiService); } @POST @Operation( - operationId = "createAPIService", + operationId = "createApiService", summary = "Create API service", description = "Create a new API service.", responses = { @@ -338,16 +338,16 @@ public class APIServiceResource content = @Content( mediaType = "application/json", - schema = @Schema(implementation = APIService.class))), + schema = @Schema(implementation = ApiService.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response create( @Context UriInfo uriInfo, @Context SecurityContext securityContext, - @Valid CreateAPIService create) { - APIService service = getService(create, securityContext.getUserPrincipal().getName()); + @Valid CreateApiService create) { + ApiService service = getService(create, securityContext.getUserPrincipal().getName()); Response response = create(uriInfo, securityContext, service); - decryptOrNullify(securityContext, (APIService) response.getEntity()); + decryptOrNullify(securityContext, (ApiService) response.getEntity()); return response; } @@ -363,16 +363,16 @@ public class APIServiceResource content = @Content( mediaType = "application/json", - schema = @Schema(implementation = APIService.class))), + schema = @Schema(implementation = ApiService.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response createOrUpdate( @Context UriInfo uriInfo, @Context SecurityContext securityContext, - @Valid CreateAPIService update) { - APIService service = getService(update, securityContext.getUserPrincipal().getName()); + @Valid CreateApiService update) { + ApiService service = getService(update, securityContext.getUserPrincipal().getName()); Response response = createOrUpdate(uriInfo, securityContext, unmask(service)); - decryptOrNullify(securityContext, (APIService) response.getEntity()); + decryptOrNullify(securityContext, (ApiService) response.getEntity()); return response; } @@ -504,7 +504,7 @@ public class APIServiceResource content = @Content( mediaType = "application/json", - schema = @Schema(implementation = APIService.class))) + schema = @Schema(implementation = ApiService.class))) }) public Response restoreAPIService( @Context UriInfo uriInfo, @@ -513,20 +513,20 @@ public class APIServiceResource return restoreEntity(uriInfo, securityContext, restore.getId()); } - private APIService getService(CreateAPIService create, String user) { + private ApiService getService(CreateApiService create, String user) { return repository - .copy(new APIService(), create, user) + .copy(new ApiService(), create, user) .withServiceType(create.getServiceType()) .withConnection(create.getConnection()); } @Override - protected APIService nullifyConnection(APIService service) { + protected ApiService nullifyConnection(ApiService service) { return service.withConnection(null); } @Override - protected String extractServiceType(APIService service) { + protected String extractServiceType(ApiService service) { return service.getServiceType().value(); } } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchIndexFactory.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchIndexFactory.java index 6cc25604d5f..36cea84741c 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchIndexFactory.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchIndexFactory.java @@ -23,15 +23,8 @@ import org.openmetadata.schema.entity.data.Table; import org.openmetadata.schema.entity.data.Topic; import org.openmetadata.schema.entity.domains.DataProduct; import org.openmetadata.schema.entity.domains.Domain; -import org.openmetadata.schema.entity.services.APIService; -import org.openmetadata.schema.entity.services.DashboardService; -import org.openmetadata.schema.entity.services.DatabaseService; -import org.openmetadata.schema.entity.services.MessagingService; -import org.openmetadata.schema.entity.services.MetadataService; -import org.openmetadata.schema.entity.services.MlModelService; -import org.openmetadata.schema.entity.services.PipelineService; -import org.openmetadata.schema.entity.services.SearchService; -import org.openmetadata.schema.entity.services.StorageService; +import org.openmetadata.schema.entity.services.*; +import org.openmetadata.schema.entity.services.ApiService; import org.openmetadata.schema.entity.services.ingestionPipelines.IngestionPipeline; import org.openmetadata.schema.entity.teams.Team; import org.openmetadata.schema.entity.teams.User; @@ -118,7 +111,7 @@ public class SearchIndexFactory { case Entity.MESSAGING_SERVICE -> new MessagingServiceIndex((MessagingService) entity); case Entity.MLMODEL_SERVICE -> new MlModelServiceIndex((MlModelService) entity); case Entity.SEARCH_SERVICE -> new SearchServiceIndex((SearchService) entity); - case Entity.API_SERVICE -> new APIServiceIndex((APIService) entity); + case Entity.API_SERVICE -> new APIServiceIndex((ApiService) entity); case Entity.SEARCH_INDEX -> new SearchEntityIndex( (org.openmetadata.schema.entity.data.SearchIndex) entity); case Entity.PIPELINE_SERVICE -> new PipelineServiceIndex((PipelineService) entity); diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/APIServiceIndex.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/APIServiceIndex.java index 10bb01461bd..5795f272193 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/APIServiceIndex.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/APIServiceIndex.java @@ -3,11 +3,11 @@ package org.openmetadata.service.search.indexes; import java.util.ArrayList; import java.util.List; import java.util.Map; -import org.openmetadata.schema.entity.services.APIService; import org.openmetadata.service.Entity; import org.openmetadata.service.search.models.SearchSuggest; -public record APIServiceIndex(APIService apiService) implements SearchIndex { +public record APIServiceIndex(org.openmetadata.schema.entity.services.ApiService apiService) + implements SearchIndex { @Override public List getSuggest() { diff --git a/openmetadata-service/src/main/resources/json/data/testConnections/api/rest.json b/openmetadata-service/src/main/resources/json/data/testConnections/api/rest.json index a2ab1060f47..2a10215658c 100644 --- a/openmetadata-service/src/main/resources/json/data/testConnections/api/rest.json +++ b/openmetadata-service/src/main/resources/json/data/testConnections/api/rest.json @@ -1,5 +1,5 @@ { - "name": "REST", + "name": "Rest", "displayName": "REST Test Connection", "description": "This Test Connection validates the schema provided for openapi", "steps": [ diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/services/APIServiceResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/services/APIServiceResourceTest.java index a1efa41da3a..d135883f454 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/services/APIServiceResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/services/APIServiceResourceTest.java @@ -22,23 +22,23 @@ import org.apache.http.client.HttpResponseException; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; import org.openmetadata.common.utils.CommonUtil; -import org.openmetadata.schema.api.services.CreateAPIService; -import org.openmetadata.schema.entity.services.APIService; +import org.openmetadata.schema.api.services.CreateApiService; +import org.openmetadata.schema.entity.services.ApiService; import org.openmetadata.schema.entity.services.connections.TestConnectionResult; import org.openmetadata.schema.entity.services.connections.TestConnectionResultStatus; -import org.openmetadata.schema.services.connections.api.RESTConnection; -import org.openmetadata.schema.type.APIServiceConnection; +import org.openmetadata.schema.services.connections.api.RestConnection; +import org.openmetadata.schema.type.ApiConnection; import org.openmetadata.schema.type.ChangeDescription; import org.openmetadata.service.Entity; import org.openmetadata.service.resources.services.apiservices.APIServiceResource; import org.openmetadata.service.util.JsonUtils; import org.openmetadata.service.util.TestUtils; -public class APIServiceResourceTest extends ServiceResourceTest { +public class APIServiceResourceTest extends ServiceResourceTest { public APIServiceResourceTest() { super( Entity.API_SERVICE, - APIService.class, + ApiService.class, APIServiceResource.APIServiceList.class, "services/apiServices", "owners"); @@ -47,25 +47,25 @@ public class APIServiceResourceTest extends ServiceResourceTest authHeaders) throws HttpResponseException { WebTarget target = getResource(serviceId).path("/testConnectionResult"); - return TestUtils.put(target, testConnectionResult, APIService.class, OK, authHeaders); + return TestUtils.put(target, testConnectionResult, ApiService.class, OK, authHeaders); } @Override - public CreateAPIService createRequest(String name) { - return new CreateAPIService() + public CreateApiService createRequest(String name) { + return new CreateApiService() .withName(name) - .withServiceType(CreateAPIService.APIServiceType.REST) + .withServiceType(CreateApiService.ApiServiceType.Rest) .withConnection( - new APIServiceConnection() + new ApiConnection() .withConfig( - new RESTConnection() + new RestConnection() .withOpenAPISchemaURL( CommonUtil.getUri("http://localhost:8585/swagger.json")))); } @Override public void validateCreatedEntity( - APIService service, CreateAPIService createRequest, Map authHeaders) { + ApiService service, CreateApiService createRequest, Map authHeaders) { assertEquals(createRequest.getName(), service.getName()); - APIServiceConnection expectedConnection = createRequest.getConnection(); - APIServiceConnection actualConnection = service.getConnection(); + ApiConnection expectedConnection = createRequest.getConnection(); + ApiConnection actualConnection = service.getConnection(); validateConnection(expectedConnection, actualConnection, service.getServiceType()); } @Override public void compareEntities( - APIService expected, APIService updated, Map authHeaders) { + ApiService expected, ApiService updated, Map authHeaders) { // PATCH operation is not supported by this entity } @Override - public APIService validateGetWithDifferentFields(APIService service, boolean byName) + public ApiService validateGetWithDifferentFields(ApiService service, boolean byName) throws HttpResponseException { String fields = ""; service = @@ -209,13 +209,13 @@ public class APIServiceResourceTest extends ServiceResourceTest { await settingClick(page, GlobalSettingOptions.APIS); await page.getByTestId('add-service-button').click(); - await page.getByTestId('REST').click(); + await page.getByTestId('Rest').click(); await page.getByTestId('next-button').click(); // step 1 diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/ServiceIngestion.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/ServiceIngestion.spec.ts index 2bfecbae4ec..70f21743c5e 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/ServiceIngestion.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/ServiceIngestion.spec.ts @@ -16,6 +16,7 @@ import { PLAYWRIGHT_INGESTION_TAG_OBJ } from '../../constant/config'; import { MYSQL, POSTGRES, REDSHIFT } from '../../constant/service'; import { GlobalSettingOptions } from '../../constant/settings'; import AirflowIngestionClass from '../../support/entity/ingestion/AirflowIngestionClass'; +import ApiIngestionClass from '../../support/entity/ingestion/ApiIngestionClass'; import BigQueryIngestionClass from '../../support/entity/ingestion/BigQueryIngestionClass'; import KafkaIngestionClass from '../../support/entity/ingestion/KafkaIngestionClass'; import MetabaseIngestionClass from '../../support/entity/ingestion/MetabaseIngestionClass'; @@ -30,6 +31,7 @@ import { INVALID_NAMES, redirectToHomePage } from '../../utils/common'; import { settingClick, SettingOptionsType } from '../../utils/sidebar'; const services = [ + ApiIngestionClass, S3IngestionClass, MetabaseIngestionClass, MysqlIngestionClass, diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ApiCollectionClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ApiCollectionClass.ts index 4390a90d24e..bdbd9799c7e 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ApiCollectionClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ApiCollectionClass.ts @@ -24,10 +24,10 @@ export class ApiCollectionClass extends EntityClass { private apiCollectionName = `pw-api-collection-${uuid()}`; service = { name: this.serviceName, - serviceType: 'REST', + serviceType: 'Rest', connection: { config: { - type: 'REST', + type: 'Rest', openAPISchemaURL: 'https://sandbox-beta.open-metadata.org/swagger.json', }, }, diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ApiEndpointClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ApiEndpointClass.ts index 20cb8027132..722667be45f 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ApiEndpointClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ApiEndpointClass.ts @@ -23,10 +23,10 @@ export class ApiEndpointClass extends EntityClass { private apiCollectionName = `pw-api-collection-${uuid()}`; service = { name: this.serviceName, - serviceType: 'REST', + serviceType: 'Rest', connection: { config: { - type: 'REST', + type: 'Rest', openAPISchemaURL: 'https://sandbox-beta.open-metadata.org/swagger.json', }, }, diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ApiIngestionClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ApiIngestionClass.ts new file mode 100644 index 00000000000..36565e388f1 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ApiIngestionClass.ts @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Page } from '@playwright/test'; +import { uuid } from '../../../utils/common'; +import { + checkServiceFieldSectionHighlighting, + Services, +} from '../../../utils/serviceIngestion'; +import ServiceBaseClass from './ServiceBaseClass'; + +class ApiIngestionClass extends ServiceBaseClass { + constructor() { + super(Services.API, `pw-api-with-%-${uuid()}`, 'Rest', 'Containers'); + } + + async createService(page: Page) { + await super.createService(page); + } + + async updateService(page: Page) { + await super.updateService(page); + } + + async fillConnectionDetails(page: Page) { + const openAPISchemaURL = 'https://docs.open-metadata.org/swagger.json'; + + await page.locator('#root\\/openAPISchemaURL').fill(openAPISchemaURL); + await checkServiceFieldSectionHighlighting(page, 'openAPISchemaURL'); + } + + async deleteService(page: Page): Promise { + await super.deleteService(page); + } +} + +export default ApiIngestionClass; diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/service/ApiServiceClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/service/ApiServiceClass.ts index 39ded95079e..aa57a1db0cd 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/service/ApiServiceClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/service/ApiServiceClass.ts @@ -21,10 +21,10 @@ import { EntityClass } from '../EntityClass'; export class ApiServiceClass extends EntityClass { entity = { name: `pw-api-service-${uuid()}`, - serviceType: 'REST', + serviceType: 'Rest', connection: { config: { - type: 'REST', + type: 'Rest', openAPISchemaURL: 'https://sandbox-beta.open-metadata.org/swagger.json', }, }, diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/serviceIngestion.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/serviceIngestion.ts index 211222a7d8a..7d9b1390b24 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/serviceIngestion.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/serviceIngestion.ts @@ -24,6 +24,7 @@ export enum Services { MLModels = GlobalSettingOptions.MLMODELS, Storage = GlobalSettingOptions.STORAGES, Search = GlobalSettingOptions.SEARCH, + API = GlobalSettingOptions.APIS, } export const getEntityTypeFromService = (service: Services) => { @@ -42,6 +43,8 @@ export const getEntityTypeFromService = (service: Services) => { return EntityTypeEndpoint.MlModelService; case Services.Pipeline: return EntityTypeEndpoint.PipelineService; + case Services.API: + return EntityTypeEndpoint.ApiService; default: return EntityTypeEndpoint.DatabaseService; } @@ -63,6 +66,8 @@ export const getServiceCategoryFromService = (service: Services) => { return 'mlmodelService'; case Services.Pipeline: return 'pipelineService'; + case Services.API: + return 'apiService'; default: return 'databaseService'; } diff --git a/openmetadata-ui/src/main/resources/ui/public/locales/en-US/API/REST.md b/openmetadata-ui/src/main/resources/ui/public/locales/en-US/ApiEntity/Rest.md similarity index 100% rename from openmetadata-ui/src/main/resources/ui/public/locales/en-US/API/REST.md rename to openmetadata-ui/src/main/resources/ui/public/locales/en-US/ApiEntity/Rest.md diff --git a/openmetadata-ui/src/main/resources/ui/public/locales/en-US/ApiEntity/workflows/metadata.md b/openmetadata-ui/src/main/resources/ui/public/locales/en-US/ApiEntity/workflows/metadata.md new file mode 100644 index 00000000000..9487e44b27e --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/public/locales/en-US/ApiEntity/workflows/metadata.md @@ -0,0 +1,44 @@ +# Metadata + +API Service Metadata Pipeline Configuration. + +$$section +### API Collection Filter Pattern $(id="apiCollectionFilterPattern") + +API Collection filter patterns to control whether to include API Collections as part of metadata ingestion. + +**Include**: Explicitly include API Collections by adding a list of regular expressions to the `Include` field. OpenMetadata will include all API Collections with names matching one or more of the supplied regular expressions. All other API Collections will be excluded. + +For example, to include only those API Collections whose name starts with the word `demo`, add the regex pattern in the include field as `^demo.*`. + +**Exclude**: Explicitly exclude API Collections by adding a list of regular expressions to the `Exclude` field. OpenMetadata will exclude all API Collections with names matching one or more of the supplied regular expressions. All other API Collections will be included. + +For example, to exclude all API Collections with the name containing the word `demo`, add the regex pattern in the exclude field as `.*demo.*`. + +Checkout [this](https://docs.open-metadata.org/connectors/ingestion/workflows/metadata/filter-patterns/database#database-filter-pattern) document for further examples on filter patterns. +$$ + +$$section +### Enable Debug Logs $(id="enableDebugLog") + +Set the `Enable Debug Log` toggle to set the logging level of the process to debug. You can check these logs in the Ingestion tab of the service and dig deeper into any errors you might find. +$$ + +$$section +### Mark Deleted API Collection $(id="markDeletedApiCollections") + +Optional configuration to soft delete `API Collections` in OpenMetadata if the source `API Collections` are deleted. After deleting, all the associated entities like lineage, etc., with that `API Collection` will be deleted. +$$ + +$$section +### Override Metadata $(id="overrideMetadata") + +Set the `Override Metadata` toggle to control whether to override the existing metadata in the OpenMetadata server with the metadata fetched from the source. + +If the toggle is `enabled`, the metadata fetched from the source will override and replace the existing metadata in the OpenMetadata. + +If the toggle is `disabled`, the metadata fetched from the source will not override the existing metadata in the OpenMetadata server. In this case the metadata will only get updated for fields that has no value added in OpenMetadata. + +This is applicable for fields like description, tags, owner and displayName + +$$ \ No newline at end of file diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/AddService/AddService.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/AddService/AddService.component.tsx index e444533a427..d6e5eb6b2ec 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/AddService/AddService.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/AddService/AddService.component.tsx @@ -243,13 +243,10 @@ const AddService = ({ {activeServiceStep > 3 && ( handleAddIngestion(true)} handleViewServiceClick={handleViewServiceClick} name={serviceConfig.serviceName} - // API Service does not support ingestion workflows - showIngestionButton={ - serviceCategory !== ServiceCategory.API_SERVICES - } state={FormSubmitType.ADD} suffix={getServiceCreatedLabel(serviceCategory)} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/ServiceDocPanel/ServiceDocPanel.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/ServiceDocPanel/ServiceDocPanel.tsx index 42f5f07ae40..a33a4502f42 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/ServiceDocPanel/ServiceDocPanel.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/ServiceDocPanel/ServiceDocPanel.tsx @@ -83,14 +83,16 @@ const ServiceDocPanel: FC = ({ const fetchRequirement = async () => { setIsLoading(true); try { + const supportedServiceType = + serviceType === 'Api' ? 'ApiEntity' : serviceType; let response = ''; const isEnglishLanguage = i18n.language === SupportedLocales.English; - let filePath = `${i18n.language}/${serviceType}/${serviceName}.md`; - let fallbackFilePath = `${SupportedLocales.English}/${serviceType}/${serviceName}.md`; + let filePath = `${i18n.language}/${supportedServiceType}/${serviceName}.md`; + let fallbackFilePath = `${SupportedLocales.English}/${supportedServiceType}/${serviceName}.md`; if (isWorkflow && workflowType) { - filePath = `${i18n.language}/${serviceType}/workflows/${workflowType}.md`; - fallbackFilePath = `${SupportedLocales.English}/${serviceType}/workflows/${workflowType}.md`; + filePath = `${i18n.language}/${supportedServiceType}/workflows/${workflowType}.md`; + fallbackFilePath = `${SupportedLocales.English}/${supportedServiceType}/workflows/${workflowType}.md`; } const [translation, fallbackTranslation] = await Promise.allSettled([ diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/Services.constant.ts b/openmetadata-ui/src/main/resources/ui/src/constants/Services.constant.ts index c4742fb2fff..6c435278f48 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/Services.constant.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/Services.constant.ts @@ -417,7 +417,6 @@ export const BETA_SERVICES = [ PipelineServiceType.OpenLineage, PipelineServiceType.Flink, DatabaseServiceType.Teradata, - APIServiceType.REST, StorageServiceType.Gcs, DatabaseServiceType.SapERP, PipelineServiceType.Flink, diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx index d1c90a7be1a..f2c4d3bedf5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx @@ -1021,22 +1021,21 @@ const ServiceDetailsPage: FunctionComponent = () => { }); } - if (serviceCategory !== ServiceCategory.API_SERVICES) { - tabs.push({ + tabs.push( + { name: t('label.ingestion-plural'), key: EntityTabs.INGESTIONS, isHidden: !showIngestionTab, count: ingestionPaging.total, children: ingestionTab, - }); - } - - tabs.push({ - name: t('label.connection'), - isHidden: !servicePermission.EditAll, - key: EntityTabs.CONNECTION, - children: testConnectionTab, - }); + }, + { + name: t('label.connection'), + isHidden: !servicePermission.EditAll, + key: EntityTabs.CONNECTION, + children: testConnectionTab, + } + ); return tabs .filter((tab) => !tab.isHidden) diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ServicesPage/ServicesPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ServicesPage/ServicesPage.tsx index 6eaf765c4cc..7b123a14f93 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ServicesPage/ServicesPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ServicesPage/ServicesPage.tsx @@ -105,8 +105,7 @@ const ServicesPage = () => { label: 'Services', }, ]), - // pipelines are not supported for apiServices so don't show pipelines tab for apiServices - ...(isAdminUser && serviceName !== 'apiServices' + ...(isAdminUser ? [ { key: 'pipelines', diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/APIServiceUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/APIServiceUtils.ts index fe256ab5300..9e6a2b6b206 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/APIServiceUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/APIServiceUtils.ts @@ -13,14 +13,14 @@ import { cloneDeep } from 'lodash'; import { COMMON_UI_SCHEMA } from '../constants/Services.constant'; import { APIServiceType } from '../generated/entity/services/apiService'; -import RESTConnection from '../jsons/connectionSchemas/connections/apiService/restConnection.json'; +import restConnection from '../jsons/connectionSchemas/connections/api/restConnection.json'; export const getAPIConfig = (type: APIServiceType) => { let schema = {}; const uiSchema = { ...COMMON_UI_SCHEMA }; switch (type) { case APIServiceType.REST: - schema = RESTConnection; + schema = restConnection; break; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/GlobalSettingsClassBase.ts b/openmetadata-ui/src/main/resources/ui/src/utils/GlobalSettingsClassBase.ts index 871e287e237..8160f392b0d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/GlobalSettingsClassBase.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/GlobalSettingsClassBase.ts @@ -117,6 +117,16 @@ class GlobalSettingsClassBase { icon: ServiceIcon, description: t('message.service-description'), items: [ + { + label: t('label.api-uppercase-plural'), + description: t('message.page-sub-header-for-apis'), + isProtected: userPermissions.hasViewPermissions( + ResourceEntity.API_SERVICE, + permissions + ), + key: `${GlobalSettingsMenuCategory.SERVICES}.${GlobalSettingOptions.APIS}`, + icon: IconAPI, + }, { label: t('label.database-plural'), description: t('message.page-sub-header-for-databases'), @@ -197,17 +207,6 @@ class GlobalSettingsClassBase { key: `${GlobalSettingsMenuCategory.SERVICES}.${GlobalSettingOptions.METADATA}`, icon: OpenMetadataIcon, }, - { - label: t('label.api-uppercase-plural'), - description: t('message.page-sub-header-for-apis'), - isProtected: userPermissions.hasViewPermissions( - ResourceEntity.API_SERVICE, - permissions - ), - key: `${GlobalSettingsMenuCategory.SERVICES}.${GlobalSettingOptions.APIS}`, - icon: IconAPI, - isBeta: true, - }, { label: t('label.data-observability'), description: t('message.page-sub-header-for-data-observability'), diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/ServiceUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/ServiceUtils.tsx index 8f67293e3db..0dc5e7279e0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/ServiceUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/ServiceUtils.tsx @@ -29,7 +29,6 @@ import { ServiceCategory } from '../enums/service.enum'; import { StorageServiceType } from '../generated/entity/data/container'; import { Database } from '../generated/entity/data/database'; import { MlModelServiceType } from '../generated/entity/data/mlmodel'; -import { APIServiceType } from '../generated/entity/services/apiService'; import { DashboardService, DashboardServiceType, @@ -100,8 +99,7 @@ export const shouldTestConnection = (serviceType: string) => { serviceType !== DashboardServiceType.CustomDashboard && serviceType !== MlModelServiceType.CustomMlModel && serviceType !== PipelineServiceType.CustomPipeline && - serviceType !== StorageServiceType.CustomStorage && - serviceType !== APIServiceType.REST + serviceType !== StorageServiceType.CustomStorage ); }; @@ -348,7 +346,7 @@ export const getServiceRouteFromServiceType = (type: ServiceTypes) => { return GlobalSettingOptions.SEARCH; } - if (type === 'apiServices') { + if (type === ServiceCategory.API_SERVICES) { return GlobalSettingOptions.APIS; } @@ -387,7 +385,6 @@ export const getResourceEntityFromServiceCategory = ( case ServiceCategory.STORAGE_SERVICES: return ResourceEntity.STORAGE_SERVICE; - case 'apiServices': case ServiceCategory.API_SERVICES: return ResourceEntity.API_SERVICE; }