Slide 36
Slide 36 text
@bp.route("/", methods=["POST"])
@validated_body
def create_dns_record(ndr: CreateDNSRecord) -> APIResult:
try:
dr_id = svc.create_record(
get_uow(), ndr.domain, # ...
)
except PlanError as e:
raise APIError(
id=error_ids.PLAN_NOT_SUFFICIENT,
status="402",
title=e.args[0],
source={"pointer": "/data/attributes/domain"},
)
# ...