system.kanoa.asset.addAsset
Description
Adds an assetSyntax
addAsset(assetInfo, userId)Parameters:
Returns:
Dictionary
| Parameter | Type | Required | Notes | 
|---|---|---|---|
| assetName | string | ||
| parentId | int | ||
| assetTypeId | int | ||
| assetGroupId | int | ||
| oeeType | string | i.e. 'OEE_Enabled' or None | |
| oee | float | Target | |
| a | float | Target | |
| p | float | Target | |
| q | float | Target | |
| targetThreshold | float | Target +/- this value | |
| sortOrder | int | ||
| enabled | bool | ||
| timeZone | string | 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, msg = system.kanoa.asset.addAsset(assetInfo, userId)
print assetId, msg
>>> 2076, None