Skip to content

Bulk Create Assets

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.
Asset Type The name of the Asset Type that this Asset belongs to. This must be a valid Asset Type name.
Properties A list of key/value pairs that define custom properties of the asset. Use this to define attributes like: Location, Site, PLC Type, Manufacturer, Serial Number, etc.
Cluster Name ID Reserved for internal use in Asset Maps.
Relationships A list of Assets that this Asset is related to. This is used in Asset Maps to draw lines between related Assets
Latitude GPS coordinate for placing the Asset in the Asset Maps page
Longitude GPS coordinate for placing the Asset in the Asset Maps page

Bulk Create Assets

If you need to create multiple Assets at once, you can use the following example to create them in bulk.

You can create Assets in bulk using the import Assets option in Assets.

In this brief demo you can see how to do this;

To start you need to create your Asset list in Excel, Google Sheets or any program that can save to a CSV file format.

You can read more about each of these properties in the Add Asset page here.

You can get the latest template from the Kelvin UI. Read further down to see where you can download the template. You can have as many headings after the Asset Type Name and each one will be treated as a new Asset Property.

Name ID, Asset Type Name, Cluster Name ID and Relationships values must follow the name format which must contain only lowercase alphanumeric characters. The ., _ and - characters are also allowed to separate words instead of a space but not at the beginning or end.

When finished, make sure you save it in a CSV file format using comma to define the field delimiter and UTF-8 as the Character set. This is usually the default settings. This is an example location for saving csv files in Google Sheets.

In Google Sheets, there are no options and will save with the defaults we mention above.

Once you have a filled in template file available locally on your machine, you can initiate the bulk create Assets as follows;

First go to the Assets under Administration.

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

Click on the Import Assets button.

Either select the CSV file you have created or drag and drop it into the box and click Next.

This will only accept files with a CSV extension.

Wait for the file and data verification process to be completed. If there are any issues, check and correct the issues, go back to step 1 and reupload the file for a recheck.

When all is ok, click on the Import button and all your Assets will be created.

This request will create 2 Assets.

API cURL Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
curl -X "POST" \
  "https://<url.kelvin.ai>/api/v4/assets/bulk/create" \
  -H "Authorization: Bearer <Your Current Token>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
        "assets": [
            {
                "name": "doc_demo_asset_01",
                "title": "Documentation Demo Asset 01",
                "asset_type_name": "doc_demo_asset_type",
                "properties": [
                    {
                        "name": "plc_manufacturer",
                        "title": "PLC Manufacturer",
                        "value": "Siemens"
                    }
                ]
            },
            {
                "name": "doc_demo_asset_02",
                "title": "Documentation Demo Asset 02",
                "asset_type_name": "doc_demo_asset_type",
                "properties": [
                    {
                        "name": "plc_manufacturer",
                        "title": "PLC Manufacturer",
                        "value": "Siemens"
                    }
                ]
            }
        ]
    }'

This script will create 2 Assets.

API Client (Python) Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from kelvin.api.client import Client

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

# Create Assets in Bulk
response = client.asset.create_asset_bulk(
    dry_run=False,
    data={
        "assets": [
            {
                "name": "doc_demo_asset_01",
                "title": "Documentation Demo Asset 01",
                "asset_type_name": "doc_demo_asset_type",
                "properties": [
                    {
                        "name": "plc_manufacturer",
                        "title": "PLC Manufacturer",
                        "value": "Siemens",
                    }
                ],
            },
            {
                "name": "doc_demo_asset_02",
                "title": "Documentation Demo Asset 02",
                "asset_type_name": "doc_demo_asset_type",
                "properties": [
                    {
                        "name": "plc_manufacturer",
                        "title": "PLC Manufacturer",
                        "value": "Siemens",
                    }
                ],
            },
        ]
    },
)

print(response)

You will not receive a response;