Skip to content
Snippets Groups Projects
Commit 959136e5 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch 'develop' of https://gitlab.com/teraflow-h2020/controller into...

Merge branch 'develop' of https://gitlab.com/teraflow-h2020/controller into feat/dlt-component-connector
parents a173e1ab 4d33b6b1
No related branches found
No related tags found
2 merge requests!54Release 2.0.0,!16DLT component (and related) improvements
Showing
with 679 additions and 76 deletions
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: apps/v1
kind: Deployment
metadata:
name: pathcompservice
spec:
selector:
matchLabels:
app: pathcompservice
template:
metadata:
labels:
app: pathcompservice
spec:
terminationGracePeriodSeconds: 5
containers:
- name: server
image: registry.gitlab.com/teraflow-h2020/controller/pathcomp:latest
imagePullPolicy: Always
ports:
- containerPort: 10020
env:
- name: LOG_LEVEL
value: "INFO"
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:10020"]
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:10020"]
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: 700m
memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
name: pathcompservice
spec:
type: ClusterIP
selector:
app: pathcompservice
ports:
- name: grpc
protocol: TCP
port: 10020
targetPort: 10020
src/
src/*/*
# used to prevent breaking symbolic links from source code folders
!src/*/.gitignore
!src/python/__init__.py
uml/generated
// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package acl;
enum AclRuleTypeEnum {
ACLRULETYPE_UNDEFINED = 0;
ACLRULETYPE_IPV4 = 1;
ACLRULETYPE_IPV6 = 2;
ACLRULETYPE_L2 = 3;
ACLRULETYPE_MPLS = 4;
ACLRULETYPE_MIXED = 5;
}
enum AclForwardActionEnum {
ACLFORWARDINGACTION_UNDEFINED = 0;
ACLFORWARDINGACTION_DROP = 1;
ACLFORWARDINGACTION_ACCEPT = 2;
ACLFORWARDINGACTION_REJECT = 3;
}
enum AclLogActionEnum {
ACLLOGACTION_UNDEFINED = 0;
ACLLOGACTION_NOLOG = 1;
ACLLOGACTION_SYSLOG = 2;
}
message AclMatch {
uint32 dscp = 1;
uint32 protocol = 2;
string src_address = 3;
string dst_address = 4;
uint32 src_port = 5;
uint32 dst_port = 6;
uint32 start_mpls_label = 7;
uint32 end_mpls_label = 8;
}
message AclAction {
AclForwardActionEnum forward_action = 1;
AclLogActionEnum log_action = 2;
}
message AclEntry {
uint32 sequence_id = 1;
string description = 2;
AclMatch match = 3;
AclAction action = 4;
}
message AclRuleSet {
string name = 1;
AclRuleTypeEnum type = 2;
string description = 3;
string user_id = 4;
repeated AclEntry entries = 5;
}
// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package context_policy;
import "context.proto";
import "policy.proto";
// created as a separate service to prevent import-loops in context and policy
service ContextPolicyService {
rpc ListPolicyRuleIds(context.Empty ) returns (policy.PolicyRuleIdList) {}
rpc ListPolicyRules (context.Empty ) returns (policy.PolicyRuleList ) {}
rpc GetPolicyRule (policy.PolicyRuleId ) returns (policy.PolicyRuleBasic ) {}
rpc SetPolicyRule (policy.PolicyRuleBasic) returns (policy.PolicyRuleId ) {}
rpc RemovePolicyRule (policy.PolicyRuleId ) returns (context.Empty ) {}
}
......@@ -15,6 +15,7 @@
syntax = "proto3";
package context;
import "acl.proto";
import "kpi_sample_types.proto";
service ContextService {
......@@ -82,8 +83,12 @@ enum EventTypeEnum {
EVENTTYPE_REMOVE = 3;
}
message Event {
message Timestamp {
double timestamp = 1;
}
message Event {
Timestamp timestamp = 1;
EventTypeEnum event_type = 2;
}
......@@ -223,6 +228,7 @@ message Service {
repeated Constraint service_constraints = 4;
ServiceStatus service_status = 5;
ServiceConfig service_config = 6;
Timestamp timestamp = 7;
}
enum ServiceTypeEnum {
......@@ -237,6 +243,7 @@ enum ServiceStatusEnum {
SERVICESTATUS_PLANNED = 1;
SERVICESTATUS_ACTIVE = 2;
SERVICESTATUS_PENDING_REMOVAL = 3;
SERVICESTATUS_SLA_VIOLATED = 4;
}
message ServiceStatus {
......@@ -273,6 +280,13 @@ message Slice {
repeated ServiceId slice_service_ids = 4;
repeated SliceId slice_subslice_ids = 5;
SliceStatus slice_status = 6;
SliceOwner slice_owner = 7;
Timestamp timestamp = 8;
}
message SliceOwner {
Uuid owner_uuid = 1;
string owner_string = 2;
}
enum SliceStatusEnum {
......@@ -281,6 +295,7 @@ enum SliceStatusEnum {
SLICESTATUS_INIT = 2;
SLICESTATUS_ACTIVE = 3;
SLICESTATUS_DEINIT = 4;
SLICESTATUS_SLA_VIOLATED = 5;
}
message SliceStatus {
......@@ -305,11 +320,47 @@ message ConnectionId {
Uuid connection_uuid = 1;
}
message ConnectionSettings_L0 {
string lsp_symbolic_name = 1;
}
message ConnectionSettings_L2 {
string src_mac_address = 1;
string dst_mac_address = 2;
uint32 ether_type = 3;
uint32 vlan_id = 4;
uint32 mpls_label = 5;
uint32 mpls_traffic_class = 6;
}
message ConnectionSettings_L3 {
string src_ip_address = 1;
string dst_ip_address = 2;
uint32 dscp = 3;
uint32 protocol = 4;
uint32 ttl = 5;
}
message ConnectionSettings_L4 {
uint32 src_port = 1;
uint32 dst_port = 2;
uint32 tcp_flags = 3;
uint32 ttl = 4;
}
message ConnectionSettings {
ConnectionSettings_L0 l0 = 1;
ConnectionSettings_L2 l2 = 2;
ConnectionSettings_L3 l3 = 3;
ConnectionSettings_L4 l4 = 4;
}
message Connection {
ConnectionId connection_id = 1;
ServiceId service_id = 2;
repeated EndPointId path_hops_endpoint_ids = 3;
repeated ServiceId sub_service_ids = 4;
ConnectionSettings settings = 5;
}
message ConnectionIdList {
......@@ -337,6 +388,7 @@ message EndPoint {
EndPointId endpoint_id = 1;
string endpoint_type = 2;
repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
Location endpoint_location = 4;
}
......@@ -347,19 +399,94 @@ enum ConfigActionEnum {
CONFIGACTION_DELETE = 2;
}
message ConfigRule_Custom {
string resource_key = 1;
string resource_value = 2;
}
message ConfigRule_ACL {
EndPointId endpoint_id = 1;
acl.AclRuleSet rule_set = 2;
}
message ConfigRule {
ConfigActionEnum action = 1;
string resource_key = 2;
string resource_value = 3;
oneof config_rule {
ConfigRule_Custom custom = 2;
ConfigRule_ACL acl = 3;
}
}
// ----- Constraint ----------------------------------------------------------------------------------------------------
message Constraint {
message Constraint_Custom {
string constraint_type = 1;
string constraint_value = 2;
}
message Constraint_Schedule {
float start_timestamp = 1;
float duration_days = 2;
}
message GPS_Position {
float latitude = 1;
float longitude = 2;
}
message Location {
oneof location {
string region = 1;
GPS_Position gps_position = 2;
}
}
message Constraint_EndPointLocation {
EndPointId endpoint_id = 1;
Location location = 2;
}
message Constraint_SLA_Latency {
float e2e_latency_ms = 1;
}
message Constraint_SLA_Capacity {
float capacity_gbps = 1;
}
message Constraint_SLA_Availability {
uint32 num_disjoint_paths = 1;
bool all_active = 2;
}
enum IsolationLevelEnum {
NO_ISOLATION = 0;
PHYSICAL_ISOLATION = 1;
LOGICAL_ISOLATION = 2;
PROCESS_ISOLATION = 3;
PHYSICAL_MEMORY_ISOLATION = 4;
PHYSICAL_NETWORK_ISOLATION = 5;
VIRTUAL_RESOURCE_ISOLATION = 6;
NETWORK_FUNCTIONS_ISOLATION = 7;
SERVICE_ISOLATION = 8;
}
message Constraint_SLA_Isolation_level {
IsolationLevelEnum isolation_level = 1;
}
message Constraint {
oneof constraint {
Constraint_Custom custom = 1;
Constraint_Schedule schedule = 2;
Constraint_EndPointLocation endpoint_location = 3;
Constraint_SLA_Capacity sla_capacity = 4;
Constraint_SLA_Latency sla_latency = 5;
Constraint_SLA_Availability sla_availability = 6;
Constraint_SLA_Isolation_level sla_isolation = 7;
}
}
// ----- Miscellaneous -------------------------------------------------------------------------------------------------
message TeraFlowController {
......
// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package dlt;
import "context.proto";
service DltConnectorService {
rpc RecordAll (context.Empty ) returns (context.Empty) {}
rpc RecordAllDevices (context.Empty ) returns (context.Empty) {}
rpc RecordDevice (context.DeviceId ) returns (context.Empty) {}
rpc RecordAllServices(context.Empty ) returns (context.Empty) {}
rpc RecordService (context.ServiceId) returns (context.Empty) {}
rpc RecordAllSlices (context.Empty ) returns (context.Empty) {}
rpc RecordSlice (context.SliceId ) returns (context.Empty) {}
}
......@@ -17,7 +17,7 @@ package dlt;
import "context.proto";
service DltService {
service DltGatewayService {
rpc RecordToDlt (DltRecord ) returns ( DltRecordStatus ) {}
rpc GetFromDlt (DltRecordId ) returns ( DltRecord ) {}
rpc SubscribeToDlt(DltRecordSubscription ) returns (stream DltRecordEvent ) {}
......
// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package forecaster;
import "context.proto";
service ForecasterService {
rpc GetForecastOfTopology (context.TopologyId) returns (Forecast) {}
rpc GetForecastOfLink(context.LinkId) returns (Forecast) {}
rpc CheckService (context.ServiceId) returns (ForecastPrediction) {}
}
message SingleForecast {
context.Timestamp timestamp= 1;
double value = 2;
}
message Forecast {
oneof uuid {
context.TopologyId topologyId= 1;
context.LinkId linkId = 2;
}
repeated SingleForecast forecast = 3;
}
enum AvailabilityPredictionEnum {
FORECASTED_AVAILABILITY = 0;
FORECASTED_UNAVAILABILITY = 1;
}
message ForecastPrediction {
AvailabilityPredictionEnum prediction = 1;
}
#!/bin/bash -eu
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Make folder containing the script the root folder for its execution
cd $(dirname $0)
mkdir -p src/python
rm -rf src/python/*.py
tee src/python/__init__.py << EOF > /dev/null
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
EOF
# Generate Python code
python3 -m grpc_tools.protoc -I=./ --python_out=src/python/ --grpc_python_out=src/python/ *.proto
# Arrange generated code imports to enable imports from arbitrary subpackages
find src/python -type f -iname *.py -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \;
......@@ -13,12 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
python3 -m grpc_tools.protoc -I=./ --python_out=../src/ --grpc_python_out=../src/ *.proto
#requires installation of protoc-gen-uml
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
rm *.puml
......@@ -18,9 +18,11 @@ package interdomain;
import "context.proto";
service InterdomainService {
rpc Authenticate (context.TeraFlowController) returns (context.AuthenticationResult) {}
rpc Authenticate (context.TeraFlowController) returns (context.AuthenticationResult) {} // Deprecated
rpc RequestSlice (context.Slice ) returns (context.SliceId ) {}
rpc LookUpSlice (context.Slice ) returns (context.SliceId ) {}
rpc OrderSliceFromCatalog (context.Slice ) returns (context.Slice ) {}
rpc CreateSliceAndAddToCatalog(context.Slice ) returns (context.Slice ) {}
rpc OrderSliceWithSLA (context.Slice) returns (context.SliceId) {} // If slice with SLA already exists, returns slice. If not, it creates it.
rpc UpdateSlice (context.Slice ) returns (context.Slice ) {}
}
......@@ -19,27 +19,73 @@ import "context.proto";
import "kpi_sample_types.proto";
service MonitoringService {
rpc CreateKpi (KpiDescriptor ) returns (KpiId ) {}
rpc GetKpiDescriptor(KpiId ) returns (KpiDescriptor) {}
rpc IncludeKpi (Kpi ) returns (context.Empty) {}
rpc MonitorKpi (MonitorKpiRequest) returns (context.Empty) {}
rpc GetStreamKpi (KpiId ) returns (stream Kpi ) {}
rpc GetInstantKpi (KpiId ) returns (Kpi ) {}
rpc CreateKpi (KpiDescriptor ) returns (KpiId ) {}
rpc EditKpiDescriptor (EditedKpiDescriptor ) returns (context.Empty ) {}
rpc DeleteKpi (KpiId ) returns (context.Empty ) {}
rpc GetKpiDescriptorList (context.Empty ) returns (KpiDescriptorList) {}
rpc CreateBundleKpi (BundleKpiDescriptor ) returns (KpiId ) {}
rpc GetKpiDescriptor (KpiId ) returns (KpiDescriptor ) {}
rpc IncludeKpi (Kpi ) returns (context.Empty ) {}
rpc MonitorKpi (MonitorKpiRequest ) returns (context.Empty ) {}
rpc QueryKpiData (KpiQuery ) returns (KpiList ) {}
rpc SubscribeKpi (SubsDescriptor ) returns (stream KpiList ) {}
rpc GetSubsDescriptor (SubscriptionID ) returns (SubsDescriptor ) {}
rpc GetSubscriptions (context.Empty ) returns (SubsIDList ) {}
rpc EditKpiSubscription (SubsDescriptor ) returns (context.Empty ) {}
rpc CreateKpiAlarm (AlarmDescriptor ) returns ( AlarmID ) {}
rpc EditKpiAlarm (AlarmDescriptor ) returns (context.Empty ) {}
rpc GetAlarms (context.Empty ) returns (AlarmIDList ) {}
rpc GetAlarmDescriptor (AlarmID ) returns (AlarmDescriptor ) {}
rpc GetAlarmResponseStream (AlarmID ) returns (stream AlarmResponse ) {}
// rpc GetStreamKpi (KpiId ) returns (stream Kpi ) {}
// rpc GetInstantKpi (KpiId ) returns (KpiList ) {}
}
message KpiDescriptor {
string kpi_description = 1;
kpi_sample_types.KpiSampleType kpi_sample_type = 2;
context.DeviceId device_id = 3;
context.EndPointId endpoint_id = 4;
context.ServiceId service_id = 5;
// context.SliceId slice_id = 6;
string kpi_description = 1;
kpi_sample_types.KpiSampleType kpi_sample_type = 2;
context.DeviceId device_id = 3;
context.EndPointId endpoint_id = 4;
context.ServiceId service_id = 5;
context.SliceId slice_id = 6;
}
message MonitorKpiRequest{
KpiId kpi_id = 1;
float sampling_duration_s = 2;
float sampling_interval_s = 3;
message BundleKpiDescriptor {
string kpi_description = 1;
repeated KpiId kpi_id_list = 2;
kpi_sample_types.KpiSampleType kpi_sample_type = 3;
context.DeviceId device_id = 4;
context.EndPointId endpoint_id = 5;
context.ServiceId service_id = 6;
context.SliceId slice_id = 7;
}
message EditedKpiDescriptor {
KpiId kpi_id = 1;
string kpi_description = 2;
repeated KpiId kpi_id_list = 3;
kpi_sample_types.KpiSampleType kpi_sample_type = 4;
context.DeviceId device_id = 5;
context.EndPointId endpoint_id = 6;
context.ServiceId service_id = 7;
context.SliceId slice_id = 8;
}
message MonitorKpiRequest {
KpiId kpi_id = 1;
float monitoring_window_s = 2;
float sampling_rate_s = 3;
// Pending add field to reflect Available Device Protocols
}
message KpiQuery {
repeated KpiId kpi_id = 1;
float monitoring_window_s = 2;
float sampling_rate_s = 3;
uint32 last_n_samples = 4; // used when you want something like "get the last N many samples
string start_date = 5; // used when you want something like "get the samples since X date/time"
string end_date = 6; // used when you want something like "get the samples until X date/time"
// Pending add field to reflect Available Device Protocols
}
message KpiId {
......@@ -47,20 +93,73 @@ message KpiId {
}
message Kpi {
KpiId kpi_id = 1;
string timestamp = 2;
KpiValue kpi_value = 4;
KpiId kpi_id = 1;
string timestamp = 2;
KpiValue kpi_value = 3;
}
message KpiValueRange {
KpiValue kpiMinValue = 1;
KpiValue kpiMaxValue = 2;
}
message KpiValue {
oneof value {
uint32 intVal = 1;
float floatVal = 2;
string stringVal = 3;
bool boolVal = 4;
uint32 intVal = 1;
float floatVal = 2;
string stringVal = 3;
bool boolVal = 4;
}
}
message KpiList {
repeated Kpi kpi_list = 1;
repeated Kpi kpi_list = 1;
}
message KpiDescriptorList {
repeated KpiDescriptor kpi_descriptor_list = 1;
}
message SubsDescriptor{
KpiId kpi_id = 1;
float sampling_duration_s = 2;
float sampling_interval_s = 3;
string start_date = 4; // used when you want something like "get the samples since X date/time"
string end_date = 5; // used when you want something like "get the samples until X date/time"
// Pending add field to reflect Available Device Protocols
}
message SubscriptionID {
context.Uuid subs_id = 1;
}
message SubsResponse {
SubscriptionID subs_id = 1;
repeated KpiList kpi_list = 2;
}
message SubsIDList {
repeated SubscriptionID subs_list = 1;
}
message AlarmDescriptor {
string alarm_description = 1;
string name = 2;
KpiId kpi_id = 3;
KpiValueRange kpi_value_range = 4;
string timestamp = 5;
}
message AlarmID{
context.Uuid alarm_id = 1;
}
message AlarmResponse {
AlarmID alarm_id = 1;
string text = 2;
KpiValue kpi_value = 3;
}
message AlarmIDList {
repeated AlarmID alarm_list = 1;
}
// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package pathcomp;
import "context.proto";
service PathCompService {
rpc Compute(PathCompRequest) returns (PathCompReply) {}
}
message Algorithm_ShortestPath {}
message Algorithm_KShortestPath {
uint32 k_inspection = 1;
uint32 k_return = 2;
}
message PathCompRequest {
repeated context.Service services = 1;
oneof algorithm {
Algorithm_ShortestPath shortest_path = 10;
Algorithm_KShortestPath k_shortest_path = 11;
}
}
message PathCompReply {
// Services requested completed with possible missing fields, and
// sub-services required for supporting requested services on the
// underlying layers.
repeated context.Service services = 1;
// Connections supporting the requested services and sub-services
// required for the underlying layers.
repeated context.Connection connections = 2;
}
......@@ -20,23 +20,28 @@ import "policy-condition.proto";
import "policy-action.proto";
service PolicyService {
rpc PolicyAdd (PolicyRule) returns (PolicyRuleState) {}
rpc PolicyUpdate (PolicyRule) returns (PolicyRuleState) {}
rpc PolicyDelete (PolicyRule) returns (PolicyRuleState) {}
rpc GetPolicy (PolicyRuleId) returns (PolicyRule) {}
rpc GetPolicyByDeviceId (context.DeviceId) returns (PolicyRuleList) {}
rpc GetPolicyByServiceId (context.ServiceId) returns (PolicyRuleList) {}
rpc PolicyAddService (PolicyRuleService) returns (PolicyRuleState) {}
rpc PolicyAddDevice (PolicyRuleDevice) returns (PolicyRuleState) {}
rpc PolicyUpdateService (PolicyRuleService) returns (PolicyRuleState) {}
rpc PolicyUpdateDevice (PolicyRuleDevice) returns (PolicyRuleState) {}
rpc PolicyDelete (PolicyRuleId) returns (PolicyRuleState) {}
rpc GetPolicyService (PolicyRuleId) returns (PolicyRuleService) {}
rpc GetPolicyDevice (PolicyRuleId) returns (PolicyRuleDevice) {}
rpc GetPolicyByServiceId (context.ServiceId) returns (PolicyRuleServiceList) {}
}
enum RuleState {
POLICY_INACTIVE = 0; // Rule is currently inactive
POLICY_PLANNED = 1; // Rule installation planned
POLICY_ACTIVE = 2; // Rule is currently active
}
enum PolicyRuleType {
POLICYTYPE_DEVICE = 0; // Device-level
POLICYTYPE_NETWORK = 1; // Network-wide
POLICY_UNDEFINED = 0; // Undefined rule state
POLICY_FAILED = 1; // Rule failed
POLICY_INSERTED = 2; // Rule is just inserted
POLICY_VALIDATED = 3; // Rule content is correct
POLICY_PROVISIONED = 4; // Rule subscribed to Monitoring
POLICY_ACTIVE = 5; // Rule is currently active (alarm is just thrown by Monitoring)
POLICY_ENFORCED = 6; // Rule action is successfully enforced
POLICY_INEFFECTIVE = 7; // The applied rule action did not work as expected
POLICY_EFFECTIVE = 8; // The applied rule action did work as expected
POLICY_UPDATED = 9; // Operator requires a policy to change
POLICY_REMOVED = 10; // Operator requires to remove a policy
}
message PolicyRuleId {
......@@ -44,39 +49,56 @@ message PolicyRuleId {
}
message PolicyRuleState {
context.Uuid policyRuleId = 1;
RuleState policyRuleState = 2;
RuleState policyRuleState = 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;
// Basic policy rule attributes
message PolicyRuleBasic {
PolicyRuleId policyRuleId = 1;
optional PolicyRuleState policyRuleState = 2;
uint32 priority = 3;
// Event-Condition-Action (ECA) model
repeated PolicyRuleCondition conditionList = 4; // When these policy conditions are met, an event is automatically thrown
BooleanOperator booleanOperator = 5; // Evaluation operator to be used
repeated PolicyRuleAction actionList = 6; // One or more actions should be applied
}
// 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 {
// Service-oriented policy rule
message PolicyRuleService {
// Basic policy rule attributes
PolicyRuleId policyRuleId = 1;
PolicyRuleType policyRuleType = 2;
uint32 priority = 3;
PolicyRuleBasic policyRuleBasic = 1;
// Affected service and (some of) its device(s)
context.ServiceId serviceId = 2;
repeated context.DeviceId deviceList = 3; // List of devices this service is traversing (not exhaustive)
}
// Device-oriented policy rule
message PolicyRuleDevice {
// Basic policy rule attributes
PolicyRuleBasic policyRuleBasic = 1;
// Affected device(s)
repeated context.DeviceId deviceList = 2;
}
// A list of policy rule IDs
message PolicyRuleIdList {
repeated PolicyRuleId policyRuleIdList = 1;
}
// Event-Condition-Action model
PolicyRuleEvent event = 4; // A single event triggers the policy
repeated PolicyRuleCondition conditionList = 5; // One or more conditions must be met
BooleanOperator booleanOperator = 6; // Evaluation operator to be used
repeated PolicyRuleAction actionList = 7; // One or more actions should be applied
// A list of service-oriented policy rules
message PolicyRuleServiceList {
repeated PolicyRuleService policyRuleServiceList = 1;
}
// Affected service and devices
context.ServiceId serviceId = 8;
repeated context.DeviceId deviceList = 9;
// A list of device-oriented policy rules
message PolicyRuleDeviceList {
repeated PolicyRuleDevice policyRuleDeviceList = 1;
}
// A list of policy rules
message PolicyRuleList {
repeated PolicyRule policyRuleList = 1;
repeated PolicyRuleId policyRules = 1;
}
......@@ -21,4 +21,6 @@ service SliceService {
rpc CreateSlice(context.Slice ) returns (context.SliceId) {}
rpc UpdateSlice(context.Slice ) returns (context.SliceId) {}
rpc DeleteSlice(context.SliceId) returns (context.Empty ) {}
rpc OrderSliceWithSLA(context.Slice) returns (context.SliceId) {} // If slice with SLA already exists, returns slice. If not, it creates it.
rpc RunSliceGrouping (context.Empty) returns (context.Empty) {} // Optimizes the underlying services and re-maps them to the requested slices.
}
*
# used to prevent breaking symbolic links from source code folders
!.gitignore
!__init__.py
*
# used to prevent breaking symbolic links from source code folders
!.gitignore
!__init__.py
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
......@@ -16,10 +16,9 @@ syntax = "proto3";
package te;
import "context.proto";
import "service.proto";
service TEService {
rpc RequestLSP(service.Service ) returns (service.ServiceState) {}
rpc UpdateLSP (service.ServiceId) returns (service.ServiceState) {}
rpc DeleteLSP (service.ServiceId) returns (context.Empty ) {}
rpc RequestLSP (context.Service) returns (context.ServiceStatus) {}
rpc UpdateLSP (context.ServiceId) returns (context.ServiceStatus) {}
rpc DeleteLSP (context.ServiceId) returns (context.Empty) {}
}
proto/uml/acl.png

39.1 KiB

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