06-02-2022 04:13 PM
Background: I'm trying to do some Asset Management where I have SystemLink detect whether a device is "connected" to the client machine or not. I have custom logic to determine if the device is connected or not, but I'm unable to make this Asset show up on the SystemLink web app.
Using this API, but for some reason the Salt Minion won't pick up my .json file. The asset file content is shown below.
{
"assets": [
{
"assetName": "Test device",
"serialNumber": 123123,
"modelName": "Device Model 1",
"vendorName": "Acme",
}
]
}
Not sure if the API is relevant or not anymore, any help would be appreciated.
Solved! Go to Solution.
06-03-2022 11:34 AM
Your JSON is invalid because it has a trailing comma after "Acme" and the serialNumber has to be a string instead of an int.
06-03-2022 03:32 PM
Thanks, that seems to do the trick.
I'm also having a hard time understanding how the SystemLink determines if a custom asset is "in use" or "disconnected". So far it seems like deleting the json file will get the minion to disconnect the asset, but modifications of the json file won't. I'm also not really sure how to tell SystemLink that the device is still connected, but isn't in use.
Are we suppose to be making an json file for each asset? Is there any documentation on these behaviors?
06-06-2022 09:08 AM
There is a Windows tray application that out of the box will mark every asset in the system as in use the moment a user logs into the system either locally or over remote desktop with the utilization type set to Configuration. You can modify the SL tray application to not automatically mark all of the assets in use and instead use the LV, .NET, Python or HTTP to programmatically set when and which assets are in use.
06-07-2022 04:50 PM
Thanks, can you send a link to the .NET or HTTP API on how to programmatically setting it?
Using the System Tray is a bit buggy and I'm getting scenarios like this (Note one of my device is disconnected, but it's in use?).
06-08-2022 12:38 PM
Here is a link to the .NET API documentation.
https://www.ni.com/docs/en-US/bundle/systemlink-2021-r3-api-overview/page/net-api-reference.html
To view the HTTP documentation for any of the APIs just click on the ? in the top right-hand corner of any SL web interface and then select "HTTP API" to open up the Swagger documentation. You switch between different APIs by using the drop-down on the top right.
https://www.ni.com/docs/en-US/bundle/systemlink-2021-r3-api-overview/page/http-api-reference.html