archiver-appliance / epicsarchiverap

This is an implementation of an archiver for EPICS control systems that aims to archive millions of PVs.
Other
41 stars 40 forks source link

getPVTypeInfo not consistently returning `hostName` key pair. #106

Open DanielALS opened 4 years ago

DanielALS commented 4 years ago

When I use a home grown Python client to query my Archiver Appliance, I get different key pairs for analog channels than I do for a boolean channel.

Here's my sample IPython terminal output:

Analog Channel

In [10]: log = logging.basicConfig(level=logging.DEBUG)                                                                                                                                                                                                                                                                                                                                                                       
In [11]: client.getPVTypeInfo("cmm:beam_current")                                                                                                                                                              
DEBUG:RestClient:URL built:/mgmt/bpl/getPVTypeInfo?pv=cmm%3Abeam_current                                                                                                                                       

Truncated Output Possibly Rearranged

{'DBRType': 'DBR_SCALAR_DOUBLE', 
'hasReducedDataSet': 'false',                                                                                                                                                                                  
'hostName': 'xxx.als.lbl.gov',                                                                                                                                                                              
'lowerAlarmLimit': 'NaN',                                                                                                                                                                                      
'lowerCtrlLimit': '0.0',                                                                                                                                                                                       
'lowerDisplayLimit': '0.0',                                                                                                                                                                                    
'lowerWarningLimit': 'NaN',                                                                                                                                                                                    
'modificationTime': '2020-10-06T18:57:38.651Z',          
'extraFields': {'ADEL': '0.0',                                                                                                                                                                                  
'MDEL': '0.0',                                                                                                                                                                                                 
'NAME': 'cmm:beam_current',                                                                                                                                                                                    
'RTYP': 'calc',                                                                                                                                                                                                
'SCAN': 'Passive'},`

Boolean Channel:

meta = client.getPVTypeInfo('BL0402:BL:OPKeyEnable')                                                                                                                                                  
DEBUG:RestClient:URL built:/mgmt/bpl/getPVTypeInfo?pv=BL0402%3ABL%3AOPKeyEnable                                                                                                                                                                        

Checking for Specific Key Pair

In [22]: meta['DBRType']                                                                                                                                                                                       
Out[22]: 'DBR_SCALAR_ENUM'                                                                                                                                                                                                                                                                                                                                                                                                    

In [23]: meta['hostName']                                                                                                                                                                                      
---------------------------------------------------------------------------                                                                                                                                    
KeyError                                  Traceback (most recent call last)                                                                                                                                    
<ipython-input-23-bbc911c41ab2> in <module>()                                                                                                                                                                  
----> 1 meta['hostName']                                                                                                                                                                                                                                                                                                                                                                                                      
KeyError: 'hostName'         

A few more details:

'extraFields': {'NAME': 'BL0402:BL:OPKeyEnable',                                                                                                                                                                
'RTYP': 'bi',                                                                                                                                                                                                  
'SCAN': 'I/O Intr'},               
DanielALS commented 4 years ago

Accidentally closed...no confirmation ??