DevNet Professional study materials
DevNet Professional study resources

DevNet Professional practice questions

One question at a time. Build your DevNet Professional understanding.

First 50 of 199 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1Network automation and programmability fundamentals

In a NETCONF session, which YANG statement defines a data node that can appear at most once and is always created with its parent?

  1. list
  2. rpc
  3. leaf-list
  4. container Correct answer.

Explanation

A container is a non-instantiable grouping node that holds child nodes and exists implicitly whenever its parent exists; it cannot repeat. A list and a leaf-list both allow multiple instances, and rpc defines an operation rather than configuration data.

Question 2Network automation and programmability fundamentals

An engineer needs a RESTCONF request that returns only the interface named GigabitEthernet1 from a device running a YANG model. Which HTTP request line is correct?

  1. POST /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1
  2. PUT /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1
  3. GET /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1 Correct answer.
  4. GET /restconf/data/ietf-interfaces:interfaces/interface/GigabitEthernet1

Explanation

RESTCONF addresses a list entry by appending the key name and value after an equals sign, and retrieving data uses GET. The method must be read-only for a query, and the list key is joined with '=' rather than a slash.

Question 3Network automation and programmability fundamentals

Which HTTP status code does a RESTCONF server return when a client sends a request body that violates a YANG 'must' constraint?

  1. 404 Not Found
  2. 405 Method Not Allowed
  3. 401 Unauthorized
  4. 400 Bad Request Correct answer.

Explanation

RFC 8040 maps semantic and syntactic errors in the message body, including violated YANG constraints, to 400 Bad Request. Authorization failures use 401, missing resources use 404, and unsupported methods use 405, none of which describe invalid content.

Question 4Network automation and programmability fundamentals

A Python script uses ncclient to edit a device configuration and wants the change to apply immediately without a candidate datastore commit. Which target should it pass?

  1. "startup"
  2. "running" Correct answer.
  3. "candidate"
  4. "intended"

Explanation

Editing the running datastore applies the change immediately on servers that support direct running edits. The candidate datastore requires an explicit commit, startup only affects the next boot, and intended is a YANG NMDA datastore not used as an edit target here.

Question 5Network automation and programmability fundamentals

What is the primary purpose of a YANG module's revision statement sequence?

  1. To record the module's version history so importers can select a compatible revision Correct answer.
  2. To declare which namespaces the module owns
  3. To list the devices that may use the module
  4. To specify the transport protocol used to access the data

Explanation

Each revision statement carries a date and description, forming a chronological history that lets a client or import statement reference a specific revision. Namespaces are declared separately, and the module does not define devices or transport.

Question 6Network automation and programmability fundamentals

In Ansible, a playbook task must run a configuration change only when the device is not already compliant. Which construct achieves this?

  1. A loop using with_items
  2. A delegate_to directive
  3. A conditional using the when keyword Correct answer.
  4. A handler triggered by notify

Explanation

The when keyword evaluates an expression per host and skips the task when the condition is false, which supports idempotent compliance checks. Handlers respond to change notifications, loops repeat a task, and delegation changes the execution host.

Question 7Network automation and programmability fundamentals

Which characteristic distinguishes a declarative automation approach from an imperative one?

  1. It describes the desired end state and lets the tool compute the steps Correct answer.
  2. It cannot be made idempotent
  3. It only works with CLI transports
  4. It requires the operator to script every command in sequence

Explanation

Declarative tooling accepts a target state and determines the operations needed to reach it, which naturally supports idempotency. Imperative approaches list explicit steps, and neither approach is tied to a single transport.

Question 8Network automation and programmability fundamentals

A team wants a single YANG model to represent both configuration and operational state for interfaces. Which YANG construct provides read-only state nodes?

  1. presence true
  2. mandatory true
  3. ordered-by user
  4. config false Correct answer.

Explanation

Setting config false marks a subtree as state data that cannot be configured, which is how operational values are modeled. mandatory, presence, and ordered-by affect existence and ordering rules but not read-only semantics.

Question 9Network automation and programmability fundamentals

What does the NETCONF <get-config> operation return compared with <get>?

  1. Only configuration data from the specified datastore Correct answer.
  2. The device's full startup configuration file
  3. Only state data from the specified datastore
  4. Both configuration and state data from the running system

Explanation

get-config retrieves configuration data from a named datastore, defaulting to running. The get operation returns both configuration and state data, and neither operation returns a raw startup file.

