system.kanoa.asset.addState
Description
Add a state to the state table (kanoaOPS).Syntax
addState(stateInfo, userId)- stateInfo (dict) - Dictionary i.e., {'stateName': 'Running', 'stateColor': None, 'stateCategoryId': 1, 'stateTypeId': 3, 'assetGroupId': None, 'enabled': True}
- userId (int) - User ID.
- stateId (int) - ID of the added state.
Code Examples
# Example Usage:
state_info = {
'stateName': 'NewState',
'stateCategoryId': 1,
'stateTypeId': 1,
'assetGroupId': 1,
'enabled': True
}
user_id = 456
state_id = system.kanoa.asset.addState(state_info, user_id)