def capsule_create(self, context, capsule, requested_networks, limits): @utils.synchronized("capsule-" + capsule.uuid) def do_capsule_create(): self._do_capsule_create(context, capsule, requested_networks, limits) utils.spawn_n(do_capsule_create)
def container_commit(self, context, container, repository, tag=None): LOG.debug('Committing the container: %s', container.uuid) snapshot_image = None try: # NOTE(miaohb): Glance is the only driver that support image # uploading in the current version, so we have hard-coded here. # https://bugs.launchpad.net/zun/+bug/1697342 snapshot_image = image_driver.create_image(context, repository, glance.GlanceDriver()) except exception.DockerError as e: LOG.error("Error occurred while calling glance " "create_image API: %s", six.text_type(e)) utils.spawn_n(self._do_container_commit, context, snapshot_image, container, repository, tag) return snapshot_image.id
def container_create(self, context, limits, requested_networks, requested_volumes, container, run, pci_requests=None): @utils.synchronized(container.uuid) def do_container_create(): if not self._attach_volumes(context, container, requested_volumes): return created_container = self._do_container_create( context, container, requested_networks, requested_volumes, pci_requests, limits) if run and created_container: self._do_container_start(context, created_container) utils.spawn_n(do_container_create)
def container_unpause(self, context, container): utils.spawn_n(self._do_container_unpause, context, container)
def container_start(self, context, container): utils.spawn_n(self._do_container_start, context, container)
def container_stop(self, context, container, timeout): utils.spawn_n(self._do_container_stop, context, container, timeout)
def container_reboot(self, context, container, timeout): utils.spawn_n(self._do_container_reboot, context, container, timeout)
def add_security_group(self, context, container, security_group): utils.spawn_n(self._add_security_group, context, container, security_group)
def container_create(self, context, container): utils.spawn_n(self._do_container_create, context, container)
def container_start(self, context, container): @utils.synchronized(container.uuid) def do_container_start(): self._do_container_start(context, container) utils.spawn_n(do_container_start)
def container_stop(self, context, container, timeout): @utils.synchronized(container.uuid) def do_container_stop(): self._do_container_stop(context, container, timeout) utils.spawn_n(do_container_stop)
def add_security_group(self, context, container, security_group): @utils.synchronized(container.uuid) def do_add_security_group(): self._add_security_group(context, container, security_group) utils.spawn_n(do_add_security_group)
def container_delete(self, context, container, force=False): @utils.synchronized(container.uuid) def do_container_delete(): self._do_container_delete(context, container, force) utils.spawn_n(do_container_delete)
def container_run(self, context, limits, requested_networks, container): utils.spawn_n(self._do_container_run, context, container, requested_networks, limits)
def container_kill(self, context, container, signal): utils.spawn_n(self._do_container_kill, context, container, signal)
def container_unpause(self, context, container): @utils.synchronized(container.uuid) def do_container_unpause(): self._do_container_unpause(context, container) utils.spawn_n(do_container_unpause)
def image_pull(self, context, image): utils.spawn_n(self._do_image_pull, context, image)
def container_kill(self, context, container, signal): @utils.synchronized(container.uuid) def do_container_kill(): self._do_container_kill(context, container, signal) utils.spawn_n(do_container_kill)
def container_run(self, context, container): utils.spawn_n(self._do_container_run, context, container)
def capsule_create(self, context, capsule, requested_networks, limits): utils.spawn_n(self._do_capsule_create, context, capsule, requested_networks, limits)