'Create a QoS policy.
:param context: neutron api request context
:type context: neutron_lib.context.Context
:param policy: policy data to be applied
:type policy: dict
:returns: a QosPolicy object'

@db_base_plugin_common.convert_result_to_dict
def create_policy(self, context, policy):

    policy['policy'].pop('tenant_id', None)
    policy_obj = policy_object.QosPolicy(context, **policy['policy'])
    with db_api.context_manager.writer.using(context):
        policy_obj.create()
        self.driver_manager.call(qos_consts.CREATE_POLICY_PRECOMMIT, context, policy_obj)
    self.driver_manager.call(qos_consts.CREATE_POLICY, context, policy_obj)
    return policy_obj
