Class Configuration
java.lang.Object
org.gcube.resourcemanagement.rest.BaseREST
org.gcube.resourcemanagement.rest.administration.Admin
org.gcube.resourcemanagement.rest.administration.Configuration
The Resource Manager configuration for the context of the request
(i.e. the context where the token has been generated).
Only Managers are able to invoke non-safe methods.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe path for configurations endpointsstatic final StringThe path parameter for context full namestatic final StringThe path parameter for current contextFields inherited from class org.gcube.resourcemanagement.rest.administration.Admin
ADMIN_PATHFields inherited from class org.gcube.resourcemanagement.rest.BaseREST
APPLICATION_JSON_API, APPLICATION_JSON_CHARSET_UTF_8, COUNT_KEY, httpHeaders, LOCATION_HEADER, PURGE_QUERY_PARAMETER, uriInfo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcheckContext(String context) Check and validate the context parameterjakarta.ws.rs.core.ResponseThis API allows to create the Resource Manager configuration for the context of the request (i.e.createOrUpdate(String context, String json) This API allows to create/update the Resource Manager configuration for the context of the request (i.e.jakarta.ws.rs.core.Responsedelete()Remove the Resource Manager configuration from cache and force reloadjakarta.ws.rs.core.ResponseIt removes from the cache the Resource Manager configuration for the context of the request (i.e.jakarta.ws.rs.core.ResponsePatch the configuration for the current contextjakarta.ws.rs.core.ResponseThis API allows to patch the Resource Manager configuration for the context of the request (i.e.jakarta.ws.rs.core.Responsepurge()Remove the configuration from cache and from ISjakarta.ws.rs.core.ResponseIt removes remove the Resource Manager configuration from the IS for the context of the request (i.e.jakarta.ws.rs.core.Responseread()Read the configuration for the current contextjakarta.ws.rs.core.ResponseThis API allows to read the Resource Manager configuration for the specified context.jakarta.ws.rs.core.ResponseUpdate the configuration for the current contextMethods inherited from class org.gcube.resourcemanagement.rest.BaseREST
addLocation, createCountJson, setAccountingMethod
-
Field Details
-
CONFIGURATIONS_PATH
The path for configurations endpoints- See Also:
-
CURRENT_CONTEXT_PATH_PARAMETER
The path parameter for current context- See Also:
-
CONTEXT_FULLNAME_PARAMETER
The path parameter for context full name- See Also:
-
-
Constructor Details
-
Configuration
public Configuration()
-
-
Method Details
-
checkContext
Check and validate the context parameter- Parameters:
context- the context string to validate- Returns:
- the validated context string
- Throws:
jakarta.xml.ws.WebServiceException- if the context is invalid
-
create
@POST @Consumes("application/json;charset=UTF-8") @Produces("application/json;charset=UTF-8") public jakarta.ws.rs.core.Response create(String json) throws jakarta.xml.ws.WebServiceException This API allows to create the Resource Manager configuration for the context of the request (i.e. the context where the token has been generated) using the json provided as request body.- Parameters:
json- the configuration data in JSON format- Returns:
- Response indicating the result of the creation operation
- Throws:
jakarta.xml.ws.WebServiceException- if the configuration creation fails
-
read
@GET @Path("/{CONTEXT_FULLNAME_PARAMETER}") @Produces("application/json;charset=UTF-8") public jakarta.ws.rs.core.Response read(@PathParam("CONTEXT_FULLNAME_PARAMETER") String context) throws jakarta.xml.ws.WebServiceException This API allows to read the Resource Manager configuration for the specified context.- Parameters:
context- the context for which to read the configuration- Returns:
- Response containing the configuration data
- Throws:
jakarta.xml.ws.WebServiceException- if reading the configuration fails
-
read
public jakarta.ws.rs.core.Response read() throws jakarta.xml.ws.WebServiceExceptionRead the configuration for the current context- Returns:
- Response containing the configuration data for the current context
- Throws:
jakarta.xml.ws.WebServiceException- if reading fails
-
createOrUpdate
@PUT @Path("/{CONTEXT_FULLNAME_PARAMETER}") @Consumes("application/json;charset=UTF-8") @Produces("application/json;charset=UTF-8") public String createOrUpdate(@PathParam("CONTEXT_FULLNAME_PARAMETER") String context, String json) throws jakarta.xml.ws.WebServiceException This API allows to create/update the Resource Manager configuration for the context of the request (i.e. the context where the token has been generated) using the json provided as request body.- Parameters:
context- the target context for the configurationjson- the configuration data in JSON format- Returns:
- the updated configuration as JSON string
- Throws:
jakarta.xml.ws.WebServiceException- if the operation fails
-
update
Update the configuration for the current context- Parameters:
json- the configuration data in JSON format- Returns:
- Response containing the updated configuration
- Throws:
jakarta.xml.ws.WebServiceException- if the update fails
-
patch
@PATCH @Path("/{CONTEXT_FULLNAME_PARAMETER}") @Consumes("application/json;charset=UTF-8") @Produces("application/json;charset=UTF-8") public jakarta.ws.rs.core.Response patch(@PathParam("CONTEXT_FULLNAME_PARAMETER") String context, String json) throws jakarta.xml.ws.WebServiceException This API allows to patch the Resource Manager configuration for the context of the request (i.e. the context where the token has been generated) using the json provided as request body.- Parameters:
context- the target context for the configurationjson- the patch data in JSON format- Returns:
- Response containing the patched configuration
- Throws:
jakarta.xml.ws.WebServiceException- if the patch operation fails
-
patch
Patch the configuration for the current context- Parameters:
json- the patch data in JSON format- Returns:
- Response containing the patched configuration
- Throws:
jakarta.xml.ws.WebServiceException- if the patch operation fails
-
delete
@DELETE @Path("/{CONTEXT_FULLNAME_PARAMETER}") public jakarta.ws.rs.core.Response delete(@PathParam("CONTEXT_FULLNAME_PARAMETER") String context, @QueryParam("purge") @DefaultValue("false") Boolean purge) throws jakarta.xml.ws.WebServiceException It removes from the cache the Resource Manager configuration for the context of the request (i.e. the context where the token has been generated).
This API forces the service to read again from the Information System (IS) the Resource Manager configuration for the context of the request.
If the user specifies thepurgequery parameter this API remove the configuration from the IS. Please note that this implies that the Resource Manager is no more configured for the context of the request.- Parameters:
context- context must contains the context of the request (i.e. the context where the token has been generated) or the placeholderCURRENT_CONTEXT.
Please note that the context must be URL encoded, e.g. /gcube/devsec/devVRE -> %2Fgcube%2Fdevsec%2FdevVREpurge- indicates to the service to remove the configuration from the IS- Returns:
- Response indicating the result of the delete operation
- Throws:
jakarta.xml.ws.WebServiceException- if the delete operation fails
-
delete
public jakarta.ws.rs.core.Response delete() throws jakarta.xml.ws.WebServiceExceptionRemove the Resource Manager configuration from cache and force reload- Returns:
- Response indicating the result of the delete operation
- Throws:
jakarta.xml.ws.WebServiceException- if the delete operation fails
-
purge
@Path("/{CONTEXT_FULLNAME_PARAMETER}") public jakarta.ws.rs.core.Response purge(@PathParam("CONTEXT_FULLNAME_PARAMETER") String context) throws jakarta.xml.ws.WebServiceException It removes remove the Resource Manager configuration from the IS for the context of the request (i.e. the context where the token has been generated).
Please note that this implies that the resource manager is no more configured for the context of the request.- Parameters:
context- context must contains the context of the request (i.e. the context where the token has been generated) or the placeholderCURRENT_CONTEXT.
Please note that the context must be URL encoded, e.g. /gcube/devsec/devVRE -> %2Fgcube%2Fdevsec%2FdevVRE- Returns:
- Response indicating the result of the purge operation
- Throws:
jakarta.xml.ws.WebServiceException- if the purge operation fails
-
purge
public jakarta.ws.rs.core.Response purge() throws jakarta.xml.ws.WebServiceExceptionRemove the configuration from cache and from IS- Returns:
- Response indicating the result of the purge operation
- Throws:
jakarta.xml.ws.WebServiceException- if the purge operation fails
-