A Python script using the requests library sends a RESTCONF PATCH to set an interface description and receives HTTP 400 with a YANG error body whose error-path names a leaf absent from the device's YANG model. The engineer must decide what to fix before sending anything again. Which interpretation of that RESTCONF response should the script act on?
Select an answer to reveal the explanation.
Short Explanation
A 400 from RESTCONF means the device refused the edit and the datastore changed nothing, while the YANG error body names the node it disliked. Since error-path points at a leaf your model does not have, the payload's the problem rather than the connection. It works like a form rejecting a field label the server does not know, so fix the field name before resubmitting.
Full Explanation
The response is an HTTP 400 with a YANG error-path identifying a leaf that the device’s model does not define. That is actionable evidence of a schema/payload mismatch, so the script should correct the payload—by removing or replacing the unsupported leaf—before retrying. Checking namespace mappings is a sensible way to diagnose YANG errors when a module or prefix may be misidentified, but it does not resolve this case: the premise says the named leaf is absent from the device’s model, not merely qualified incorrectly. Confirming datastore writability is also useful when edits fail because of target selection or permissions; switching datastores cannot make an undefined leaf valid. Likewise, checking the supported PATCH media type and encoding is a standard RESTCONF interoperability check, but the reported YANG path points to model validation rather than a media-type problem, so resending the unchanged body in another format does not address the stated cause. Exam caveat: an HTTP status alone rarely identifies the precise fault; interpret the structured RESTCONF/YANG error body and its error-path in context. Practical check: compare the payload’s module-qualified leaf names with the device’s advertised YANG library or schema for the relevant datastore, then validate the revised body before sending it.