first Docker attempt

This commit is contained in:
Olivier Lambert 2015-05-08 15:37:30 +02:00
parent f986487df9
commit 9bddec2dfd
2 changed files with 15 additions and 5 deletions

View File

@ -1108,7 +1108,7 @@ exports.stats = stats;
# Actions on a Docker container in a VM
# Can be: start, stop, pause, unpause, restart
dockerContainerAction = $coroutine ({host, vm, container, action}) ->
dockerAction = $coroutine ({vm, container, action}) ->
xapi = @getXAPI vm
host = @getObject vm.$container
args = {
@ -1118,14 +1118,14 @@ dockerContainerAction = $coroutine ({host, vm, container, action}) ->
console.log args
return $wait xapi.call 'host.call_plugin', host.ref, 'xscontainer', action, args
dockerContainerAction.params = {
dockerAction.params = {
vm: { type: 'string' }
container: { type: 'string' }
action: { type: 'string' }
}
dockerContainerAction.resolve = {
dockerAction.resolve = {
vm: ['vm', 'VM'],
}
dockerContainerAction.permission = 'admin'
exports.dockerContainerAction = dockerContainerAction
dockerAction.permission = 'admin'
exports.dockerAction = dockerAction

View File

@ -474,6 +474,16 @@ module.exports = ->
current_operations: -> @genval.current_operations
docker: ->
if @genval.other_config.docker_info
docker = {
enabled: @genval.other_config.xscontainer_monitor
process: ($parseXML @genval.other_config.docker_ps).docker_ps
info: ($parseXML @genval.other_config.docker_info).docker_info
version: ($parseXML @genval.other_config.docker_version).docker_version
}
else false
# TODO: there is two possible value: "best-effort" and "restart"
high_availability: ->
if @genval.ha_restart_priority