Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/api formbackend management #3617

Merged
merged 5 commits into from
Nov 12, 2024

Conversation

thoniTUB
Copy link
Collaborator

@thoniTUB thoniTUB commented Nov 8, 2024

uses openapi spec to define endpoints

@thoniTUB
Copy link
Collaborator Author

Ich habe einen Issue bei dw aufgemacht und versuche ein Workaround zu implementieren: dropwizard/dropwizard#9612

@thoniTUB thoniTUB marked this pull request as ready for review November 11, 2024 13:01
Comment on lines 19 to 24
try {
managerNode.getFormScanner().execute(null, null);
}
catch (Exception e) {
throw new RuntimeException(e);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRY?

// Workaround to remove metrics (see https://github.com/dropwizard/dropwizard/issues/9612)
ConfiguredCloseableHttpClient internalHttpClient = conqueryClientBuilder.getHttpClient();
if (internalHttpClient != null) {
internalHttpClient.getClient().close();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frage mich hier ob du damit nicht alle clients schließt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Der InterneClient ist exclusiv für jeden JerseyClient, den man Instanziiert

@@ -9,4 +9,6 @@
public interface PluginConfig {

default void initialize(ManagerNode managerNode){}

default void deinitialize(){}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

close()?

<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/openapi/admin-openapi.json</inputSpec>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wo benutzt du die Klassen die hiermit konfiguriert werden?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Es wird dieses Interface generiert:

/**
* Represents a collection of functions to interact with the API endpoints.
*/
@Path("/config/plugins/form-backend")
@Api(description = "the config API")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", date = "2024-11-08T16:19:10.432789300+01:00[Europe/Berlin]", comments = "Generator version: 7.9.0")
public interface ConfigApi {

    /**
     * 
     *
     * @param configId 
     * @return successful operation
     */
    @DELETE
    @Path("/{configId}")
    @Produces({ "*/*" })
    @ApiOperation(value = "unegister form backend configuration", notes = "", tags={ "plugin" })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "successful operation", response = String.class) })
    String deleteFormBackend(@PathParam("configId") String configId);


    /**
     * 
     *
     * @return successful operation
     */
    @GET
    @Produces({ "application/json" })
    @ApiOperation(value = "lists all registered form backend configurations", notes = "", tags={ "plugin" })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "successful operation", response = String.class, responseContainer = "List") })
    List<String> listFormBackends();


    /**
     * 
     *
     * @param pluginConfig 
     * @return successful operation
     */
    @POST
    @Consumes({ "application/json" })
    @Produces({ "application/json" })
    @ApiOperation(value = "adds a form backend configurations", notes = "", tags={ "plugin" })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "successful operation", response = String.class) })
    String registerFormBackend(@Valid @NotNull FormBackendConfig pluginConfig);

}

Und ich habe es hiermit implementiert backend/src/main/java/com/bakdata/conquery/resources/admin/rest/ConfigApiResource.java

@thoniTUB thoniTUB merged commit e0dc145 into develop Nov 12, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants