Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions modules/c2c/murano2cloud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ end

local function flush(ids, acc)
if not ids or not ids[1] then return acc end
local r = murano.services[murano2cloud.alias].getBulkWeather({ id = ids })
if r and r.error then return r end
local idList = {}
for index, value in ipairs(ids) do
local r = murano.services[murano2cloud.alias].getWeather({ id = value })
if r and r.error then return r end
table.insert( idList, r)
end
if not acc then
acc = r.list
acc = idList
else
for i, location in ipairs(r.list) do
for i, location in ipairs(idList) do
table.insert(acc, location)
end
end
Expand Down
35 changes: 0 additions & 35 deletions openweatherapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,38 +92,3 @@ paths:
schema:
type: object
description: Location weather, find details on https://openweathermap.org/current

/group:
get:
description: Get bulk weather data
operationId: getBulkWeather
parameters:
- name: id
in: query
description: List of location ids
type: array
required: true
maxItems: 20
items:
type: integer
description: Location Id
collectionFormat: csv
- $ref: '#/parameters/Units'
- $ref: '#/parameters/Lang'
- $ref: '#/parameters/Appid'
responses:
default:
description: Bulk request response
schema:
type: object
description: Bulk request response
properties:
cnt:
description: Number of location returned
type: integer
list:
description: List of location weather
type: array
items:
description: Location weather, find details on https://openweathermap.org/current
type: object