tempest/services/compute/v3/xml/flavors_client.py
def create_flavor(self, name, ram, vcpus, disk, flavor_id, **kwargs):
        """Creates a new flavor or instance type."""
        flavor = Element("flavor",
                         xmlns=XMLNS_V3,
                         ram=ram,
                         vcpus=vcpus,
                         disk=disk,
                         id=flavor_id,
                         name=name)
        if kwargs.get('rxtx'):
            flavor.add_attr('rxtx_factor', kwargs.get('rxtx'))
        if kwargs.get('swap'):
            flavor.add_attr('swap', kwargs.get('swap'))
        if kwargs.get('ephemeral'):
            flavor.add_attr('ephemeral', kwargs.get('ephemeral'))
        if kwargs.get('is_public'):
            flavor.add_attr('flavor-access:is_public',
                            kwargs.get('is_public'))
        flavor.add_attr('xmlns:flavor-access', XMLNS_OS_FLV_ACCESS)
        resp, body = self.post('flavors', str(Document(flavor)), self.headers)
        body = xml_to_json(etree.fromstring(body))
        flavor = self._format_flavor(body)
        return resp, flavor
Creates a new flavor or instance type.
Creates a new flavor or instance type.
Creates a new flavor or instance type .
def create_flavor(self, name, ram, vcpus, disk, flavor_id, **kwargs):
        flavor = Element("flavor",
                         xmlns=XMLNS_V3,
                         ram=ram,
                         vcpus=vcpus,
                         disk=disk,
                         id=flavor_id,
                         name=name)
        if kwargs.get('rxtx'):
            flavor.add_attr('rxtx_factor', kwargs.get('rxtx'))
        if kwargs.get('swap'):
            flavor.add_attr('swap', kwargs.get('swap'))
        if kwargs.get('ephemeral'):
            flavor.add_attr('ephemeral', kwargs.get('ephemeral'))
        if kwargs.get('is_public'):
            flavor.add_attr('flavor-access:is_public',
                            kwargs.get('is_public'))
        flavor.add_attr('xmlns:flavor-access', XMLNS_OS_FLV_ACCESS)
        resp, body = self.post('flavors', str(Document(flavor)), self.headers)
        body = xml_to_json(etree.fromstring(body))
        flavor = self._format_flavor(body)
        return resp, flavor
def create_flavor ( self , name , ram , vcpus , disk , flavor_id , ** kwargs ) : flavor = Element ( "flavor" , xmlns = XMLNS_V3 , ram = ram , vcpus = vcpus , disk = disk , id = flavor_id , name = name ) if kwargs . get ( 'rxtx' ) : flavor . add_attr ( 'rxtx_factor' , kwargs . get ( 'rxtx' ) ) if kwargs . get ( 'swap' ) : flavor . add_attr ( 'swap' , kwargs . get ( 'swap' ) ) if kwargs . get ( 'ephemeral' ) : flavor . add_attr ( 'ephemeral' , kwargs . get ( 'ephemeral' ) ) if kwargs . get ( 'is_public' ) : flavor . add_attr ( 'flavor-access:is_public' , kwargs . get ( 'is_public' ) ) flavor . add_attr ( 'xmlns:flavor-access' , XMLNS_OS_FLV_ACCESS ) resp , body = self . post ( 'flavors' , str ( Document ( flavor ) ) , self . headers ) body = xml_to_json ( etree . fromstring ( body ) ) flavor = self . _format_flavor ( body ) return resp , flavor
Creates a new flavor or instance type.
Creates a new flavor or instance type .
"""Creates a new flavor or instance type."""
self
name
ram
vcpus
disk
flavor_id