'Reboots or shuts down the host.'

def host_power_action(self, action):

    args = {'action': jsonutils.dumps(action)}
    methods = {'reboot': 'host_reboot', 'shutdown': 'host_shutdown'}
    response = call_xenhost(self._session, methods[action], args)
    return response.get('power_action', response)
