Skip to content

Commit

Permalink
feat(keel): add veto-related endpoints (#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Munson committed Sep 18, 2019
1 parent 09c1cab commit 13ce30d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.netflix.spinnaker.kork.manageddelivery.model.Resource;
import java.util.List;
import java.util.Map;
import retrofit.client.Response;
import retrofit.http.Body;
import retrofit.http.DELETE;
import retrofit.http.GET;
Expand Down Expand Up @@ -55,4 +56,10 @@ List<Map<String, Object>> getResourceEvents(
@GET("/application/{application}")
Map getApplicationDetails(
@Path("application") String application, @Query("includeDetails") Boolean includeDetails);

@POST("/vetos/{name}")
Response passVetoMessage(@Path("name") String name, @Body Map<String, Object> message);

@GET("/vetos/{name}/rejections")
List<String> getVetoRejections(@Path("name") String name);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import groovy.util.logging.Slf4j;
import io.swagger.annotations.ApiOperation;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -83,4 +84,17 @@ Map getApplicationDetails(
Boolean includeDetails) {
return keelService.getApplicationDetails(application, includeDetails);
}

@ApiOperation(value = "Pass a message to a veto plugin", response = Map.class)
@RequestMapping(value = "/vetos/{name}", method = POST)
void passVetoMessage(
@PathVariable("name") String name, @RequestBody Map<String, Object> message) {
keelService.passVetoMessage(name, message);
}

@ApiOperation(value = "Get everything a specific veto plugin will reject", response = List.class)
@RequestMapping(value = "/vetos/{name}/rejections", method = GET)
List<String> getVetoRejections(@PathVariable("name") String name) {
return keelService.getVetoRejections(name);
}
}

0 comments on commit 13ce30d

Please sign in to comment.