Beispiel #1
0
    def flavors(self, **kwargs):
        """
        Lists the flavors on the cloud

        :return: dict of flavors
        """
        flavors = AwsFlavor()
        data = flavors.fetch()
        result = flavors.list(data)
        return self.update_dict(result, kind="flavor")
Beispiel #2
0
 def flavor(self, name=None):
     """
     Gets the flavor with a given name
     :param name: The name of the flavor
     :return: The dict of the flavor
     """
     flavors = AwsFlavor()
     flavors.update()
     for flavor in flavors.get():
         if flavor['name'] == name:
             return [flavor]
     return []