Written by Andrew Pasika
In Kaa, assets typically represent physical or logical entities. For example, an asset can represent a vehicle, field, room, building, etc. The main responsibility of assets is to represent an entity that cannot be represented by an endpoint and to establish hierarchical relationships between assets itself, or between assets and endpoints.
Each asset has a type. Before an asset can be created, its asset type must exist.
Each asset type has a name and a definition JSON schema.
The name represents the type of the asset, for example, VEHICLE
.
The definition JSON schema defines the structure by which all assets of that type will be created.
In other words, definition JSON schema defines a set of fields that all assets of that type will have.
Consider an example of the definition JSON schema for the VEHICLE
asset type.
{
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Name"
},
"vin": {
"type": "string",
"title": "VIN"
},
"licensePlate": {
"type": "string",
"title": "License Plate"
}
},
"required": [
"name",
"vin",
"licensePlate"
]
}
This JSON schema means that all assets must have a Name, License Plate, and VIN.
To create an asset type, go to Asset Management -> Asset types, and click Add asset type.
Define your asset type and click Create.
Once an asset type is created, you can create an asset of that type.
Go to Asset Management -> Assets, select the asset type from the dropdown, and click Add asset. Fill out the form generated based on the definition JSON schema and click Create.
Asset Relations allow you to establish relationships between assets and endpoints.
To specify the behavior of an asset relation, you can use a relation type.
There are next relation types: CONTAINS
, SUPPORTS
, MANAGES
, and CONTROLS
.
And their passive forms: IS_CONTAINED_BY
, IS_SUPPORTED_BY
, IS_MANAGED_BY
, IS_CONTROLLED_BY
.
Relation types don’t provide any unique functionality by themselves.
They are intended as human-readable labels that briefly describe the behavior of a specific Asset Relation.
In the diagram below, we have represented a hierarchy with a Fleet Operator that manages (MANAGES
relation type) two vehicles - Volvo and Mercedes.
Each vehicle contains one GPS tracker (CONTAINS
relation type).
Before a relationship can be established between assets and endpoints, it must be allowed. This achieved by means of establishing relationship between asset types and applications that endpoints belongs to. This way we eliminate mistakes when establishing relationships between end assets and endpoints.
Let’s introduce the Fleet Operator asset type and establish a relationship with the Vehicle asset type.
Go to Asset types and create the FLEET_OPERATOR
asset type.
Then, go to Device management -> Applications, and add the “GPS Tracker” application.
At this point, we have two asset types (Vehicle, Fleet Operator), and one application that will contain GPS trackers.
Let’s establish a relationship between the Vehicle asset type, Fleet Operator, and GPS Tracker application.
Go to Asset hierarchy.
Select “Asset type” as Entity type, and “Fleet Operator” as Asset type.
Click the plus button (+
), and select the “Manages” relation type, “Asset type” as To entity, and “Vehicle” as the Asset type, then click Save.
After that, click the plus button (+
), select the “Contains” relation type, “Application” as To entity, and select “GPS Tracker” as Application.
Now we established a relationship between asset types and the application, which allows us to establish the same relationship between end assets and endpoints—Fleet Operators can manage Vehicles; Vehicles can contain endpoints (GPS trackers).
Let’s create end assets and establish relationships between them and endpoints.
Go to Asset Management -> Assets, and create one more asset of the Vehicle asset type, for example, Mercedes with a random VIN. Switch to the Fleet Operator asset type and create one with a random Location, for example, Florida. Go to Device management -> Devices, and select the “GPS Tracker” application. Create an application version if it does not have one yet. Add a couple of devices.
At this point, we have one asset of the Fleet Operator type with a location in Florida, two assets of the Vehicle type—Volvo and Mercedes, and two endpoints. Now we can establish relationships between them.
Go to Assets, switch to Fleet Operator assets, and go to the page of the Florida operator. Click Add child and configure the relations.
Go to Assets, switch to Vehicles assets, and establish the CONTAINS
relation for both vehicles—Mercedes with “GPS Tracker 1” and Volvo with “GPS Tracker 2”.
To visualize the whole relationship tree starting from the top, go to Asset hierarchy, select “Asset” as Entity type, and “Fleet Operator” as Asset type.