@Path("admin/configurations") public class Configuration extends Admin
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 Details

    • CONFIGURATIONS_PATH

      public static final String CONFIGURATIONS_PATH
      The path for configurations endpoints
      See Also:
    • CURRENT_CONTEXT_PATH_PARAMETER

      public static final String CURRENT_CONTEXT_PATH_PARAMETER
      The path parameter for current context
      See Also:
    • CONTEXT_FULLNAME_PARAMETER

      public static final String CONTEXT_FULLNAME_PARAMETER
      The path parameter for context full name
      See Also:
  • Constructor Details

    • Configuration

      public Configuration()
  • Method Details

    • checkContext

      protected String checkContext(String context) throws jakarta.xml.ws.WebServiceException
      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.WebServiceException
      Read 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 configuration
      json - the configuration data in JSON format
      Returns:
      the updated configuration as JSON string
      Throws:
      jakarta.xml.ws.WebServiceException - if the operation fails
    • update

      public jakarta.ws.rs.core.Response update(String json) throws jakarta.xml.ws.WebServiceException
      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 configuration
      json - the patch data in JSON format
      Returns:
      Response containing the patched configuration
      Throws:
      jakarta.xml.ws.WebServiceException - if the patch operation fails
    • patch

      public jakarta.ws.rs.core.Response patch(String json) throws jakarta.xml.ws.WebServiceException
      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 the purge query 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 placeholder CURRENT_CONTEXT.
      Please note that the context must be URL encoded, e.g. /gcube/devsec/devVRE -> %2Fgcube%2Fdevsec%2FdevVRE
      purge - 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.WebServiceException
      Remove 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 placeholder CURRENT_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.WebServiceException
      Remove 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