A client uses a YANG-defined interface model and sends its values in JSON. Which statement correctly describes the roles of YANG and JSON?
2 Network APIs and Data Models Online Quiz Questions
Use this free practice quiz with 20 questions to review 2 Network APIs and Data Models, test your knowledge, and prepare for your next test or exam.
An API returns 204 No Content after a resource update. What should the client infer from this response?
- A
The request failed because every successful response must include a body.
- B
The response is a redirection because 204 is in the 3xx class.
- C
The response indicates success and contains no body.
- D
The server has not found the target resource.
An API documents support for partial resource changes. Which HTTP method should a client consider for changing only selected fields?
- A
GET
- B
POST
- C
PUT
- D
PATCH
An HTTP request contains a method, target URL, headers, and sometimes a body. Which part expresses the operation the client wants performed?
- A
The method
- B
The target URL
- C
The headers
- D
The body
A client will authenticate to a network API with a bearer token. Which practices help protect that token? Select all that apply.
- A
Use HTTPS with certificate validation.
- B
Keep credentials out of logs and code repositories.
- C
Grant only the permissions needed.
- D
Put the token in the request URL so it is easy to inspect.
- E
Disable certificate validation to avoid connection failures.
A team is automating API changes that may encounter timeouts or rate limits. Which practices are appropriate? Select all that apply.
- A
Validate input before sending a change.
- B
Retry every failed POST immediately without checking its outcome.
- C
Handle timeouts and rate limits.
- D
Make retries carefully because a repeated POST may create duplicates.
A repeated PUT is intended to have the same effect as one successful PUT, so retrying it is generally less likely to create duplicate resources than repeating a POST.
- A
True
- B
False
Because YAML is commonly used for human-edited configuration files, a network API will automatically accept YAML request bodies.
- A
True
- B
False
Which gNMI RPC lets a client discover the models and encodings supported by a target? Enter the exact RPC name.
An API response indicates that the requested target was not found. What three-digit HTTP status code corresponds to this condition?
An HTTP response with a 5xx status code indicates a error.
In gNMI, the RPC used to receive updates through a one-time result, polling, or a continuing stream is .
After an API accepts a configuration change, what should a client check to confirm that the intended network outcome was actually achieved?
A network-management client communicates with a service using gRPC, including gNMI. Which listed encoding is schema-based and binary?
- A
YAML
- B
Protocol Buffers
- C
XML
- D
JSON
An API uses an interface schema that specifies a name, an enabled flag, and a numeric MTU. Which statement best describes the relationship between that schema and JSON?
- A
A data model is the text encoding used on the wire, while JSON defines valid field types and constraints.
- B
A data model defines the information and constraints; JSON is one format that can encode that information.
- C
A data model and an encoding format are interchangeable names for the same API component.
- D
JSON defines which network resources exist, while a data model specifies how requests are authenticated.
A team has a network configuration file written in YAML and wants to submit it to an API. What should they do before sending it?
- A
An API accepts YAML whenever its configuration can be edited in YAML.
- B
YAML is always the required format for network API requests.
- C
The API documentation must be checked to determine whether YAML is supported.
- D
YAML is a data model, so it cannot be used to encode configuration.
Which HTTP method would a client typically use to retrieve the current representation of a network interface?
A client receives a successful response after requesting a network configuration change. The client can conclude that the intended network state has been achieved without checking the resulting state.
- A
True
- B
False
A client wants to change only an interface's MTU by sending a PUT body containing the interface name and new MTU. What should the client check before sending the request?
- A
PUT always changes only the fields included in the request body.
- B
The endpoint may treat PUT as replacement of the complete resource, so its update semantics should be checked.
- C
PUT is used only to retrieve a resource and cannot change it.
- D
PUT is guaranteed to append the request body as a new resource.
Which gNMI RPC does a client use to modify network data?