libcloud/compute/drivers/dimensiondata.py [2536:2612]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            response_code = findtext(response, "responseCode", TYPES_URN)

        return response_code in ["IN_PROGRESS", "SUCCESS"]

    def ex_clean_failed_deployment(self, node):
        """
        Removes a node that has failed to deploy

        :param  node: The failed node to clean
        :type   node: :class:`Node` or ``str``
        """
        node_id = self._node_to_node_id(node)
        request_elm = ET.Element("cleanServer", {"xmlns": TYPES_URN, "id": node_id})
        body = self.connection.request_with_orgId_api_2(
            "server/cleanServer", method="POST", data=ET.tostring(request_elm)
        ).object
        response_code = findtext(body, "responseCode", TYPES_URN)
        return response_code in ["IN_PROGRESS", "OK"]

    def ex_list_customer_images(self, location=None):
        """
        Return a list of customer imported images

        :param location: The target location
        :type  location: :class:`NodeLocation` or ``str``

        :rtype: ``list`` of :class:`NodeImage`
        """
        params = {}
        if location is not None:
            params["datacenterId"] = self._location_to_location_id(location)

        return self._to_images(
            self.connection.request_with_orgId_api_2("image/customerImage", params=params).object,
            "customerImage",
        )

    def ex_get_base_image_by_id(self, id):
        """
        Gets a Base image in the Dimension Data Cloud given the id

        :param id: The id of the image
        :type  id: ``str``

        :rtype: :class:`NodeImage`
        """
        image = self.connection.request_with_orgId_api_2("image/osImage/%s" % id).object
        return self._to_image(image)

    def ex_get_customer_image_by_id(self, id):
        """
        Gets a Customer image in the Dimension Data Cloud given the id

        :param id: The id of the image
        :type  id: ``str``

        :rtype: :class:`NodeImage`
        """
        image = self.connection.request_with_orgId_api_2("image/customerImage/%s" % id).object
        return self._to_image(image)

    def ex_get_image_by_id(self, id):
        """
        Gets a Base/Customer image in the Dimension Data Cloud given the id

        Note: This first checks the base image
              If it is not a base image we check if it is a customer image
              If it is not in either of these a DimensionDataAPIException
              is thrown

        :param id: The id of the image
        :type  id: ``str``

        :rtype: :class:`NodeImage`
        """
        try:
            return self.ex_get_base_image_by_id(id)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



libcloud/compute/drivers/nttcis.py [3228:3313]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        response_code = findtext(response, "responseCode", TYPES_URN)

        return response_code in ["IN_PROGRESS", "SUCCESS"]

    def ex_clean_failed_deployment(self, node):
        """
        Removes a node that has failed to deploy

        :param  node: The failed node to clean
        :type   node: :class:`Node` or ``str``
        """

        node_id = self._node_to_node_id(node)
        request_elm = ET.Element("cleanServer", {"xmlns": TYPES_URN, "id": node_id})
        body = self.connection.request_with_orgId_api_2(
            "server/cleanServer", method="POST", data=ET.tostring(request_elm)
        ).object
        response_code = findtext(body, "responseCode", TYPES_URN)

        return response_code in ["IN_PROGRESS", "OK"]

    def ex_list_customer_images(self, location=None):
        """
        Return a list of customer imported images

        :param location: The target location
        :type  location: :class:`NodeLocation` or ``str``

        :rtype: ``list`` of :class:`NodeImage`
        """

        params = {}

        if location is not None:
            params["datacenterId"] = self._location_to_location_id(location)

        return self._to_images(
            self.connection.request_with_orgId_api_2("image/customerImage", params=params).object,
            "customerImage",
        )

    def ex_get_base_image_by_id(self, id):
        """
        Gets a Base image in the NTTC-CIS Cloud given the id

        :param id: The id of the image
        :type  id: ``str``

        :rtype: :class:`NodeImage`
        """

        image = self.connection.request_with_orgId_api_2("image/osImage/%s" % id).object

        return self._to_image(image)

    def ex_get_customer_image_by_id(self, id):
        """
        Gets a Customer image in the NTTC-CIS Cloud given the id

        :param id: The id of the image
        :type  id: ``str``

        :rtype: :class:`NodeImage`
        """

        image = self.connection.request_with_orgId_api_2("image/customerImage/%s" % id).object

        return self._to_image(image)

    def ex_get_image_by_id(self, id):
        """
        Gets a Base/Customer image in the NTTC-CIS Cloud given the id

        Note: This first checks the base image
              If it is not a base image we check if it is a customer image
              If it is not in either of these a NttCisAPIException
              is thrown

        :param id: The id of the image
        :type  id: ``str``

        :rtype: :class:`NodeImage`
        """

        try:
            return self.ex_get_base_image_by_id(id)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



