From ee6164e2f9b4dad8d15a6f633a8b337296816e8c Mon Sep 17 00:00:00 2001 From: Ayush Shah Date: Thu, 3 Apr 2025 15:56:44 +0530 Subject: [PATCH] Enhance: Add PATCH endpoint to update storage service by FQN in StorageServiceResource (#20598) --- .../storage/StorageServiceResource.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/services/storage/StorageServiceResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/services/storage/StorageServiceResource.java index fbfe83ebe0b..b9bafe4e8cf 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/services/storage/StorageServiceResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/services/storage/StorageServiceResource.java @@ -393,6 +393,37 @@ public class StorageServiceResource return patchInternal(uriInfo, securityContext, id, patch); } + @PATCH + @Path("/name/{fqn}") + @Operation( + operationId = "patchStorageServiceByFQN", + summary = "Update an storage service by FQN", + description = "Update an existing storage service using JsonPatch by FQN.", + externalDocs = + @ExternalDocumentation( + description = "JsonPatch RFC", + url = "https://tools.ietf.org/html/rfc6902")) + @Consumes(MediaType.APPLICATION_JSON_PATCH_JSON) + public Response patch( + @Context UriInfo uriInfo, + @Context SecurityContext securityContext, + @Parameter( + description = "Fully qualified name of the storage service", + schema = @Schema(type = "string")) + @PathParam("fqn") + String fqn, + @RequestBody( + description = "JsonPatch with array of operations", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_PATCH_JSON, + examples = { + @ExampleObject("[{op:remove, path:/a},{op:add, path: /b, value: val}]") + })) + JsonPatch patch) { + return patchInternal(uriInfo, securityContext, fqn, patch); + } + @DELETE @Path("/{id}") @Operation(