RESTCONF operation for NETCONF edit-config create
Short answer
D Use RESTCONF POST, not PUT, to replace NETCONF <edit-config> operation="create" statements that create a YANG data resource.
Question
(operation="create"). Which RESTCONF operation must be used to replace these statements?
Key Takeaways
It tests the method mapping between NETCONF edit-config operations and RESTCONF HTTP verbs, with the trap of choosing PUT from the "create or replace" wording instead of matching create-only to POST.
This question tests the RESTCONF method corresponding to NETCONF <edit-config> operation="create"; the correct replacement is POST (D), while PUT is create-or-replace.
Common mistake: The most plausible wrong answer is PUT (A). PUT is create-or-replace: it can overwrite an existing target resource, whereas NETCONF operation="create" is create-only and should fail if the node exists; POST matches that create-only semantics.
Expert Analysis
What the NETCONF operation means
<edit-config> is NETCONF's configuration edit RPC, and operation="create" is a create-only instruction: the target data node must not already exist. If it does, the server returns an error rather than merging or replacing. The company is not asking how to overwrite an existing node; it is translating that create-only statement into a RESTCONF HTTP method.
The RESTCONF request path
In RESTCONF, the YANG data resource is addressed by a URI, and the HTTP method selects the edit behavior. A request goes to the target resource or its parent collection. POST is the create operation: it submits a new resource under the target parent. PUT is create-or-replace: it writes the supplied representation at the target URI and will replace an existing resource. PATCH is merge, DELETE removes, and GET only retrieves. CREATE is not an HTTP/RESTCONF method at all. That makes D the exact match for operation="create"; PUT corresponds to the broader create/replace or replace semantics, which is not what the original NETCONF statement does.
Why the "replace" wording is a trap
The question says the scripts need to "replace these statements," but that means replacing the NETCONF statement in the script, not replacing data on the device. A comment argues for PUT because Cisco's RESTCONF documentation summarizes PUT as "create or replace," noting that if the command is not present it is created and if present it is replaced. That is real PUT behavior, but it is precisely why PUT is a poorer match to create-only. Another mapping cited in the discussion pairs POST with <edit-config> operation="create" and PUT with operation="create/replace", with PATCH for merge and DELETE for delete. The exam should be answered by the operation semantics, not by the word "replace" in the scenario.
Verdict
The replacement operation is POST (D). Use it when the RESTCONF request must create a resource only; use PUT only when create-or-replace behavior is intended.
Official Reference
- https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/171/b_171_programmability_cg/restconf_protocol.html#id_125840
- https://www.rfc-editor.org/rfc/rfc8040
These links open the official vendor documentation in a new tab.
Exam Strategy
Build a small method-to-operation table before reading the options: POST creates, PUT creates or replaces, PATCH merges, DELETE deletes, and GET reads. Then isolate the NETCONF operation in the stem—create-only is not the same as create/replace—and ignore incidental words such as "replace these statements," which describe editing the script rather than device data. This technique also works for RESTCONF status-code and URI questions because it forces you to separate the HTTP verb's semantics from the resource being addressed.
Frequently Asked Questions
Does RESTCONF POST create a resource only, whereas PUT can replace it?
Which RESTCONF method matches NETCONF edit-config operation="merge"?
Is CREATE a valid RESTCONF operation?
Community Votes
50% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 21 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 21
-
Ado_68 👍 13RESTCONF NETCONF GET <get>, <get-config> POST <edit-config> (operation=”create”) PUT <edit-config> (operation=”create/replace”) Selected Answer D PATCH <edit-config> (operation=”merge”) DELETE <edit-config> (operation=”delete”)
-
PALURDIN 👍 10 Answered DRESTCONF does not have CREATE method.
-
jj970us 👍 4 Answered DPOST: This method creates a data resource or invokes an operations resource.
-
doron1122 👍 3why no A ? PUT: This method creates or replaces the target resource.
-
MO_2022 👍 3 Answered DPOST <edit-config> (operation=”create”)
Show 16 more comments
-
Dan_T_P 👍 2 Answered Dso from https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/171/b_171_programmability_cg/restconf_protocol.html#id_125840 it is either PUT (create or replace) or POST (create or operation like reload) however looking at the question key wording is that scripts contain the "operation" so from the link answer =>POST
-
Alondrix 👍 2You are interpreting as replacing information on the device. The question is asking to replace the NETCONF command with the RESTCONF command.
-
net_eng10021 👍 2I'm wondering the same thing...why not A? PUT <edit-config> (operation=”create/replace”)
-
ZarNi 👍 1 Answered AThe PUT method is used to create or replace the entire resource identified by the Request-URI (Uniform Resource Identifier). If the resource does not exist, it is created. If the resource already exists, it is replaced with the new representation specified in the request payload. Therefore, when migrating from NETCONF scripts that use <edit-config> (operation="create") to RESTCONF, the corresponding operation to use is PUT.
-
asusarla 👍 1imo, I'm going with PUT...the keyword in the question says "replace" PUT: (Create or Replace) Request: If the specified command is not present on the device, the POST request creates it ; however, if it is already present in the running configuration, the command will be replaced by this request https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/171/b_171_programmability_cg/restconf_protocol.html#id_125840
-
teems5uk 👍 1 Answered AWhile POST can be used for creating resources, the more direct equivalent to <edit-config> with operation="create" in NETCONF is the PUT method. PUT is used when you want to update or create a resource at a specific URI. In summary, for the scenario described in the question, where <edit-config> with operation="create" is used in NETCONF scripts, the appropriate RESTCONF operation is PUT (option A).
-
Bluntedcase 👍 1I think it's A. Here from Cisco: https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/171/b_171_programmability_cg/restconf_protocol.html#id_125840 "PUT: (Create or Replace) Request: If the specified command is not present on the device, the POST request creates it ; however, if it is already present in the running configuration, the command will be replaced by this request."
-
CisR 👍 1It could be A or D. A if they mean use RESTCONF to replace the text in the NETCONF script (therefore a PUT as that is the replace operator, you are replacing some text with something else) D if they mean reword the NETCONF script by some means to do the same thing as it did before, which was a 'create' (and therefore a POST)
-
BryCR 👍 1Has to be POST D https://www.cisco.com/c/en/us/td/docs/dcn/nx-os/nexus9000/101x/programmability/cisco-nexus-9000-series-nx-os-programmability-guide-release-101x/m-n9k-agent-restconf-101x.pdf
-
aaabattery 👍 1https://www.cisco.com/c/en/us/td/docs/dcn/nx-os/nexus9000/101x/programmability/cisco-nexus-9000-series-nx-os-programmability-guide-release-101x/m-n9k-agent-restconf-101x.pdf
-
Bluntedcase 👍 1I've realised my mistake.... of course it's a new command in order to replace the CREATE from NETCONF. That's why POST would be correct, imo
-
net_eng10021 👍 1Why would A not work? PUT <edit-config> (operation=”create/replace”)
-
doron1122 👍 1https://www.ipspace.net/kb/CiscoAutomation/070-netconf.html
-
a67c04a 👍 1 Answered AGoing with A. The question says replace = PUT.
-
eXPlosion 👍 1Wrong, you did not read the question
-
Ocsicccnp 👍 1 Answered APUT means replace
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All 350-401 Questions
Access 218 questions with complete answers and detailed explanations.
View Full 350-401 Practice Test →