'Stop a container.'

def stop(self, name):

    job = jobs.get(name, {})
    if (job.get('state') not in [JobState.up, JobState.crashed, JobState.error]):
        raise TransitionError(job.get('state'), JobState.up, 'the    container    must    be    up    to    stop')
    job['state'] = JobState.down
