tempest/services/compute/v3/json/flavors_client.py
def create_flavor(self, name, ram, vcpus, disk, flavor_id, **kwargs):
        """Creates a new flavor or instance type."""
        post_body = {
            'name': name,
            'ram': ram,
            'vcpus': vcpus,
            'disk': disk,
            'id': flavor_id,
        }
        if kwargs.get('ephemeral'):
            post_body['ephemeral'] = kwargs.get('ephemeral')
        if kwargs.get('swap'):
            post_body['swap'] = kwargs.get('swap')
        if kwargs.get('rxtx'):
            post_body['rxtx_factor'] = kwargs.get('rxtx')
        if kwargs.get('is_public'):
            post_body['flavor-access:is_public'] = kwargs.get('is_public')
        post_body = json.dumps({'flavor': post_body})
        resp, body = self.post('flavors', post_body, self.headers)

        body = json.loads(body)
        return resp, body['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):
        post_body = {
            'name': name,
            'ram': ram,
            'vcpus': vcpus,
            'disk': disk,
            'id': flavor_id,
        }
        if kwargs.get('ephemeral'):
            post_body['ephemeral'] = kwargs.get('ephemeral')
        if kwargs.get('swap'):
            post_body['swap'] = kwargs.get('swap')
        if kwargs.get('rxtx'):
            post_body['rxtx_factor'] = kwargs.get('rxtx')
        if kwargs.get('is_public'):
            post_body['flavor-access:is_public'] = kwargs.get('is_public')
        post_body = json.dumps({'flavor': post_body})
        resp, body = self.post('flavors', post_body, self.headers)
        body = json.loads(body)
        return resp, body['flavor']
def create_flavor ( self , name , ram , vcpus , disk , flavor_id , ** kwargs ) : post_body = { 'name' : name , 'ram' : ram , 'vcpus' : vcpus , 'disk' : disk , 'id' : flavor_id , } if kwargs . get ( 'ephemeral' ) : post_body [ 'ephemeral' ] = kwargs . get ( 'ephemeral' ) if kwargs . get ( 'swap' ) : post_body [ 'swap' ] = kwargs . get ( 'swap' ) if kwargs . get ( 'rxtx' ) : post_body [ 'rxtx_factor' ] = kwargs . get ( 'rxtx' ) if kwargs . get ( 'is_public' ) : post_body [ 'flavor-access:is_public' ] = kwargs . get ( 'is_public' ) post_body = json . dumps ( { 'flavor' : post_body } ) resp , body = self . post ( 'flavors' , post_body , self . headers ) body = json . loads ( body ) return resp , body [ '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