RE: [CONF] Apache Syncope REST API upgrade

2013-02-20 Thread Jan Bernhardt
Hi Syncoper,

Here are some more best practices for RESTful APIs.

Use PUT if you want to persist an entity as it is. Use POST from any kind of 
processes.

Hence I would recommend to change:
PUT /connectors/reload

To

POST /connectors/reload

Best regards.
Jan

From: conflue...@apache.org [mailto:conflue...@apache.org]
Sent: Mittwoch, 20. Februar 2013 12:34
To: Jan Bernhardt
Subject: [CONF] Apache Syncope  REST API upgrade

REST API 
upgradehttps://cwiki.apache.org/confluence/display/SYNCOPE/REST+API+upgrade
Page edited by Francesco 
Chicchiriccohttps://cwiki.apache.org/confluence/display/~ilgrosso

Changes (2)
...

| GET /connector/\{connectorId\}/configurationProperty/list | GET 
/connectors/\{connectorId\}/configuration | Returns configuration for selected 
connector. |
| POST /connector/check | POST /connectors/check | Checks if a connection can 
be established. |

| GET /connector/\{resourceName\}/connectorBean 
/connector/\{resourceName\}/readByResource | GET 
/connectors;resourceName=\{connectorId\} | Returns connector for resourceName. |

| PUT /connector/reload | PUT /connectors/reload | Reload all connector bundles 
and instances. |


h2. Entitlement Service

...

Full Content
[https://cwiki.apache.org/confluence/images/icons/emoticons/warning.gif]

Version warning
In Syncope 1.1.0 a new REST interface was introduced (referred as new in the 
following).
The REST interface available in 1.0.X (referred as old in the following) is 
still present but will be removed from releases = 1.2.0.

This page shall give you an overview of old and new REST API.

  *   Configuration Service
  *   Connector Service
  *   Entitlement Service
  *   Logger Service
  *   Notification Service
  *   Policy Service
  *   Report Service
  *   Resource Service
  *   Role Service
  *   Schema Service
  *   Task Service
  *   User Service
  *   UserRequest Service
  *   Workflow Service
Main focus on redesign REST interface was to apply RESTful Best 
Practiceshttp://www.slideshare.net/calamitas/restful-best-practices

  *   use HTTP operations instead of URL encoded operation names
  *   GET does not modify any object (read-only safety operation)
  *   PUT and DELETE are idempotent operations
[*]   PUT and DELETE do not return (old) object any longer, except for 
Roles and Users, since they contain propagation status information

  *   CREATE operations return location URL in header for newly created object
[*]   In addition to that unique identifier of resource is also send in 
response header (org.apache.syncope.resource.id)
While redesigning interface, we also made changes to exception 
handlinghttps://cwiki.apache.org/confluence/display/SYNCOPE/Remote+Exceptions.
Configuration Service
Old URL

New URL

Comment

POST /configuration/create

POST /configurations

Creates a new Configuration.

GET /configuration/read/{key}

GET /configurations/{key}

Returns configuration element with matching key.

GET /configuration/list

GET /configurations

Returns a list of all configuration elements.

POST /configuration/update

PUT /configurations/{key}

Overwrites configuration element with matching key.

GET /configuration/delete/{key}

DELETE /configurations/{key}

Deletes configuration with matching key.

Old URL

New URL

Comment

GET /configuration/validators

GET /configurations/validators

Returns a list of known validators.

GET /configuration/mailTemplates

GET /configurations/mailTemplates

Returns a list of known mail-templates.

GET /configuration/dbexport

GET /configurations/dbDump

Returns configuration as an downloadable content.xml database export file.

Connector Service
Old URL

New URL

Comment

POST /connector/create

POST /connectors

Creates a new connector instance.

GET /connector/read/{connectorId}

GET /connectors/{connectorId}

Returns connector with matching id.

GET /connector/list?lang={lang}

GET /connectors?lang={lang}

Returns a list of all connectors. Default language is English.

POST /connector/update

PUT /connectors/{connectorId}

Overwrites connector with matching key.

GET /connector/delete/{connectorId}

DELETE /connectors/{connectorId}

Deletes connector with matching id.

Old URL

New URL

Comment

GET /connector/bundle/list?lang={lang}

GET /connectors/bundles?lang={lang}

Returns known bundles. Default language is English.

POST /connector/schema/list?showall={showall}

POST /connectors/{connectorId}/schemas?showAll={showall}

Returns schema names for connector. Default is showAll=false.

GET /connector/{connectorId}/configurationProperty/list

GET /connectors/{connectorId}/configuration

Returns configuration for selected connector.

POST /connector/check

POST /connectors/check

Checks if a connection can be established.

GET /connector/{resourceName}/readByResource

GET /connectors;resourceName={connectorId}

Returns connector for resourceName.

PUT /connector/reload

PUT /connectors/reload

Reload all connector bundles and instances.

Entitlement Service
Old URL

New URL


Re: [CONF] Apache Syncope REST API upgrade

2013-02-20 Thread Francesco Chicchiriccò

On 20/02/2013 15:13, Jan Bernhardt wrote:

Hi Syncoper,

Here are some more best practices for RESTful APIs.

Use PUT if you want to persist an entity as it is. Use POST from any kind of 
processes.

Hence I would recommend to change:
PUT /connectors/reload

To

POST /connectors/reload


Hi Jan, thanks for reporting.

I'll do this right away.

Regards.

--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/



Re: [CONF] Apache Syncope REST API upgrade

2013-02-20 Thread Francesco Chicchiriccò

On 20/02/2013 15:15, Francesco Chicchiriccò wrote:

On 20/02/2013 15:13, Jan Bernhardt wrote:

Hi Syncoper,

Here are some more best practices for RESTful APIs.

Use PUT if you want to persist an entity as it is. Use POST from any 
kind of processes.


Hence I would recommend to change:
PUT /connectors/reload

To

POST /connectors/reload


Hi Jan, thanks for reporting.

I'll do this right away.


Done.

Regards.

--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/