Skip to content
Snippets Groups Projects
Commit 34556392 authored by Georgios Katsikas's avatar Georgios Katsikas
Browse files

feat: update policy protobufs


Policy component's protobufs are updated based upon
the Event Condition Action (ECA) model.
Minor fixes are applied to the slice.proto in order
to compile.

Signed-off-by: default avatarGeorgios Katsikas <katsikas.gp@gmail.com>
parent 632af8e0
No related branches found
No related tags found
1 merge request!54Release 2.0.0
src/
uml/generated
#!/bin/bash
python3 -m grpc_tools.protoc -I=./ --python_out=src/ --grpc_python_out=src/ *.proto
#requires installation of protoc-gen-uml
export PATH=/home/osboxes/protoc-gen-uml/target/universal/stage/bin:$PATH
export PATH=${HOME}/protoc-gen-uml/target/universal/stage/bin:$PATH
protoc --uml_out=uml/ -I ./ *.proto
cd uml
java -jar plantuml.7997.jar *.puml
......
......@@ -2,7 +2,6 @@ syntax = "proto3";
package policy;
import "context.proto";
import "service.proto";
service PolicyService {
rpc PolicyAdd (PolicyRule) returns (PolicyRuleState) {}
......@@ -10,53 +9,77 @@ service PolicyService {
rpc PolicyDelete (PolicyRule) returns (PolicyRuleState) {}
rpc GetPolicy (PolicyRuleId) returns (PolicyRule) {}
rpc GetPolicyByDeviceId (context.DeviceId) returns (PolicyRuleList) {}
rpc GetPolicyByServiceId (service.ServiceId) returns (PolicyRuleList) {}
rpc GetPolicyByServiceId (context.ServiceId) returns (PolicyRuleList) {}
}
message PolicyRuleList {
repeated PolicyRule policyRuleList = 1;
enum RuleState {
POLICY_INACTIVE = 0; // Rule is currently inactive
POLICY_PLANNED = 1; // Rule installation planned
POLICY_ACTIVE = 2; // Rule is currently active
}
//according to IETF’s RFC 3060 [] and RFC 3460 []
message PolicyRule {
PolicyRuleId policyRuleId = 1;
repeated service.ServiceId serviceList = 2;
repeated context.DeviceId deviceList = 3;
string policyRuleType = 4;
string PolicyRulePriority = 5;
repeated PolicyRuleCondition polRuleConditionList = 6;
repeated PolicyRuleAction polRuleActionList = 7;
enum PolicyRuleType {
POLICYTYPE_DEVICE = 0; // Device-level
POLICYTYPE_NETWORK = 1; // Network-wide
}
message PolicyRuleId {
message PolicyRuleId {
context.Uuid uuid = 1;
}
message PolicyRuleState {
context.Uuid policyRuleId = 1;
RuleState policyRuleState = 2;
}
message PolicyRuleVariable {
string policyRuleVariable = 1;
}
message PolicyRuleValue {
string policyRuleValue = 1;
}
// IETF draft: Framework for Use of ECA (Event Condition Action) in Network Self Management
// Source: https://datatracker.ietf.org/doc/draft-bwd-netmod-eca-framework/
// Event
message PolicyRuleEvent {
context.Event event = 1;
}
// Condition
message PolicyRuleCondition {
PolicyRuleVariable polRuleConditionVar = 1;
PolicyRuleValue polRuleConditionVal = 2;
}
// Action
message PolicyRuleAction {
PolicyRuleVariable polRuleActionVar = 1;
PolicyRuleValue polRuleActionVal = 2;
}
message PolicyRuleVariable {
string policyRuleVariable = 1;
}
// Policy rule partially complies with IETF’s:
// RFC 3060: https://datatracker.ietf.org/doc/html/rfc3060
// RFC 3460: https://datatracker.ietf.org/doc/html/rfc3460
// Enhanced with a policy rule event according to the ECA model
message PolicyRule {
// Basic policy rule attributes
PolicyRuleId policyRuleId = 1;
PolicyRuleType policyRuleType = 2;
uint32 PolicyRulePriority = 3;
message PolicyRuleValue {
string policyRuleValue = 1;
}
// Event-Condition-Action model
PolicyRuleEvent event = 4; // A single event triggers the policy
repeated PolicyRuleCondition polRuleConditionList = 5; // One or more conditions must be met
repeated PolicyRuleAction polRuleActionList = 6; // One or more actions should be applied
message PolicyRuleState {
context.Uuid policyRuleId = 1;
RuleState policyRuleState = 2;
// Affected services and devices
repeated context.ServiceId serviceList = 7;
repeated context.DeviceId deviceList = 8;
}
enum RuleState {
PLANNED = 0;
ACTIVE = 1;
// A list of policy rules
message PolicyRuleList {
repeated PolicyRule policyRuleList = 1;
}
......@@ -3,24 +3,21 @@ syntax = "proto3";
package slice;
import "context.proto";
import "service.proto";
service SliceService {
rpc CreateUpdateSlice ( TransportSlice ) returns (SliceStatus) {}
rpc DeleteSlice ( TransportSlice ) returns (context.Empty) {}
rpc CreateUpdateSlice (TransportSlice) returns (SliceStatus) {}
rpc DeleteSlice (TransportSlice) returns (context.Empty) {}
}
message SliceEndpoint {
context.EndPoint port_id = 1;
}
message TransportSlice {
SliceId slice_id = 1;
repeated slice.SliceEndpoint endpoints = 2;
repeated context.Constraint constraints = 3;
repeated service.ServiceId services = 4;
repeated context.ServiceId services = 4;
repeated SliceId subSlicesId = 5;
SliceStatus status = 6;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment