def imagesImage_DELETE(self, body, identifier): try: systemManager.delete_image(identifier=identifier, **body) except TypeError as e: raise exceptions.TypeError(e) except Exception as e: raise exceptions.DockerError(e) return self.success_message()
def containersContainer_DELETE(self, body, name): try: systemManager.remove_container_by_name(name=name, **body) except TypeError as e: raise exceptions.TypeError(e) except docker.errors.NotFound as e: #Actually catches all docker.errors errors raise exceptions.DockerError(e) except Exception as e: raise e return self.success_message()
def containers_POST(self, body): try: container = systemManager.run_image(**body) except TypeError as e: raise exceptions.TypeError(e) except exceptions.InsufficientResourcesError as e: raise e except docker.errors.APIError as e: raise exceptions.DockerError(e) except Exception as e: raise e return self.success_message()
def containersStoppedContainer_PUT(self, body, name): try: systemManager.stop_container_by_name(name=name, **body) except TypeError as e: raise exceptions.TypeError(e) return self.success_message()