Hi,
I haven't used this, but this C++ library seems easy to use for this kind of task:
https://docs.libcpr.org/introduction.html
Or, if you want to stick to a Python solution I can also recommend PyDevice:
https://github.com/klemenv/PyDevice
Cheers,
Matt
-----Original Message-----
From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Sean Leavey via Tech-talk
Sent: Friday, October 28, 2022 9:16 AM
To: Mark Rivers <rivers at cars.uchicago.edu>; tech-talk at aps.anl.gov
Subject: [EXTERNAL] Re: Grabbing data from REST API
Hi Mark,
I had hoped to avoid implementing REST client code myself! It'd be cool if there were a module that could map REST API endpoints (and probably some template for extracting the value from the returned HTTP body) to records.
I think if implementing my own client ends up being the only way (short of writing a REST client module described above - I'm not ready to tackle that yet), I'd rather use this driver that I alluded to in my first email and implement the client code in Python:
https://github.com/paulscherrerinstitute/asynPythonDriver
Cheers,
Sean
On 28/10/2022 13:46, Mark Rivers wrote:
> Hi Sean,
>
> The Eiger detectors from Dectris use the REST API. This is the code
> that is used to communicate with them from EPICS.
>
> https://github.com/areaDetector/ADEiger/blob/master/eigerApp/src/restA
> pi.cpp
> <https://github.com/areaDetector/ADEiger/blob/master/eigerApp/src/rest
> Api.cpp>
>
> Mark
>
> ----------------------------------------------------------------------
> --
> *From:* Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Sean
> Leavey via Tech-talk <tech-talk at aps.anl.gov>
> *Sent:* Friday, October 28, 2022 7:22 AM
> *To:* tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
> *Subject:* Grabbing data from REST API Hi all,
>
> I've got a sensor that provides its measurements via a REST API. I saw
> on the mailing list in 2017
> (https://epics.anl.gov/tech-talk/2017/msg01698.php
> <https://epics.anl.gov/tech-talk/2017/msg01698.php>) there was a
> message about writing a generic REST client module for EPICS and
> wondered if anything came about from this. If not, does anyone have a
> suggestion how to talk REST via EPICS? I remember seeing a module that
> allowed the IOC to call out to a Python script, where I could
> implement the REST part, but I wondered if there's something a bit
> more focused on this particular task available already as an EPICS module.
>
> Cheers,
> Sean
>
> This email and any attachments are intended solely for the use of the
> named recipients. If you are not the intended recipient you must not
> use, disclose, copy or distribute this email or any of its attachments
> and should notify the sender immediately and delete this email from
> your system. UK Research and Innovation (UKRI) has taken every
> reasonable precaution to minimise risk of this email or any
> attachments containing viruses or malware but the recipient should
> carry out its own virus and malware checks before opening the
> attachments. UKRI does not accept any liability for any losses or
> damages which the recipient may sustain due to presence of any viruses.
This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify the sender immediately and delete this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own virus and malware checks before opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses.
- References:
- Grabbing data from REST API Sean Leavey via Tech-talk
- Re: Grabbing data from REST API Mark Rivers via Tech-talk
- Re: Grabbing data from REST API Sean Leavey via Tech-talk
- Navigate by Date:
- Prev:
Re: Missing DLL entry points in PV utils on windows-x64-mingw? Michael Davidsaver via Tech-talk
- Next:
Software Engineer Position at APS Shen, Guobao via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
<2022>
2023
2024
2025
- Navigate by Thread:
- Prev:
Re: Grabbing data from REST API Sean Leavey via Tech-talk
- Next:
Software Engineer Position at APS Shen, Guobao via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
<2022>
2023
2024
2025
|