示例#1
0
 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()
示例#2
0
 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()
示例#3
0
 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()
示例#4
0
 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()