@exception.wrap_pecan_controller_exception
    @pecan.expose()
    def put(self):
        """Modify this plan."""
        # make sure the plan exists before parsing the request
        handler = plan_handler.PlanHandler(pecan.request.security_context)
        handler.get(self._id)

        if not pecan.request.body or len(pecan.request.body) < 1:
            raise exception.BadRequest(reason="No data.")

        if (pecan.request.content_type is not None and
                'yaml' in pecan.request.content_type):
            data = init_yml_plan_by_version()
            updated_plan_yml = yamlutils.dump(yaml_content(handler.update(
                self._id, data.as_dict(objects.registry.Plan))))
        else:
            data = init_json_plan_by_version()
            plan_obj = handler.update(self._id,
                                      data.as_dict(objects.registry.Plan))
            updated_plan_yml = wsme_json.encode_result(plan.Plan.from_db_model(
                plan_obj, pecan.request.host_url), plan.Plan)

        pecan.response.status = 200
        return updated_plan_yml
dataset/ETHPy150Open openstack/solum/solum/api/controllers/v1/plan.py/PlanController.put/original