Commit b4280820 authored by Federico Sismondi's avatar Federico Sismondi

Update() README, Add() files for contenerization of scripts

parent e510f465
......@@ -114,10 +114,18 @@ UPDATE|
cd naiades-platform-poc
docker-compose up -d
```
## Put platform down
```bash
cd naiades-platform-poc
docker-compose down
```
## Check services' status
```bash
>>> docker-compose ps
docker-compose ps
Name Command State Ports
-------------------------------------------------------------------------------------------------------------------------
......@@ -133,61 +141,6 @@ mongo-express tini -- /docker-entrypoint ... Up 0.
## Run demo using shell scripts in `scripts` folder
Let's start by looking at the type of REST requests used in the scripts:
```bash
cat 01_create_entity.sh
curl --location --request POST 'http://localhost:1026/v2/entities/' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-345",
"type": "FlowerBed",
"category": {
"type": "Property",
"value": ["urbanTreeSpot"]
},
"soilMoistureVwc": {
"type": "Property",
"value": 0.85
},
"dateLastWatering": {
"type": "DateTime",
"value": "2020-02-11T08:00:00Z"
},
"soilTemperature": {
"type": "Property",
"value": 17
},
"address": {
"type": "Property",
"value": {
"addressCountry": "Switzerland",
"streetAddress": "Place de Sardaigne",
"adressLocality": "Carouge",
"type": "PostalAddress"
}
},
"location": {
"type": "GeoProperty",
"value": {
"type": "Point",
"coordinates": [46.184255,6.1378375]
}
}
}'
```
Now, let's run the script:
```bash
cd scripts
./01_create_entity.sh
```
Please see `getting started` documentation at this [link](https://gitlab.distantaccess.com/naiades/naiades-platform-poc/-/wikis/API-client-examples-(curl-and-python-scripts))
## Put platform down
``` bash
cd naiades-platform-poc
docker-compose down
```
# This is for building docker images for running the scripts
FROM python:3.8-slim-buster
MAINTAINER Federico Sismondi <fsismondi@udgalliance.org>
RUN apt-get update
RUN mkdir /scripts
WORKDIR /scripts
COPY requirements.txt requirements.txt
RUN pip install --timeout 300 -r requirements.txt
COPY . /scripts
CMD ["echo", "please override this CMD with some .sh or .py script call"]
requests
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment