You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by ma...@apache.org on 2015/12/03 17:40:13 UTC
syncope git commit: RESTful reference, SYNCOPE-700
Repository: syncope
Updated Branches:
refs/heads/master 85843f77c -> cfce9b9f3
RESTful reference, SYNCOPE-700
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/cfce9b9f
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/cfce9b9f
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/cfce9b9f
Branch: refs/heads/master
Commit: cfce9b9f3a1b0aaac2fb607953add73078ccd74f
Parents: 85843f7
Author: massi <ma...@tirasa.net>
Authored: Thu Dec 3 17:39:39 2015 +0100
Committer: massi <ma...@tirasa.net>
Committed: Thu Dec 3 17:39:50 2015 +0100
----------------------------------------------------------------------
.../asciidoc/images/restReferenceLoggerRead.png | Bin 0 -> 68071 bytes
.../images/restReferenceLoggerUpdate.png | Bin 0 -> 63936 bytes
.../images/restSchemaReferenceLogger.png | Bin 0 -> 203689 bytes
src/main/asciidoc/images/swaggerLoggerRead.png | Bin 0 -> 98491 bytes
.../restfulservices/client-library.adoc | 16 ++++-
.../restfulservices/restful-reference.adoc | 62 +++++++++++++++++++
.../restfulservices/restful-services.adoc | 9 +++
7 files changed, 86 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/cfce9b9f/src/main/asciidoc/images/restReferenceLoggerRead.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/restReferenceLoggerRead.png b/src/main/asciidoc/images/restReferenceLoggerRead.png
new file mode 100644
index 0000000..b9c0152
Binary files /dev/null and b/src/main/asciidoc/images/restReferenceLoggerRead.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/cfce9b9f/src/main/asciidoc/images/restReferenceLoggerUpdate.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/restReferenceLoggerUpdate.png b/src/main/asciidoc/images/restReferenceLoggerUpdate.png
new file mode 100644
index 0000000..58ac593
Binary files /dev/null and b/src/main/asciidoc/images/restReferenceLoggerUpdate.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/cfce9b9f/src/main/asciidoc/images/restSchemaReferenceLogger.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/restSchemaReferenceLogger.png b/src/main/asciidoc/images/restSchemaReferenceLogger.png
new file mode 100644
index 0000000..44b85a6
Binary files /dev/null and b/src/main/asciidoc/images/restSchemaReferenceLogger.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/cfce9b9f/src/main/asciidoc/images/swaggerLoggerRead.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/swaggerLoggerRead.png b/src/main/asciidoc/images/swaggerLoggerRead.png
new file mode 100644
index 0000000..0861665
Binary files /dev/null and b/src/main/asciidoc/images/swaggerLoggerRead.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/cfce9b9f/src/main/asciidoc/restfulservices/client-library.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/restfulservices/client-library.adoc b/src/main/asciidoc/restfulservices/client-library.adoc
index dfcfaac..9831b2e 100644
--- a/src/main/asciidoc/restfulservices/client-library.adoc
+++ b/src/main/asciidoc/restfulservices/client-library.adoc
@@ -43,4 +43,18 @@ SyncopeClient client = new SyncopeClientFactoryBean().
and you get enabled for any kind of REST service interaction with Apache Syncope.
You can read the http://syncope.apache.org/apidocs/1.2/org/apache/syncope/common/services/package-summary.html[javadoc]
-page for a documented list of available REST services in Apache Syncope.
\ No newline at end of file
+page for a documented list of available REST services in Apache Syncope.
+
+===== Usage example
+Below a snippet that shows how to use the SyncopeClient to update the logger configuration.
+[source,java]
+----
+SyncopeClient client = new SyncopeClientFactoryBean().
+ setAddress("http://localhost:9080/syncope/rest/").
+ create("admin", "password");
+LoggerService loggerService = client.getService(LoggerService.class);
+
+LoggerTO loggerTO = loggerService.read(LoggerType.LOG, "org.apache.syncope.core.connid");
+loggerTO.setLevel(LoggerLevel.DEBUG);
+loggerService.update(LoggerType.LOG, loggerTO);
+----
http://git-wip-us.apache.org/repos/asf/syncope/blob/cfce9b9f/src/main/asciidoc/restfulservices/restful-reference.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/restfulservices/restful-reference.adoc b/src/main/asciidoc/restfulservices/restful-reference.adoc
new file mode 100644
index 0000000..73bcf83
--- /dev/null
+++ b/src/main/asciidoc/restfulservices/restful-reference.adoc
@@ -0,0 +1,62 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+==== RESTful reference
+If you want to read from the complete descriptive REST reference the URL you need is
+[source]
+--
+http://localhost:9080/syncope/
+--
+where you can see all the REST resources with their description, the parameters and the reference to the schema,
+so you are able to see which attributes and which type are needed to the every service.
+Following the same example as before, below two images to show the REST resources of the logger service and another one
+for the reference to the schema:
+
+image::restReferenceLoggerRead.png[restReferenceLoggerRead]
+
+image::restReferenceLoggerUpdate.png[restReferenceLoggerUpdate]
+
+image::restSchemaReferenceLogger.png[restSchemaReferenceLogger]
+
+===== Swagger UI
+From the 2.0 version, Syncope offers also the Swagger UI to work with its services.
+The swagger interface is available going to the URL
+[source]
+--
+http://localhost:9080/syncope/swagger/#/
+--
+
+Reading from the Swagger http://swagger.io/[website]
+
+.Swagger
+****
+Swagger is a simple yet powerful representation of your RESTful API. With the largest ecosystem of API tooling on
+the planet, thousands of developers are supporting Swagger in almost every modern programming language and deployment
+environment. With a Swagger-enabled API, you get interactive documentation, client SDK generation and discoverability.
+
+We created Swagger to help fulfill the promise of APIs. Swagger helps companies like Apigee, Getty Images, Intuit,
+LivingSocial, McKesson, Microsoft, Morningstar, and PayPal build the best possible services with RESTful APIs.
+
+Now in version 2.0, Swagger is more enabling than ever. And it's 100% open source software.
+
+****
+
+To be consistent with the example, below the image shows the Swagger UI used to read the configuration
+of _org.apache.syncope.core.rest_
+
+image::swaggerLoggerRead.png[swaggerLoggerRead]
http://git-wip-us.apache.org/repos/asf/syncope/blob/cfce9b9f/src/main/asciidoc/restfulservices/restful-services.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/restfulservices/restful-services.adoc b/src/main/asciidoc/restfulservices/restful-services.adoc
index 0e6b2b0..758bb74 100644
--- a/src/main/asciidoc/restfulservices/restful-services.adoc
+++ b/src/main/asciidoc/restfulservices/restful-services.adoc
@@ -17,5 +17,14 @@
// under the License.
//
=== RESTful services
+The RESTful services is the way how the Syncope core web application receives the input from the clients.
+This layer, developed in http://cxf.apache.org/docs/jax-rs.html[Apache CXF 2.0], is usually reachable under the
+root context of the deployment.
+[source]
+--
+http://localhost:9080/syncope/rest
+--
+
+include::restful-reference.adoc[]
include::client-library.adoc[]
\ No newline at end of file