Question 10Network automation and programmability fundamentals

A developer needs to subscribe to YANG-modeled telemetry pushed from a router. Which transport and encoding pairing is most typical for model-driven telemetry on Cisco IOS XE?

  1. gRPC with protobuf-encoded KV-GPB or GPB Correct answer.
  2. SNMP with BER encoding
  3. Syslog over UDP with plaintext
  4. TFTP with netascii encoding

Explanation

Model-driven telemetry commonly uses gRPC as the transport with GPB or KV-GPB encoding for structured, high-frequency push updates. SNMP polling, syslog, and TFTP are legacy mechanisms that do not carry model-driven structured telemetry.

Question 11Network automation and programmability fundamentals

Which Python library is designed specifically to interact with network devices over SSH and handle prompt detection and paging?

  1. PyYAML
  2. Requests
  3. Netmiko Correct answer.
  4. Jinja2

Explanation

Netmiko builds on Paramiko and adds network-specific handling such as prompt detection, disabling paging, and sending configuration sets. Requests handles HTTP, PyYAML parses YAML, and Jinja2 renders templates.

Question 12Network automation and programmability fundamentals

A JSON payload must be validated against a YANG module before being sent with a RESTCONF PATCH. Which artifact best supports that validation?

  1. The YANG source module compiled into a schema tree Correct answer.
  2. A TACACS+ server configuration
  3. A syslog severity table
  4. An SNMP MIB file

Explanation

Compiling YANG modules produces a schema tree that defines allowed nodes, types, and constraints, which tooling uses to validate JSON or XML payloads. MIBs, syslog tables, and AAA server settings do not describe RESTCONF data structure.

Question 13Network automation and programmability fundamentals

Which statement accurately describes the relationship between OpenConfig and IETF YANG models?

  1. OpenConfig models are vendor-neutral models often used alongside IETF models on the same device Correct answer.
  2. IETF models are derived automatically from OpenConfig models
  3. OpenConfig models replace all IETF models and cannot coexist
  4. OpenConfig models are proprietary to a single vendor

Explanation

OpenConfig publishes vendor-neutral models that devices commonly support in addition to IETF standard models, and both can be present in the same schema. They are not vendor-proprietary, and neither family is generated from the other.

Question 14Network automation and programmability fundamentals

An engineer wants to retrieve a device's interface counters using NETCONF with a subtree filter. Which filter element correctly restricts the reply to the interfaces container?

  1. <filter type="subtree"><interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"/></filter> Correct answer.
  2. <filter type="xpath" select="/interfaces"/>
  3. <get-config><source><running/></source></get-config>
  4. <filter type="subtree"><running/></filter>

Explanation

A subtree filter contains XML elements that mirror the target data tree, with the namespace identifying the model. The xpath option requires a proper XPath expression, and the other choices either omit the filter or place a datastore element inside it.

Question 15Network automation and programmability fundamentals

In a YANG list, what is the role of the key statement?

  1. It defines the default value used when an entry is created
  2. It names the leaf or leaves that uniquely identify each list entry Correct answer.
  3. It marks the list as read-only operational data
  4. It specifies the maximum number of entries allowed

Explanation

The key statement lists one or more leafs whose values uniquely identify each list instance, and those leafs must exist in every entry. Defaults, read-only status, and size limits are expressed by other statements.

Question 16Network automation and programmability fundamentals

Which RESTCONF media type requests that the server return data encoded as JSON?

  1. application/yang-data+json Correct answer.
  2. application/yang-patch+xml
  3. text/plain
  4. application/xml

Explanation

RFC 8040 defines application/yang-data+json for JSON-encoded YANG data and application/yang-data+xml for XML. The other listed types either specify XML or are not YANG data media types.

Question 17Network automation and programmability fundamentals

A CI pipeline must verify that a proposed YANG module compiles and that its imports resolve. Which tool is appropriate for this check?

  1. pyang Correct answer.
  2. tcpdump
  3. nmap
  4. iperf3

Explanation

pyang parses and validates YANG modules, reporting syntax errors and unresolved imports, which makes it suitable for pipeline gating. The other tools perform packet capture, bandwidth testing, and port scanning.

Question 18Network automation and programmability fundamentals

Which YANG statement is used to include a grouping's nodes inside a container without creating a separate data node for the grouping itself?

  1. augment
  2. typedef
  3. feature
  4. uses Correct answer.

