Skip to content

Create asset type

Reference:

Field Description
Name (Name ID) Unique name identifier. It must contain only lowercase alphanumeric characters. The characters ., _ and - are allowed to separate words instead of a space BUT can not be at the beginning or end of the name.
Title (Display Name) The display name to show on the Kelvin UI. It can contain any characters, including spaces.

Create Asset Type

In this example we will create an Asset Type.

Asset Types can be managed from the Administration section of the UI.

Do not get confused with the Asset management in the Operations section which is designed for the Production Engineers.

Note

Unlike the Kelvin API and Kelvin SDK, the Asset State is not configured when you create or edit the Asset Type.

There is a separate option for Asset State management. You can read how to do this in the Manage Asset States page.

You can watch this short demo video or read the full step-by step written tutorial below.

To start, go to the Assets in the Administration section of the left side bar and then click on the Asset Types tab.

To add an Asset Type, click on the Add Asset Type button;

Then type in the Asset Type details and click Add.

Note

The status_indicator_configs key is optional.

If it is missing, then no status will be shown.

API cURL Example
curl -X "POST" \
"https://<url.kelvin.ai>/api/v4/assets/types/create" \
-H "Authorization: Bearer <Your Current Token>" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
        "name": "doc_demo_asset_type",
        "title": "Documentation Demo Asset Type",
        "status_indicator_configs": [
            {
            "name": "0-green",
            "label": "Normal Operations",
            "resource": "krn:datastream:doc_demo_gas_flow_rate",
            "operator": "<",
            "value": 20
            },
            {
            "name": "1-yellow",
            "label": "Borderline Issues",
            "resource": "krn:datastream:doc_demo_gas_flow_rate",
            "operator": "==",
            "value": 25
            },
            {
            "name": "2-red",
            "label": "Critical",
            "resource": "krn:datastream:doc_demo_gas_flow_rate",
            "operator": ">=",
            "value": 30
            }
        ]
    }'

You will get a response similar to this;

API cURL Example Response
1
2
3
4
5
6
7
<Response [201]>
{
    "name":"doc_demo_asset_type",
    "title":"Documentation Demo Asset Type",
    "created":"2025-01-23T08:53:28.650245Z",
    "updated":"2025-01-23T08:53:28.650245Z"
}

Note

The status_indicator_configs key is optional.

If it is missing, then no status will be shown.

API Client (Python) Example
from kelvin.api.client import Client

# Login
client = Client(url="https://<url.kelvin.ai>", username="<your_username>")
client.login(password="<your_password>")

# Create Asset Type
response = client.asset.create_asset_type(data={
    "name": "doc_demo_asset_type",
    "title": "Documentation Demo Asset Type",
    "status_indicator_configs": [
        {
        "name": "0-green",
        "label": "Normal Operations",
        "resource": "krn:datastream:doc_demo_gas_flow_rate",
        "operator": "<",
        "value": 20
        },
        {
        "name": "1-yellow",
        "label": "Borderline Issues",
        "resource": "krn:datastream:doc_demo_gas_flow_rate",
        "operator": "==",
        "value": 25
        },
        {
        "name": "2-red",
        "label": "Critical",
        "resource": "krn:datastream:doc_demo_gas_flow_rate",
        "operator": ">=",
        "value": 30
        }
    ]
})

print(response)

You will get a response similar to this;

API Client (Python) Example Response
created=datetime.datetime(2024, 5, 23, 8, 52, 7, 803281, tzinfo=datetime.timezone.utc) name='doc_demo_asset_type' title='Documentation Demo Asset Type' updated=datetime.datetime(2024, 5, 23, 8, 52, 7, 803281, tzinfo=datetime.timezone.utc)