350-401 · Question #710
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 repl
The correct answer is A. POST. NETCONF to RESTCONF Operation Mapping POST is the correct RESTCONF equivalent for NETCONF's <edit-config> operation="create" because both are used to create a new resource that does not yet exist on the device - if the resource already exists, the operation will fail with an erro
Question
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?
Options
- APOST
- BGET
- CPUT
- DCREATE
How the community answered
(31 responses)- A90% (28)
- C6% (2)
- D3% (1)
Explanation
NETCONF to RESTCONF Operation Mapping
POST is the correct RESTCONF equivalent for NETCONF's <edit-config> operation="create" because both are used to create a new resource that does not yet exist on the device - if the resource already exists, the operation will fail with an error, preserving the "create-only" behavior.
GET (Option B) is used purely for retrieving/reading data, making it the equivalent of NETCONF's <get> operation - it has no ability to modify configurations. PUT (Option C) maps more closely to NETCONF's operation="replace", as it creates or replaces an existing resource, meaning it won't fail if the resource already exists. CREATE (Option D) is simply not a valid RESTCONF HTTP method - RESTCONF is built on standard HTTP methods (GET, POST, PUT, PATCH, DELETE).
Memory Tip: Think of POST = "Please Only Start Today" (create something new), while PUT = "Place Until Transformed" (replace whatever is there). If NETCONF says "create" (new only), RESTCONF says POST.
Topics
Community Discussion
No community discussion yet for this question.