   $wait xapi.call 'host.power_on', host.ref
 
   return true
-exports.restart_agent.permission = 'admin'
-exports.restart_agent.params = {
-  id: { type: 'string' }
-}
-
-exports.stop = $coroutine ({id}) ->
+
+start.params = {
+  id: { type: 'string' }
+}
+
+start.resolve = {
+  host: ['id', 'host'],
+}
+
+exports.start = start
+
+#---------------------------------------------------------------------
+
+stop = $coroutine ({id}) ->
   try
     host = @getObject id, 'host'
   catch


#=====================================================================

exports.set = $coroutine (params) ->
  try
    host = @getObject params.id, 'host'
  catch
    @throw 'NO_SUCH_OBJECT'

  xapi = @getXAPI host

  for param, field of {

  $wait xapi.call 'pool.eject', host.ref

  return true

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

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

exports.detach = detach

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

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