Question

Difficulty: MediumCharacteristics of REST-Based APIs (CRUD, HTTP Verbs, Data Formats)

An administrator needs to modify only the target syslog server address on a network device via a RESTCONF API. The existing target resource container contains configuration attributes for syslog logging levels, facility settings, and buffer sizes. To update the server address without deleting or overwriting the unreferenced logging attributes within that resource container, which HTTP verb and header combination must be transmitted?

  1. HTTP PATCH verb with Content-Type: application/yang-data+jsonAnswer
  2. B
    HTTP PUT verb with Content-Type: application/yang-data+json
  3. C
    HTTP POST verb with Content-Type: application/yang-data+json
  4. D
    HTTP GET verb with Content-Type: application/yang-data+json

Answer

HTTP PATCH verb with Content-Type: application/yang-data+json
The HTTP PATCH verb is designed for partial resource modification. When modifying a sub-element (such as a syslog server IP) inside an existing resource container, PATCH applies changes only to the keys included in the request payload while preserving unreferenced parameters such as facility settings and buffer sizes.

Step-by-Step Solution

1
Identify the required CRUD operation
The operation requires a partial update to modify specific fields within an existing configuration container without affecting existing untouched parameters.
Understanding whether the intent is partial modification or complete resource replacement dictates the choice between REST HTTP verbs.
2
Map the required operation to the correct HTTP verb
The HTTP PATCH verb corresponds to partial update in REST API architecture.
HTTP PUT replaces the complete resource object, whereas HTTP PATCH updates only the supplied fields.
3
Verify payload format headers for RESTCONF data interaction
RESTCONF uses specialized media type headers such as application/yang-data+json to process JSON payload data structures.
Correct HTTP Content-Type headers ensure the target API parser interprets the body syntax properly.

Key Concept

REST HTTP Verbs vs CRUD Operations (PUT vs PATCH differences)
Estimated Time:1m 0s
Rate this question