code: @POST
     @Consumes(MediaType.APPLICATION_JSON)
     @RolesAllowed("administrators")
     @Path("/create-repository")
     public Response createRepository(@Context UriInfo uriInfo, RepositoryEntry newRepository) throws URISyntaxException
     {
        String errorMessage = new String();
        Status status;
        try
        {
           repositoryService.createRepository(newRepository);
           repositoryService.getConfig().retain(); // save configuration to persistence (file or persister)
           return Response.ok().cacheControl(NO_CACHE).build();
        }
        catch (RepositoryException e)
        {
           if (log.isDebugEnabled())
           {
              log.error(e.getMessage(), e);
           }
           errorMessage = e.getMessage();
           status = Status.BAD_REQUEST;
        }
        catch (RepositoryConfigurationException e)
        {
           if (log.isDebugEnabled())
           {
              log.error(e.getMessage(), e);
           }
           errorMessage = e.getMessage();
           status = Status.BAD_REQUEST;
        }
        catch (Throwable e) //NOSONAR
        {
           if (log.isDebugEnabled())
           {
              log.error(e.getMessage(), e);
           }
           errorMessage = e.getMessage();
           status = Status.INTERNAL_SERVER_ERROR;
        }
  
        return Response.status(status).entity(errorMessage).type(MediaType.TEXT_PLAIN_TYPE).cacheControl(NO_CACHE)
           .build();
     }
docs: Creates a repository based on the given repository configuration
  
  @param uriInfo the uri location
  @param newRepository the configuration of the new repository
  @return Response return the Response
  @throws URISyntaxException will be generated the URISyntaxException
  @request
  {code:json}
  {"newRepository": the configuration of the new repository }
  {code}
  @LevelAPI Experimental