add cql workload generator endpoint

This commit is contained in:
Jonathan Shook 2020-09-23 23:28:48 -05:00
parent 2694af32c8
commit b15ddd6709
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package io.nosqlbench.activitytype.cql.endpoints;
import io.nosqlbench.generators.cql.lang.CqlWorkloadGen;
import io.nosqlbench.docsys.api.WebServiceObject;
import io.nosqlbench.nb.annotations.Service;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@Service(WebServiceObject.class)
@Path("/services/cql/")
public class CqlWorkloadGeneratorEndpoint implements WebServiceObject {
@POST
@Path("generate")
public Response generate(String cqlSchema) {
try {
CqlWorkloadGen generator = new CqlWorkloadGen();
String generated = generator.generate(cqlSchema);
return Response.ok(generated).type(MediaType.TEXT_PLAIN).build();
} catch (Exception e) {
return Response.serverError().entity(e).build();
}
}
}

View File

@ -0,0 +1,9 @@
package io.nosqlbench.generators.cql.lang;
public class CqlWorkloadGen {
public String generate(String cqlSchema) {
return null;
}
}