Search in sources :

Example 1 with Integration

use of io.kaoto.backend.model.deployment.Integration in project kaoto-backend by KaotoIO.

the class ClusterService method getIntegrations.

public List<Integration> getIntegrations() {
    List<Integration> res = new ArrayList<>();
    try {
        final var resources = kubernetesClient.resources(KameletBinding.class).list().getItems();
        for (KameletBinding integration : resources) {
            Integration i = new Integration();
            i.setName(integration.getMetadata().getName());
            i.setRunning(true);
            i.setResource(integration);
            res.add(i);
        }
    } catch (Exception e) {
        log.warn("Error extracting the list of integrations.", e);
    }
    return res;
}
Also used : Integration(io.kaoto.backend.model.deployment.Integration) ArrayList(java.util.ArrayList) KameletBinding(io.kaoto.backend.model.deployment.kamelet.KameletBinding) ConstructorException(org.yaml.snakeyaml.constructor.ConstructorException)

Example 2 with Integration

use of io.kaoto.backend.model.deployment.Integration in project kaoto-backend by KaotoIO.

the class IntegrationResource method integrations.

/*
     * 🐱method stop: String
     *
     * Stops and deletes an integration by name
     */
@DELETE
@Produces(MediaType.APPLICATION_JSON)
@Path("/{name}")
@Operation(summary = "Stop/Remove integration", description = "Remove the integration identified by name.")
public boolean integrations(@Parameter(description = "Name of the integration to stop.") @PathParam("name") final String name) {
    Integration i = new Integration();
    i.setName(name);
    return clusterService.stop(i);
}
Also used : Integration(io.kaoto.backend.model.deployment.Integration) Path(javax.ws.rs.Path) DELETE(javax.ws.rs.DELETE) Produces(javax.ws.rs.Produces) Operation(org.eclipse.microprofile.openapi.annotations.Operation)

Aggregations

Integration (io.kaoto.backend.model.deployment.Integration)2 KameletBinding (io.kaoto.backend.model.deployment.kamelet.KameletBinding)1 ArrayList (java.util.ArrayList)1 DELETE (javax.ws.rs.DELETE)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 Operation (org.eclipse.microprofile.openapi.annotations.Operation)1 ConstructorException (org.yaml.snakeyaml.constructor.ConstructorException)1