Add some API scripts

main
jebba 2022-01-25 14:01:57 -07:00
parent 35cf344871
commit 731ddc2c0a
8 changed files with 71 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
.~lock.*#
*.swp
output.json

View File

@ -22,6 +22,11 @@ See `./scripts/` directory in this repo for current scripts.
Current scripts:
* `pysalx-api-config` --- Get analyzer configuration via API.
* `pysalx-api-id` --- Get analyzer ID via API.
* `pysalx-api-status` --- Get analyzer status via API.
* `pysalx-api-test` --- Do Analyzer test via API.
* `pysalx-api-wlcalibration` --- Get analyzer wavelength calibration via API.
* `pysalx-backup-export` --- Backup the export directory, with spectra from
templates.
* `pysalx-backup-extsd` --- Backup the ext SD card.

View File

@ -0,0 +1,11 @@
#!/bin/bash
# Acquire a sample via API
# XXX kruft
SCIAPSIP=`cat ~/.sciaps-ip`
SCIAPSPORT=`cat ~/.sciaps-port`
#curl -X POST -H "Content-Type: application/json" -d @settings.json --output output.json http://192.168.1.1:8080/api/v2/acquire/all?mode=Alloy
curl -X POST -H "Content-Type: application/json" -d @settings.json --output output.json http://$SCIAPSIP:$SCIAPSPORT/api/v2/acquire/all?mode=Alloy

View File

@ -0,0 +1,10 @@
#!/bin/bash
# Get Analyzer Configuration via API
# XXX kruft
SCIAPSIP=`cat ~/.sciaps-ip`
SCIAPSPORT=`cat ~/.sciaps-port`
curl \
http://$SCIAPSIP:$SCIAPSPORT/api/v2/config

View File

@ -0,0 +1,10 @@
#!/bin/bash
# Get Analyzer ID via API
# XXX kruft
SCIAPSIP=`cat ~/.sciaps-ip`
SCIAPSPORT=`cat ~/.sciaps-port`
curl \
http://$SCIAPSIP:$SCIAPSPORT/api/v2/id

View File

@ -0,0 +1,10 @@
#!/bin/bash
# Get Analyzer status via API
# XXX kruft
SCIAPSIP=`cat ~/.sciaps-ip`
SCIAPSPORT=`cat ~/.sciaps-port`
curl \
http://$SCIAPSIP:$SCIAPSPORT/api/v2/status

View File

@ -0,0 +1,14 @@
#!/bin/bash
# Do Analyzer test via API
# XXX kruft
SCIAPSIP=`cat ~/.sciaps-ip`
SCIAPSPORT=`cat ~/.sciaps-port`
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{}' \
--output output.json \
http://$SCIAPSIP:$SCIAPSPORT/api/v2/test

View File

@ -0,0 +1,10 @@
#!/bin/bash
# Get Analyzer wavelength calibration via API
# XXX kruft
SCIAPSIP=`cat ~/.sciaps-ip`
SCIAPSPORT=`cat ~/.sciaps-port`
curl \
http://$SCIAPSIP:$SCIAPSPORT/api/v2/wlcalibration