@utils.arg('--name',
           metavar='<name>',
           help='name of the container')
@utils.arg('--image',
           required=True,
           metavar='<image>',
           help='name or ID of the image')
@utils.arg('--bay',
           required=True,
           metavar='<bay>',
           help='ID or name of the bay.')
@utils.arg('--command',
           metavar='<command>',
           help='Send command to the container')
@utils.arg('--memory',
           metavar='<memory>',
           help='The container memory size (format: <number><optional unit>, '
                'where unit = b, k, m or g)')
def do_container_create(cs, args):
    bay = cs.bays.get(args.bay)
    if bay.status not in ['CREATE_COMPLETE',
                          'UPDATE_IN_PROGRESS', 'UPDATE_COMPLETE']:
        raise exceptions.InvalidAttribute(
            'Bay status for %s is: %s. We cannot create a %s'
            ' unless the status is CREATE_COMPLETE, UPDATE_IN_PROGRESS'
            ' or UPDATE_COMPLETE.' % (bay.uuid, bay.status, "container"))
        return
    opts = {}
    opts['name'] = args.name
    opts['image'] = args.image
    opts['bay_uuid'] = bay.uuid
    opts['command'] = args.command
    opts['memory'] = args.memory
    _show_container(cs.containers.create(**opts))
Create a container.
dataset/ETHPy150Open openstack/python-magnumclient/magnumclient/v1/containers_shell.py/do_container_create