diff --git a/server/django/db_initial_resource_types.json b/server/django/db_initial_resource_types.json new file mode 100644 index 00000000..cabc36a0 --- /dev/null +++ b/server/django/db_initial_resource_types.json @@ -0,0 +1,245 @@ +[ + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3303, + "resource_id": 5700, + "name": "temperature", + "data_type": "float" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3303, + "resource_id": 5701, + "name": "humidity", + "data_type": "float" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 0, + "name": "manufacturer", + "data_type": "string" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 1, + "name": "model_number", + "data_type": "string" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 2, + "name": "serial_number", + "data_type": "string" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 3, + "name": "firmware_version", + "data_type": "string" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 6, + "name": "power_source", + "data_type": "int" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 7, + "name": "power_source_v", + "data_type": "int" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 8, + "name": "power_source_i", + "data_type": "int" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 9, + "name": "battery_level", + "data_type": "int" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 10, + "name": "memory_free", + "data_type": "int" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 11, + "name": "error_code", + "data_type": "int" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 13, + "name": "current_time", + "data_type": "time" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 14, + "name": "utc_offset", + "data_type": "string" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 15, + "name": "timezone", + "data_type": "string" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 16, + "name": "binding_mode", + "data_type": "string" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 17, + "name": "device_type", + "data_type": "string" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 18, + "name": "hardware_version", + "data_type": "string" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 19, + "name": "software_version", + "data_type": "string" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 20, + "name": "battery_status", + "data_type": "int" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 3, + "resource_id": 21, + "name": "memory_total", + "data_type": "int" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 5, + "resource_id": 1, + "name": "package_uri", + "data_type": "string" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 5, + "resource_id": 2, + "name": "update", + "data_type": "string" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 5, + "resource_id": 3, + "name": "state", + "data_type": "int" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 5, + "resource_id": 4, + "name": "update_result", + "data_type": "int" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 5, + "resource_id": 5, + "name": "package_name", + "data_type": "string" + } + }, + { + "model": "sensordata.resourcetype", + "fields": { + "object_id": 5, + "resource_id": 6, + "name": "package_version", + "data_type": "string" + } + } +] diff --git a/server/django/django_start.sh b/server/django/django_start.sh index ca2e0800..a7157ae0 100755 --- a/server/django/django_start.sh +++ b/server/django/django_start.sh @@ -11,5 +11,7 @@ echo "Running migrate..." python manage.py migrate 2>&1 | tee -a $logfile echo "Loading initial data..." python manage.py loaddata db_initial_data.json 2>&1 | tee -a $logfile +echo "Loading lwm2m resource types data..." +python manage.py loaddata db_initial_resource_types.json 2>&1 | tee -a $logfile echo "Starting the server..." python manage.py runserver 0.0.0.0:8000 2>&1 | tee -a "$logfile"