gcat/docs/index.rst

81 lines
2.4 KiB
ReStructuredText
Raw Normal View History

2022-09-13 17:28:21 +02:00
.. Social Service Client documentation master file, created by
sphinx-quickstart on Tue Aug 2 16:11:12 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to gCat documentation!
=================================================
gCat is a RESTful application which exposes operations ...
See the available REST-API on `its API docs <../api-docs/index.html>`_.
Base URL
==================
2022-09-13 17:36:05 +02:00
In the production environment, its current value is https://api.d4science.org/gcat
2022-09-13 17:28:21 +02:00
Authorization
==================
D4Science adopts state-of-the-art industry standards for authentication and authorization.
Specifically, the implementation fully adopts `OIDC (OpenID Connect) <https://openid.net/connect>`_ for authentication and UMA 2 (User Managed Authorization) for authorization flows.
`JSON Web Token (JWT) Access token <https://jwt.io/>`_ are used for both authentication and authorization.
Obtain your Bearer token here: https://dev.d4science.org/how-to-access-resources
Java Client
==================
The methods of the Web Service can be called by writing your own REST client application or by using already existing REST client plugins. We provide the following Java Client out-of-the-box.
.. TIP::
If you're coding in Java it is recommended that you use this Java Client.
**Maven Coordinates**
.. code:: xml
<groupId>org.gcube.data-catalogue</groupId>
<artifactId>gcat-client</artifactId>
2022-09-13 17:36:05 +02:00
<version>[2.2.0, 3.0.0-SNAPSHOT)</version>
2022-09-13 17:28:21 +02:00
**Methods Result**
2022-09-13 17:44:16 +02:00
The service exposes `its methods <../api-docs/index.html>`_ using a standard naming approach. Moreover, they accept (in case of http POST/PUT methods) JSON objects.
2022-09-13 17:28:21 +02:00
.. IMPORTANT::
The result of all methods is always a JSON object as per below:
.. code:: javascript
{
"success": false/true,
"message": ...,
"result": ...,
}
Where
- success reports if the request succeeded or failed;
- message is a status/error message that can be checked in case of errors (success equals false);
- result is the current result object (it can be a list, a single object and so on depending on the invoked method).
*Inputs are automatically validated before the request is served.*
**Usage examples**
- Example 1
.. code:: java
import org.gcube.gcat.client.Item;
// count item number
Item item = new Item();
int count = item.count();
...