예제 #1
0
 def delete_image(self, image, force=False):
     """
     Delete image
     :param image:
     :param force:
     :return:
     """
     assert(image is not None)
     cmd = ["rmi"]
     if force:
         cmd.append("-f")
     cmd.append(image)
     util.kpod(cmd)
예제 #2
0
 def delete_image(self, image, force=False):
     """
     Delete image
     :param image:
     :param force:
     :return:
     """
     assert (image is not None)
     cmd = ["rmi"]
     if force:
         cmd.append("-f")
     cmd.append(image)
     util.kpod(cmd)
예제 #3
0
 def get_containers(self):
     """
     Get containers for the backend
     :return: list of container objects
     """
     containers = json.loads(util.kpod(["ps", "-a", "--format", "json"]))
     container_objects = []
     for container in containers:
         container_objects.append(self._make_container(container['id'], container))
     return container_objects
예제 #4
0
 def get_images(self, get_all=False):
     """
     Get images for the backend
     :param get_all: bool
     :return:  list of image objects
     """
     images = json.loads(util.kpod(["images", "--format", "json"]))
     image_objects = []
     for image in images:
         image_objects.append(self._make_image(image['id'], image))
     return image_objects
예제 #5
0
 def get_containers(self):
     """
     Get containers for the backend
     :return: list of container objects
     """
     containers = json.loads(util.kpod(["ps", "-a", "--format", "json"]))
     container_objects = []
     for container in containers:
         container_objects.append(
             self._make_container(container['id'], container))
     return container_objects
예제 #6
0
 def get_images(self, get_all=False):
     """
     Get images for the backend
     :param get_all: bool
     :return:  list of image objects
     """
     images = json.loads(util.kpod(["images", "--format", "json"]))
     image_objects = []
     for image in images:
         image_objects.append(self._make_image(image['id'], image))
     return image_objects
예제 #7
0
 def _inspect_container(self, container):
     return json.loads(util.kpod(['inspect', container]))
예제 #8
0
 def _inspect_image(self, image):
     return json.loads(util.kpod(['inspect', image]))
예제 #9
0
 def tag_image(self, _src, _dest):
     cmd = ['tag', _src, _dest]
     return util.kpod(cmd)
예제 #10
0
 def stop_container(self, con_obj, **kwargs):
     # If we plant to honor stop labels here, we will
     # need to implement that when kpod exec is available.
     return util.kpod(["stop", con_obj.id])
예제 #11
0
 def get_dangling_images(self):
     images = json.loads(
         util.kpod(
             ["images", "--filter", "dangling=true", "--format", "json"]))
     return [x['id'] for x in images]
예제 #12
0
 def _inspect_container(self, container):
     return json.loads(util.kpod(['inspect', container]))
예제 #13
0
 def _inspect_image(self, image):
     return json.loads(util.kpod(['inspect', image]))
예제 #14
0
 def tag_image(self, _src, _dest):
     cmd = ['tag', _src, _dest]
     return util.kpod(cmd)
예제 #15
0
 def get_dangling_images(self):
     images = json.loads(util.kpod(["images", "--filter", "dangling=true", "--format", "json"]))
     return [x['id'] for x in images]