Resources

A resource is an object with a type, associated data, relationships to other resources, and a set of methods that operate on it.

Only a few standard methods are defined for the resource corresponding to the standard HTTP, such as GET, HEAD, OPTIONS, POST, PUT, PATCH, and DELETE. Resources can be grouped into collections (in the YANG model, it is represented as a "List" statement). Each collection is homogeneous (it contains only one type of resource) and unordered.

Resources can also exist outside any collection. These resources are known as singleton resources (in the YANG model, it is represented as a "Container" statement). Collections are resources themselves. For example, resources defined in the YANG model are physical interface, port-channel, VLAN, switchport, access-list, and so on. The following figure describes the resource model.

Click to expand in new window
Resource Model

Base resource, Configuration resource, YANG-RPC Operations resource, and Operational-state are the types of resources that are supported to represent the configuration data and YANG-RPC operations.