'Create a new flavor or instance type.
For a full list of available parameters, please refer to the official
API reference:
https://developer.openstack.org/api-ref/compute/#create-flavor'

def create_flavor(self, **kwargs):

    if ('ephemeral' in kwargs):
        kwargs['OS-FLV-EXT-DATA:ephemeral'] = kwargs.pop('ephemeral')
    if ('is_public' in kwargs):
        kwargs['os-flavor-access:is_public'] = kwargs.pop('is_public')
    post_body = json.dumps({'flavor': kwargs})
    (resp, body) = self.post('flavors', post_body)
    body = json.loads(body)
    self.validate_response(schema.create_get_flavor_details, resp, body)
    return rest_client.ResponseBody(resp, body)
