Enhance: Add PATCH endpoint to update storage service by FQN in StorageServiceResource (#20598)

This commit is contained in:
Ayush Shah 2025-04-03 15:56:44 +05:30 committed by GitHub
parent cf110edf31
commit ee6164e2f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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(