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: if criteria is not None:
hosts = hosts.filter(criteria) hosts = hosts.filter(criteria)
response = request.ResponseClass() response = request.ResponseClass()
response.set_payload(None, hosts.all()) response.set_payload(None, {
'hosts': hosts.all(),
})
return response return response
def POST(self, request): def POST(self, request):

View File

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