Explanation

The uses statement instantiates the contents of a grouping at that location, so the grouping name does not appear as a node. typedef creates a type, feature gates optional nodes, and augment adds nodes to an existing tree.

Question 19Network automation and programmability fundamentals

What does the YANG leafref type accomplish?

  1. It restricts a leaf to a fixed enumeration
  2. It embeds a copy of another leaf's value at compile time
  3. It converts a string leaf into an integer
  4. It references the value of another leaf so the two remain consistent Correct answer.

Explanation

A leafref uses a path to point at another leaf instance, and validation requires that the referenced value exist, which enforces referential integrity. It does not copy values, change types, or define enumerations.

Question 20Network automation and programmability fundamentals

A developer writes a Jinja2 template that must render one configuration block per VLAN in a list. Which template construct is appropriate?

  1. A for loop over the VLAN list Correct answer.
  2. A macro with no arguments
  3. An if block testing a single boolean
  4. A comment block

Explanation

A for loop iterates over the provided list and emits a block for each item, which is the standard way to render repeated configuration. Conditionals, argument-free macros, and comments do not iterate over data.

Question 21Network automation and programmability fundamentals

Which statement about the NETCONF <lock> operation is accurate?

  1. It permanently reserves the datastore for the requesting user
  2. It copies the running datastore to startup
  3. It encrypts the datastore contents for the session
  4. It prevents other sessions from modifying the locked datastore until it is unlocked Correct answer.

Explanation

A lock grants the session exclusive write access to a datastore and other sessions receive an error if they attempt to modify it until unlock. It does not encrypt data, persist beyond the session, or copy configurations.

Question 22Network automation and programmability fundamentals

An automation script must parse semi-structured device output that uses indentation rather than braces. Which data format is most likely being parsed?

  1. YAML Correct answer.
  2. JSON
  3. Protocol Buffers
  4. CSV

Explanation

YAML represents hierarchy through indentation, whereas JSON uses braces and brackets. Protocol Buffers is a binary encoding, and CSV is a flat tabular format without nesting.

Question 23Network automation and programmability fundamentals

A RESTCONF client sends a PATCH with content type application/yang-data+json to an existing interface resource. What is the expected effect?

  1. A new sibling resource is created under the parent
  2. The entire resource is replaced, deleting unlisted children
  3. The request is rejected because PATCH is not allowed
  4. The listed leaf values are merged into the target resource Correct answer.

Explanation

RFC 8040 defines PATCH with yang-data media types as a merge operation that updates only the nodes present in the body. Full replacement is the behavior of PUT, creation targets the parent collection, and PATCH is a supported method on data resources.

Question 24Network automation and programmability fundamentals

Which capability in the NETCONF hello message indicates support for the candidate datastore?

  1. urn:ietf:params:netconf:capability:writable-running:1.0
  2. urn:ietf:params:netconf:capability:rollback-on-error:1.0
  3. urn:ietf:params:netconf:base:1.1
  4. urn:ietf:params:netconf:capability:candidate:1.0 Correct answer.

Explanation

The candidate capability URN advertises that the server supports a candidate datastore with commit. The writable-running URN covers direct running edits, base 1.1 covers framing, and rollback-on-error covers error recovery.

Question 25Network automation and programmability fundamentals

A team wants automated tests to assert that a rendered device configuration contains a specific BGP neighbor line. Which approach is most robust?

  1. Compare the rendered output against a screenshot
  2. Grep the template source file for the neighbor string
  3. Parse the rendered output and assert on the structured neighbor entry Correct answer.
  4. Count the total number of lines in the output

Explanation

Parsing the rendered configuration into structured data and asserting on the specific neighbor entry verifies the actual generated result and is resilient to formatting changes. Searching the template source, using screenshots, or counting lines does not confirm the rendered content.

Question 26Network automation and programmability fundamentals

A developer wants to retrieve only the hostname leaf from a device's native YANG model using NETCONF. Which protocol operation is designed to return configuration data filtered by a subtree selector?

  1. <copy-config> targeting the running datastore
  2. <get> with a <xpath-filter>
  3. <edit-config> with a <config> element
  4. <get-config> with a <subtree-filter> Correct answer.

Explanation

