Skip to content

Commit

Permalink
add asset_type to asset meta schema (#966)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsdas authored Aug 5, 2022
1 parent 571e3ee commit 6539551
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions care/facility/migrations/0308_auto_20220805_2247.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 2.2.11 on 2022-08-05 17:17

import care.utils.models.validators
import django.contrib.postgres.fields.jsonb
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('facility', '0307_auto_20220805_1933'),
]

operations = [
migrations.AlterField(
model_name='asset',
name='meta',
field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict, validators=[care.utils.models.validators.JSONFieldSchemaValidator({'$schema': 'http://json-schema.org/draft-07/schema#', 'anyOf': [{'$ref': '#/definitions/onvif'}, {'$ref': '#/definitions/hl7monitor'}, {'$ref': '#/definitions/empty'}], 'definitions': {'empty': {'additionalProperties': False, 'type': 'object'}, 'hl7monitor': {'additionalProperties': False, 'properties': {'asset_type': {'type': 'string'}, 'insecure_connection': {'type': 'boolean'}, 'local_ip_address': {'type': 'string'}, 'middleware_hostname': {'type': 'string'}}, 'required': ['local_ip_address', 'middleware_hostname'], 'type': 'object'}, 'onvif': {'additionalProperties': False, 'properties': {'asset_type': {'type': 'string'}, 'camera_access_key': {'type': 'string'}, 'camera_type': {'type': 'string'}, 'insecure_connection': {'type': 'boolean'}, 'local_ip_address': {'type': 'string'}, 'middleware_hostname': {'type': 'string'}}, 'required': ['local_ip_address', 'middleware_hostname', 'camera_access_key', 'camera_type'], 'type': 'object'}}})]),
),
]
2 changes: 2 additions & 0 deletions care/facility/models/json_schema/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"properties": {
"local_ip_address": {"type": "string"},
"middleware_hostname": {"type": "string"},
"asset_type": {"type": "string"},
"insecure_connection": {"type": "boolean"},
},
"additionalProperties": False,
Expand All @@ -22,6 +23,7 @@
"middleware_hostname": {"type": "string"},
"camera_access_key": {"type": "string"},
"camera_type": {"type": "string"},
"asset_type": {"type": "string"},
"insecure_connection": {"type": "boolean"},
},
"additionalProperties": False,
Expand Down

0 comments on commit 6539551

Please sign in to comment.