[infinispan-issues] [JBoss JIRA] (ISPN-8535) Rest API redesign

Gustavo Fernandes (Jira) issues at jboss.org
Fri Dec 7 12:41:00 EST 2018


     [ https://issues.jboss.org/browse/ISPN-8535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gustavo Fernandes updated ISPN-8535:
------------------------------------
    Description: 
Infinispan REST API deals with only one resource, (the cache) and maps all operations on the cache using HTTP verbs and request parameters. The API assumes the URI is related to the cache making it hard to add new kinds of resources without causing ambiguous references. 

Since we now have other types of entities, such as counters, scripts, templates, etc,  and each one of them can involve different operations, we should make the API more "Restful" by using more than one resource and collections of resources, plus HTTP verbs and operations on them. Examples:

*  Create a cache: POST /rest/caches
*  Delete a cache: DELETE /rest/caches/myCache
*  Create a template: POST /rest/templates
*  Delete a template: DELETE /rest/templates/myTemplate
*  Create an entry: POST /rest/caches/myCache/1
*  Create a counter: POST /rest/counters
*  Get a counter value: GET /rest/counters/mycounter
*  Increment a counter: GET /rest/counters/mycounter?action=increment
*  Search a cache: GET /rest/caches/myCache?action=search
*  Create a script: POST /rest/scripts/
*  Get a script source: GET /rest/scritps/myScript
*  Execute a script: GET /rest/scripts/myScript?action=execute&param1=foo 
*  Stop individual servers and the full cluster

 

  was:
Infinispan REST API deals with only one resource, (the cache) and maps all operations on the cache using HTTP verbs and request parameters. The API assumes the URI is related to the cache making it hard to add new kinds of resources without causing ambiguous references. 

Since we now have other types of entities, such as counters, scripts, templates, etc,  and each one of them can involve different operations, we should make the API more "Restful" by using more than one resource and collections of resources, plus HTTP verbs and operations on them. Examples:

*  Create a cache: POST /rest/caches
*  Delete a cache: DELETE /rest/caches/myCache
*  Create a template: POST /rest/templates
*  Delete a template: DELETE /rest/templates/myTemplate
*  Create an entry: POST /rest/caches/myCache/1
*  Create a counter: POST /rest/counters
*  Get a counter value: GET /rest/counters/mycounter
*  Increment a counter: GET /rest/counters/mycounter?action=increment
*  Search a cache: GET /rest/caches/myCache?action=search
*  Create a script: POST /rest/scripts/
*  Get a script source: GET /rest/scritps/myScript
*  Execute a script: GET /rest/scripts/myScript?action=execute&param1=foo 

 



> Rest API redesign
> -----------------
>
>                 Key: ISPN-8535
>                 URL: https://issues.jboss.org/browse/ISPN-8535
>             Project: Infinispan
>          Issue Type: Enhancement
>          Components: Server
>    Affects Versions: 9.2.0.Final
>            Reporter: Gustavo Fernandes
>            Assignee: Gustavo Fernandes
>            Priority: Major
>             Fix For: 10.0.0.Final
>
>
> Infinispan REST API deals with only one resource, (the cache) and maps all operations on the cache using HTTP verbs and request parameters. The API assumes the URI is related to the cache making it hard to add new kinds of resources without causing ambiguous references. 
> Since we now have other types of entities, such as counters, scripts, templates, etc,  and each one of them can involve different operations, we should make the API more "Restful" by using more than one resource and collections of resources, plus HTTP verbs and operations on them. Examples:
> *  Create a cache: POST /rest/caches
> *  Delete a cache: DELETE /rest/caches/myCache
> *  Create a template: POST /rest/templates
> *  Delete a template: DELETE /rest/templates/myTemplate
> *  Create an entry: POST /rest/caches/myCache/1
> *  Create a counter: POST /rest/counters
> *  Get a counter value: GET /rest/counters/mycounter
> *  Increment a counter: GET /rest/counters/mycounter?action=increment
> *  Search a cache: GET /rest/caches/myCache?action=search
> *  Create a script: POST /rest/scripts/
> *  Get a script source: GET /rest/scritps/myScript
> *  Execute a script: GET /rest/scripts/myScript?action=execute&param1=foo 
> *  Stop individual servers and the full cluster
>  



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the infinispan-issues mailing list