On 4/2/19 8:23 PM, William Cork via Tech-talk wrote:
> Hi All,
>
> I’m working on a softIOC that will make calls to a Monit daemon to restart and monitor services under Monit.
>
> Right now, I have the following pv structure (a wip):
>
> |test:Monit:localhost structure string host http://localhost:2812 int poll 120 structure[] services structure string name testService boolean monitored true int state 0 string type SERVICE epics:nt/NTEnum:1.0 action enum_t value int index 0 string[] choices ["none", "enable", "disable", "start", "stop", "restart"] |
>
> Is it possible to change an element in the nested services list with pvput, or are the immutable?
> |pvput test:Monit:localhost services='...'| may be the wrong syntax?
> More precisely, can I change services[index of service I care about].action = one of the action enums.
>
> Architecturally speaking, is it more ideal to have a bookkeeping PVArray that lists the provided services and individual PVs for each service?
Are you thinking to control this with a existing client application?
eg. an OPI client like cs-studio? I find that questions like this
are best approached by think from the prospective of a client.
What will a client want to do? What steps are involved?
Are there any issues of atomicity (eg. racing with other
clients). What configuration will a client need?
Now for the part for which I have a clear answer.
> pvput test:Monit:localhost services='...'
For the present the 'field=' syntax is limited to scalars and arrays of scalars.
It is possible to send an array of structures w/ pvput provided you're
building against Base >=3.15 (which includes a JSON parser). The syntax
is awkward though:
> $ pvput -h 2>&1|grep JSON
> JSON support is present
> Field values may be given with JSON syntax.
An empty array:
> pvput test:Monit:localhost '{"services":[]}'
One element with all default values.
> pvput test:Monit:localhost '{"services":[{}]}'
One element with one field having a non-default value.
> pvput test:Monit:localhost '{"services":[{"state":42}]}'
- Replies:
- Re: Nested PVStructureArray With pvput William Cork via Tech-talk
- References:
- Nested PVStructureArray With pvput William Cork via Tech-talk
- Navigate by Date:
- Prev:
Nested PVStructureArray With pvput William Cork via Tech-talk
- Next:
Re: Nested PVStructureArray With pvput William Cork 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
- Navigate by Thread:
- Prev:
Nested PVStructureArray With pvput William Cork via Tech-talk
- Next:
Re: Nested PVStructureArray With pvput William Cork 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
|