Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c6fa18a
annotation new schema and service changes
harsh-sikhwal May 5, 2026
903f4f7
Update auto generated content
actions-user May 5, 2026
eb1085e
adding correct descriptions
harsh-sikhwal May 5, 2026
e61aa1a
Update auto generated content
actions-user May 5, 2026
4d5f3d3
annotations for getgraph
Amos-Rai-KEYS May 7, 2026
a42db70
Update auto generated content
actions-user May 7, 2026
18ce36e
refactoring
Amos-Rai-KEYS May 7, 2026
9c61ee0
Merge branch 'feature-annotation' of https://github.com/Keysight/infr…
Amos-Rai-KEYS May 7, 2026
89b5ebd
schema changes and get graph implementation
Amos-Rai-KEYS May 11, 2026
ab39efa
Update auto generated content
actions-user May 11, 2026
ec131fd
graphrequest schema changes
Amos-Rai-KEYS May 11, 2026
9090ad1
Merge branch 'feature-annotation' of https://github.com/Keysight/infr…
Amos-Rai-KEYS May 11, 2026
5039025
Update auto generated content
actions-user May 11, 2026
bf4bcc5
change get_graph implementation
Amos-Rai-KEYS May 11, 2026
ae01bd0
Merge branch 'feature-annotation' of https://github.com/Keysight/infr…
Amos-Rai-KEYS May 11, 2026
98896ec
add checks for edges
Amos-Rai-KEYS May 11, 2026
2b976d7
get_graph schema
Amos-Rai-KEYS May 14, 2026
b8043e6
Update auto generated content
actions-user May 14, 2026
1d957ff
get graph implementation and some fixes
Amos-Rai-KEYS May 15, 2026
4b7ad14
Merge branch 'feature-annotation' of https://github.com/Keysight/infr…
Amos-Rai-KEYS May 15, 2026
bd23357
get graph schema changes and code implementations
Amos-Rai-KEYS May 19, 2026
bfd75a5
Update auto generated content
actions-user May 19, 2026
ffc0bbd
description change for graph.yaml
Amos-Rai-KEYS May 20, 2026
f90b48d
Merge branch 'feature-annotation' of https://github.com/Keysight/infr…
Amos-Rai-KEYS May 20, 2026
c4c1ce8
Update auto generated content
actions-user May 20, 2026
ce3d8f8
Merge branch 'main' into feature-annotation
Amos-Rai-KEYS May 21, 2026
b207eed
Update auto generated content
actions-user May 21, 2026
4c55a08
fix review comments
Amos-Rai-KEYS May 21, 2026
ef78be6
Merge branch 'feature-annotation' of https://github.com/Keysight/infr…
Amos-Rai-KEYS May 21, 2026
aebd53f
fix comments
Amos-Rai-KEYS May 21, 2026
ea5919c
change dict name
Amos-Rai-KEYS May 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ deploy: ## deploy packages to pypi.org
source .venv/bin/activate && \
python3 -m twine upload -u __token__ -p $(PYPI_TOKEN) dist/*

.PHONY: openapi-html
openapi-html: ## generate OpenAPI HTML from artifacts/openapi.yaml using redocly
npx @redocly/cli build-docs artifacts/openapi.yaml -o docs/src/openapi.html

.PHONY: docs
docs: ## generate local documentation to docs/site
docs: openapi-html ## generate local documentation to docs/site
source .venv/bin/activate && \
python3 docs/generate_yaml.py && \
python3 -m mkdocs build --config-file docs/mkdocs.yml --site-dir site
Expand Down
5 changes: 3 additions & 2 deletions api/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ paths:

Creating a fully qualified infrastructure graph requires the following steps:
- process each of the infrastructure instance objects by locating the device and creating a subgraph using the device's edges and substituting the instance name for the device name.
- process each of the infrastructure edges, looking up the instance to determine the max count and the name to be substituted for the device and link the subgraphs to create a complete infrastructure graph
- process each of the infrastructure edges, looking up the instance to determine the max count and the name to be substituted for the device and link the subgraphs to create a complete infrastructure graph
- resets all the annotations
requestBody:
required: true
content:
Expand Down Expand Up @@ -80,7 +81,7 @@ paths:
content:
application/json:
schema:
$ref: '../models/graph.yaml#/components/schemas/AnnotateRequest'
$ref: '../models/annotation.yaml#/components/schemas/Annotation'
responses:
'200':
$ref: '../models/request.yaml#/components/responses/Success'
Expand Down
192 changes: 139 additions & 53 deletions artifacts/infragraph.proto
Original file line number Diff line number Diff line change
Expand Up @@ -451,95 +451,180 @@ message Warning {
repeated string warnings = 1;
}

// Request specifying the desired format for the returned graph.
// Configuration controlling which annotations are returned with the graph.
message AnnotationConfig {

// Selects whether the response includes the full set of annotations or only the user-applied
// (partial) annotations.
AnnotationType annotations = 1;
}

// Selects the scope of annotations to return on graph elements.
message AnnotationType {

message Choice {
enum Enum {
unspecified = 0;
full = 1;
partial = 2;
}
}
// Chooses between returning the complete annotation set or only the
// partial (user-applied) annotations.
// - full: include every attribute present on nodes, edges and links.
// - partial: include only attributes added on top of the underlying infrastructure.
optional Choice.Enum choice = 1;

// Returns every attribute set on graph elements, including those derived from the underlying
// infrastructure.
optional string full = 2;

// Returns only the annotations that have been explicitly applied on top of the infrastructure,
// excluding immutable infrastructure-derived attributes.
optional string partial = 3;
}

// The infragraph representation of the current graph, consisting of the infrastructure
// definition and the annotations applied to its nodes, edges and links.
message GraphResponseInfragraph {

// The infrastructure definition that the graph was built from.
Infrastructure infrastructure = 1;

// The set of annotations applied to nodes, edges and links of the graph.
Annotation annotations = 2;
}

// Selects the representation used when returning the graph.
message GraphType {

message Choice {
enum Enum {
unspecified = 0;
infragraph = 1;
}
}
// The graph representation to return.
// - infragraph: native infrastructure + annotations representation.
optional Choice.Enum choice = 1;
}

// Request specifying which graph representation to return and how
// annotations should be included in the response.
message GraphRequest {

message Format {
message Choice {
enum Enum {
unspecified = 0;
networkx = 1;
infragraph = 1;
networkx = 2;
}
}
// The format that the graph will be returned in.
optional Format.Enum format = 1;
// The graph representation to return.
// - infragraph: infrastructure and annotations as a structured object.
// - networkx: a networkx node-link graph serialized as a YAML string.
optional Choice.Enum choice = 1;

// Annotation configuration applied when returning the graph as an infragraph (infrastructure
// and annotations).
AnnotationConfig infragraph = 2;

// Annotation configuration applied when returning the graph as a networkx node-link
// YAML string.
AnnotationConfig networkx = 3;
}

// The content of the graph response, specifying the format and the serialized graph
// data.
message GraphContent {
// The content of a graph response, returned either as a structured infragraph object
// or as a networkx YAML string depending on the request.
message GraphResponseContent {

message Choice {
enum Enum {
unspecified = 0;
networkx = 1;
infragraph = 1;
networkx = 2;
}
}
// Specifies the format of the returned graph content.
// The representation contained in this response.
// - infragraph: structured infrastructure and annotations object.
// - networkx: networkx node-link graph serialized as a YAML string.
optional Choice.Enum choice = 1;

// This contains the returned graph content formatted as a networkx yaml string.
optional string networkx = 2;
// The graph returned as a structured infragraph (infrastructure plus annotations).
GraphResponseInfragraph infragraph = 2;

// The graph returned as a networkx node-link graph serialized as a YAML string.
optional string networkx = 3;
}

// Defines an annotation to be applied to a graph node.
message AnnotationAttribute {

// The attribute name that will be added to the endpoint.
optional string attribute = 1;

// The attribute value that will be added to the endpoint.
optional string value = 2;
}

// Defines an annotation to be applied to a graph node.
message AnnotationNode {

// A fully qualified node name that MUST exist in the graph.
// - server.0.xpu.0
// - server.6.nic.3
// - switch.2.asic.0
// Node name that MUST exist or match nodes present in the graph. This supports slicing
// operator and converts to expanded format:
// - server[0]xpu[0]
// - server[0:2]
// - switch
optional string name = 1;

// The attribute name that will be added to the endpoint.
optional string attribute = 2;
// An inventory of attributes and values.
repeated AnnotationAttribute attributes = 2;
}

// The attribute value that will be added to the endpoint.
optional string value = 3;
// Defines an annotation to be applied to a graph link.
message AnnotationLink {

// A fully qualified link name that MUST exist in the graph.
// - pcie
optional string name = 1;

// An inventory of attributes and values.
repeated AnnotationAttribute attributes = 2;
}

// Defines an annotation to be applied to a graph edge.
message AnnotationEdge {

// A fully qualified endpoint name that MUST exist as part of an edge along with ep2
// in the graph.
// - server.0.xpu.0
// - server.6.nic.3
// - switch.2.asic.0
// Endpoint name that MUST exist or match edges present in the graph. This supports
// slicing operator and expands to the networkx expanded format:
// - server[0]xpu[0]
// - server[0:2]
// - switch
optional string ep1 = 1;

// A fully qualified endpoint name that MUST exist as part of an edge along with ep1
// in the graph.
// - server.0.xpu.0
// - server.6.nic.3
// - switch.2.asic.0
// Endpoint name that MUST exist or match edges present in the graph. This supports
// slicing operator and expands to the networkx expanded format:
// - server[0]xpu[0]
// - server[0:2]
// - switch
optional string ep2 = 2;

// The attribute name that will be added to the edge.
optional string attribute = 3;

// The attribute value that will be added to the edge.
optional string value = 4;
// An inventory of attributes and values.
repeated AnnotationAttribute attributes = 3;
}

// Request object specifying which graph elements (nodes or edges) to annotate and the
// annotations to apply.
message AnnotateRequest {
message Annotation {

message Choice {
enum Enum {
unspecified = 0;
nodes = 1;
edges = 2;
}
}
// Select whether to annotate nodes or edges..
optional Choice.Enum choice = 1;
// List of annotations to apply to nodes.
repeated AnnotationNode nodes = 1;

// List of node annotations to apply when the choice is set to nodes.
repeated AnnotationNode nodes = 2;
// List of annotations to apply to edges.
repeated AnnotationEdge edges = 2;

// List of edge annotations to apply when the choice is set to edges.
repeated AnnotationEdge edges = 3;
// List of annotations to apply to links.
repeated AnnotationLink links = 3;
}

// Represents a generic name and value pair attribute.
Expand Down Expand Up @@ -744,9 +829,9 @@ message Failure {
Error error = 1;
}

// The entire fully validated graph content.
// The current graph content, returned in the representation selected by the request.
message GraphResponse {
GraphContent graph_content = 1;
GraphResponseContent graph_response_content = 1;
}

// Answer to the query request.
Expand All @@ -772,7 +857,7 @@ message GetGraphRequest {
GraphRequest graph_request = 1;
}
message GetGraphResponse {
GraphContent graph_content = 1;
GraphResponseContent graph_response_content = 1;
}


Expand All @@ -785,7 +870,7 @@ message QueryGraphResponse {


message AnnotateGraphRequest {
AnnotateRequest annotate_request = 1;
Annotation annotation = 1;
}
message AnnotateGraphResponse {
Warning warning = 1;
Expand Down Expand Up @@ -814,6 +899,7 @@ service Openapi {
// - process each of the infrastructure edges, looking up the instance to determine
// the max count and the name to be substituted for the device and link the subgraphs
// to create a complete infrastructure graph
// - resets all the annotations
rpc SetGraph(SetGraphRequest) returns (SetGraphResponse);
// streaming version of the rpc SetGraph
rpc streamSetGraph(stream Data) returns (SetGraphResponse);
Expand Down
Loading
Loading