From 248106a3383fc5b4bfcaab011c5172ad65e176e1 Mon Sep 17 00:00:00 2001 From: anbalogh Date: Wed, 13 Nov 2024 13:40:16 +0000 Subject: [PATCH] add additional comments --- protos/bind.proto | 21 +++++++++++++++++++++ protos/infra.proto | 14 ++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/protos/bind.proto b/protos/bind.proto index 869fcc1..ea7dc8f 100644 --- a/protos/bind.proto +++ b/protos/bind.proto @@ -2,6 +2,27 @@ // // A data model to describe binding infrastructure paths to external // application information. +// +// Some examples of binding third party information to infrastructure paths: +// +// binding = Binding( +// device_instance="pod_switch.0", +// data=Data( +// name="routing", +// value="routing configuration information in a third party format")) +// +// binding = Binding( +// device_instance_index_component_index="host.0.nic.0", +// data=Data( +// name="mellanox_config", +// value="additional nic configuration information in a third party format")) +// +// binding = Binding( +// infrastructure="ranks", +// data=Data( +// name="rank_to_host_map", +// value="rank to host mapping in a third party format")) +// syntax = "proto3"; diff --git a/protos/infra.proto b/protos/infra.proto index ca1419a..e715e5c 100644 --- a/protos/infra.proto +++ b/protos/infra.proto @@ -1,6 +1,12 @@ // infra.proto // // A data model for describing infrastructure as a graph. +// +// NOTES: +// - use of optional is to allow for a better presence check, all optional +// fields must be filled in. For additional details on why optional is being +// used review this article https://protobuf.dev/programming-guides/proto3/#field-labels +// syntax = "proto3"; @@ -131,9 +137,13 @@ message Device { optional string name = 1; // collection of unique components in the device + // The key must be the Component.name which is used to guard against duplicates + // and will be checked as part of Service.Validation rpc map components = 3; // collection of unique links in the device + // The key must be the Link.name which is used to guard against duplicates + // and will be checked as part of Service.Validation rpc map links = 4; // a list of connections that describe how Components are connected to each @@ -187,6 +197,8 @@ message Inventory { // A collection of all unique types of links in the infrastructure. // These links can be reused multiple times when creating connections // between devices. + // The key must be the Link.name which is used to guard against duplicates + // and will be checked as part of Service.Validation rpc map links = 2; } @@ -204,6 +216,8 @@ message Infrastructure { // A map of the device instances that represents the total number of devices // in the infrastructure. // Use this to scale out infrastructure + // The must be the DeviceInstances.name which is used to guard against duplicates + // and will be checked as part of Service.Validation rpc map device_instances = 2; // format: The following pieces of information each separated by a "."