The <get-config> operation retrieves configuration data from a specified datastore and accepts a filter element, including a subtree filter that selects only the requested nodes. This makes it the correct way to pull just the hostname leaf from the configuration datastore.

Question 27Network automation and programmability fundamentals

Which HTTP method does RESTCONF define for replacing an entire target resource with the supplied representation?

  1. POST
  2. PATCH
  3. PUT Correct answer.
  4. OPTIONS

Explanation

RESTCONF maps CRUD semantics onto HTTP verbs, and PUT is defined to create or replace the target resource with the enclosed representation. PATCH is used for partial modification, and POST creates a child resource rather than replacing the target.

Question 28Network automation and programmability fundamentals

In a YANG model, a leaf is declared with mandatory true and no default. What does this mean for a NETCONF <edit-config> that omits that leaf?

  1. The server rejects the edit because a required node is missing. Correct answer.
  2. The server silently inserts an empty string value.
  3. The server leaves the previous value untouched and returns success.
  4. The server marks the leaf as read-only for later edits.

Explanation

The mandatory statement declares that the node must be present for the data to be valid, so a configuration edit that omits it violates the model. A compliant NETCONF server responds with an error such as missing-element rather than guessing a value.

Question 29Network automation and programmability fundamentals

A Python script needs to model device configuration as Python objects where each YANG leaf becomes an attribute with type checking. Which approach fits this requirement?

  1. Parsing CLI output with regular expressions into dictionaries
  2. Querying SNMP OIDs and mapping them to variables
  3. Generating bindings from the YANG modules and using them in the script Correct answer.
  4. Storing the configuration as raw XML strings in a list

Explanation

YANG binding generators produce language-native classes whose attributes correspond to YANG nodes, giving typed access and validation. This is the standard way to work with modeled data as objects instead of manipulating raw text or XML.

Question 30Network automation and programmability fundamentals

Which statement best describes the role of the YANG module revision statement when a client retrieves schema information from a device?

  1. It defines the namespace URI used to qualify all nodes in the module.
  2. It records the module's version date so clients can detect which revision the device implements. Correct answer.
  3. It marks the module as configurable rather than state-only.
  4. It lists the submodules that the module imports at compile time.

Explanation

The revision statement carries a date that identifies a specific published version of the module, allowing a client to compare what the device advertises with what the client expects. Multiple revision statements can appear, with the most recent listed first.

Question 31Network automation and programmability fundamentals

A network team wants to compare two candidate automation strategies. One pushes a full intended configuration each run; the other sends only the delta needed to reach the target. Which pair of terms correctly labels these strategies?

  1. Both are declarative because both target a desired state.
  2. The first is declarative and the second is imperative. Correct answer.
  3. Both are imperative because both change device state.
  4. The first is imperative and the second is declarative.

Explanation

Declarative automation describes the intended end state and lets the system reconcile the device to it, which is what pushing a full desired configuration represents. Sending only computed deltas is an imperative step-by-step approach that specifies the exact changes to apply.

Question 32Network automation and programmability fundamentals

Which data encoding is native to NETCONF messages as defined by its base specification?

  1. Protocol Buffers
  2. XML Correct answer.
  3. JSON
  4. YAML

Explanation

NETCONF was defined with XML encoding for its RPC messages and configuration payloads, and the base protocol relies on XML namespaces and elements. JSON encodings exist for RESTCONF and for later extensions, but the native NETCONF encoding is XML.

Question 33Network automation and programmability fundamentals

An engineer needs to verify that a rendered configuration is idempotent before deploying it to production devices. Which practice supports that verification?

  1. Running the deployment during a maintenance window
  2. Storing the rendered output in a version control repository
  3. Applying the configuration twice and confirming the second run reports no changes Correct answer.
  4. Reviewing the template variables for spelling errors

Explanation

Idempotence means reapplying the same intended state produces no further changes, so a second run that reports nothing to change demonstrates it. The other practices support quality or safety but do not test idempotence directly.

Question 34Network automation and programmability fundamentals

Which statement describes the purpose of the YANG choice statement?

  1. It defines a reusable set of nodes that can be instantiated in multiple places.
  2. It declares a list whose entries are uniquely identified by a key.
  3. It groups several cases so that only one case's nodes may exist at a time. Correct answer.
  4. It restricts a leaf's value to a set of enumerated strings.

Explanation

A choice contains cases, and at most one case is present in valid data, which models mutually exclusive configuration options. The other statements describe list, grouping, and enumeration constructs respectively.

