Skip to content

Commit

Permalink
feat(keel): add diff endpoints (#921)
Browse files Browse the repository at this point in the history
  • Loading branch information
emjburns committed Oct 17, 2019
1 parent 780ad7e commit 0e29589
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ List<Map<String, Object>> getResourceEvents(
@POST("/resources")
Resource upsertResource(@Body Resource resource);

@POST("/resources/diff")
Map diffResource(@Body Resource resource);

@DELETE("/resources/{name}")
Resource deleteResource(@Path("name") String name);

Expand All @@ -53,6 +56,9 @@ List<Map<String, Object>> getResourceEvents(
@POST("/delivery-configs")
DeliveryConfig upsertManifest(@Body DeliveryConfig manifest);

@POST("/delivery-configs/diff")
Map diffManifest(@Body DeliveryConfig manifest);

@GET("/application/{application}")
Map getApplicationDetails(
@Path("application") String application, @Query("includeDetails") Boolean includeDetails);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ Resource upsertResource(@RequestBody Resource resource) {
return keelService.upsertResource(resource);
}

@ApiOperation(value = "Ad-hoc validate and diff a resource", response = Resource.class)
@RequestMapping(value = "/resources/diff", method = POST)
Map diffResource(@RequestBody Resource resource) {
return keelService.diffResource(resource);
}

@ApiOperation(value = "Delete a resource", response = Resource.class)
@RequestMapping(value = "/resources/{name}", method = DELETE)
Resource deleteResource(@PathVariable("name") String name) {
Expand All @@ -82,6 +88,14 @@ DeliveryConfig upsertManifest(@RequestBody DeliveryConfig manifest) {
return keelService.upsertManifest(manifest);
}

@ApiOperation(
value = "Ad-hoc validate and diff a config manifest",
response = DeliveryConfig.class)
@RequestMapping(value = "/delivery-configs", method = POST)
Map diffManifest(@RequestBody DeliveryConfig manifest) {
return keelService.diffManifest(manifest);
}

@ApiOperation(value = "Get managed details about an application", response = Map.class)
@RequestMapping(value = "/application/{application}", method = GET)
Map getApplicationDetails(
Expand Down

0 comments on commit 0e29589

Please sign in to comment.