'Stop a container
:param container: The container to be stopped
:type  container: :class:`libcloud.container.base.Container`
:return: The container refreshed with current data
:rtype: :class:`libcloud.container.base.Container`'

def stop_container(self, container):

    result = self.connection.request(('/v%s/containers/%s/stop' % (self.version, container.id)), method='POST')
    if (result.status in VALID_RESPONSE_CODES):
        return self.get_container(container.id)
    else:
        raise DockerException(result.status, 'failed    to    stop    container')
