300-435 exam dumps

300-435 practice question 48 of 322

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

300-435 Question 48

Single answer

You are tasked with creating an XML instance document for a network configuration based on a YANG model. The YANG model defines the following structure:

module example-config {
  namespace "http://example.com/config";
  prefix ex;

  container device {
    leaf hostname {
      type string;
    }
    leaf ip-address {
      type inet:ipv4-address;
    }
  }
}

Which of the following XML documents correctly represents this YANG model?

  1. A

    Router1192.168.1.1

  2. B

    Router1

  3. C

    Router1192.168.1.1

  4. D

    Router1192.168.1.1

Show answer and explanation

Correct answer: C

Explanation

The correct XML instance must adhere to the structure defined in the YANG model. The root element should be 'device', the namespace should be declared as 'http://example.com/config', and all mandatory leaves ('hostname' and 'ip-address') must be present. Option 3 satisfies all these requirements.

  • A. Incorrect.

    This XML document is missing the namespace declaration for the 'example-config' module, which is required based on the YANG model.

  • B. Incorrect.

    This XML document includes the correct namespace but is missing the 'ip-address' leaf, which is mandatory based on the YANG model.

  • C. Correct.

    This XML document is correct as it includes the namespace 'http://example.com/config' and both mandatory leaves 'hostname' and 'ip-address', matching the YANG model structure.

  • D. Incorrect.

    This XML document incorrectly uses a root element 'example-config', which is not defined in the YANG model. The correct root element should be 'device'.

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