Class PlanManager
java.lang.Object
org.gcube.resourcemanagement.rest.BaseREST
org.gcube.resourcemanagement.rest.vremodelling.PlanManager
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe path parameter for plan UUIDstatic final StringThe path part for plans endpointsFields inherited from class org.gcube.resourcemanagement.rest.BaseREST
APPLICATION_JSON_API, APPLICATION_JSON_CHARSET_UTF_8, COUNT_KEY, httpHeaders, LOCATION_HEADER, logger, PURGE_QUERY_PARAMETER, uriInfo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate or update a plan definition PUT /plans/{UUID} e.g.Allow executing a plan POST /plans/{UUID}list()Allow listing defined plans eventually with filters (pending, completed, failed) GET /plans e.g.Allow reading the plan definition GET /plans/{UUID} e.g.Methods inherited from class org.gcube.resourcemanagement.rest.BaseREST
addLocation, createCountJson, setAccountingMethod
-
Field Details
-
PLANS_PATH_PART
The path part for plans endpoints- See Also:
-
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.WebApplicationExceptionAllow 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/updatejson- 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 executejson- the execution parameters in JSON format- Returns:
- the execution results as JSON string
- Throws:
jakarta.ws.rs.WebApplicationException- if the request is invalid
-