Skip to main content

system.kanoa.asset.addState

This function requires KanoaOPS module

Description

Add a state to the state table (kanoaOPS).

Syntax

addState(stateInfo, userId)
  • Parameters
      stateInfo (dict) - Dictionary i.e., {'stateName': 'Running', 'stateColor': None, 'stateCategoryId': 1, 'stateTypeId': 3, 'assetGroupId': None, 'enabled': True}
      userId (int) - User ID.
  • Returns
      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)