Skip to main content

system.kanoa.asset.updateAsset

Description

Updates an asset.

Syntax

updateAsset(assetInfo, userId)

Parameters:
  • assetInfo (dict): Dictionary containing asset fields to update.
  • userId (int):

  • Returns:
  • assetId (int)
  • Dictionary

    ParameterTypeRequiredNotes
    assetIdint
    assetNamestring
    parentIdint
    assetTypeIdint
    assetGroupIdint
    oeeTypestringi.e. 'OEE_Enabled' or None
    oeefloatTarget
    afloatTarget
    pfloatTarget
    qfloatTarget
    targetThresholdfloatTarget +/- this value
    sortOrderint
    enabledbool
    timeZonestringi.e. 'Pacific Standard Time'. Only needed at the site level

    Code Examples

    userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
    assetTypeId = system.kanoa.utilities.getFieldValue('assetTypeId', system.kanoa.asset.getAssetTypes({'assetTypeName': 'enterprise'}))
    assetInfo = {
    'assetName': 'New Enterprise',
    'parentId': None,
    'assetTypeId': 1,
    'assetGroupId': None,
    'oeeType': None,
    'oee': None,
    'a': None,
    'p': None,
    'q': None,
    'targetThreshold': None,
    'sortOrder': 1,
    'enabled': True,
    'timeZone': None
    }
    retVal = system.kanoa.asset.updateAsset(assetInfo, userId)
    print retVal
    >>> 1