Asset Actor Commands
Asset commands are methods applied to Assets with the applyCommands message. Valid Asset commands and their actions are:
| addActivityLog | Adds an activity log to an Asset |
| addTag | Adds a tag to an Asset |
| createItem | Adds a new Asset Item to a Asset |
| createItemRelation | Adds a new graph node relation to a Asset Item |
| createRelation | Adds a new graph node relation to a Asset |
| deleteItem | Removes an Asset Item from an Asset |
| deleteItemRelation | Removes a graph node relation from a Asset Item |
| deleteRelation | Removes a graph node relation from a Asset |
| generateAssetNumberByPrefix | Generates an asset number for an Asset based on the given prefix |
| removeTag | Removes a tag from an Asset |
| setDynamicFields | Sets dynamic fields of an asset. Non specified fields will be left unchanged. Set value to null to remove field. |
| setItemDynamicFields | Sets dynamic fields of an asset item. Non specified fields will be left unchanged. Set value to null to remove field. |
All commands are batch processed. Therefore, if one command in a batch fails, all commands fail.
To apply a command to an asset, send a request with the following format. See applyCommands for a specific example.
POST https://<hantera-hostname>/resources/actors/asset/<ASSET ID>Authorization: Bearer <YOUR TOKEN>Content-Type: application/json
[{ "type": "applyCommands", "body": { "commands": [ ] }}]curl -i -X POST \ https://<hantera-hostname>/resources/actors/asset/<ASSET ID> \ -H 'Authorization: Bearer <YOUR TOKEN>' \ -H 'Content-Type: application/json' \ -d '[{ "type": "applyCommands", "body": { "commands": [ ] }}]'Invoke-WebRequest `-Uri "https://<hantera-hostname>/resources/actors/asset/<ASSET ID>" `-Method POST `-Headers @{Authorization="Bearer <YOUR TOKEN>"; 'Content-Type'="application/json"} `-Body '[{ "type": "applyCommands", "body": { "commands": [ ] }}]'