mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-25 17:04:54 +00:00
Fix #315: Allow Editing of fields in Messaging service
This commit is contained in:
parent
31a4e7a2cb
commit
f31b0fe1c7
@ -34,6 +34,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
|
||||
import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound;
|
||||
@ -71,12 +72,14 @@ public abstract class MessagingServiceRepository {
|
||||
return messagingService;
|
||||
}
|
||||
|
||||
public MessagingService update(String id, String description, Schedule ingestionSchedule)
|
||||
public MessagingService update(String id, String description, List<String> brokers, URI schemaRegistry,
|
||||
Schedule ingestionSchedule)
|
||||
throws IOException {
|
||||
validateIngestionSchedule(ingestionSchedule);
|
||||
MessagingService dbService = EntityUtil.validate(id, messagingServiceDOA().findById(id), MessagingService.class);
|
||||
// Update fields
|
||||
dbService.withDescription(description).withIngestionSchedule(ingestionSchedule);
|
||||
dbService.withDescription(description).withIngestionSchedule(ingestionSchedule)
|
||||
.withSchemaRegistry(schemaRegistry).withBrokers(brokers);
|
||||
messagingServiceDOA().update(id, JsonUtils.pojoToJson(dbService));
|
||||
return dbService;
|
||||
}
|
||||
|
@ -177,7 +177,8 @@ public class MessagingServiceResource {
|
||||
@Valid UpdateMessagingService update) throws IOException {
|
||||
SecurityUtil.checkAdminOrBotRole(authorizer, securityContext);
|
||||
MessagingService service = addHref(uriInfo,
|
||||
dao.update(id, update.getDescription(), update.getIngestionSchedule()));
|
||||
dao.update(id, update.getDescription(), update.getBrokers(), update.getSchemaRegistry(),
|
||||
update.getIngestionSchedule()));
|
||||
return Response.ok(service).build();
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,14 @@
|
||||
"description": "Description of Messaging service entity.",
|
||||
"type": "string"
|
||||
},
|
||||
"brokers": {
|
||||
"$ref" : "../../entity/services/messagingService.json#/definitions/brokers"
|
||||
},
|
||||
"schemaRegistry" : {
|
||||
"description": "Schema registry URL.",
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"ingestionSchedule" : {
|
||||
"description": "Schedule for running metadata ingestion jobs",
|
||||
"$ref" : "../../type/schedule.json"
|
||||
|
@ -199,6 +199,7 @@ public class MessagingServiceResourceTest extends CatalogApplicationTest {
|
||||
// Update description and ingestion schedule again
|
||||
update.withDescription("description1").withIngestionSchedule(schedule.withRepeatFrequency("PT1H"));
|
||||
updateAndCheckService(id, update, OK, adminAuthHeaders());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user