I would like to disable/enable the audit profile on Ignition edge.
I do not find anything to do that directly in SDK.
Perhaps I need to use 8.3.8 new system.config API ?
Ultimately, you need to write an enabled: false value into the resource's attributes.
Are you trying to do this from a custom module, or in a scripting environment?
From a scripting environment
Then yes, this is absolutely possible with system.config. Something like this:
moduleId="ignition"
typeId="audit-profile"
name="MyAuditProfile"
existing = system.config.getResource(moduleId=moduleId, typeId=typeId, name=name)
if existing is None:
throw ValueError("No such resource: %s/%s/%s" % (moduleId, typeId, name))
system.config.replace(
moduleId=moduleId,
typeId=typeId,
name=name,
signature=existing.signature,
enabled=not existing.enabled,
files=existing.files
)
Thanks a lot. I think we will have lots of usecase for the new system.config API !
I suppose that system.config.replace trigger the listener for settings changed in the IA audit module which is immediatly aware of the new settings ?
no need to execute some gateway rescan.
Correct. Just like the REST API, config changes here affect the in-memory model immediately, and are then synced to disk.