walk = Files.walk(path)) {
- walk.sorted(Comparator.reverseOrder())
- .map(Path::toFile)
-// .peek(System.out::println)
- .forEach(f -> {
- logger.debug(() -> "deleting '" + f + "'");
- if (!f.delete()) {
- throw new RuntimeException("Unable to delete " + f);
- }
- });
-
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
-
- }
- }
-
- public final static class FileInfo {
- private final Path path;
-
- public FileInfo(Path path) {
- this.path = path;
- }
-
- public MediaType getMediaType() {
- try {
- String contentType = Files.probeContentType(path);
- MediaType mediaType = MediaType.valueOf(contentType);
- return mediaType;
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- public ByteBuffer getContent() {
- byte[] bytes = new byte[0];
- try {
- bytes = Files.readAllBytes(path);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- return ByteBuffer.wrap(bytes);
- }
-
- public Path getPath() {
- return path;
- }
- }
-
-}
diff --git a/engine-rest/src/main/java/io/nosqlbench/engine/rest/services/openapi/OpenApiLoader.java b/engine-rest/src/main/java/io/nosqlbench/engine/rest/services/openapi/OpenApiLoader.java
deleted file mode 100644
index b736abedc..000000000
--- a/engine-rest/src/main/java/io/nosqlbench/engine/rest/services/openapi/OpenApiLoader.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright (c) 2022 nosqlbench
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.nosqlbench.engine.rest.services.openapi;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import io.nosqlbench.api.content.Content;
-import io.nosqlbench.api.content.NBIO;
-import io.swagger.parser.OpenAPIParser;
-import io.swagger.v3.oas.models.OpenAPI;
-import io.swagger.v3.oas.models.Operation;
-import io.swagger.v3.oas.models.PathItem;
-import io.swagger.v3.oas.models.Paths;
-import io.swagger.v3.parser.core.models.ParseOptions;
-import io.swagger.v3.parser.core.models.SwaggerParseResult;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.yaml.snakeyaml.DumperOptions;
-import org.yaml.snakeyaml.Yaml;
-import org.yaml.snakeyaml.introspector.BeanAccess;
-
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * @see OpenApi Spec 3.1.0
- */
-public class OpenApiLoader {
- private final static Logger logger = LogManager.getLogger(OpenApiLoader.class);
-
- private static final OpenAPIParser parser = new OpenAPIParser();
- private static final Gson gson = new GsonBuilder().setPrettyPrinting().create();
-
- /**
- * If it is not found, the Stargate path is used by default.
- *
- * For now, the json is used as a filter with the following conventions:
- * {@code
- * {
- * " ": {...},
- * ...
- * }
- * }
- *
- * The presence of a key with a matching method and path to one of those found
- * in the openapi details indicates it should be included.
- *
- * @param openIdYamlPath a filepath is where an openapi descriptor can be found
- * @param json The selection data used to filer in our out calls from the openapi descriptor
- * @return A yaml workload which can be used with the http driver
- */
- public static String generateWorkloadFromFilepath(String openIdYamlPath, String json) {
- Map, ?> filter = gson.fromJson(json, Map.class);
- Set included = filter.keySet().stream()
- .map(Object::toString)
- .collect(Collectors.toSet());
-
- OpenAPI openAPI = parseOpenApi(openIdYamlPath);
- Paths paths = openAPI.getPaths();
-
- List allOps = new ArrayList<>();
-
- for (String pathName : paths.keySet()) {
- PathItem pathItem = paths.get(pathName);
- List calls = PathOp.wrap(pathName, pathItem);
- allOps.addAll(calls);
- }
-
- List activeOps = allOps.stream()
- .filter(op -> {
- return included.contains(op.getCall());
- })
- .collect(Collectors.toList());
-
- Map pathops = new HashMap<>();
- DumperOptions dumper = new DumperOptions();
- dumper.setAllowReadOnlyProperties(true);
- Yaml yaml = new Yaml(dumper);
- yaml.setBeanAccess(BeanAccess.DEFAULT);
-
- for (PathOp activeOp : activeOps) {
- logger.debug(() -> "yaml for op:" + yaml.dump(activeOp));
- pathops.put(activeOp.getCall(), activeOp);
- }
-
- String dump = yaml.dump(pathops);
- return dump;
- }
-
- public static OpenAPI parseOpenApi(String filepath) {
- if (filepath == null) {
- filepath = "stargate.yaml";
- } else if (!filepath.endsWith(".yaml")) {
- throw new RuntimeException("Only .yaml filepaths are supported for now.");
- }
-
- Content> one = NBIO.all().name(filepath).one();
- String content = one.asString();
- SwaggerParseResult parsed = parser.readContents(content, List.of(), new ParseOptions());
- List messages = parsed.getMessages();
- if (messages.size() > 0) {
- throw new RuntimeException("error while parsing: " + String.join("\n", messages.toArray(new String[0])));
- }
-
- OpenAPI openAPI = parsed.getOpenAPI();
- return new OpenApiView(openAPI).getDereferenced();
- }
-
- // TODO; use the op wrapper interface here
- public static Map parseToMap(String filepath) {
- OpenAPI openAPI = parseOpenApi(filepath);
-
- Paths paths = openAPI.getPaths();
- LinkedHashMap map = new LinkedHashMap<>();
-
- for (String pathName : paths.keySet()) {
- PathItem pathItem = paths.get(pathName);
-
- if (pathItem.getGet() != null) {
- Operation op = pathItem.getGet();
- map.put("GET " + pathName, map("GET", pathName, op));
- }
- if (pathItem.getPost() != null) {
- Operation op = pathItem.getPost();
- map.put("POST " + pathName, map("POST", pathName, op));
- }
- if (pathItem.getPut() != null) {
- Operation op = pathItem.getPut();
- map.put("PUT " + pathName, map("PUT", pathName, op));
- }
- if (pathItem.getPatch() != null) {
- Operation op = pathItem.getPatch();
- map.put("PATCH " + pathName, map("PATCH", pathName, op));
- }
- if (pathItem.getDelete() != null) {
- Operation op = pathItem.getDelete();
- map.put("DELETE " + pathName, map("DELETE", pathName, op));
- }
- if (pathItem.getHead() != null) {
- Operation op = pathItem.getHead();
- map.put("HEAD " + pathName, map("HEAD", pathName, op));
- }
- if (pathItem.getOptions() != null) {
- Operation op = pathItem.getOptions();
- map.put("OPTIONS " + pathName, map("OPTIONS", pathName, op));
- }
- }
- return map;
- }
-
- private static Map map(String method, String pathName, Operation op) {
- LinkedHashMap map = new LinkedHashMap<>();
-
- map.put("method", method);
- map.put("path", pathName);
- map.put("api", op);
- map.put("summary", op.getSummary() != null ? op.getSummary() : "");
- map.put("description", op.getDescription() != null ? op.getDescription() : "");
- return map;
-
- }
-
-}
diff --git a/engine-rest/src/main/java/io/nosqlbench/engine/rest/services/openapi/OpenApiView.java b/engine-rest/src/main/java/io/nosqlbench/engine/rest/services/openapi/OpenApiView.java
deleted file mode 100644
index a8a0bde3e..000000000
--- a/engine-rest/src/main/java/io/nosqlbench/engine/rest/services/openapi/OpenApiView.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 2022 nosqlbench
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.nosqlbench.engine.rest.services.openapi;
-
-import io.swagger.v3.oas.models.OpenAPI;
-import io.swagger.v3.oas.models.Operation;
-import io.swagger.v3.oas.models.PathItem;
-import io.swagger.v3.oas.models.Paths;
-import io.swagger.v3.oas.models.headers.Header;
-import io.swagger.v3.oas.models.links.Link;
-import io.swagger.v3.oas.models.media.Schema;
-import io.swagger.v3.oas.models.parameters.Parameter;
-import io.swagger.v3.oas.models.parameters.RequestBody;
-import io.swagger.v3.oas.models.responses.ApiResponse;
-import io.swagger.v3.oas.models.responses.ApiResponses;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#pathsObject
- */
-public class OpenApiView {
-
- private final OpenAPI model;
-
- public OpenApiView(OpenAPI model) {
- this.model = model;
- }
-
- public OpenAPI getDereferenced() {
-
- // Since links, parameters, and responses in components can have references,
- // connect their references first
-
- resolveBodiesInLinks();
- resolveSchemasInParameters();
- resolveHeadersInResponses();
-
-// OpenAPI out = new OpenAPI();
- Paths paths = model.getPaths();
-
- for (String pathKey : paths.keySet()) {
- PathItem pi = paths.get(pathKey);
- if (pi.get$ref() != null) {
- throw new RuntimeException("Unable to read external ref in this version for path '" + pathKey + "':'"
- + pi.get$ref() + "'");
- }
-
- for (Operation op : new Operation[]{
- pi.getDelete(),
- pi.getGet(),
- pi.getPost(),
- pi.getTrace(),
- pi.getPatch(),
- pi.getOptions(),
- pi.getPut(),
- pi.getHead()
- }) {
- if (op != null) {
- flattenOperation(op);
- }
- }
-
- pi.setParameters(resolveParameterList(pi.getParameters()));
-
- }
- return model;
- }
-
- private void flattenOperation(Operation op) {
- if (op.getResponses() != null) {
- op.setResponses(resolveResponsesMap(op.getResponses()));
- }
- if (op.getParameters() != null) {
- op.setParameters(resolveParameterList(op.getParameters()));
- }
- if (op.getRequestBody() != null) {
- op.setRequestBody(resolveRequestBody(op.getRequestBody()));
- }
- }
-
- private RequestBody resolveRequestBody(RequestBody requestBody) {
- while (requestBody.get$ref() != null) {
- requestBody = model.getComponents().getRequestBodies().get(requestBody.get$ref());
- }
- return requestBody;
- }
-
- private List resolveParameterList(List parameters) {
- if (parameters == null) {
- return null;
- }
- List resolved = new ArrayList<>();
- for (Parameter p : parameters) {
- p = resolve(p);
- p.setSchema(resolveSchema(p.getSchema()));
- resolved.add(p);
- }
- return resolved;
- }
-
- private final static Map, String> componentPaths =
- Map.of(
- Parameter.class, "#/components/parameters/",
- ApiResponse.class, "#/components/responses/"
- );
-
- private final static Map, String> mapMethods =
- Map.of(
- Parameter.class, "getParameters",
- ApiResponse.class, "getResponses"
- );
-
-
- private T resolve(T aliased) {
- if (aliased == null) {
- return null;
- }
-
- String typepath = componentPaths.get(aliased.getClass());
- if (typepath == null) {
- throw new RuntimeException("Could not find component path prefix for " + aliased.getClass().getCanonicalName());
- }
- String mapMethod = mapMethods.get(aliased.getClass());
- if (mapMethod == null) {
- throw new RuntimeException("Could not find map method for " + aliased.getClass().getCanonicalName());
- }
-
- T element = aliased;
- int remaining = 100;
- while (true) {
- if (remaining <= 0) {
- throw new RuntimeException("loop limit reached in resolving element");
- }
- try {
- Method getref = element.getClass().getMethod("get$ref");
- Object invoke = getref.invoke(element);
- if (invoke == null) {
- return element;
- }
- String refid = invoke.toString();
-
- int idAt = refid.lastIndexOf("/");
- String name = refid.substring(idAt + 1);
- String prefix = refid.substring(0, idAt + 1);
- if (!prefix.equals(typepath)) {
- throw new RuntimeException("wrong type path (" + typepath + ") for prefix '" + prefix + "'");
- }
- Method getMap = model.getComponents().getClass().getMethod(mapMethod);
- Object mapobj = getMap.invoke(model.getComponents());
- Map map = (Map) mapobj;
- Object o = map.get(name);
- element = (T) o;
- } catch (Exception e) {
- throw new RuntimeException("unable to call get$ref: " + aliased.getClass().getCanonicalName());
- }
- }
- }
-
- private Schema resolveSchema(Schema schema) {
- while (schema.get$ref() != null) {
- schema = model.getComponents().getSchemas().get(schema.get$ref());
- }
- return schema;
- }
-
- private ApiResponses resolveResponsesMap(ApiResponses responses) {
- if (responses != null) {
- for (String rk : responses.keySet()) {
- ApiResponse response = responses.get(rk);
- response = resolve(response);
-
- response.setHeaders(resolveHeaderMap(response.getHeaders()));
- response.setExtensions(resolveExtensionsMap(response.getExtensions()));
- response.setLinks(resolveLinksMap(response.getLinks()));
- }
- }
- return responses;
- }
-
- private Map resolveLinksMap(Map links) {
- if (links != null) {
- for (String lk : links.keySet()) {
- Link link = links.get(lk);
- while (link.get$ref() != null) {
- link = model.getComponents().getLinks().get(link.get$ref());
- }
- links.put(lk, link);
- }
- }
- return links;
- }
-
- private Map resolveExtensionsMap(Map extensions) {
- if (extensions != null) {
- if (extensions.keySet().size() > 0) {
- throw new RuntimeException("extensions are not supported in this version");
- }
- }
- return extensions;
- }
-
- private Map resolveHeaderMap(Map headers) {
- if (headers != null) {
- for (String hk : headers.keySet()) {
- Header header = headers.get(hk);
- while (header.get$ref() != null) {
- header = model.getComponents().getHeaders().get(hk);
- }
- headers.put(hk, header);
- }
- }
- return headers;
- }
-
- private void resolveBodiesInLinks() {
- Map links = model.getComponents().getLinks();
- if (links == null) {
- return;
- }
- for (String linkKey : links.keySet()) {
- Link modelLink = model.getComponents().getLinks().get(linkKey);
-
-// RequestBody body = modelLink.getRequestBody();
-// while (body.get$ref() != null) {
-// body = model.getComponents().getRequestBodies().get(body.get$ref());
-// }
- Object body = modelLink.getRequestBody();
- modelLink.setRequestBody(body);
- }
- }
-
- private void resolveSchemasInParameters() {
- for (String parameterKey : model.getComponents().getParameters().keySet()) {
- Parameter parameter = model.getComponents().getParameters().get(parameterKey);
- Schema schema = parameter.getSchema();
- while (schema.get$ref() != null) {
- schema = model.getComponents().getSchemas().get(schema.get$ref());
- }
- parameter.setSchema(schema);
-
- }
- }
-
- private void resolveHeadersInResponses() {
- for (String responseKey : model.getComponents().getResponses().keySet()) {
- ApiResponse response = model.getComponents().getResponses().get(responseKey);
- Map modelHeaders = response.getHeaders();
- Map headers = new HashMap<>();
-
- for (String headerKey : headers.keySet()) {
- Header header = modelHeaders.get(headerKey);
- while (header.get$ref() != null) {
- header = modelHeaders.get(header.get$ref());
- }
- headers.put(headerKey, header);
- }
- response.setHeaders(headers);
- }
- }
-
-}
diff --git a/engine-rest/src/main/java/io/nosqlbench/engine/rest/services/openapi/PathOp.java b/engine-rest/src/main/java/io/nosqlbench/engine/rest/services/openapi/PathOp.java
deleted file mode 100644
index 762def5da..000000000
--- a/engine-rest/src/main/java/io/nosqlbench/engine/rest/services/openapi/PathOp.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2022 nosqlbench
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.nosqlbench.engine.rest.services.openapi;
-
-import io.swagger.v3.oas.models.Operation;
-import io.swagger.v3.oas.models.PathItem;
-import io.swagger.v3.oas.models.parameters.Parameter;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class PathOp {
-
- private final String method;
- private final String path;
- private final Operation op;
-
- public PathOp(String method, String path, Operation op) {
- this.method = method;
- this.path = path;
- this.op = op;
- }
-
- public Operation getOp() {
- return op;
- }
-
- public static List wrap(String path, PathItem item) {
- List methods = List.of("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD", "TRACE");
- Operation[] ops = new Operation[]{item.getGet(), item.getPost(), item.getPut(), item.getDelete(),
- item.getPatch(), item.getOptions(),
- item.getHead(), item.getTrace()};
- List pathops = new ArrayList<>();
-
- for (int i = 0; i < methods.size(); i++) {
- PathOp pathop = wrap(path, methods.get(i), ops[i]);
- if (pathop != null) {
- pathops.add(pathop);
- }
- }
- return pathops;
- }
-
- private static PathOp wrap(String path, String method, Operation op) {
- if (op == null) {
- return null;
- }
- return new PathOp(method, path, op);
- }
-
- public Operation getOperation() {
- return this.op;
- }
-
- public String toString() {
- String call = getMethod() + " " + getPath();
- if (getOperation().getParameters().size() > 0) {
- for (Parameter p : getOperation().getParameters()) {
- String name = p.getName();
- System.out.println("name: " + name);
- }
- }
- return call;
- }
-
- public String getPath() {
- return this.path;
- }
-
- public String getMethod() {
- return this.method;
- }
-
- public String getCall() {
- return method.toUpperCase() + " " + path;
- }
-}
diff --git a/engine-rest/src/main/java/io/nosqlbench/engine/rest/services/package-info.java b/engine-rest/src/main/java/io/nosqlbench/engine/rest/services/package-info.java
deleted file mode 100644
index bf6cd56ef..000000000
--- a/engine-rest/src/main/java/io/nosqlbench/engine/rest/services/package-info.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2022 nosqlbench
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Classes in this package are meant to provide a basic
- * internal service facade to be used by endpoints.
- * This simplifies endpoint implementations and facilitates DRY
- * implementations.
- *
- * These implementations should only expose primitive types,
- * collections of primitive types, or views of transfer types
- * as implemented in that package.
- */
-package io.nosqlbench.engine.rest.services;
diff --git a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/LiveScenarioView.java b/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/LiveScenarioView.java
deleted file mode 100644
index 2af423f65..000000000
--- a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/LiveScenarioView.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2022 nosqlbench
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.nosqlbench.engine.rest.transfertypes;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyDescription;
-import io.nosqlbench.engine.api.activityapi.core.progress.ProgressMeterDisplay;
-import io.nosqlbench.engine.core.lifecycle.scenario.Scenario;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-public class LiveScenarioView {
-
- private final Scenario scenario;
-
- public LiveScenarioView(Scenario scenario) {
- this.scenario = scenario;
- }
-
- @JsonProperty
- @JsonPropertyDescription("Optionally populated result, "+
- " present only if there was an error or the scenario is complete")
- public ResultView getResult() {
- return new ResultView(scenario.getResultIfComplete().orElse(null));
- }
-
- @JsonProperty("scenario_name")
- public String getScenarioName() {
- return scenario.getScenarioName();
- }
-
- @JsonProperty("started_at")
- public long getStartMillis() {
- return scenario.getStartedAtMillis();
- }
-
- @JsonProperty("ended_at")
- public long getEndMillis() {
- return scenario.getEndedAtMillis();
- }
-
- public Scenario.State getState() {
- return scenario.getScenarioState();
- }
-
- @JsonProperty("progress")
- public List getProgress() {
- List progressView = new ArrayList<>();
- if (scenario.getScenarioController()==null) {
- return progressView;
- }
-
- Collection extends ProgressMeterDisplay> meters = scenario.getScenarioController().getProgressMeters();
- for (ProgressMeterDisplay progressMeterDisplay : meters) {
- ProgressView meterView = new ProgressView(progressMeterDisplay);
- progressView.add(meterView);
- }
-
- return progressView;
- }
-
-}
diff --git a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/ProgressView.java b/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/ProgressView.java
deleted file mode 100644
index 4edd2369a..000000000
--- a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/ProgressView.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2022 nosqlbench
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.nosqlbench.engine.rest.transfertypes;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.nosqlbench.engine.api.activityapi.core.progress.CycleMeter;
-import io.nosqlbench.engine.api.activityapi.core.progress.ProgressMeterDisplay;
-import io.nosqlbench.engine.api.activityapi.core.progress.StateCapable;
-
-public class ProgressView {
-
- private final ProgressMeterDisplay progressMeterDisplay;
-
- public ProgressView(ProgressMeterDisplay progressMeterDisplay) {
- if (progressMeterDisplay ==null) {
- throw new RuntimeException("Unable to create a view with a null progressMeter");
- }
- this.progressMeterDisplay = progressMeterDisplay;
- }
-
- @JsonProperty("summary")
- public String getProgressDetails() {
- return progressMeterDisplay.getSummary();
- }
-
- @JsonProperty("min")
- public double getMin() {
- return progressMeterDisplay.getMinValue();
- }
-
- @JsonProperty("current")
- public double getCurrent() {
- return progressMeterDisplay.getCurrentValue();
- }
-
- @JsonProperty("max")
- public double getMax() {
- return progressMeterDisplay.getMaxValue();
- }
-
-
- @JsonProperty("recycles_max")
- public double getRecyclesMax() {
- if (progressMeterDisplay instanceof CycleMeter cm) {
- return cm.getRecyclesMax();
- } else {
- return Double.NaN;
- }
- }
-
- @JsonProperty("recycles_current")
- public double getRecyclesCurrent() {
- if (progressMeterDisplay instanceof CycleMeter cm) {
- return cm.getRecyclesCurrent();
- } else {
- return Double.NaN;
- }
- }
-
- @JsonProperty("eta_millis")
- public double getEtaMills() {
- return progressMeterDisplay.getProgressETAMillis();
- }
-
- @JsonProperty("name")
- public String getName() {
- return progressMeterDisplay.getProgressName();
- }
-
- @JsonProperty("completed")
- public double getProgress() {
- return progressMeterDisplay.getRatioComplete();
- }
-
- @JsonProperty("state")
- public String getState() {
- if (progressMeterDisplay instanceof StateCapable) {
- return ((StateCapable) progressMeterDisplay).getRunState().toString();
- } else {
- return "unknown";
- }
- }
-
-
-}
diff --git a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/ResultView.java b/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/ResultView.java
deleted file mode 100644
index 9bf85980f..000000000
--- a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/ResultView.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2022 nosqlbench
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.nosqlbench.engine.rest.transfertypes;
-
-import io.nosqlbench.engine.core.lifecycle.ExecutionMetricsResult;
-
-public class ResultView {
-
- private final ExecutionMetricsResult result;
-
- public ResultView(ExecutionMetricsResult result) {
- this.result = result;
- }
-
- public String getIOLog() {
- if (result != null) {
- return result.getIOLog();
- } else {
- return "";
- }
- }
-
- public String getError() {
- if (result != null && result.getException()!=null) {
- return result.getException().getMessage();
- }
- return "";
- }
-}
diff --git a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/RunScenarioRequest.java b/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/RunScenarioRequest.java
deleted file mode 100644
index 35072e752..000000000
--- a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/RunScenarioRequest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2022 nosqlbench
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.nosqlbench.engine.rest.transfertypes;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-import java.util.List;
-import java.util.Map;
-
-public class RunScenarioRequest {
-
- @JsonProperty("commands")
- private List commands = List.of();
-
- @JsonProperty("filemap")
- private Map filemap = Map.of();
-
- @JsonProperty("console")
- private String stdout;
-
- @JsonProperty("scenario_name")
- private String scenarioName = "auto";
-
- @JsonProperty("workspace")
- private String workspace = "default";
-
- public String getWorkspace() {
- return workspace;
- }
-
- public void setWorkspace(String workspace) {
- this.workspace = workspace;
- }
-
- public void setScenarioName(String scenarioName) {
- this.scenarioName = scenarioName;
- }
-
- public String getScenarioName() {
- return scenarioName;
- }
-
- public void setCommands(List commands) {
- this.commands = commands;
- }
-
- public void setFileMap(Map filemap) {
- this.filemap = filemap;
- }
-
- public void setStdout(String stdout) {
- this.stdout = stdout;
- }
-
- public List getCommands() {
- return commands;
- }
-
- public Map getFilemap() {
- return filemap;
- }
-
- public String getStdout() {
- return stdout;
- }
-
-}
diff --git a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/WorkloadsView.java b/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/WorkloadsView.java
deleted file mode 100644
index c1dc70b2a..000000000
--- a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/WorkloadsView.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2022 nosqlbench
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.nosqlbench.engine.rest.transfertypes;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.nosqlbench.engine.api.scenarios.WorkloadDesc;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class WorkloadsView {
- private final Map> workloadsByWorkspace = new HashMap<>();
-
- @JsonProperty("workloads")
- public Map> getWorkloads() {
- return workloadsByWorkspace;
- }
-
- public void add(String workspace, WorkloadDesc workload) {
- workloadsByWorkspace.computeIfAbsent(workspace, ws -> new ArrayList<>()).add(workload);
- }
-
- public void addAll(String workspace, List workloads) {
- workloadsByWorkspace.computeIfAbsent(workspace,ws -> new ArrayList<>()).addAll(workloads);
- }
-}
diff --git a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/WorkspaceItemView.java b/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/WorkspaceItemView.java
deleted file mode 100644
index ccd12ecbe..000000000
--- a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/WorkspaceItemView.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (c) 2022 nosqlbench
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.nosqlbench.engine.rest.transfertypes;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.attribute.FileOwnerAttributeView;
-import java.nio.file.attribute.PosixFileAttributeView;
-import java.nio.file.attribute.PosixFileAttributes;
-import java.nio.file.attribute.PosixFilePermission;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
-public class WorkspaceItemView {
-
- private final Path _path;
- private String type;
- private String perms;
- private String owner;
- private String group;
- private long size;
- private long mtime;
-
- private final static List fields = List.of(
- "type",
- "perms",
- "owner",
- "group",
- "size",
- "mtime",
- "name"
- );
-
- public WorkspaceItemView(Path wspath, Path path) {
- try {
- PosixFileAttributeView posix = Files.getFileAttributeView(path, PosixFileAttributeView.class);
- PosixFileAttributes attrs = posix.readAttributes();
-
- setPerms(fromPerms(attrs.permissions()));
- setType(typeOf(path));
- setOwner(attrs.owner().getName());
- setGroup(attrs.group().getName());
- setSize(attrs.size());
- setMtimeMillis(attrs.lastModifiedTime().to(TimeUnit.MILLISECONDS));
- setName(wspath.relativize(path).toString());
- this._path = path;
-
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
-
- private void setOwner(FileOwnerAttributeView fileAttributeView) {
- try {
- this.setOwner(fileAttributeView.getOwner().getName());
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- private String typeOf(Path path) {
- if (Files.isRegularFile(path)) {
- return "F";
- }
- if (Files.isDirectory(path)) {
- return "D";
- }
- return "U";
- }
-
- @JsonProperty("fields")
- public List> getAsFields() {
- return List.of(
- fields,
- List.of(
- this.type,
- this.perms,
- this.owner,
- this.group,
- String.valueOf(this.size),
- "mtime",
- this.name
- )
- );
-
- }
- private String fromPerms(Set perms) {
- StringBuilder sb = new StringBuilder();
- String img = "rwxrwxrwx";
- String not = "---------";
- int step = 0;
- for (PosixFilePermission perm : PosixFilePermission.values()) {
- String src = perms.contains(perm) ? img : not;
- sb.append(src.charAt(step));
- step++;
- }
- return sb.toString();
- }
-
- public String getPerms() {
- return perms;
- }
-
- public void setPerms(String perms) {
- this.perms = perms;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getOwner() {
- return owner;
- }
-
- public void setOwner(String owner) {
- this.owner = owner;
- }
-
- public String getGroup() {
- return group;
- }
-
- public void setGroup(String group) {
- this.group = group;
- }
-
- public long getSize() {
- return size;
- }
-
- public void setSize(long size) {
- this.size = size;
- }
-
- public long getMtimeMillis() {
- return mtime;
- }
-
- public void setMtimeMillis(long mtime) {
- this.mtime = mtime;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- private String name;
-
- public boolean contains(String content) {
- if (!Files.isRegularFile(_path)) {
- return false;
- }
- try {
- String s = Files.readString(this._path);
- return s.matches("(?s)" + content);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/WorkspaceView.java b/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/WorkspaceView.java
deleted file mode 100644
index e9c349590..000000000
--- a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/WorkspaceView.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2022 nosqlbench
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.nosqlbench.engine.rest.transfertypes;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.joda.time.Period;
-import org.joda.time.format.PeriodFormatter;
-import org.joda.time.format.PeriodFormatterBuilder;
-
-import java.io.IOException;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.SimpleFileVisitor;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.List;
-
-public class WorkspaceView {
-
- private final static PeriodFormatter pf = new PeriodFormatterBuilder()
- .appendWeeks().appendSuffix(" week", " weeks").appendSeparator(" ")
- .appendDays().appendSuffix(" day", " days").appendSeparator(" ")
- .appendHours().appendSuffix("H")
- .appendMinutes().appendSuffix("M")
- .appendSeconds().appendSuffix("S")
- .toFormatter();
-
- private final Path workspaceRoot;
- private Summary summary;
-
- @JsonProperty("ls")
- private List listing = null;
-
- public WorkspaceView(Path workspaceRoot) {
- this.workspaceRoot = workspaceRoot;
- }
-
- public String getName() {
- return workspaceRoot.getFileName().toString();
- }
-
- @JsonProperty("modified")
- public long getModified() {
- try {
- return Files.getLastModifiedTime(workspaceRoot).toMillis();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- @JsonProperty("summary")
- public Summary getSummary() {
- if (this.summary == null) {
- Summary v = new Summary(this.workspaceRoot);
- try {
- Files.walkFileTree(this.workspaceRoot, v);
- this.summary = v;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- return this.summary;
- }
-
- public void setListing(List listing) {
- this.listing = listing;
- }
-
- public final static class Summary extends SimpleFileVisitor {
-
- private final Path root;
-
- public long total_bytes = 0L;
- public long total_files = 0L;
- public long last_changed_epoch = Long.MIN_VALUE;
- public String last_changed_filename = "";
-
- public String getLast_changed_ago() {
- int millis = (int) (System.currentTimeMillis() - last_changed_epoch);
- Period period = Period.millis(millis);
- return pf.print(period.normalizedStandard());
- }
-
- public Summary(Path root) {
- this.root = root;
- }
-
- @Override
- public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
- total_bytes += Files.size(file);
- total_files++;
- long millis= Files.getLastModifiedTime(file).toMillis();
- if (last_changed_epoch getWorkspaces() {
- List workspaces = new ArrayList<>();
- try (DirectoryStream paths = Files.newDirectoryStream(workspacesRoot)) {
- for (Path path : paths) {
- workspaces.add(path.toString());
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- return workspaces;
- }
-}
diff --git a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/package-info.java b/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/package-info.java
deleted file mode 100644
index cd347b0fd..000000000
--- a/engine-rest/src/main/java/io/nosqlbench/engine/rest/transfertypes/package-info.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2022 nosqlbench
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Types in this package are meant to provide a mapping
- * between internal state and external views. Specifically,
- * these types should only include details which are meant to
- * be shared by endpoints. This can be achieved by wrapping
- * internal state and exposing only the visible properties, or
- * it can be done by implementing types which are built from
- * common internal types.
- *
- * Service objects in the services package should only provide
- * primitive values or the view types from this package.
- */
-package io.nosqlbench.engine.rest.transfertypes;
diff --git a/engine-rest/src/main/resources/stargate.yaml b/engine-rest/src/main/resources/stargate.yaml
deleted file mode 100644
index 9338df46c..000000000
--- a/engine-rest/src/main/resources/stargate.yaml
+++ /dev/null
@@ -1,1789 +0,0 @@
-openapi: 3.0.1
-info:
- title: Stargate REST on Astra
- description: ""
- license:
- name: Apache 2.0
- url: http://www.apache.org/licenses/LICENSE-2.0.html
- version: 2.0.0
-servers:
- - url: https://{databaseId}-{region}.apps.astra.datastax.com
-externalDocs:
- description: Reference Document
- url: http://shorturl.at/hnqIQ
-tags:
- - name: auth
- description: auth
- - name: namespaces
- description: document data
- - name: keyspaces
- description: tablular data
- - name: schemas
- description: storage configuration
-paths:
- /api/rest/v1/auth:
- post:
- tags:
- - auth
- summary: Create an auth token
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- requestBody:
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Credentials"
- required: true
- responses:
- 201:
- description: Created
- content:
- application/json:
- examples:
- default:
- value: { "authToken": "string" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/namespaces/{namespace-id}/collections/{collection-id}:
- get:
- tags:
- - namespaces
- summary: search for documents in {collection-id}
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/collection-id"
- - $ref: "#/components/parameters/where"
- - $ref: "#/components/parameters/fields"
- - $ref: "#/components/parameters/page-size"
- - $ref: "#/components/parameters/page-state"
- - $ref: "#/components/parameters/sort"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "count": 1,
- "pageState": "2f4acd34",
- "data":
- [
- {
- "documentId": "my-first-post-a6h54",
- "title": "Hello World",
- "author": { "name": "Cliff Wicklow" },
- },
- ],
- }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- post:
- tags:
- - namespaces
- summary: add a new document to {collection-id}
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/collection-id"
- requestBody:
- description: document
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value:
- {
- "title": "Hello World",
- "author":
- {
- "name": "CRW",
- "social":
- { "foo-bar-789": { "followers": 1, "likes": 7 } },
- },
- }
- responses:
- 201:
- description: resource created
- content:
- application/json:
- examples:
- default:
- value:
- { "documentId": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 409:
- $ref: "#/components/responses/409"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/namespaces/{namespace-id}/collections/{collection-id}/{document-id}:
- get:
- tags:
- - namespaces
- summary: get a document by id
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/collection-id"
- - $ref: "#/components/parameters/document-id"
- - $ref: "#/components/parameters/fields"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "data":
- {
- "documentId": "my-first-post-a6h54",
- "title": "Hello World",
- "author": { "name": "Cliff Wicklow" },
- },
- }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 404:
- $ref: "#/components/responses/404"
- 500:
- $ref: "#/components/responses/500"
- put:
- tags:
- - namespaces
- summary: replace a document
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/collection-id"
- - $ref: "#/components/parameters/document-id"
- requestBody:
- description: document
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value: { "title": "Hello World", "author": { "name": "DKG" } }
- responses:
- 200:
- description: resource updated
- content:
- application/json:
- examples:
- default:
- value:
- { "documentId": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- patch:
- tags:
- - namespaces
- summary: update part of a document
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/collection-id"
- - $ref: "#/components/parameters/document-id"
- requestBody:
- description: document
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value: { "title": "Hello World" }
- responses:
- 200:
- description: resource updated
- content:
- application/json:
- examples:
- default:
- value:
- { "documentId": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 404:
- $ref: "#/components/responses/404"
- 500:
- $ref: "#/components/responses/500"
- delete:
- tags:
- - namespaces
- summary: delete a document
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/collection-id"
- - $ref: "#/components/parameters/document-id"
- responses:
- 204:
- description: resource deleted
- content:
- application/json:
- examples:
- default:
- value: { }
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/namespaces/{namespace-id}/collections/{collection-id}/{document-id}/{document-path}:
- get:
- tags:
- - namespaces
- summary: get a sub document by path
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/collection-id"
- - $ref: "#/components/parameters/document-id"
- - $ref: "#/components/parameters/document-path"
- - $ref: "#/components/parameters/fields"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "documentPath": "author",
- "data": { "name": "Cliff Wicklow" },
- }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 404:
- $ref: "#/components/responses/404"
- 500:
- $ref: "#/components/responses/500"
- put:
- tags:
- - namespaces
- summary: replace a sub document
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/collection-id"
- - $ref: "#/components/parameters/document-id"
- - $ref: "#/components/parameters/document-path"
- requestBody:
- description: document
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value: { "foo-bar-789": { "followers": 1, "likes": 7 } }
-
- responses:
- 201:
- description: resource created
- content:
- application/json:
- examples:
- default:
- value:
- { "documentId": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- patch:
- tags:
- - namespaces
- summary: update part of a sub document
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/collection-id"
- - $ref: "#/components/parameters/document-id"
- - $ref: "#/components/parameters/document-path"
- requestBody:
- description: document
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value: { "title": "Hello World" }
- responses:
- 200:
- description: resource updated
- content:
- application/json:
- examples:
- default:
- value:
- { "documentId": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 404:
- $ref: "#/components/responses/404"
- 500:
- $ref: "#/components/responses/500"
- delete:
- tags:
- - namespaces
- summary: delete a sub document
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/collection-id"
- - $ref: "#/components/parameters/document-id"
- - $ref: "#/components/parameters/document-path"
- responses:
- 204:
- description: resource deleted
- content:
- application/json:
- examples:
- default:
- value: { }
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/keyspaces/{keyspace-id}/{table-id}:
- get:
- tags:
- - keyspaces
- summary: search a table
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- - $ref: "#/components/parameters/where"
- - $ref: "#/components/parameters/fields"
- - $ref: "#/components/parameters/page-size"
- - $ref: "#/components/parameters/page-state"
- - $ref: "#/components/parameters/sort"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "count": 1,
- "pageState": "2f4acd34",
- "data":
- [ { "title": "Hello World", "author": "Cliff Wicklow" } ],
- }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- post:
- tags:
- - keyspaces
- summary: add a new row
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- requestBody:
- description: row
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value:
- {
- "pk": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7",
- "title": "Hello World",
- "author": "CRW",
- }
- responses:
- 201:
- description: resource created
- content:
- application/json:
- examples:
- default:
- value: { "pk": "e73c77ec-002d-457a-8b65-8ce7cfb15fc7" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 409:
- $ref: "#/components/responses/409"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/keyspaces/{keyspace-id}/{table-id}/{primary-key}:
- get:
- tags:
- - keyspaces
- summary: get a row(s)
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- - $ref: "#/components/parameters/primary-key"
- - $ref: "#/components/parameters/fields"
- - $ref: "#/components/parameters/page-size"
- - $ref: "#/components/parameters/page-state"
- - $ref: "#/components/parameters/sort"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "count": 1,
- "pageState": "2f4acd34",
- "data":
- [ { "title": "Hello World", "author": "Cliff Wicklow" } ],
- }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- put:
- tags:
- - keyspaces
- summary: replace a row(s)
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- - $ref: "#/components/parameters/primary-key"
- - $ref: "#/components/parameters/raw"
- requestBody:
- description: document
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value: { "title": "New Title" }
- responses:
- 200:
- description: resource updated
- content:
- application/json:
- examples:
- default:
- value:
- { "rowsModified": 208, "data": { "title": "New Title" } }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- patch:
- tags:
- - keyspaces
- summary: update part of a row(s)
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- - $ref: "#/components/parameters/primary-key"
- - $ref: "#/components/parameters/raw"
- requestBody:
- description: document
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value: { "title": "New Title", "author": null }
- responses:
- 200:
- description: resource updated
- content:
- application/json:
- examples:
- default:
- value:
- { "rowsModified": 208, "data": { "title": "New Title" } }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- delete:
- tags:
- - keyspaces
- summary: delete a row(s)
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- - $ref: "#/components/parameters/primary-key"
- responses:
- 204:
- description: resource deleted
- content:
- application/json:
- examples:
- default:
- value: { }
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/schemas/keyspaces:
- get:
- tags:
- - schemas
- summary: list keyspaces
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "data":
- [
- {
- "name": "killrvideo",
- "datacenters":
- [
- { "name": "dc1", "replicas": 3 },
- { "name": "dc2", "replicas": 3 },
- ],
- },
- ],
- }
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- post:
- tags:
- - schemas
- summary: create a keyspace
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- requestBody:
- description: ""
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- simple strategy:
- value: { "name": "killrvideo" }
- datacenters:
- value:
- {
- "name": "killrvideo",
- "datacenters":
- [
- { "name": "dc1", "replicas": 3 },
- { "name": "dc2", "replicas": 3 },
- ],
- }
- responses:
- 201:
- description: resource created
- content:
- application/json:
- examples:
- default:
- value: { "name": "killrvideo" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 409:
- $ref: "#/components/responses/409"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/schemas/keyspaces/{keyspace-id}:
- get:
- tags:
- - schemas
- summary: get a keyspace
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "data":
- {
- "name": "killrvideo",
- "datacenters":
- [
- { "name": "dc1", "replicas": 3 },
- { "name": "dc2", "replicas": 3 },
- ],
- },
- }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 404:
- $ref: "#/components/responses/404"
- 500:
- $ref: "#/components/responses/500"
- delete:
- tags:
- - schemas
- summary: delete a keyspace
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- responses:
- 204:
- description: resource deleted
- content:
- application/json:
- examples:
- default:
- value: { }
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/schemas/keyspaces/{keyspace-id}/tables:
- get:
- tags:
- - schemas
- summary: list tables
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "data":
- [
- {
- "name": "string",
- "keyspace": "string",
- "columnDefinitions":
- [
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false,
- },
- ],
- "primaryKey":
- {
- "partitionKey": [ "string" ],
- "clusteringKey": [ "string" ],
- },
- "tableOptions":
- {
- "defaultTimeToLive": 0,
- "clusteringExpression":
- [ { "column": "string", "order": "ASC" } ],
- },
- },
- ],
- }
- 401:
- $ref: "#/components/responses/401"
- 404:
- $ref: "#/components/responses/404"
- 500:
- $ref: "#/components/responses/500"
- post:
- tags:
- - schemas
- summary: create a table
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- requestBody:
- description: ""
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value:
- {
- "name": "users",
- "ifNotExists": false,
- "columnDefinitions":
- [
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false,
- },
- ],
- "primaryKey":
- {
- "partitionKey": [ "string" ],
- "clusteringKey": [ "string" ],
- },
- "tableOptions":
- {
- "defaultTimeToLive": 0,
- "clusteringExpression":
- [ { "column": "string", "order": "ASC" } ],
- },
- }
- responses:
- 201:
- description: resource created
- content:
- application/json:
- examples:
- default:
- value: { "name": "users" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 409:
- $ref: "#/components/responses/409"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/schemas/keyspaces/{keyspace-id}/tables/{table-id}:
- get:
- tags:
- - schemas
- summary: get a table
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "data":
- {
- "name": "string",
- "keyspace": "string",
- "columnDefinitions":
- [
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false,
- },
- ],
- "primaryKey":
- {
- "partitionKey": [ "string" ],
- "clusteringKey": [ "string" ],
- },
- "tableOptions":
- {
- "defaultTimeToLive": 0,
- "clusteringExpression":
- [ { "column": "string", "order": "ASC" } ],
- },
- },
- }
- 401:
- $ref: "#/components/responses/401"
- 404:
- $ref: "#/components/responses/404"
- 500:
- $ref: "#/components/responses/500"
- put:
- tags:
- - schemas
- summary: replace a table definition, except for columns
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- requestBody:
- description: ""
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value:
- {
- "name": "users",
- "ifNotExists": false,
- "primaryKey":
- {
- "partitionKey": [ "string" ],
- "clusteringKey": [ "string" ],
- },
- "tableOptions":
- {
- "defaultTimeToLive": 0,
- "clusteringExpression":
- [ { "column": "string", "order": "ASC" } ],
- },
- }
- responses:
- 200:
- description: resource updated
- content:
- application/json:
- examples:
- default:
- value: { "name": "users" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 404:
- $ref: "#/components/responses/404"
- 409:
- $ref: "#/components/responses/409"
- 500:
- $ref: "#/components/responses/500"
- delete:
- tags:
- - schemas
- summary: delete a table
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- responses:
- 204:
- description: resource deleted
- content:
- application/json:
- examples:
- default:
- value: { }
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/schemas/keyspaces/{keyspace-id}/tables/{table-id}/columns:
- get:
- tags:
- - schemas
- summary: list columns
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "data":
- [
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false,
- },
- ],
- }
- 401:
- $ref: "#/components/responses/401"
- 404:
- $ref: "#/components/responses/404"
- 500:
- $ref: "#/components/responses/500"
- post:
- tags:
- - schemas
- summary: create a column
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- requestBody:
- description: ""
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value:
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false,
- }
- responses:
- 201:
- description: resource created
- content:
- application/json:
- examples:
- default:
- value: { "name": "emailaddress" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 409:
- $ref: "#/components/responses/409"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/schemas/keyspaces/{keyspace-id}/tables/{table-id}/columns/{column-id}:
- get:
- tags:
- - schemas
- summary: get a column
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- - $ref: "#/components/parameters/column-id"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "data":
- {
- "name": "emailaddress",
- "typeDefinition": "text",
- "static": false,
- },
- }
- 401:
- $ref: "#/components/responses/401"
- 404:
- $ref: "#/components/responses/404"
- 500:
- $ref: "#/components/responses/500"
- put:
- tags:
- - schemas
- summary: replace a column definition
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- - $ref: "#/components/parameters/column-id"
- requestBody:
- description: ""
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value:
- {
- "name": "emailaddressRenamed",
- "typeDefinition": "text",
- "static": true,
- }
- responses:
- 200:
- description: resource updated
- content:
- application/json:
- examples:
- default:
- value: { "name": "users" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 404:
- $ref: "#/components/responses/404"
- 409:
- $ref: "#/components/responses/409"
- 500:
- $ref: "#/components/responses/500"
- delete:
- tags:
- - schemas
- summary: delete a column
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/keyspace-id"
- - $ref: "#/components/parameters/table-id"
- - $ref: "#/components/parameters/column-id"
- responses:
- 204:
- description: resource deleted
- content:
- application/json:
- examples:
- default:
- value: { }
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/schemas/namespaces:
- get:
- tags:
- - schemas
- summary: list namespaces
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "data":
- [
- {
- "name": "killrvideo",
- "datacenters":
- [
- { "name": "dc1", "replicas": 3 },
- { "name": "dc2", "replicas": 3 },
- ],
- },
- ],
- }
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- post:
- tags:
- - schemas
- summary: create a namespace
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- requestBody:
- description: ""
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- simple strategy:
- value: { "name": "killrvideo" }
- datacenters:
- value:
- {
- "name": "killrvideo",
- "datacenters":
- [
- { "name": "dc1", "replicas": 3 },
- { "name": "dc2", "replicas": 3 },
- ],
- }
- responses:
- 201:
- description: resource created
- content:
- application/json:
- examples:
- default:
- value: { "name": "killrvideo" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 409:
- $ref: "#/components/responses/409"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/schemas/namespaces/{namespace-id}:
- get:
- tags:
- - schemas
- summary: get a namespace
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "data":
- {
- "name": "killrvideo",
- "datacenters":
- [
- { "name": "dc1", "replicas": 3 },
- { "name": "dc2", "replicas": 3 },
- ],
- },
- }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 404:
- $ref: "#/components/responses/404"
- 500:
- $ref: "#/components/responses/500"
- delete:
- tags:
- - schemas
- summary: delete a namespace
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- responses:
- 204:
- description: resource deleted
- content:
- application/json:
- examples:
- default:
- value: { }
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/schemas/namespaces/{namespace-id}/collections:
- get:
- tags:
- - schemas
- summary: list collections in a namespace
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "data":
- [
- {
- "name": "users",
- "fields":
- { "name": { "type": "String", "index": true } },
- "validationAction": "warn",
- },
- ],
- }
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- post:
- tags:
- - schemas
- summary: create a collection
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- requestBody:
- description: ""
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value:
- {
- "name": "users",
- "fields": { "name": { "type": "String", "index": true } },
- "validationAction": "warn",
- }
- responses:
- 201:
- description: resource created
- content:
- application/json:
- examples:
- default:
- value: { "name": "killrvideo" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 409:
- $ref: "#/components/responses/409"
- 500:
- $ref: "#/components/responses/500"
- /api/rest/v2/schemas/namespaces/{namespace-id}/collections/{collection-id}:
- get:
- tags:
- - schemas
- summary: get a collection
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/collection-id"
- - $ref: "#/components/parameters/raw"
- responses:
- 200:
- description: ""
- content:
- application/json:
- examples:
- default:
- value:
- {
- "data":
- [
- {
- "name": "users",
- "fields":
- { "name": { "type": "String", "index": true } },
- "validationAction": "warn",
- },
- ],
- }
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
- put:
- tags:
- - schemas
- summary: update (replace) a collection
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/collection-id"
- requestBody:
- description: ""
- required: true
- content:
- application/json:
- schema:
- type: object
- examples:
- default:
- value:
- {
- "name": "users",
- "fields": { "name": { "type": "String", "index": true } },
- "validationAction": "warn",
- }
- responses:
- 200:
- description: resource updated
- content:
- application/json:
- examples:
- default:
- value: { "name": "users" }
- 400:
- $ref: "#/components/responses/400"
- 401:
- $ref: "#/components/responses/401"
- 409:
- $ref: "#/components/responses/409"
- 500:
- $ref: "#/components/responses/500"
- delete:
- tags:
- - schemas
- summary: delete a collection
- parameters:
- - $ref: "#/components/parameters/X-Cassandra-Request-Id"
- - $ref: "#/components/parameters/databaseId"
- - $ref: "#/components/parameters/region"
- - $ref: "#/components/parameters/pretty"
- - $ref: "#/components/parameters/X-Cassandra-Token"
- - $ref: "#/components/parameters/namespace-id"
- - $ref: "#/components/parameters/collection-id"
- responses:
- 204:
- description: resource deleted
- content:
- application/json:
- examples:
- default:
- value: { }
- 401:
- $ref: "#/components/responses/401"
- 500:
- $ref: "#/components/responses/500"
-components:
- parameters:
- region:
- name: "region"
- description: "Cloud region where your database lives. For example, `us-east-1`"
- in: "path"
- schema:
- type: "string"
- required: true
- databaseId:
- name: "databaseId"
- description: "UUID of your database from the Astra URL. For example, `d341f349-e5db-46d2-9c90-bb9ebaa6f0fc`."
- in: "path"
- schema:
- type: "string"
- required: true
- X-Cassandra-Token:
- name: X-Cassandra-Token
- in: header
- required: true
- description: "The token returned from the authorization endpoint. Use this token in each request to the database."
- schema:
- type: string
- X-Cassandra-Request-Id:
- name: X-Cassandra-Request-Id
- in: header
- required: true
- description: "Unique identifier (UUID) for the request. Use any valid UUID."
- schema:
- type: string
- format: uuid
- pretty:
- name: pretty
- in: query
- description: format results
- schema:
- type: boolean
- raw:
- name: raw
- in: query
- description: unwrap results
- schema:
- type: boolean
- namespace-id:
- name: namespace-id
- in: path
- description: namespace name
- required: true
- schema:
- type: string
- collection-id:
- name: collection-id
- in: path
- description: name of the document collection
- required: true
- schema:
- type: string
- document-id:
- name: document-id
- in: path
- description: the id of the document
- required: true
- schema:
- type: string
- document-path:
- name: document-path
- in: path
- description: a JSON path
- required: true
- schema:
- type: string
- keyspace-id:
- name: keyspace-id
- in: path
- description: keyspace name
- required: true
- schema:
- type: string
- table-id:
- name: table-id
- in: path
- description: table name
- required: true
- schema:
- type: string
- column-id:
- name: column-id
- in: path
- description: column name
- required: true
- schema:
- type: string
- primary-key:
- name: primary-key
- in: path
- required: true
- description: |
- Value from the primary key column for the table. Define composite keys by separating values with
- slashes (`val1/val2...`) in the order they were defined. For example, if the composite key
- was defined as `PRIMARY KEY(race_year, race_name)` then the primary key in the path would be
- `race_year/race_name`
- schema:
- type: string
- fields:
- name: fields
- in: query
- description: URL escaped, comma delimited list of keys to include
- schema:
- type: string
- examples:
- default:
- value: "name, email"
- sort:
- name: sort
- in: query
- description: keys to sort by
- schema:
- type: object
- examples:
- default:
- value: { "documentId": "asc", "name": "desc" }
- page-state:
- name: page-state
- in: query
- description: move the cursor to a particular result
- schema:
- type: string
- examples:
- default:
- value: ""
- page-size:
- name: page-size
- description: restrict the number of returned items (max 100)
- in: query
- schema:
- type: integer
- format: int32
- examples:
- default:
- value: 10
- where:
- name: where
- in: query
- description: |
- URL escaped JSON query using the following keys:
- | Key | Operation |
- |-|-|
- | $lt | Less Than |
- | $lte | Less Than Or Equal To |
- | $gt | Greater Than |
- | $gte | Greater Than Or Equal To |
- | $ne | Not Equal To |
- | $in | Contained In |
- | $exists | A value is set for the key |
- | $select | This matches a value for a key in the result of a different query |
- | $dontSelect | Requires that a key’s value not match a value for a key in the result of a different query |
- | $all | Contains all of the given values |
- | $regex | Requires that a key’s value match a regular expression |
- | $text | Performs a full text search on indexed fields |
- schema:
- type: object
- examples:
- search with or:
- value:
- {
- "author.name": "Cliff Wicklow",
- "createTime": { "$gte": 0 },
- "$or":
- [ { "name": "Cliff" }, { "documentId": "my-first-post-a6h54" } ],
- }
- examples: { }
- responses:
- 404:
- description: Not Found
- content:
- application/json:
- examples:
- default:
- value: { "code": 404, "description": "Not Found" }
- 400:
- description: Invalid input
- content:
- application/json:
- examples:
- default:
- value: { "code": 400, "description": "Invalid input" }
- 401:
- description: Unauthorized
- content:
- application/json:
- examples:
- default:
- value: { "code": 401, "description": "Unauthorized" }
- 409:
- description: Conflict
- content:
- application/json:
- examples:
- default:
- value: { "code": 409, "description": "resource already exists." }
- 500:
- description: Internal server error
- content:
- application/json:
- examples:
- default:
- value: { "code": 500, "description": "Internal server error" }
- schemas:
- Credentials:
- type: object
- required:
- - username
- - password
- description: User credentials for authenticating
- properties:
- username:
- type: string
- description: Username
- password:
- type: string
- description: Password
diff --git a/engine-rest/src/test/java/io/nosqlbench/engine/rest/services/openapi/OpenApiLoaderTest.java b/engine-rest/src/test/java/io/nosqlbench/engine/rest/services/openapi/OpenApiLoaderTest.java
deleted file mode 100644
index e4a2a30f1..000000000
--- a/engine-rest/src/test/java/io/nosqlbench/engine/rest/services/openapi/OpenApiLoaderTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2022 nosqlbench
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.nosqlbench.engine.rest.services.openapi;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.junit.jupiter.api.Test;
-
-public class OpenApiLoaderTest {
- private final static Logger logger = LogManager.getLogger(OpenApiLoaderTest.class);
- @Test
- public void testYamlGenerator() {
- String openidpath = "stargate.yaml";
- String filterJson = "{\n" +
- "'POST /api/rest/v1/auth' : {}\n" +
- "}\n";
-
- String result = OpenApiLoader.generateWorkloadFromFilepath(openidpath, filterJson);
- logger.debug(result);
-
- }
-
-}
diff --git a/engine-rest/src/test/resources/log4j2-test.xml b/engine-rest/src/test/resources/log4j2-test.xml
deleted file mode 100644
index dc9a74051..000000000
--- a/engine-rest/src/test/resources/log4j2-test.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- %d %p %C{1.} [%t] %m%n
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mvn-defaults/pom.xml b/mvn-defaults/pom.xml
index 6e1a1d2ac..15760b25a 100644
--- a/mvn-defaults/pom.xml
+++ b/mvn-defaults/pom.xml
@@ -70,7 +70,6 @@
-
org.testcontainers
testcontainers-bom
@@ -78,25 +77,21 @@
pom
import
-
org.codehaus.groovy
groovy
- 3.0.14
+ 3.0.17
-
org.snakeyaml
snakeyaml-engine
2.6
-
info.picocli
picocli
4.7.4
-
net.java.dev.jna
@@ -108,44 +103,37 @@
jna-platform
5.13.0
-
org.junit.jupiter
5.9.0-M1
junit-jupiter
test
-
org.mpierce.metrics.reservoir
hdrhistogram-metrics-reservoir
1.1.3
-
org.hdrhistogram
HdrHistogram
2.1.12
-
io.dropwizard.metrics
metrics-graphite
4.2.19
-
io.dropwizard.metrics
metrics-core
4.2.19
-
org.apache.commons
commons-text
1.10.0
-
org.apache.commons
commons-math4-core
@@ -171,7 +159,6 @@
commons-statistics-distribution
1.0
-
org.openjdk.jmh
jmh-core
@@ -182,53 +169,65 @@
jmh-generator-annprocess
1.36
-
com.mitchtalmadge
ascii-data
1.4.0
-
org.lz4
lz4-java
1.4.1
-
org.xerial.snappy
snappy-java
1.1.10.1
-
+
+ com.datastax.oss
+ java-driver-query-builder
+ 4.16.0
+
+
+ org.snakeyaml
+ snakeyaml-engine
+ 2.6
+
+
+ org.xerial.snappy
+ snappy-java
+ 1.1.10.1
+
+
+ com.esri.geometry
+ esri-geometry-api
+ 2.2.4
+
io.netty
netty-handler
4.1.94.Final
-
io.netty
netty-transport-native-epoll
4.1.51.Final
linux-x86_64
-
io.netty
netty-transport-native-kqueue
4.1.46.Final
linux-x86_64
-
io.netty
netty-codec-haproxy
4.1.86.Final
-
com.github.docker-java
docker-java-api
@@ -240,11 +239,45 @@
-
+
+ org.apache.commons
+ commons-collections4
+ 4.4
+
+
+ org.bouncycastle
+ bcprov-jdk15on
+ 1.69
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ 2.15.2
+
+
+ commons-io
+ commons-io
+ 2.11.0
+
+
+ org.apache.tinkerpop
+ gremlin-core
+ 3.6.4
+
+
+ com.datastax.oss
+ java-driver-core
+ 4.16.0
+
+
+ org.apache.tinkerpop
+ tinkergraph-gremlin
+ 3.6.4
+
com.github.docker-java
docker-java-core
- 3.3.0
+ 3.3.2
org.slf4j
@@ -252,13 +285,11 @@
-
com.squareup.okhttp3
okhttp
4.10.0
-
com.github.docker-java
docker-java-transport-okhttp
@@ -269,9 +300,7 @@
jcl-over-slf4j
-
-
com.github.docker-java
docker-java
@@ -284,55 +313,46 @@
-
com.github.oshi
oshi-core-java11
6.4.3
-
com.google.code.gson
gson
2.10.1
-
com.amazonaws
aws-java-sdk-s3
1.12.495
-
com.elega9t
number-to-words
1.0.0
-
org.greenrobot
essentials
3.1.0
-
org.apache.commons
commons-lang3
3.12.0
-
com.squareup
javapoet
1.13.0
-
joda-time
joda-time
2.12.5
-
org.apache.commons
commons-csv
@@ -348,37 +368,31 @@
mvel2
2.5.0.Final
-
org.antlr
antlr4-runtime
4.12.0
-
org.apache.commons
commons-compress
1.21
-
com.fasterxml.jackson.jaxrs
jackson-jaxrs-json-provider
2.9.8
-
com.sun.xml.bind
jaxb-core
2.3.0.1
-
com.sun.xml.bind
jaxb-impl
2.4.0-b180830.0438
-
org.graalvm.sdk
diff --git a/virtdata-api/pom.xml b/virtdata-api/pom.xml
index ffb5f45ea..ca9c21787 100644
--- a/virtdata-api/pom.xml
+++ b/virtdata-api/pom.xml
@@ -43,24 +43,19 @@
${revision}
nb-api
-
io.nosqlbench
virtdata-lang
${revision}
-
-
org.apache.commons
commons-lang3
-
com.squareup
javapoet
-
org.apache.commons
commons-math4-core
@@ -76,7 +71,6 @@
org.apache.commons
commons-math4-legacy-exception
- 4.0-beta1
org.apache.commons
@@ -85,9 +79,16 @@
com.datastax.oss
java-driver-core
- 4.16.0
compile
+
+ com.github.docker-java
+ docker-java-core
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+