Huawei OPS Connection Class HTTP Method Mapping Errors
Short answer
AD Both A and D are incorrect because create() should use POST instead of PUT, and set() should use PUT instead of POST.
Question
Key Takeaways
The main trap is confusing HTTP POST (for creation) with PUT (for modification). Remember: Create=POST, Update=PUT, Read=GET, Delete=DELETE.
Identify incorrect HTTP method mappings in Huawei OPSConnection class. Correct answers are A and D, as create() needs POST and set() needs PUT.
Common mistake: Choosing only one option (A or D) is common, but both A and D represent incorrect mappings according to REST standards and Huawei's template.
Expert Analysis
The question asks to identify the incorrect HTTP method mappings in the Huawei OPSConnection class script template. This requires knowledge of standard RESTful API conventions and how Huawei's OPS implementation aligns with them.
In RESTful design:
- GET is used to retrieve data (Read).
- POST is typically used to create new resources (Create).
- PUT is used to update or modify existing resources (Update/Set).
- DELETE is used to remove resources (Delete).
Analyzing the options based on community feedback and standard practices:
- Option A (
createusesPUT): This is incorrect. Creating a resource should usePOST. UsingPUTfor creation is non-standard and often implies an idempotent upsert, but in the context of simple CRUD templates,createmaps toPOST. The comment explicitly states: "A — create uses 'PUT' → incorrect. Creating a resource should use POST." - Option B (
deleteusesDELETE): This is correct. Deleting a resource uses theDELETEmethod. - Option C (
getusesGET): This is correct. Retrieving a resource uses theGETmethod. - Option D (
setusesPOST): This is incorrect. Modifying or setting a resource configuration should usePUT.POSTis for creation. The comment states: "D — set uses 'POST' → incorrect. Modifying/setting a resource should use PUT."
Therefore, both A and D contain incorrect method mappings. The question asks for the incorrect methods, so both A and D are valid answers.
This topic covers the integration of Python scripts with network devices via REST APIs, a key aspect of network automation. Understanding the semantic difference between POST (create) and PUT (update) is critical for writing functional automation scripts. Getting this wrong leads to operational errors where scripts fail to create objects or incorrectly overwrite existing configurations.
Exam Strategy
When dealing with REST API questions in certification exams, always revert to standard HTTP semantics: POST for creating, PUT for updating, GET for reading, DELETE for removing. If a question asks for 'incorrect' mappings, check every option against these four pillars. Do not assume 'set' means 'create'; 'set' implies modifying an existing state, which is a PUT operation.
Frequently Asked Questions
Why does create() use POST and not PUT?
What is the difference between POST and PUT in Huawei OPS?
Community Votes
100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 3 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 3
-
0d3d98b 👍 4Should be AD According Examples 'Create' uses 'POST', and 'Modify' uses 'PUT'
-
6702b63 👍 2like Question #82 A and D
-
megamind23 👍 1 Answered ASould be AD A — create() uses "PUT" → incorrect. Creating a resource should use POST. B — delete() uses "DELETE" → correct. C — get() uses "GET" → correct. D — set() uses "POST" → incorrect. Modifying/setting a resource should use PUT
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.