Question 35Network automation and programmability fundamentals

A developer must send a NETCONF edit that deletes a single leaf without affecting sibling leaves in the same container. Which operation attribute on that leaf accomplishes this?

  1. operation="create"
  2. operation="merge"
  3. operation="delete" Correct answer.
  4. operation="replace"

Explanation

The delete operation attribute removes the targeted node from the datastore, and when placed on a specific leaf it affects only that node. Merge and replace are used to add or overwrite content rather than to remove an existing leaf.

Question 36Network automation and programmability fundamentals

Which YANG built-in type is most appropriate for a leaf that holds a device's management IP address and must reject malformed values?

  1. binary
  2. string
  3. ipv4-address Correct answer.
  4. uint32

Explanation

The ipv4-address type includes a pattern that validates dotted-quad syntax, so malformed values are rejected by the model. A plain string accepts any text, and the other types represent different data entirely.

Question 37Network automation and programmability fundamentals

An automation pipeline uses a template to generate BGP configuration. Which Jinja2 construct iterates over a list of neighbor dictionaries to emit one configuration stanza per neighbor?

  1. {% if neighbor %} ... {% endif %}
  2. {{ neighbor | default('') }}
  3. {% for neighbor in neighbors %} ... {% endfor %} Correct answer.
  4. {# neighbor #}

Explanation

A for block repeats its body once per item in the iterable, which produces one stanza for each neighbor in the list. If blocks test conditions, filters transform values, and comment blocks emit nothing.

Question 38Network automation and programmability fundamentals

Which characteristic distinguishes a RESTCONF request targeting a YANG list entry from one targeting the list itself?

  1. The entry request omits the media type header.
  2. The entry request always targets the candidate datastore.
  3. The entry request must use POST while the list request uses GET.
  4. The entry URL includes key values as path segments after the list name. Correct answer.

Explanation

RESTCONF addresses list entries by appending the key values to the resource path, for example interfaces/interface=GigabitEthernet1. Targeting the list itself addresses the collection of entries rather than one instance.

Question 39Network automation and programmability fundamentals

Which YANG statement makes a node appear in operational state data but prevents it from being set through configuration?

  1. config false Correct answer.
  2. presence true
  3. mandatory true
  4. ordered-by user

Explanation

Setting config false marks a node as state data, so it is returned by operations that read state but cannot be modified by configuration edits. The other statements affect presence requirements, container existence, and ordering.

Question 40Network automation and programmability fundamentals

A developer is choosing between NETCONF and RESTCONF for a browser-based dashboard that must read interface statistics. Which pairing of transport and encoding is correct for RESTCONF?

  1. TLS transport with Protocol Buffers encoding
  2. HTTPS transport with JSON or XML encoding Correct answer.
  3. TCP transport with YAML encoding
  4. SSH transport with XML encoding

Explanation

RESTCONF uses HTTP over HTTPS and supports both JSON and XML encodings selected through media types. NETCONF, by contrast, runs over SSH and uses XML.

Question 41Network automation and programmability fundamentals

Which NETCONF capability indicates that a device supports validating a candidate configuration before it is committed?

  1. urn:ietf:params:netconf:capability:writable-running:1.0
  2. urn:ietf:params:netconf:base:1.1
  3. urn:ietf:params:netconf:capability:rollback-on-error:1.0
  4. urn:ietf:params:netconf:capability:validate:1.0 Correct answer.

Explanation

The validate capability advertises support for the <validate> operation, which checks a datastore's contents against the model without committing. The other capabilities describe writable running, error rollback, and the base protocol version.

Question 42Network automation and programmability fundamentals

A team wants to subscribe to periodic interface counter updates pushed from devices without polling. Which mechanism is designed for this purpose?

  1. NETCONF <get> operations in a loop
  2. SNMP GET requests issued on a timer
  3. Model-driven telemetry over gRPC with a dial-out subscription Correct answer.
  4. Syslog messages parsed by a collector

Explanation

Model-driven telemetry lets a device push structured data according to a subscription, and dial-out over gRPC is a common implementation. Polling loops and trap-style mechanisms do not provide structured, subscription-based streaming of modeled data.

Question 43Network automation and programmability fundamentals

Which statement accurately describes a YANG grouping?

  1. It declares a list key that must be unique across the module.
  2. It restricts a leaf to a fixed set of allowed values.
  3. It defines a reusable set of nodes that takes effect only where it is referenced with uses. Correct answer.
  4. It creates a data node in the schema tree at the point of definition.

Explanation

A grouping is a template of nodes that does not itself appear in the data tree; its contents are instantiated where a uses statement references it. This lets modelers reuse common structures such as address blocks.

Question 44Network automation and programmability fundamentals

An engineer wants to confirm that a proposed YANG module's import statements resolve and that its syntax is valid before merging a change. Which action accomplishes this?

  1. Execute the module through a Jinja2 template render
  2. Run a YANG validator such as pyang against the module and its search path Correct answer.
  3. Convert the module to JSON with a generic JSON parser
  4. Load the module into a running device and commit it

Explanation

A YANG validator parses the module, resolves imports and includes against a search path, and reports syntax or semantic errors without touching a device. This is the standard pre-merge check in a CI pipeline.

Question 45Network automation and programmability fundamentals

In a YANG model, two lists are nested so that a child list is defined inside a parent list's entry. What does this nesting imply about addressing a child entry?

  1. The child entry is addressed relative to its parent entry's key values. Correct answer.
  2. The child list cannot have keys of its own.
  3. The child entry requires a globally unique key across all parents.
  4. The child list is automatically converted to a leaf-list.

Explanation

Nested lists are scoped to their parent entry, so the path to a child entry includes the parent's keys before the child's keys. Keys need only be unique among siblings sharing the same parent.

Question 46Network automation and programmability fundamentals

A developer uses a library that maintains a persistent SSH session to a device and sends commands expecting prompt-based responses. Which library class of tools does this describe?

  1. A RESTCONF HTTP client library
  2. A gRPC telemetry collector library
  3. A CLI screen-scraping library such as Netmiko or Paramiko-based tooling Correct answer.
  4. A model-driven NETCONF client library

Explanation

Libraries like Netmiko and Paramiko manage SSH sessions and handle prompt detection for interactive CLI, which is screen scraping. Model-driven clients instead exchange structured XML or JSON payloads.

Question 47Network automation and programmability fundamentals

A configuration template must emit a VLAN block only when a device variable named vlan_id is defined. Which Jinja2 pattern expresses this condition?

  1. {{ vlan_id | default('') }}
  2. {% set vlan_id = 0 %}
  3. {% for vlan_id in vlans %} ... {% endfor %}
  4. {% if vlan_id is defined %} ... {% endif %} Correct answer.

Explanation

The defined test in an if block renders the enclosed content only when the variable exists in the rendering context. A for loop iterates an existing iterable, a default filter substitutes a value, and set assigns a variable.

Question 48Network automation and programmability fundamentals

A team's automation reads a device's intended state from a source of truth and reconciles the device to match. Which property must the reconciliation logic guarantee to avoid repeated unnecessary changes?

  1. That each run restarts the management plane
  2. That each run clears the candidate datastore
  3. That each run produces a diff only when the device deviates from the intended state Correct answer.
  4. That each run always issues a full configuration replace

Explanation

Reconciliation should compare intended and actual state so that changes are issued only when a meaningful difference exists. Always replacing or restarting would create unnecessary churn and risk.

Question 49Network automation and programmability fundamentals

A NETCONF client sends an <edit-config> with the default-operation set to none and operation attributes on individual nodes. What is the effect of this combination?

  1. The edit is rejected because a default operation is required.
  2. Only the nodes carrying explicit operation attributes are changed. Correct answer.
  3. All nodes in the payload are merged as if operation were merge.
  4. The entire target datastore is replaced by the payload.

Explanation

Setting default-operation to none means nodes without an explicit operation attribute are left alone, so only annotated nodes take effect. This gives precise control when a payload mixes different intended actions.

Question 50Network automation and programmability fundamentals

An engineer reviews a YANG module and sees a leafref that points to another leaf. What validation does this provide when data is loaded?

  1. It copies the target leaf's value into the referencing leaf automatically.
  2. It makes the referencing leaf read-only.
  3. It enforces that the target leaf is mandatory.
  4. It ensures the referencing leaf's value matches an existing instance of the target leaf. Correct answer.

Explanation

A leafref constrains its value to equal the value of an existing target leaf instance, which models references such as a list entry pointing to a defined interface. It does not copy data, change access, or impose mandatory status on the target.