Web browsers use REST to get and post information to web servers or other systems that use HTTP. The same HTTP request methods and response codes are used.
Figure 12-4 shows a create, retrieve, update, and delete (CRUD) example with a client using HTTP POST, GET, PUT, and DELETE calls along with the response codes coming back from the server.

Figure 12-4 Create, Retrieve, Update, and Delete (CRUD)
Table 12-2 lists some common HTTP response codes.
Table 12-2 Common HTTP Response Codes
Response Code | Description |
Success Messages (2xxx) | |
200 | Request succeeded |
201 | The request has been fulfilled; new resource created |
204 | The server fulfilled the request but does not return a body |
Client Errors (4xx) | |
400 | Bad request; malformed syntax |
401 | Unauthorized |
403 | Server understood request but refuses to fulfill it |
Server Errors (5xx) | |
500 | Internal server error |
501 | Not implemented |
YANG, NETCONF, and RESTCONF Explored
YANG is intertwined with NETCONF and RESTCONF, as they are all protocols used to manage configuration and state data.
Table 12-3 lists the Cisco-supported products for YANG, NETCONF, and RESTCONF.
Table 12-3 Cisco-Supported Products for YANG, NETCONF, and RESTCONF
Cisco-Supported Products | YANG, NETCONF, and/or RESTCONF |
Tail-f Network Control System | NETCONF/YANG |
Tail-f Confd Agent | NETCONF/YANG |
Open SDN Controller/OpenDaylight | NETCONF/YANG/RESTCONF |
IOS XR | NETCONF/YANG |
NX-OS | NETCONF |
IOS XE | NETCONF |
YANG Concepts
Yet Another Next Generation (YANG) is an IETF standard (RFC 6020) data modeling language used to describe the data for network configuration protocols such as NETCONF and RESTCONF. YANG is extensible, enabling the addition of new content to existing data models and new statements to the YANG language. YANG also has a limited scope: It is intended to describe network concepts in a tree structure along with data and types. YANG is intended to be very readable compared to other schema languages.
YANG data models can be displayed and represented in a variety of formats, including the following:
- YANG language
- Clear text
- XML
- JSON
- HTML/JavaScript
Figure 12-5 illustrates the NETCONF/YANG stack.

Figure 12-5 NETCONF/YANG Stack
A YANG module is a self-contained top-level hierarchy of nodes. A YANG module can also use submodules. It uses linkage statements such as import and include. Within a module, containers are used to group related nodes. Within a container, lists are used to identify nodes that are stored in a sequence. Inside lists, each individual attribute is referred to as a leaf, and attributes are used for things like names or descriptions. Each leaf also needs to have an associated type, such as Boolean or string.
Table 12-4 lists the common attributes for leaf values.
Table 12-4 Leaf Attributes
Attribute | Description |
config | Specifies whether this leaf is a configurable value (“true”) or an operational value (“false”) and is inherited from the parent container if not specified |
default | Specifies the default value for this leaf and implies that the leaf is optional |
mandatory | Specifies whether the leaf is mandatory (“true”) or optional (“false”) |
must | Specifies the XPath constraint that will be enforced for this leaf |
type | Specifies the data type (and range) of this leaf |
when | Indicates a conditional leaf, which is present only if the XPath expression is true |
description | Provides a human-readable definition and help text for the leaf |
reference | Provides a human-readable reference to some other element or spec |
units | Provides a human-readable unit specification (for example, Hz, Mbps, °F) |
status | Indicates whether this leaf is current, deprecated, or obsolete |
When versioning YANG modules, consider the following:
- Add a revision statement at the top.
- Update the organization, contact, and other information.
- Do not rename a module or namespaces.
- Do not remove obsolete definitions.
- Do not reorder data definitions.