web: hosts: Return an object containing hosts list

master
Dustin 2016-01-03 17:14:09 -06:00
parent a73f090fe2
commit 3b8f033253
2 changed files with 10 additions and 4 deletions

View File

@ -33,7 +33,9 @@ class HostListController(controllers.BaseController):
if criteria is not None:
hosts = hosts.filter(criteria)
response = request.ResponseClass()
response.set_payload(None, hosts.all())
response.set_payload(None, {
'hosts': hosts.all(),
})
return response
def POST(self, request):

View File

@ -38,9 +38,13 @@ paths:
200:
description: Host list
schema:
type: array
items:
$ref: '#/definitions/Host'
name: ListOfHosts
type: object
properties:
hosts:
type: array
items:
$ref: '#/definitions/Host'
tags:
- hosts
post: