Skip to content

Add support for software field

Damien Lacoste requested to merge add_support_for_software_and_machine_fields into main

This allows to set the software field in the message sent. And makes the instrumentname optional, as we do not need it all the time.

For example this call:

client = IcatElogbookClient(
    "https://...", type="broadcast", source="ebs", tags=["testtag", "machine"], software="defaultsoft"
)
client.send_message(
    "mycontent", category="comment", tags=["commenttag"], software="mysoft"
)

sends this message

{'apikey': ...,
 'category': 'comment',
 'content': [{'format': 'plainText', 'text': 'mycontent'}],
 'creationDate': '2022-05-13T14:56:05.063887',
 'machine': '....esrf.fr',
 'software': 'mysoft',
 'source': 'ebs',
 'tags': [{'name': 'testtag'}, {'name': 'machine'}, {'name': 'commenttag'}],
 'type': 'broadcast'}
Edited by Wout De Nolf

Merge request reports

Loading