Skip to main content

system.kanoa.asset.addAsset

Description

Adds an asset

Syntax

addAsset(assetInfo, userId)

Parameters:
  • assetInfo (dict):
  • userId (int):

  • Returns:
  • assetId (int)
  • Dictionary

    ParameterTypeRequiredNotes
    assetNamestring
    parentIdint
    assetTypeIdint
    assetGroupIdint
    oeeTypestring i.e. 'OEE_Enabled' or None
    oeefloat Target
    afloat Target
    pfloat Target
    qfloat Target
    targetThresholdfloat Target +/- this value
    sortOrderint
    enabledbool
    timeZonestring i.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
    }
    assetId = system.kanoa.asset.addAsset(assetInfo, userId)
    print assetId
    >>> 2076