diff --git a/src/api/vm.coffee b/src/api/vm.coffee index c991a0b6c..321a6603f 100644 --- a/src/api/vm.coffee +++ b/src/api/vm.coffee @@ -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 diff --git a/src/spec.coffee b/src/spec.coffee index 443eb01b5..b3852a8d6 100644 --- a/src/spec.coffee +++ b/src/spec.coffee @@ -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