300-435 exam dumps

300-435 practice question 45 of 322

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

300-435 Question 45

Single answer

You are working on a Cisco network automation project and are provided with a YANG model defining the configuration of network interfaces. Using YANG Suite, you generate an XML instance for an interface configuration. Which XML instance correctly conforms to the following YANG model snippet?

module interface-config {
  namespace "urn:ietf:params:xml:ns:yang:interface-config";
  prefix intf;

  container interface {
    leaf name {
      type string;
    }
    leaf enabled {
      type boolean;
    }
  }
}

Select the XML instance that matches this model.

  1. A

    GigabitEthernet1true

  2. B

    GigabitEthernet1true

  3. C

    <intf:interface xmlns:intf="urn:ietf:params:xml:ns:yang:interface-config">GigabitEthernet1true</intf:interface>

  4. D

    intf:interfaceGigabitEthernet1true</intf:interface>

Show answer and explanation

Correct answer: C

Explanation

The correct XML instance must match the structure and naming defined in the YANG model, including the root element, leaf names, and namespace declaration. Option 3 includes the correct namespace declaration, root element ('interface'), and leaf names ('name' and 'enabled'), making it the valid XML instance for the provided YANG model.

  • A. Incorrect.

    This XML instance is missing the namespace declaration for the YANG module, making it invalid for the given YANG model.

  • B. Incorrect.

    This XML instance uses the wrong root element 'interface-config' instead of 'interface', and it also lacks the namespace declaration.

  • C. Correct.

    This XML instance correctly conforms to the YANG model by using the correct root element, the proper namespace declaration, and the appropriate leaf names defined in the model.

  • D. Incorrect.

    This XML instance uses the wrong leaf name 'status' instead of 'enabled', making it invalid for the given 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