Create flasgger example for meb

This commit is contained in:
Guille Gutierrez 2023-02-24 17:06:04 -05:00
parent f8ff0d15f5
commit a54b13e335

View File

@ -3,7 +3,7 @@ info:
description: NextGen Cities Institute API
termsOfService: http://swagger.io/terms/
contact:
email: peteryefi@gmail.com
email: nextgen-cities@gmail.com
version: 1.4
externalDocs:
description: Find out more about Swagger
@ -139,6 +139,44 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/unauthorized'
/v1.4/buildings/meb:
get:
security:
- session_id: [ ]
- token: [ ]
- application_uuid: [ ]
parameters:
- in: body
name: data
schema:
type: string
example: {"city_1" :["building_1", "building_2"], "city_2" :["building_3", "building_8"]}
required: true
description: Json containing the city name and the buildings whose monthly energy balance is requested.
tags:
- Buildings monthly energy balance meb
summary: Retrieve the monthly energy balance results for the given buildings in the given cities
operationId: building_monthly_energy_balance
description: Retrieve the monthly energy balance results for the given buildings in the given cities
responses:
'200':
description: Succeed
content:
application/json:
schema:
$ref: '#/components/schemas/meb'
headers:
token:
type: string
format: uuid
description: Token expected in next operation header
example: '77e1c83b-7bb0-437b-bc50-a7a58e5660ac'
'403':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/unauthorized'
components:
securitySchemes:
session_id:
@ -181,4 +219,206 @@ components:
example: 'succeed'
cities:
type: array
example: [{'name': 'city 1', 'geometric_level_of_detail': '1'}, {'name': 'city 2', 'geometric_level_of_detail': '1'}]
example: [{'name': 'city 1', 'geometric_level_of_detail': '1'}, {'name': 'city 2', 'geometric_level_of_detail': '1'}]
meb:
type: object
properties:
result:
type: string
example: 'succeed'
results:
type: string
example: '[
{
"city_1":{
"building_1":{
"insel meb":[
{
"monthly_cooling":{
"0":381853.821,
"1":484038.818,
"2":944923.8890000001,
"3":1465614.6200000001,
"4":2816751.71,
"5":4673754.8800000008,
"6":5804651.8600000003,
"7":5113784.1799999997,
"8":2464006.1000000001,
"9":1113856.5699999998,
"10":588973.45,
"11":384227.386
}
},
{
"yearly_cooling":{
"0":26236437.2839999981
}
},
{
"monthly_heating":{
"0":23752326.1999999993,
"1":20536490.1999999993,
"2":16533607.4000000004,
"3":8818033.1999999993,
"4":4036963.8700000001,
"5":915646.973,
"6":247277.222,
"7":393324.463,
"8":3161278.3199999998,
"9":8418375.9800000004,
"10":13028175.8000000007,
"11":21456785.1999999993
}
},
{
"yearly_heating":{
"0":121298284.8279999942
}
}
]
},
"building_2":{
"insel meb":[
{
"monthly_cooling":{
"0":3933853.0300000003,
"1":6749044.9199999999,
"2":12275707.0,
"3":15125280.3000000007,
"4":26189175.8000000007,
"5":38539007.799999997,
"6":44865269.5,
"7":42056718.8000000045,
"8":25809910.1999999993,
"9":12112115.1999999993,
"10":5266305.1800000006,
"11":3209882.3200000003
}
},
{
"yearly_cooling":{
"0":236132270.0499999821
}
},
{
"monthly_heating":{
"0":113151477.0,
"1":93304132.8000000119,
"2":67498476.599999994,
"3":27459867.1999999993,
"4":5259281.25,
"5":0.0,
"6":0.0,
"7":0.0,
"8":2118999.02,
"9":23991584.0,
"10":51830328.1000000015,
"11":101332000.0
}
},
{
"yearly_heating":{
"0":485946145.9700000286
}
}
]
}
}
},
{
"city_2":{
"building_3":{
"insel meb":[
{
"monthly_cooling":{
"0":1578142.8200000001,
"1":2491265.8700000001,
"2":4727943.8499999996,
"3":6648524.4100000001,
"4":12431965.8000000007,
"5":19330369.1000000015,
"6":22776884.8000000007,
"7":20448914.1000000015,
"8":11097510.7000000011,
"9":4935220.21,
"10":2247389.1600000001,
"11":1359069.3400000001
}
},
{
"yearly_cooling":{
"0":110073200.1600000113
}
},
{
"monthly_heating":{
"0":72041921.900000006,
"1":60658929.700000003,
"2":44862808.599999994,
"3":18590554.6999999993,
"4":3827654.3000000003,
"5":0.0,
"6":0.0,
"7":0.0,
"8":1737131.3500000001,
"9":16673425.8000000007,
"10":33768804.700000003,
"11":64228359.3999999985
}
},
{
"yearly_heating":{
"0":316389590.4499999881
}
}
]
},
"building_8":{
"insel meb":[
{
"monthly_cooling":{
"0":5984383.79,
"1":10543410.2000000011,
"2":20726748.0,
"3":25846933.6000000015,
"4":45066343.8000000045,
"5":65456738.299999997,
"6":74869429.6999999881,
"7":68197765.599999994,
"8":40489652.3000000045,
"9":18421974.6000000015,
"10":7668864.2600000007,
"11":4755506.3499999996
}
},
{
"yearly_cooling":{
"0":388027750.5000000596
}
},
{
"monthly_heating":{
"0":140609547.0,
"1":114809766.0,
"2":80985742.1999999881,
"3":32549675.8000000007,
"4":6437626.9500000002,
"5":0.0,
"6":0.0,
"7":0.0,
"8":2923770.5099999998,
"9":29677375.0,
"10":64619625.0,
"11":126441602.0
}
},
{
"yearly_heating":{
"0":599054730.4600000381
}
}
]
}
}
}
]'