Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gRPC Protobuf Files for CNS Operations #2754

Merged
merged 4 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -952,3 +952,6 @@ tools: acncli gocov gocov-xml go-junit-report golangci-lint gofumpt protoc ## Bu

help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

proto-gen: ## Generates source code from protobuf files
protoc --go_out=. --go-grpc_out=. cns/grpc/proto/server.proto
43 changes: 43 additions & 0 deletions cns/grpc/proto/server.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
syntax = "proto3";

package cns;

option go_package = "cns/grpc/v1alpha";

// The Container Network Service (CNS) exposes a set of operations that allow the Delegated Network Controller (DNC) to manage
// and monitor nodes in an orchestrator's infrastructure.

// CNS defines the gRPC service exposed by CNS to interact with DNC.
service CNS {
// Sets the orchestrator information for a node.
rpc SetOrchestratorInfo(SetOrchestratorInfoRequest) returns (SetOrchestratorInfoResponse);

// Retrieves detailed information about a specific node.
// Primarily used for health checks.
rpc GetNodeInfo(NodeInfoRequest) returns (NodeInfoResponse);
}

// SetOrchestratorInfoRequest is the request message for setting the orchestrator information.
message SetOrchestratorInfoRequest {
string dncPartitionKey = 1; // The partition key for DNC.
string nodeID = 2; // The node ID.
string orchestratorType = 3; // The type of the orchestrator.
}

// SetOrchestratorInfoResponse is the response message for setting the orchestrator information.
message SetOrchestratorInfoResponse {}

// NodeInfoRequest is the request message for retrieving detailed information about a specific node.
message NodeInfoRequest {
string nodeID = 1; // The node ID to identify the specific node.
}

// NodeInfoResponse is the response message containing detailed information about a specific node.
message NodeInfoResponse {
string nodeID = 1; // The node ID.
string name = 2; // The name of the node.
string ip = 3; // The IP address of the node.
bool isHealthy = 4; // Indicates whether the node is healthy or not.
string status = 5; // The current status of the node (e.g., running, stopped).
string message = 6; // Additional information about the node's health or status.
}
Loading
Loading