.setDescription("Metrics")
.setSince("3.2");
// action with default values
newController.createAction("show")
.setHandler(new RequestHandler() {
@Override
public void handle(Request request, Response response) {
}
});
// action with a lot of overridden values
NewAction create = newController.createAction("create")
.setDescription("Create metric")
.setSince("4.1")
.setPost(true)
.setResponseExample(Resources.getResource(getClass(), "ListingWsTest/metrics_example.json"))
.setHandler(new RequestHandler() {
@Override
public void handle(Request request, Response response) {
}
});
create
.createParam("severity")
.setDescription("Severity")
.setRequired(true)
.setPossibleValues("BLOCKER", "INFO")
.setExampleValue("INFO")
.setDefaultValue("BLOCKER");
create.createParam("name");
newController.createAction("internal_action").setInternal(true).setHandler(new RequestHandler() {
@Override
public void handle(Request request, Response response) throws Exception {
}
});