Exam 200-901 | Question id=6183 | Understanding and Using APIs |
Refer to the exhibit.
module ietf-ip { module ietf-interfaces {
namespace "urn:ietf:params:xml:ns:yang:ietf-ip"; namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces";
prefix ip; prefix ip;
import ietf-interfaces { typedef interface-ref {
prefix if; type leafref {
} path "/if:interfaces/if:interface/if:name";
augment "/if:interfaces/if:interfaceā€¯ { }
container ipv4 { }
leaf enabled { container interfaces {
type boolean; list.interface {
default true; key "name";
} leaf name {
list address { type string:
key "ip"; }
leaf ip { leaf description {
type inet:ipv4-address-no-zone; type string;
} }
choice subnet { leaf type {
mandatory true; type identityref {
leaf prefix-length { base interface-type;
type uint8 { }
range "0..32"; mandatory true;
} }
} leaf enabled {
leaf netmask { type boolean;
type yang:dotted-quad; default "true";
} }
} }
} }
} }
}
}
Which JSON snippet configures a new interface according to YANG model?
A. |
"ietf-interfaces": {
interface": {
"name": "Loopback100",
"enabled": true,
"ietf-ip": {
ipv4": {
"address": [
{
"ip": "10.255.254.1",
"netmask": "255.255.255.0"
}]}}
}
| |
B. |
" interface" {
"name": "Loopback100",
"enabled": true,
"ipv4": {
"address": [
{
"ip": "10.255.254.1",
"netmask": "255.255.255.0"
}]}
}
| |
C. |
"ietf-interfaces:interface": {
"name": "Loopback100",
"enabled": true,
"ietf-ip:ipv4:address": [
{
"ip": "10.255.254.1",
"netmask": "255.255.255.0"
}]
}
| |
D. |
"ietf-interfaces:interface": {
"name": "Loopback100",
"enabled": true,
"ietf-ip:ipv4": {
"address": [
{
"ip": "10.255.254.1",
"netmask": "255.255.255.0"
}]}
}
|