def _to_images(self, object): images = [] for element in object.findall("images/image"): images.append( NodeImage(id=element.attrib["id"], name=element.attrib["summary"], driver=self.connection.driver)) return images
def list_images(self, **kwargs): data = self.connection.request('/', {'cmd': 'dreamhost_ps-list_images'}).object images = [] for img in data: images.append(NodeImage( id = img['image'], name = img['image'], driver = self.connection.driver )) return images
def list_images(self): # List Images # Retrieve all available Linux distributions. params = { "api_action": "avail.distributions" } data = self.connection.request(LINODE_ROOT, params=params).object distros = [] for obj in data: i = NodeImage(id=obj["DISTRIBUTIONID"], name=obj["LABEL"], driver=self.connection.driver) distros.append(i) return distros
def list_images(self, location=None): # List Images # Retrieve all available Linux distributions. params = {"api_action": "avail.distributions"} data = self.connection.request(LINODE_ROOT, params=params).object distros = [] for obj in data: i = NodeImage(id=obj["DISTRIBUTIONID"], name=obj["LABEL"], driver=self.connection.driver, extra={ 'pvops': obj['REQUIRESPVOPSKERNEL'], '64bit': obj['IS64BIT'] }) distros.append(i) return distros
def list_images(self, location=None): """ Returns a list of all package templates aka appiances aka images """ #Make the call response = self.connection.request( '/rest/hosting/ptemplate/list').parse_body() #Turn the response into an array of NodeImage objects images = [] for ptemplate in response['packages']: images.append( NodeImage( id=ptemplate['uuid'], name='%s: %s' % (ptemplate['name'], ptemplate['description']), driver=self, )) return images
def _to_image(self, image): image = NodeImage(id=image.get("href"), name=image.get("name"), driver=self.connection.driver) return image
def _to_image(self, el): i = NodeImage(id=el.get('id'), name=el.get('name'), driver=self.connection.driver, extra={'serverId': el.get('serverId')}) return i
def _to_image(self, element): n = NodeImage(id=element['id'], name=element['friendlyName'], driver=self.connection.driver) return n
def _to_image(self, image): return NodeImage(id=image['distro_code'], name=image['distro_description'], driver=self.connection.driver)
def _to_image(self, image, cloud): image = NodeImage(id=image['id'], name="%s: %s" % (cloud, image['label']), driver=self.connection.driver) return image
def _find_image(self, image_id): return NodeImage(id=image_id, name=None, driver=None)
def _to_image(self, el): i = NodeImage(id=el.get('id'), name=el.get('name'), driver=self.connection.driver) return i
def _to_image(self, image): image = NodeImage(id=image.get('href'), name=image.get('name'), driver=self.connection.driver) return image
def _to_image(self, element): n = NodeImage(id=self._findtext(element, 'imageId'), name=self._findtext(element, 'imageLocation'), driver=self.connection.driver) return n
def _to_image(self, element): i = NodeImage(id=int(element.findtext('id')), name=str(element.findtext('name')), driver=self.connection.driver) return i
def _to_image(self, img): return NodeImage(id=img['id'], name=img['name'], driver=self.connection.driver)