Solution
To update the Retention of a SystemLink Tag using the Python API you can use the the TagManager.update
method. This takes in either the TagData
object to update every property on the server, or a TagDataUpdate
object that lets you update only the retention. See the following example for more details:
from nisystemlink.clients.tag import DataType, RetentionType, TagDataUpdate, TagManager, TagUpdateFields
mgr = TagManager()
tag = mgr.open("MyTags.Example Tag", DataType.DOUBLE, create=True)
tag.retention_type = RetentionType.COUNT
tag.retention_count = 10
update = TagDataUpdate.from_tagdata(tag, TagUpdateFields.RETENTION)
mgr.update([update])