def callback(pulp_ctx: PulpContext, entity_ctx: PulpEntityContext, **kwargs: Any) -> None: """ Update a {entity}. """ body: EntityDefinition = entity_ctx.preprocess_body(kwargs) entity_ctx.update(href=entity_ctx.pulp_href, body=body)
def callback(pulp_ctx: PulpContext, entity_ctx: PulpEntityContext, **kwargs: Any) -> None: """ Create a {entity}. """ body: EntityDefinition = entity_ctx.preprocess_body(kwargs) result = entity_ctx.create(body=body) if "created_resources" in result: entity_ctx.pulp_href = result["created_resources"][0] result = entity_ctx.entity pulp_ctx.output_result(result)