Code Monkey home page Code Monkey logo

sisi's Introduction

Sisi

Simple SIMPLON API client

Motivation

DECTRIS EIGER(2) detectors are controlled via a rest-like API (SIMPLON API). Sisi provides a simple CLI tool written in golang that can be cross-compiled and used as standalone executable on different platforms:

Real motivation

I have a terribly hard time remembering CURL commands... See the examples for comparison.

Usage

Tell Sisi if she should get, set, or do anything for you. Be friendly and say 'please'.

Usage:
sisi <ip> get <module> <param> <key> [-a <api> -t <timeout> please -p <port>]
sisi <ip> set <module> <param> <key> <value> [-a <api> -t <timeout> please -p <port>]
sisi <ip> do <module> <task> [-a <api> -t <timeout> please -p <port>]
sisi -h | --help

Options:
-p <port>	  API port [default: 80]
-a <api>      API version [default: 1.8.0]
-t <timeout>  request timeout in seconds [default: 5]
-h --help     Show this help screen.
please        just being friendly, optionally `

Examples

enable the filewriter interface

sisi 169.254.254.1 set filewriter config mode enabled

result

PUT http://169.254.254.1/filewriter/api/1.8.0/config/mode {"value":"enabled"} 200 OK 302.285724ms

the same in CURL

curl -X PUT -H "Content-Type: application/json" -d "{\"value\":\"enabled\"}" http://169.254.254.1/filewriter/api/1.6.0/config/mode

set the number of images to acquire with api 1.6.0

sisi 169.254.254.1 set detector config nimages 5 -a 1.6.0 please

result

PUT http://169.254.254.1/detector/api/1.6.0/config/nimages {"value":5} 200 OK 181.394583ms
  "nimages"
You're weclome!

the same in CURL

curl -X PUT -H "Content-Type: application/json" -d "{\"value\":5}"
http://169.254.254.1/detector/api/1.6.0/config/nimages

arm detector

sisi 169.254.254.1 do detector arm

result

PUT http://169.254.254.1/detector/api/1.8.0/command/arm  200 OK 669.908552ms
  "sequence id":14

the same in CURL

curl -X PUT http://169.254.254.1/detector/api/1.6.0/command/arm

sisi's People

Contributors

saschaandresgrimm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.