def _get_strategy(self, context, fieldname, value): try: return self._get(context, model=models.Strategy, fieldname=fieldname, value=value) except exception.ResourceNotFound: raise exception.StrategyNotFound(strategy=value)
def update_strategy(self, strategy_id, values): if 'uuid' in values: raise exception.Invalid( message=_("Cannot overwrite UUID for an existing Strategy.")) try: return self._update(models.Strategy, strategy_id, values) except exception.ResourceNotFound: raise exception.StrategyNotFound(strategy=strategy_id)
def soft_delete_strategy(self, strategy_id): try: return self._soft_delete(models.Strategy, strategy_id) except exception.ResourceNotFound: raise exception.StrategyNotFound(strategy=strategy_id)
def destroy_strategy(self, strategy_id): try: return self._destroy(models.Strategy, strategy_id) except exception.ResourceNotFound: raise exception.StrategyNotFound(strategy=strategy_id)