A company recently decided to use RESTCONF instead of NETCONF, and many of their NETCONF scripts contain the operation <edit-config> (operation="create"). Which RESTCONF operation must be used to replace these statements?
RESTCONF 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”)
The 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.
While 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).
so 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
imo, 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
It 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)
I 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."
Has 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
POST: This method creates a data resource or invokes an operations resource.
upvoted 4 times
...
This section is not available anymore. Please use the main Exam Page.350-401 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Ado_68
Highly Voted 2 years, 6 months agoPALURDIN
Highly Voted 2 years, 8 months agoaaabattery
2 years, 1 month agoa67c04a
Most Recent 8 months, 3 weeks agoeXPlosion
1 month, 2 weeks ago[Removed]
11 months, 2 weeks agoZarNi
1 year agoteems5uk
1 year, 3 months agoDan_T_P
1 year, 4 months agoasusarla
1 year, 9 months agoAlondrix
1 year, 6 months agoCisR
1 year, 10 months agoBluntedcase
1 year, 10 months agoBluntedcase
1 year, 10 months agonet_eng10021
1 year, 11 months agoMO_2022
2 years, 4 months agoBryCR
2 years, 6 months agodoron1122
2 years, 6 months agodoron1122
2 years, 6 months agonet_eng10021
1 year, 11 months agojj970us
2 years, 8 months ago