web: hosts: Return an object containing hosts list
parent
a73f090fe2
commit
3b8f033253
|
@ -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):
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue