The Zebra data model is defined by custom zebra resources that are extensible. We can add new resource types and register with the zebra server to manage the life cycle of these resources. The zebra API is a generic resource API used to create/update/delete, and read any resources. As zebra is geared toward a generic resource management system, it becomes essential to define a specific contract on how to define a new resource and plug it into the zebra server, client, and simulator services.
Resource Type contract
Define a resource package under model with a package description. All resources in the package belong to the specific namespace.
model
- types.go - registry of all types
- compute
- doc.go - contains compute package documentation
- server.go - containers server resource definitions
- ...
- network
- doc.go - contains network package documentation
- switch.go - containers server resource definitions
- ...
Define the resource type data structure with a unique type name, description and a constructor to create a new instance of the resource. Resource type name must be <namespace>.<type> format ensure that all names will be unique. Example type would be:
Zebra model
The Zebra data model is defined by custom zebra resources that are extensible. We can add new resource types and register with the zebra server to manage the life cycle of these resources. The zebra API is a generic resource API used to create/update/delete, and read any resources. As zebra is geared toward a generic resource management system, it becomes essential to define a specific contract on how to define a new resource and plug it into the zebra server, client, and simulator services.
Resource Type contract
<namespace>.<type>
format ensure that all names will be unique. Example type would be:zebra.Resource
interfaceNew<resourcename>
method that produces a valid resource object