Class AgamaDeploymentsResource


  • @Path("/agama-deployment")
    @Produces("application/json")
    public class AgamaDeploymentsResource
    extends ConfigBaseResource
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      jakarta.ws.rs.core.Response deploy​(String projectName, String autoconfigure, byte[] gamaBinary)
      Uploads an Agama project ZIP and queues a deployment task, adding or replacing the project on the server.
      jakarta.ws.rs.core.Response getConfigs​(String projectName)
      Retrieve configurations for flows that belong to the specified project.
      jakarta.ws.rs.core.Response getDeployment​(String projectName)
      Retrieve details of a single Agama deployment by project name.
      jakarta.ws.rs.core.Response getDeployments​(int start, int count)
      Retrieve a paged list of currently deployed Agama projects.
      jakarta.ws.rs.core.Response setConfigs​(String projectName, Map<String,​Map<String,​Object>> flowsConfigs)
      Replace configurations for flows that belong to the specified Agama project.
      jakarta.ws.rs.core.Response undeploy​(String projectName)
      Undeploys the named Agama project from the server.
      • Methods inherited from class io.jans.configapi.core.rest.BaseResource

        checkNotEmpty, checkNotEmpty, checkNotNull, checkNotNull, checkNotNull, checkResourceNotNull, createSearchRequest, findRootError, getBadRequestException, getBadRequestException, getBadRequestException, getHttpHeaders, getHttpRequest, getInternalServerException, getInternalServerException, getMissingAttributeError, getNotAcceptableException, getNotFoundError, getNotFoundError, getUriInfo, throwBadRequestException, throwBadRequestException, throwBadRequestException, throwInternalServerException, throwInternalServerException, throwInternalServerException, throwInternalServerException, throwMissingAttributeError, throwNotFoundException, throwNotFoundException
    • Constructor Detail

      • AgamaDeploymentsResource

        public AgamaDeploymentsResource()
    • Method Detail

      • getDeployments

        @GET
        @Produces("application/json")
        public jakarta.ws.rs.core.Response getDeployments​(@QueryParam("start")
                                                          int start,
                                                          @QueryParam("count")
                                                          int count)
        Retrieve a paged list of currently deployed Agama projects.
        Parameters:
        start - the zero-based start index for the returned page
        count - the maximum number of results to return; when less than or equal to zero a server-configured default is used
        Returns:
        a Response whose entity is a PagedResult containing the requested page of deployments; returned Deployment entries have internal folder details removed
      • getDeployment

        @GET
        @Produces("application/json")
        @Path("/{name}")
        public jakarta.ws.rs.core.Response getDeployment​(@PathParam("name")
                                                         String projectName)
        Retrieve details of a single Agama deployment by project name.
        Parameters:
        projectName - the Agama project name
        Returns:
        a Response containing HTTP 200 with the Deployment when found; HTTP 204 when the deployment exists but is not yet finished; HTTP 404 when the project is unknown
      • deploy

        @POST
        @Consumes("application/zip")
        @Path("/{name}")
        public jakarta.ws.rs.core.Response deploy​(@PathParam("name")
                                                  String projectName,
                                                  @QueryParam("autoconfigure")
                                                  String autoconfigure,
                                                  byte[] gamaBinary)
        Uploads an Agama project ZIP and queues a deployment task, adding or replacing the project on the server.
        Parameters:
        projectName - the name of the Agama project
        autoconfigure - a string parsable as boolean; `"true"` enables automatic post-deployment configuration
        gamaBinary - the raw bytes of the project ZIP (application/zip)
        Returns:
        a Response with: - 202 Accepted when a deployment task was queued, - 400 Bad Request when project name or binary data is missing, - 409 Conflict when there is an active deployment task for the project
      • undeploy

        @DELETE
        @Path("/{name}")
        public jakarta.ws.rs.core.Response undeploy​(@PathParam("name")
                                                    String projectName)
        Undeploys the named Agama project from the server.
        Parameters:
        projectName - the name of the Agama project to undeploy
        Returns:
        `204 No Content` if undeployment succeeded; `404 Not Found` if the project does not exist; `409 Conflict` if the project is currently being deployed; `500 Internal Server Error` for unexpected server errors
      • getConfigs

        @GET
        @Path("/configs/{name}")
        public jakarta.ws.rs.core.Response getConfigs​(@PathParam("name")
                                                      String projectName)
        Retrieve configurations for flows that belong to the specified project. The project must be fully processed. The response body is a JSON string that maps each flow's qualified name to its configuration properties; flows that do not exist or have no properties are omitted.
        Parameters:
        projectName - the Agama project name
        Returns:
        a JSON string representing a mapping from flow qualified names to their configuration property maps
      • setConfigs

        @PUT
        @Consumes("application/json")
        @Path("/configs/{name}")
        public jakarta.ws.rs.core.Response setConfigs​(@PathParam("name")
                                                      String projectName,
                                                      Map<String,​Map<String,​Object>> flowsConfigs)
        Replace configurations for flows that belong to the specified Agama project.
        Parameters:
        projectName - the Agama project name
        flowsConfigs - a mapping from flow qualified name to a map of configuration properties (property name -> value)
        Returns:
        a map from flow qualified name to `true` if that flow's configuration was successfully updated, `false` otherwise