Add some API scripts
parent
35cf344871
commit
731ddc2c0a
|
@ -1,2 +1,3 @@
|
||||||
.~lock.*#
|
.~lock.*#
|
||||||
*.swp
|
*.swp
|
||||||
|
output.json
|
||||||
|
|
|
@ -22,6 +22,11 @@ See `./scripts/` directory in this repo for current scripts.
|
||||||
|
|
||||||
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
|
* `pysalx-backup-export` --- Backup the export directory, with spectra from
|
||||||
templates.
|
templates.
|
||||||
* `pysalx-backup-extsd` --- Backup the ext SD card.
|
* `pysalx-backup-extsd` --- Backup the ext SD card.
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue