Skip to content
Snippets Groups Projects
Commit 08419168 authored by Rolf Niepraschk's avatar Rolf Niepraschk
Browse files

"supplyCouchdbJSON" --> "accessGitFS"

parent ee79fc03
Branches
Tags
No related merge requests found
# supplyCouchdbJSON
# accessGitFS
## install & activate
```shell
mkdir -p /usr/local/share/supplyCouchdbJSON
cd /usr/local/share/supplyCouchdbJSON
curl --silent --output - \
https://gitlab1.ptb.de/niepra01/supplyCouchdbJSON/-/archive/master/supplyCouchdbJSON-master.tar \
mkdir -p /usr/local/share/accessGitFS
cd /usr/local/share/accessGitFS
curl --silent --insecure --output - \
https://a75436.berlin.ptb.de/rolf.niepraschk/accessGitFS/-/archive/master/accessGitFS-master.tar \
| tar xf - --strip-components=1 # only once
sudo zypper in python3-pip-tools # Ubuntu: apt install python3-pip-tools
sudo zypper in python3-pip # Ubuntu: sudo apt install python3-pip
python3 -m venv .
source bin/activate
pip3 install pip-tools
pip-compile --output-file=requirements.txt requirements.in
pip3 install -r requirements.txt
chown -R nobody.nobody $PWD # Ubuntu: chown -R nobody.nogroup $PWD
systemctl daemon-reload # if already exist
systemctl link $PWD/supplyCouchdbJSON.service
systemctl enable supplyCouchdbJSON.service # make permanent
systemctl start supplyCouchdbJSON.service
systemctl status supplyCouchdbJSON.service # running?
journalctl -f --unit supplyCouchdbJSON.service # run-time check
systemctl link $PWD/accessGitFS.service
systemctl enable accessGitFS.service # make permanent
systemctl start accessGitFS.service
systemctl status accessGitFS.service # running?
journalctl -f --unit accessGitFS.service # run-time check
```
## api
### supplyCouchdbJSON/dates (GET)
### accessGitFS/dates (GET)
Returns a JSON file with an array of all date directories within the GitFS
mount area.
```
curl -s http://localhost:5301/supplyCouchdbJSON/dates > theDates.json
curl -s http://localhost:5301/accessGitFS/dates > theDates.json
```
### supplyCouchdbJSON/times/YYYY-mm-dd (GET)
### accessGitFS/times/YYYY-mm-dd (GET)
Returns a JSON file with an array of all time directories within the GitFS
mount area matching the specified date.
```
curl -s http://localhost:5301/supplyCouchdbJSON/times/2020-02-05 > theTimes.json
curl -s http://localhost:5301/accessGitFS/times/2020-02-05 > theTimes.json
```
### supplyCouchdbJSON/file/YYYY-mm-dd/HH-MM-SS-XXXXXXXXXX/xyz.json (GET)
### accessGitFS/file/YYYY-mm-dd/HH-MM-SS-XXXXXXXXXX/xyz.json (GET)
Returns the version of a file with the specified commit date.
```
curl -s http://localhost:5301/supplyCouchdbJSON/file/2020-02-05/09-49-04-9da869dfa9/000_SERVERS.json \
curl -s http://localhost:5301/accessGitFS/file/2020-02-05/09-49-04-9da869dfa9/000_SERVERS.json \
> 000_SERVERS.json
```
......
......@@ -25,17 +25,17 @@ def getDirs(root):
pass
return dirs
@app.route('/supplyCouchdbJSON/dates', methods=['GET'])
@app.route('/accessGitFS/dates', methods=['GET'])
def getDates():
dirs = getDirs(gitfs_dir)
return jsonify({'dates':dirs})
@app.route('/supplyCouchdbJSON/times/<date>', methods=['GET'])
@app.route('/accessGitFS/times/<date>', methods=['GET'])
def getTimes(date):
dirs = getDirs(os.path.join(gitfs_dir, date, ''))
return jsonify({'times':dirs})
@app.route('/supplyCouchdbJSON/file/<date>/<time>/<filename>', methods=['GET'])
@app.route('/accessGitFS/file/<date>/<time>/<filename>', methods=['GET'])
def getFile(date, time, filename):
path = os.path.join(gitfs_dir, date, time)
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment