Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Revert "Merge branch 'main' into feat/utilize-k8-devservices"
Browse files Browse the repository at this point in the history
This reverts commit 2064850, reversing
changes made to 6283538.
  • Loading branch information
ChrisRousey committed Apr 26, 2023
1 parent 2064850 commit 51a87c3
Show file tree
Hide file tree
Showing 40 changed files with 2,383 additions and 4,171 deletions.
1 change: 0 additions & 1 deletion platform-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ dependencies {
// REST related stuff
implementation 'io.quarkus:quarkus-resteasy-reactive'
implementation 'io.quarkus:quarkus-resteasy-reactive-jackson'
implementation 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-yaml-provider'

// SmallRye for Rest and messaging, micrometer for monitoring
implementation 'io.quarkus:quarkus-smallrye-openapi'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.datacater.core.config;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.jaxrs.yaml.YAMLMediaTypes;
import io.datacater.core.exceptions.ConfigNotFoundException;
import io.quarkus.security.Authenticated;
import io.smallrye.mutiny.Uni;
Expand All @@ -17,7 +16,7 @@

@Path("/configs")
@Authenticated
@Produces({MediaType.APPLICATION_JSON, YAMLMediaTypes.APPLICATION_JACKSON_YAML})
@Produces(MediaType.APPLICATION_JSON)
@SecurityRequirement(name = "apiToken")
public class ConfigEndpoint {
private static final String UUID_NOT_FOUND_ERROR_MESSAGE = "No config found for uuid %s";
Expand Down Expand Up @@ -52,7 +51,7 @@ public Uni<ConfigEntity> getConfig(@PathParam("uuid") UUID uuid) {

@POST
@RequestBody
@Consumes({MediaType.APPLICATION_JSON, YAMLMediaTypes.APPLICATION_JACKSON_YAML})
@Consumes(MediaType.APPLICATION_JSON)
public Uni<ConfigEntity> createConfig(Config config) throws JsonProcessingException {
ConfigEntity configEntity =
ConfigEntity.from(config.name(), config.kind(), config.metadata(), config.spec());
Expand All @@ -64,7 +63,7 @@ public Uni<ConfigEntity> createConfig(Config config) throws JsonProcessingExcept
@PUT
@Path("{uuid}")
@RequestBody
@Consumes({MediaType.APPLICATION_JSON, YAMLMediaTypes.APPLICATION_JACKSON_YAML})
@Consumes(MediaType.APPLICATION_JSON)
public Uni<ConfigEntity> updateConfig(@PathParam("uuid") UUID uuid, Config config) {
return sf.withTransaction(
((session, transaction) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.jaxrs.yaml.YAMLMediaTypes;
import io.datacater.core.authentication.DataCaterSessionFactory;
import io.datacater.core.config.ConfigEntity;
import io.datacater.core.config.ConfigUtilities;
Expand Down Expand Up @@ -41,7 +40,7 @@

@Path("/deployments")
@Authenticated
@Produces({MediaType.APPLICATION_JSON, YAMLMediaTypes.APPLICATION_JACKSON_YAML})
@Produces(MediaType.APPLICATION_JSON)
@SecurityRequirement(name = "apiToken")
@RequestScoped
public class DeploymentEndpoint {
Expand Down Expand Up @@ -167,7 +166,7 @@ public Uni<List<DeploymentEntity>> getDeployments() {
}

@POST
@Consumes({MediaType.APPLICATION_JSON, YAMLMediaTypes.APPLICATION_JACKSON_YAML})
@Consumes(MediaType.APPLICATION_JSON)
public Uni<DeploymentEntity> createDeployment(DeploymentSpec spec) {
DeploymentEntity de = new DeploymentEntity(spec);

Expand Down Expand Up @@ -253,7 +252,6 @@ public Uni<Response> deleteDeployment(@PathParam("uuid") UUID deploymentId) {

@PUT
@Path("{uuid}")
@Consumes({MediaType.APPLICATION_JSON, YAMLMediaTypes.APPLICATION_JACKSON_YAML})
public Uni<DeploymentEntity> updateDeployment(
@PathParam("uuid") UUID deploymentUuid, DeploymentSpec spec) {
return dsf.withTransaction(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ protected void setSpec(JsonNode spec) {
this.spec = spec;
}

public UUID getId() {
protected UUID getId() {
return this.id;
}

public JsonNode getSpec() {
protected JsonNode getSpec() {
return this.spec;
}

public JsonNode getConfigSelector() {
protected JsonNode getConfigSelector() {
return configSelector;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.datacater.core.info;

import com.fasterxml.jackson.jaxrs.yaml.YAMLMediaTypes;
import io.smallrye.mutiny.Uni;
import java.net.URI;
import javax.ws.rs.GET;
Expand All @@ -11,7 +10,7 @@
import javax.ws.rs.core.UriInfo;

@Path("/")
@Produces({MediaType.APPLICATION_JSON, YAMLMediaTypes.APPLICATION_JACKSON_YAML})
@Produces(MediaType.APPLICATION_JSON)
public class InfoEndpoint {

@GET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.jaxrs.yaml.YAMLMediaTypes;
import io.datacater.core.authentication.DataCaterSessionFactory;
import io.datacater.core.exceptions.DatacaterException;
import io.datacater.core.exceptions.PipelineNotFoundException;
Expand Down Expand Up @@ -43,7 +42,7 @@

@Path("/pipelines")
@Authenticated
@Produces({MediaType.APPLICATION_JSON, YAMLMediaTypes.APPLICATION_JACKSON_YAML})
@Produces(MediaType.APPLICATION_JSON)
@SecurityRequirement(name = "apiToken")
public class PipelineEndpoint {

Expand Down Expand Up @@ -76,7 +75,7 @@ public Uni<PipelineEntity> getPipeline(@PathParam("uuid") UUID uuid) {

@POST
@RequestBody
@Consumes({MediaType.APPLICATION_JSON, YAMLMediaTypes.APPLICATION_JACKSON_YAML})
@Consumes(MediaType.APPLICATION_JSON)
public Uni<PipelineEntity> createPipeline(Pipeline pipeline) throws JsonProcessingException {
PipelineEntity pe =
PipelineEntity.from(
Expand All @@ -89,7 +88,7 @@ public Uni<PipelineEntity> createPipeline(Pipeline pipeline) throws JsonProcessi
@PUT
@Path("{uuid}")
@RequestBody
@Consumes({MediaType.APPLICATION_JSON, YAMLMediaTypes.APPLICATION_JACKSON_YAML})
@Consumes(MediaType.APPLICATION_JSON)
public Uni<PipelineEntity> updatePipeline(@PathParam("uuid") UUID uuid, Pipeline pipeline) {
return dsf.withTransaction(
((session, transaction) ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package io.datacater.core.stream;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.jaxrs.yaml.YAMLMediaTypes;
import io.datacater.core.authentication.DataCaterSessionFactory;
import io.datacater.core.config.ConfigEntity;
import io.datacater.core.config.ConfigUtilities;
import io.datacater.core.exceptions.*;
import io.quarkus.security.Authenticated;
import io.smallrye.mutiny.Uni;
import java.util.List;
import java.util.UUID;
Expand All @@ -16,10 +16,13 @@
import javax.ws.rs.core.Response;
import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody;
import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement;
import org.jboss.logging.Logger;

@Path("/streams")
@Produces({MediaType.APPLICATION_JSON, YAMLMediaTypes.APPLICATION_JACKSON_YAML})
@Authenticated
@Produces(MediaType.APPLICATION_JSON)
@SecurityRequirement(name = "apiToken")
public class StreamEndpoint {
private static final Logger LOGGER = Logger.getLogger(StreamEndpoint.class);
private static final Integer KAFKA_API_TIMEOUT_MS =
Expand Down Expand Up @@ -55,7 +58,7 @@ public Uni<List<StreamEntity>> getStreams() {

@POST
@RequestBody
@Consumes({MediaType.APPLICATION_JSON, YAMLMediaTypes.APPLICATION_JACKSON_YAML})
@Consumes(MediaType.APPLICATION_JSON)
public Uni<Response> createStream(Stream stream) throws JsonProcessingException {
StreamEntity se = new StreamEntity(stream.name(), stream.spec(), stream.configSelector());
return dsf.withTransaction(
Expand All @@ -81,7 +84,7 @@ public Uni<Response> createStream(Stream stream) throws JsonProcessingException
@PUT
@Path("{uuid}")
@RequestBody
@Consumes({MediaType.APPLICATION_JSON, YAMLMediaTypes.APPLICATION_JACKSON_YAML})
@Consumes(MediaType.APPLICATION_JSON)
public Uni<StreamEntity> updateStream(@PathParam("uuid") UUID uuid, Stream stream) {

return dsf.withTransaction(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
import io.datacater.core.yamlTests.Utilities;
import io.quarkus.test.common.http.TestHTTPEndpoint;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.response.Response;
Expand All @@ -32,17 +30,6 @@ void testGetInfo() throws JsonProcessingException {
Assertions.assertEquals(expectedResponseCode, response.getStatusCode());
}

@Test
void testGetInfoAsYaml() throws JsonProcessingException {
final int expectedResponseCode = 200;
ObjectMapper mapper = new YAMLMapper();
response = given().header(Utilities.ACCEPT_YAML).get();
Info infoFromYaml = mapper.readValue(response.body().asString(), Info.class);

Assertions.assertEquals(expectedResponseCode, response.getStatusCode());
Assertions.assertNotNull(infoFromYaml);
}

@Test
void testStreamResourceInfo() {
Assertions.assertEquals(
Expand Down

This file was deleted.

Loading

0 comments on commit 51a87c3

Please sign in to comment.