feat(keel): endpoints for delivery config manifests
MODIFY
gate-core/src/main/groovy/com/netflix/spinnaker/gate/services/internal/KeelService.java
gate-core/src/main/groovy/com/netflix/spinnaker/gate/services/internal/KeelService.java
*/
package com.netflix.spinnaker.gate.services.internal;
+import com.netflix.spinnaker.kork.manageddelivery.model.DeliveryConfig;
import com.netflix.spinnaker.kork.manageddelivery.model.Resource;
import com.netflix.spinnaker.kork.manageddelivery.model.ResourceEvent;
import java.util.List;
@@ -42,6 +43,12 @@ public interface KeelService {
@DELETE("/resources/{name}")
Resource deleteResource(@Path("name") String name);
+ @GET("/delivery-configs/{name}")
+ DeliveryConfig getManifest(@Path("name") String name);
+
+ @POST("/delivery-configs")
+ DeliveryConfig upsertManifest(@Body DeliveryConfig manifest);
+
@GET("/application/{application}")
Map getApplicationDetails(
@Path("application") String application, @Query("includeDetails") Boolean includeDetails);

MODIFY
gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/ManagedController.java
gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/ManagedController.java
package com.netflix.spinnaker.gate.controllers;
+import static org.springframework.web.bind.annotation.RequestMethod.DELETE;
+import static org.springframework.web.bind.annotation.RequestMethod.GET;
+import static org.springframework.web.bind.annotation.RequestMethod.POST;
+
import com.netflix.spinnaker.gate.services.internal.KeelService;
+import com.netflix.spinnaker.kork.manageddelivery.model.DeliveryConfig;
import com.netflix.spinnaker.kork.manageddelivery.model.Resource;
import groovy.util.logging.Slf4j;
import io.swagger.annotations.ApiOperation;
@@ -12,7 +17,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@@ -31,25 +35,39 @@ public class ManagedController {
}
@ApiOperation(value = "Get a resource", response = Resource.class)
- @RequestMapping(value = "/resources/{name}", method = RequestMethod.GET)
+ @RequestMapping(value = "/resources/{name}", method = GET)
Resource getResource(@PathVariable("name") String name) {
return keelService.getResource(name);
}
@ApiOperation(value = "Create or update a resource", response = Resource.class)
- @RequestMapping(value = "/resources", method = RequestMethod.POST)
+ @RequestMapping(value = "/resources", method = POST)
Resource upsertResource(@RequestBody Resource resource) {
return keelService.upsertResource(resource);
}
@ApiOperation(value = "Delete a resource", response = Resource.class)
- @RequestMapping(value = "/resources/{name}", method = RequestMethod.DELETE)
+ @RequestMapping(value = "/resources/{name}", method = DELETE)
Resource deleteResource(@PathVariable("name") String name) {
return keelService.deleteResource(name);
}
+ @ApiOperation(value = "Get a delivery config manifest", response = DeliveryConfig.class)
+ @RequestMapping(value = "/delivery-configs/{name}", method = GET)
+ DeliveryConfig getManifest(@PathVariable("name") String name) {
+ return keelService.getManifest(name);
+ }
+
+ @ApiOperation(
+ value = "Create or update a delivery config manifest",
+ response = DeliveryConfig.class)
+ @RequestMapping(value = "/delivery-configs", method = POST)
+ DeliveryConfig upsertManifest(@RequestBody DeliveryConfig manifest) {
+ return keelService.upsertManifest(manifest);
+ }
+
@ApiOperation(value = "Get managed details about an application", response = Map.class)
- @RequestMapping(value = "/application/{application}", method = RequestMethod.GET)
+ @RequestMapping(value = "/application/{application}", method = GET)
Map getApplicationDetails(
@PathVariable("application") String application,
@RequestParam(value = "includeDetails", required = false, defaultValue = "false")

feat(keel): endpoints for delivery config manifests