java.lang.Object
org.gcube.resourcemanagement.rest.BaseREST
org.gcube.resourcemanagement.rest.vremodelling.PlanManager

@Path("plans") public class PlanManager extends BaseREST
This class is used to manage context plans. When a new context is created a plan is provided to the Resource Manager. The plan is a list of actions that the Resource Manager interprets to: - add resources to context; - create new instances (e.g. Virtual Services, IsRelatedTo relations); - execute actions on resources (e.g. run the provisioning of a service).
Author:
Luca Frosini (ISTI - CNR)
  • Field Details

    • PLANS_PATH_PART

      public static final String PLANS_PATH_PART
      The path part for plans endpoints
      See Also:
    • PLAN_UUID_PATH_PARAMETER

      public static final String PLAN_UUID_PATH_PARAMETER
      The path parameter for plan UUID
      See Also:
  • Constructor Details

    • PlanManager

      public PlanManager()
      Default constructor for PlanManager
  • Method Details

    • list

      @GET @Produces("application/json;charset=UTF-8") public String list() throws jakarta.ws.rs.WebApplicationException
      Allow listing defined plans eventually with filters (pending, completed, failed) GET /plans e.g. GET /plans
      Returns:
      JSON array containing the list of plans
      Throws:
      jakarta.ws.rs.WebApplicationException - if the request is invalid
    • read

      @GET @Path("{PLAN_UUID}") @Produces("application/json;charset=UTF-8") public String read(@PathParam("PLAN_UUID") String uuid) throws jakarta.ws.rs.WebApplicationException
      Allow reading the plan definition GET /plans/{UUID} e.g. GET /plans/c0f314e7-2807-4241-a792-2a6c79ed4fd0
      Parameters:
      uuid - the UUID of the plan to read
      Returns:
      the plan definition as JSON string
      Throws:
      jakarta.ws.rs.WebApplicationException - if the request is invalid
    • create

      @PUT @Path("{PLAN_UUID}") @Produces("application/json;charset=UTF-8") public String create(@PathParam("PLAN_UUID") String uuid, String json) throws jakarta.ws.rs.WebApplicationException
      Create or update a plan definition PUT /plans/{UUID} e.g. PUT /plans/c0f314e7-2807-4241-a792-2a6c79ed4fd0 Body: {} It returns the UUID of the plan
      Parameters:
      uuid - the UUID of the plan to create/update
      json - the plan definition in JSON format
      Returns:
      the UUID of the created/updated plan
      Throws:
      jakarta.ws.rs.WebApplicationException - if the request is invalid
    • execute

      @POST @Path("{PLAN_UUID}") @Produces("application/json;charset=UTF-8") public String execute(@PathParam("PLAN_UUID") String uuid, String json) throws jakarta.ws.rs.WebApplicationException
      Allow executing a plan POST /plans/{UUID}
      Parameters:
      uuid - the UUID of the plan to execute
      json - the execution parameters in JSON format
      Returns:
      the execution results as JSON string
      Throws:
      jakarta.ws.rs.WebApplicationException - if the request is invalid