system.kanoa.asset.updateAsset(assetInfo, userId)
Updates an asset. . All assetInfo keys are required
Parameters
assetInfo Dictionary
| - a | Float | Threshold settings to display 'Good' indicator |
| - assetGroupId | Integer | Id of asset group. Can be none |
| - assetId | Integer | Id of asset to update |
| - assetName | String | Name of asset |
| - assetTypeId | Integer | If of asset type |
| - enabled | Boolean | |
| - oee | Float | Threshold settings to display 'Good, Warning and Bad' indicators |
| - oeeType | String | Set to 'OEE_Enabled' if stae and count data will be collected for this asset. |
| - p | Float | Threshold settings to display 'Good,' indicator |
| - parentId | Integer | Id of parent asset. Can be none |
| - q | Float | Threshold settings to display 'Good' indicator |
| - sortOrder | Integer | |
| - targetThreshold | Float | Sets the threshold to determine 'Warning and Bad' indicator |
| - timeZone | String | i.e 'Pacific Standard Time'. Only needed at the site level |
userId Integer: Id of user executing the function
Returns
# of records modified Integer
message String None if success
Example
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, msg = system.kanoa.asset.updateAsset(assetInfo, userId)
print retVal, msg
>>> 1, None