add schemas
This commit is contained in:
parent
b92ac6b19f
commit
58c8708467
0
src/resources.py
Normal file
0
src/resources.py
Normal file
@ -14,12 +14,36 @@ __module_name__ = "schemas"
|
||||
__version__text__ = "1"
|
||||
|
||||
|
||||
class SampleSchema(ma.Schema):
|
||||
class ServiceSchema(ma.Schema):
|
||||
"""
|
||||
Parameters:
|
||||
- date (date)
|
||||
- device_id (int)
|
||||
- location (ipv4)
|
||||
- zone (string)
|
||||
"""
|
||||
|
||||
date = fields.DateTime(required=True)
|
||||
device_id = fields.Integer(required=True)
|
||||
location = fields.IPv4(required=True)
|
||||
zone = fields.String(required=True)
|
||||
|
||||
|
||||
class ServiceDirectorySchema(ma.Schema):
|
||||
"""
|
||||
Parameters:
|
||||
- name (string)
|
||||
- id (uuid)
|
||||
"""
|
||||
|
||||
name = fields.String(required=True)
|
||||
id = fields.UUID(required=True)
|
||||
|
||||
|
||||
class ServiceLocatorSchema(ma.Schema):
|
||||
"""
|
||||
Parameters:
|
||||
- name (string)
|
||||
- id (uuid)
|
||||
- servicearray (object)
|
||||
"""
|
||||
|
||||
name = fields.String(required=True)
|
||||
id = fields.UUID(required=True)
|
||||
servicearray = fields.Nested(ServiceSchema, many=True, required=True)
|
||||
|
Loading…
Reference in New Issue
Block a user