#set ($layout="json.vm")
#set ($dummy = $dbtool)
#set ($res=${response.setContentType("application/json")})
#if($params.key)
#set ($c=$clients)
#set ($res=$c.load($params.key))
#set ($comps=[ $c ])
#{else}[
#set ($comps=$clients.fetchAll())
#end
#set ($count=$comps.size())
#foreach ($c in $sorter.sort($comps,"name"))
#if ($count!=$velocityCount)
#set ($sep=",")
#else
#set ($sep="")
#end
{ "name": "$c.name", "ipAddress": "$!c.ipAddress", "macAddress": "$!c.macAddress", "owner": "$!c.owner", "server": "$!c.server", "hardwareType": "$!c.hardwareType", "manufacturer": "$!c.manufacturer", "model": "$!c.model", "serial": "$!c.serial", "location": "$!c.location", "roomNumber": "$!c.roomNumber", "purchaseDate": "$!c.purchaseDate", "warranty": "$!c.warranty", "orderNumber": "$!c.orderNumber", "inventoryNumber": "$!c.inventoryNumber"  }$!sep
#end
#if(!$params.key)
]
#end
