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 #!/bin/bash
python3 -m grpc_tools.protoc -I=./ --python_out=src/ --grpc_python_out=src/ *.proto python3 -m grpc_tools.protoc -I=./ --python_out=src/ --grpc_python_out=src/ *.proto
#requires installation of protoc-gen-uml #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 protoc --uml_out=uml/ -I ./ *.proto
cd uml cd uml
java -jar plantuml.7997.jar *.puml java -jar plantuml.7997.jar *.puml
......
...@@ -2,7 +2,6 @@ syntax = "proto3"; ...@@ -2,7 +2,6 @@ syntax = "proto3";
package policy; package policy;
import "context.proto"; import "context.proto";
import "service.proto";
service PolicyService { service PolicyService {
rpc PolicyAdd (PolicyRule) returns (PolicyRuleState) {} rpc PolicyAdd (PolicyRule) returns (PolicyRuleState) {}
...@@ -10,53 +9,77 @@ service PolicyService { ...@@ -10,53 +9,77 @@ service PolicyService {
rpc PolicyDelete (PolicyRule) returns (PolicyRuleState) {} rpc PolicyDelete (PolicyRule) returns (PolicyRuleState) {}
rpc GetPolicy (PolicyRuleId) returns (PolicyRule) {} rpc GetPolicy (PolicyRuleId) returns (PolicyRule) {}
rpc GetPolicyByDeviceId (context.DeviceId) returns (PolicyRuleList) {} rpc GetPolicyByDeviceId (context.DeviceId) returns (PolicyRuleList) {}
rpc GetPolicyByServiceId (service.ServiceId) returns (PolicyRuleList) {} rpc GetPolicyByServiceId (context.ServiceId) returns (PolicyRuleList) {}
} }
message PolicyRuleList { enum RuleState {
repeated PolicyRule policyRuleList = 1; 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 [] enum PolicyRuleType {
message PolicyRule { POLICYTYPE_DEVICE = 0; // Device-level
PolicyRuleId policyRuleId = 1; POLICYTYPE_NETWORK = 1; // Network-wide
repeated service.ServiceId serviceList = 2;
repeated context.DeviceId deviceList = 3;
string policyRuleType = 4;
string PolicyRulePriority = 5;
repeated PolicyRuleCondition polRuleConditionList = 6;
repeated PolicyRuleAction polRuleActionList = 7;
} }
message PolicyRuleId { message PolicyRuleId {
context.Uuid uuid = 1; 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 { message PolicyRuleCondition {
PolicyRuleVariable polRuleConditionVar = 1; PolicyRuleVariable polRuleConditionVar = 1;
PolicyRuleValue polRuleConditionVal = 2; PolicyRuleValue polRuleConditionVal = 2;
} }
// Action
message PolicyRuleAction { message PolicyRuleAction {
PolicyRuleVariable polRuleActionVar = 1; PolicyRuleVariable polRuleActionVar = 1;
PolicyRuleValue polRuleActionVal = 2; PolicyRuleValue polRuleActionVal = 2;
} }
message PolicyRuleVariable { // Policy rule partially complies with IETF’s:
string policyRuleVariable = 1; // 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 { // Event-Condition-Action model
string policyRuleValue = 1; 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 { // Affected services and devices
context.Uuid policyRuleId = 1; repeated context.ServiceId serviceList = 7;
RuleState policyRuleState = 2; repeated context.DeviceId deviceList = 8;
} }
enum RuleState { // A list of policy rules
PLANNED = 0; message PolicyRuleList {
ACTIVE = 1; repeated PolicyRule policyRuleList = 1;
} }
...@@ -3,24 +3,21 @@ syntax = "proto3"; ...@@ -3,24 +3,21 @@ syntax = "proto3";
package slice; package slice;
import "context.proto"; import "context.proto";
import "service.proto";
service SliceService { service SliceService {
rpc CreateUpdateSlice ( TransportSlice ) returns (SliceStatus) {} rpc CreateUpdateSlice (TransportSlice) returns (SliceStatus) {}
rpc DeleteSlice ( TransportSlice ) returns (context.Empty) {} rpc DeleteSlice (TransportSlice) returns (context.Empty) {}
} }
message SliceEndpoint { message SliceEndpoint {
context.EndPoint port_id = 1; context.EndPoint port_id = 1;
} }
message TransportSlice { message TransportSlice {
SliceId slice_id = 1; SliceId slice_id = 1;
repeated slice.SliceEndpoint endpoints = 2; repeated slice.SliceEndpoint endpoints = 2;
repeated context.Constraint constraints = 3; repeated context.Constraint constraints = 3;
repeated service.ServiceId services = 4; repeated context.ServiceId services = 4;
repeated SliceId subSlicesId = 5; repeated SliceId subSlicesId = 5;
SliceStatus status = 6; 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