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:
|
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):
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue