   $wait xapi.call 'host.disable', host.ref
 
   return true
-exports.stop.permission = 'admin'
-exports.stop.params = {
-  id: { type: 'string' }
-}
+
+disable.params = {
+  id: { type: 'string' }
+}
+
+disable.resolve = {
+  host: ['id', 'host'],
+}
+
+exports.disable = disable

  $wait xapi.call 'host.enable', host.ref

  return true
exports.stop.permission = 'admin'
exports.stop.params = {
  id: { type: 'string' }
}

exports.disable = $coroutine ({id}) ->
  try
    host = @getObject id, 'host'
  catch

  $wait xapi.call 'host.restart_agent', host.ref

  return true

restartAgent.params = {
  id: { type: 'string' }
}

restartAgent.resolve = {
  host: ['id', 'host'],
}

# TODO camel case
exports.restart_agent = restartAgent

#---------------------------------------------------------------------

start = $coroutine ({id}) ->
  try
    host = @getObject id, 'host'
  catch
