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"
|
__version__text__ = "1"
|
||||||
|
|
||||||
|
|
||||||
class SampleSchema(ma.Schema):
|
class ServiceSchema(ma.Schema):
|
||||||
"""
|
"""
|
||||||
Parameters:
|
Parameters:
|
||||||
- date (date)
|
- location (ipv4)
|
||||||
- device_id (int)
|
- zone (string)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
date = fields.DateTime(required=True)
|
location = fields.IPv4(required=True)
|
||||||
device_id = fields.Integer(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