Skip to content
Snippets Groups Projects
Commit c404831e authored by Marco Del Tufo's avatar Marco Del Tufo
Browse files

Update as-services.md

parent 47fe6ad2
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -11,9 +11,9 @@ Often only access on AS is needed. Going over DSS is a detour. For such cases it ...@@ -11,9 +11,9 @@ Often only access on AS is needed. Going over DSS is a detour. For such cases it
Here is the recipe to create an AS core plugin of type `services`: Here is the recipe to create an AS core plugin of type `services`:
1. The folder `<core plugin folder>/<module>/<version>/as/services/<core plugin name>` has to be created. 1. The folder `<core plugin folder>/<module>/<version>/as/services/<core plugin name>` has to be created.
2. In this folder two files have to be created: `plugin.properties` and `script.py`. The properties file should contain: 2. In this folder two files have to be created: `plugin.properties` and `script.py`. The properties file should contain:
**plugin.properties** **plugin.properties**
...@@ -22,7 +22,7 @@ Here is the recipe to create an AS core plugin of type `services`: ...@@ -22,7 +22,7 @@ Here is the recipe to create an AS core plugin of type `services`:
script-path = script.py script-path = script.py
``` ```
3. The script file should have the function `process` with two arguments. The first argument is the context. It contains the methods `getSessionToken()` and `getApplicationService()` which returns an instance of `ch.ethz.sis.openbis.generic.asapi.v3.IApplicationServerApi`. The second argument is a map of key-value pairs. The key is a string and the values is an arbitrary object. Anything returned by the script will be returned to the caller of the service. Here is an example of a script which creates a space: 3. The script file should have the function `process` with two arguments. The first argument is the context. It contains the methods `getSessionToken()` and `getApplicationService()` which returns an instance of `ch.ethz.sis.openbis.generic.asapi.v3.IApplicationServerApi`. The second argument is a map of key-value pairs. The key is a string and the values is an arbitrary object. Anything returned by the script will be returned to the caller of the service. Here is an example of a script which creates a space:
**script.py** **script.py**
```py ```py
from ch.ethz.sis.openbis.generic.asapi.v3.dto.space.create import SpaceCreation from ch.ethz.sis.openbis.generic.asapi.v3.dto.space.create import SpaceCreation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment