300-435 exam dumps

300-435 practice question 46 of 322

Automating Cisco Enterprise Solutions. Professional level, Cisco. Free question with the correct answer and a full explanation.

300-435 Question 46

Single answer

You are tasked with generating an XML instance based on a YANG model for a network configuration. Using YANG Suite, you have the following YANG model fragment for an interface configuration:

module example-interface {
  namespace "urn:example:interface";
  prefix "iface";

  container interfaces {
    list interface {
      key "name";
      leaf name {
        type string;
      }
      leaf enabled {
        type boolean;
      }
    }
  }
}

Which of the following XML instances correctly represents an interface named 'GigabitEthernet1' that is enabled?

  1. A

    GigabitEthernet1true

  2. B

    GigabitEthernet1True

  3. C

    GigabitEthernet1true

  4. D

    true

Show answer and explanation

Correct answer: A

Explanation

The correct XML instance must adhere to the structure defined by the YANG model. The 'interfaces' container wraps the 'interface' list, the 'name' leaf is mandatory as the key, and the 'enabled' leaf must use the correct boolean format ('true' or 'false'). Option 1 is the only XML instance that satisfies all these requirements.

  • A. Correct.

    This is the correct XML instance as it accurately reflects the YANG model structure. The 'interfaces' container wraps the 'interface' list, and the 'enabled' value is correctly represented as 'true', matching the expected boolean format in XML.

  • B. Incorrect.

    Although this option looks correct, the 'enabled' value uses 'True' with an uppercase 'T', which does not conform to the standard boolean representation in XML (case-sensitive).

  • C. Incorrect.

    This option is incorrect because it omits the 'interfaces' container, which is required by the YANG model structure.

  • D. Incorrect.

    This option is incorrect because it omits the 'name' leaf, which is a required key as per the YANG model.

Timed practice exam

Take a 300-435 practice test under exam conditions

75 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam