|
|
# D2.1 - general
|
|
|
|
|
|
The deliverable report describes the whole picture of the NOMAD database development status as of month 6.
|
|
|
|
|
|
Technical details going beyond this can be found here. This is supplementary information, thus this page is not exhaustive.
|
|
|
|
|
|
# Deliverable report
|
|
|
... submitted report will be downloadable here as soon as submitted
|
|
|
|
|
|
# Infrastructure setup
|
|
|
|
|
|
# Software implemented
|
|
|
## Mini-API
|
|
|
The API exposes to the GUI the following properties:
|
|
|
|
|
|
[List of data to be shown in the mini-GUI for the database - deliverable 2.1](https://gitlab.mpcdf.mpg.de/nomad-lab/encyclopedia-general/wikis/WM5-D2.1-mini-GUI-data)
|
|
|
|
|
|
Technologies used:
|
|
|
|
|
|
- *Python* programming language with *Flask* microframework is used to develop the RESTful API interface
|
|
|
- *Nginx* is used as web server. It is designed to serve high-load webservices and it also includes handy features like reverse-proxy, load-balancing, basic authentication which we will use/need in the future
|
|
|
- *Gunicorn* (Green Unicorn) is used as a WSGI server to serve our main Python application. It is the recommended choice for Python web applications
|
|
|
- *Supervisor* is used as a process manager. It provides a consistent interface through which long-running programs can be monitored and controlled
|
|
|
|
|
|
How to use the minimal API:
|
|
|
---------------------------
|
|
|
|
|
|
**Request**: GET
|
|
|
|
|
|
**URI**: /materials/search?element=ELEMENTS&page=PAGE-NUMBER&limit=ITEMS-PER-PAGE
|
|
|
|
|
|
**Parameters**:
|
|
|
|
|
|
- *element* - the elements for searching, separated by comma: eg. element=NH,C,Ba
|
|
|
|
|
|
- *page* - the number of page, 1 being the first page: eg. page=1
|
|
|
|
|
|
- *limit* - the number of entries shown on one page: eg. limit=25
|
|
|
|
|
|
**Note: all parameters are necessary!!!**
|
|
|
|
|
|
**Response**:
|
|
|
~~~
|
|
|
HTTP/1.0 200 OK
|
|
|
Content-Type: text/html; charset=utf-8
|
|
|
Content-Length: 1651
|
|
|
Access-Control-Allow-Origin: *
|
|
|
Access-Control-Allow-Methods: HEAD, GET
|
|
|
Access-Control-Max-Age: 21600
|
|
|
Access-Control-Allow-Credentials: true
|
|
|
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
|
|
|
Server: Werkzeug/0.11.3 Python/2.7.10
|
|
|
Date: Tue, 23 Feb 2016 08:55:33 GMT
|
|
|
|
|
|
[
|
|
|
{
|
|
|
"xc_treatment_basis": "PBE0",
|
|
|
"space_group": 216,
|
|
|
"nr_atoms": 77,
|
|
|
"code_name": "CRYSTAL09 2.0",
|
|
|
"basis_set_type": "plane waves",
|
|
|
"formula": "BaC<sub>5</sub>NH<sub>11</sub>SO<sub>2</sub>"
|
|
|
}
|
|
|
]
|
|
|
~~~
|
|
|
|
|
|
**Request example**:
|
|
|
|
|
|
$ curl -i http://localhost:5000/materials/search?element=NH,C,Ba'&'page=1'&'limit=3
|
|
|
|
|
|
**Response example**:
|
|
|
~~~
|
|
|
HTTP/1.0 200 OK
|
|
|
Content-Type: text/html; charset=utf-8
|
|
|
Content-Length: 679
|
|
|
Access-Control-Allow-Origin: *
|
|
|
Access-Control-Allow-Methods: HEAD, GET
|
|
|
Access-Control-Max-Age: 21600
|
|
|
Access-Control-Allow-Credentials: true
|
|
|
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
|
|
|
Server: Werkzeug/0.11.3 Python/2.7.10
|
|
|
Date: Thu, 25 Feb 2016 10:24:14 GMT
|
|
|
|
|
|
[
|
|
|
{
|
|
|
"xc_treatment_basis": "PBE0",
|
|
|
"space_group": 216,
|
|
|
"nr_atoms": 77,
|
|
|
"code_name": "CRYSTAL09 2.0",
|
|
|
"basis_set_type": "plane waves",
|
|
|
"formula": "BaC<sub>5</sub>NH<sub>11</sub>SO<sub>2</sub>"
|
|
|
},
|
|
|
{
|
|
|
"xc_treatment_basis": "PBE0",
|
|
|
"space_group": 216,
|
|
|
"nr_atoms": 19,
|
|
|
"code_name": "CRYSTAL09 2.0",
|
|
|
"basis_set_type": "plane waves",
|
|
|
"formula": "BaC<sub>5</sub>NH<sub>11</sub>SO<sub>2</sub>"
|
|
|
},
|
|
|
{
|
|
|
"xc_treatment_basis": "PBE0",
|
|
|
"space_group": 216,
|
|
|
"nr_atoms": 19,
|
|
|
"code_name": "CRYSTAL09 2.0",
|
|
|
"basis_set_type": "plane waves",
|
|
|
"formula": "BaC<sub>5</sub>NH<sub>11</sub>SO<sub>2</sub>"
|
|
|
}
|
|
|
]
|
|
|
~~~
|
|
|
|